diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/WcsPrintTaskController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/WcsPrintTaskController.java new file mode 100644 index 000000000..43c70332c --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/WcsPrintTaskController.java @@ -0,0 +1,108 @@ +package com.op.mes.controller; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletResponse; +//import org.springframework.security.access.prepost.PreAuthorize; +import com.op.common.core.utils.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.op.common.log.annotation.Log; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.log.enums.BusinessType; +import com.op.mes.domain.WcsPrintTask; +import com.op.mes.service.IWcsPrintTaskService; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 生产箱码和托盘绑定关系Controller + * + * @author ruoyi + * @date 2025-04-24 + */ +@RestController +@RequestMapping("/task") +public class WcsPrintTaskController extends BaseController +{ + @Autowired + private IWcsPrintTaskService wcsPrintTaskService; + + /** + * 查询生产箱码和托盘绑定关系列表 + */ + @GetMapping("/list") + public TableDataInfo list(WcsPrintTask wcsPrintTask,@RequestParam(required = false) String beginTime, + @RequestParam(required = false) String endTime) + { + // 直接使用前端传递的完整时间格式 + if (StringUtils.isNotEmpty(beginTime)){ + wcsPrintTask.getParams().put("beginTime", beginTime); + } + if (StringUtils.isNotEmpty(endTime)) { + wcsPrintTask.getParams().put("endTime", endTime); + } + startPage(); + List list = wcsPrintTaskService.selectWcsPrintTaskList(wcsPrintTask); + return getDataTable(list); + } + + /** + * 导出生产箱码和托盘绑定关系列表 + */ + @Log(title = "生产箱码和托盘绑定关系", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WcsPrintTask wcsPrintTask,@RequestParam(required = false) String beginTime, + @RequestParam(required = false) String endTime) + { + if (StringUtils.isNotEmpty(beginTime) && StringUtils.isNotEmpty(endTime)) { + wcsPrintTask.getParams().put("beginTime", beginTime + " 00:00:00"); + wcsPrintTask.getParams().put("endTime", endTime + " 23:59:59"); + } + + List list = wcsPrintTaskService.selectWcsPrintTaskList(wcsPrintTask); + ExcelUtil util = new ExcelUtil(WcsPrintTask.class); + util.exportExcel(response, list, "生产箱码和托盘绑定关系数据"); + } + + /** + * 获取生产箱码和托盘绑定关系详细信息 + */ + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return success(wcsPrintTaskService.selectWcsPrintTaskById(id)); + } + + /** + * 新增生产箱码和托盘绑定关系 + */ + @Log(title = "生产箱码和托盘绑定关系", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WcsPrintTask wcsPrintTask) + { + return toAjax(wcsPrintTaskService.insertWcsPrintTask(wcsPrintTask)); + } + + /** + * 修改生产箱码和托盘绑定关系 + */ + @Log(title = "生产箱码和托盘绑定关系", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WcsPrintTask wcsPrintTask) + { + return toAjax(wcsPrintTaskService.updateWcsPrintTask(wcsPrintTask)); + } + + /** + * 删除生产箱码和托盘绑定关系 + */ + @Log(title = "生产箱码和托盘绑定关系", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) + { + return toAjax(wcsPrintTaskService.deleteWcsPrintTaskByIds(ids)); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/WcsPrintTask.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/WcsPrintTask.java new file mode 100644 index 000000000..2d0728880 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/WcsPrintTask.java @@ -0,0 +1,280 @@ +package com.op.mes.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.springframework.data.annotation.Transient; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * 生产箱码和托盘绑定关系对象 wcs_print_task + * + * @author ruoyi + * @date 2025-04-24 + */ +public class WcsPrintTask extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 打印任务ID */ + private String id; + + /** 工单号 */ + @Excel(name = "工单号") + private String workorderCode; + + /** 打印状态 */ + @Excel(name = "打印状态") + private String printStatus; + + /** 产线编码 */ + @Excel(name = "产线编码") + private String lineCode; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 预留字段2 */ + @Excel(name = "预留字段2") + private String attr2; + + /** 预留字段3 */ + @Excel(name = "预留字段3") + private String attr3; + + /** 预留字段4 */ + @Excel(name = "预留字段4") + private String attr4; + + /** 删除字段标识(0未删除1删除) */ + private String delFlag; + + /** 打印标签码 */ + @Excel(name = "打印标签码") + private String printLableCode; + + /** 数量 */ + @Excel(name = "数量") + private Long quantity; + + /** 序号 */ + @Excel(name = "序号") + private Long inum; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String productName; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String batchCode; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String productDate; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String productUnit; + /** + * 开始结束日期 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime beginTime; + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endTime; + + public LocalDateTime getBeginTime() { + return beginTime; + } + + public void setBeginTime(LocalDateTime beginTime) { + this.beginTime = beginTime; + } + + public LocalDateTime getEndTime() { + return endTime; + } + + public void setEndTime(LocalDateTime endTime) { + this.endTime = endTime; + } + + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + public void setWorkorderCode(String workorderCode) + { + this.workorderCode = workorderCode; + } + + public String getWorkorderCode() + { + return workorderCode; + } + public void setPrintStatus(String printStatus) + { + this.printStatus = printStatus; + } + + public String getPrintStatus() + { + return printStatus; + } + public void setLineCode(String lineCode) + { + this.lineCode = lineCode; + } + + public String getLineCode() + { + return lineCode; + } + public void setAttr1(String attr1) + { + this.attr1 = attr1; + } + + public String getAttr1() + { + return attr1; + } + public void setAttr2(String attr2) + { + this.attr2 = attr2; + } + + public String getAttr2() + { + return attr2; + } + public void setAttr3(String attr3) + { + this.attr3 = attr3; + } + + public String getAttr3() + { + return attr3; + } + public void setAttr4(String attr4) + { + this.attr4 = attr4; + } + + public String getAttr4() + { + return attr4; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + public void setPrintLableCode(String printLableCode) + { + this.printLableCode = printLableCode; + } + + public String getPrintLableCode() + { + return printLableCode; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setInum(Long inum) + { + this.inum = inum; + } + + public Long getInum() + { + return inum; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setBatchCode(String batchCode) + { + this.batchCode = batchCode; + } + + public String getBatchCode() + { + return batchCode; + } + public void setProductDate(String productDate) + { + this.productDate = productDate; + } + + public String getProductDate() + { + return productDate; + } + public void setProductUnit(String productUnit) + { + this.productUnit = productUnit; + } + + public String getProductUnit() + { + return productUnit; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("workorderCode", getWorkorderCode()) + .append("printStatus", getPrintStatus()) + .append("lineCode", getLineCode()) + .append("remark", getRemark()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("delFlag", getDelFlag()) + .append("printLableCode", getPrintLableCode()) + .append("quantity", getQuantity()) + .append("inum", getInum()) + .append("productName", getProductName()) + .append("batchCode", getBatchCode()) + .append("productDate", getProductDate()) + .append("productUnit", getProductUnit()) + .toString(); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/WcsPrintTaskMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/WcsPrintTaskMapper.java new file mode 100644 index 000000000..18daa0b92 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/WcsPrintTaskMapper.java @@ -0,0 +1,61 @@ +package com.op.mes.mapper; + +import java.util.List; +import com.op.mes.domain.WcsPrintTask; + +/** + * 生产箱码和托盘绑定关系Mapper接口 + * + * @author ruoyi + * @date 2025-04-24 + */ +public interface WcsPrintTaskMapper +{ + /** + * 查询生产箱码和托盘绑定关系 + * + * @param id 生产箱码和托盘绑定关系主键 + * @return 生产箱码和托盘绑定关系 + */ + public WcsPrintTask selectWcsPrintTaskById(String id); + + /** + * 查询生产箱码和托盘绑定关系列表 + * + * @param wcsPrintTask 生产箱码和托盘绑定关系 + * @return 生产箱码和托盘绑定关系集合 + */ + public List selectWcsPrintTaskList(WcsPrintTask wcsPrintTask); + + /** + * 新增生产箱码和托盘绑定关系 + * + * @param wcsPrintTask 生产箱码和托盘绑定关系 + * @return 结果 + */ + public int insertWcsPrintTask(WcsPrintTask wcsPrintTask); + + /** + * 修改生产箱码和托盘绑定关系 + * + * @param wcsPrintTask 生产箱码和托盘绑定关系 + * @return 结果 + */ + public int updateWcsPrintTask(WcsPrintTask wcsPrintTask); + + /** + * 删除生产箱码和托盘绑定关系 + * + * @param id 生产箱码和托盘绑定关系主键 + * @return 结果 + */ + public int deleteWcsPrintTaskById(String id); + + /** + * 批量删除生产箱码和托盘绑定关系 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWcsPrintTaskByIds(String[] ids); +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/WcsPrintTaskServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/WcsPrintTaskServiceImpl.java new file mode 100644 index 000000000..aa1927992 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/WcsPrintTaskServiceImpl.java @@ -0,0 +1,104 @@ +package com.op.mes.service.impl; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.mes.mapper.WcsPrintTaskMapper; +import com.op.mes.domain.WcsPrintTask; +import com.op.mes.service.IWcsPrintTaskService; + +/** + * 生产箱码和托盘绑定关系Service业务层处理 + * + * @author ruoyi + * @date 2025-04-24 + */ +@Service +public class WcsPrintTaskServiceImpl implements IWcsPrintTaskService +{ + @Autowired + private WcsPrintTaskMapper wcsPrintTaskMapper; + + /** + * 查询生产箱码和托盘绑定关系 + * + * @param id 生产箱码和托盘绑定关系主键 + * @return 生产箱码和托盘绑定关系 + */ + @Override + @DS("#header.poolName") + public WcsPrintTask selectWcsPrintTaskById(String id) + { + return wcsPrintTaskMapper.selectWcsPrintTaskById(id); + } + + /** + * 查询生产箱码和托盘绑定关系列表 + * + * @param wcsPrintTask 生产箱码和托盘绑定关系 + * @return 生产箱码和托盘绑定关系 + */ + @Override + @DS("#header.poolName") + public List selectWcsPrintTaskList(WcsPrintTask wcsPrintTask) + { + return wcsPrintTaskMapper.selectWcsPrintTaskList(wcsPrintTask); + } + + /** + * 新增生产箱码和托盘绑定关系 + * + * @param wcsPrintTask 生产箱码和托盘绑定关系 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertWcsPrintTask(WcsPrintTask wcsPrintTask) + { + wcsPrintTask.setCreateTime(DateUtils.getNowDate()); + return wcsPrintTaskMapper.insertWcsPrintTask(wcsPrintTask); + } + + /** + * 修改生产箱码和托盘绑定关系 + * + * @param wcsPrintTask 生产箱码和托盘绑定关系 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateWcsPrintTask(WcsPrintTask wcsPrintTask) + { + wcsPrintTask.setUpdateTime(DateUtils.getNowDate()); + return wcsPrintTaskMapper.updateWcsPrintTask(wcsPrintTask); + } + + /** + * 批量删除生产箱码和托盘绑定关系 + * + * @param ids 需要删除的生产箱码和托盘绑定关系主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteWcsPrintTaskByIds(String[] ids) + { + return wcsPrintTaskMapper.deleteWcsPrintTaskByIds(ids); + } + + /** + * 删除生产箱码和托盘绑定关系信息 + * + * @param id 生产箱码和托盘绑定关系主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteWcsPrintTaskById(String id) + { + return wcsPrintTaskMapper.deleteWcsPrintTaskById(id); + } +} diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/WcsPrintTaskMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/WcsPrintTaskMapper.xml new file mode 100644 index 000000000..0dbb4df70 --- /dev/null +++ b/op-modules/op-mes/src/main/resources/mapper/mes/WcsPrintTaskMapper.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, workorder_code, print_status, line_code, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, del_flag, print_lable_code, quantity, inum, product_name, batch_code, product_date, product_unit from wcs_print_task + + + + + + + + insert into wcs_print_task + + id, + workorder_code, + print_status, + line_code, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + del_flag, + print_lable_code, + quantity, + inum, + product_name, + batch_code, + product_date, + product_unit, + + + #{id}, + #{workorderCode}, + #{printStatus}, + #{lineCode}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{delFlag}, + #{printLableCode}, + #{quantity}, + #{inum}, + #{productName}, + #{batchCode}, + #{productDate}, + #{productUnit}, + + + + + update wcs_print_task + + workorder_code = #{workorderCode}, + print_status = #{printStatus}, + line_code = #{lineCode}, + remark = #{remark}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + del_flag = #{delFlag}, + print_lable_code = #{printLableCode}, + quantity = #{quantity}, + inum = #{inum}, + product_name = #{productName}, + batch_code = #{batchCode}, + product_date = #{productDate}, + product_unit = #{productUnit}, + + where id = #{id} + + + + delete from wcs_print_task where id = #{id} + + + + delete from wcs_print_task where id in + + #{id} + + + \ No newline at end of file