diff --git a/op-common/op-common-core/src/main/java/com/op/common/core/context/SecurityContextHolder.java b/op-common/op-common-core/src/main/java/com/op/common/core/context/SecurityContextHolder.java index c4b848af..5bce0422 100644 --- a/op-common/op-common-core/src/main/java/com/op/common/core/context/SecurityContextHolder.java +++ b/op-common/op-common-core/src/main/java/com/op/common/core/context/SecurityContextHolder.java @@ -6,7 +6,6 @@ import com.alibaba.ttl.TransmittableThreadLocal; import com.op.common.core.constant.SecurityConstants; import com.op.common.core.text.Convert; import com.op.common.core.utils.StringUtils; -import sun.plugin2.main.server.Plugin; /** * 获取当前线程变量中的 用户id、用户名称、Token等信息 注意: 必须在网关通过请求头的方法传入,同时在HeaderInterceptor拦截器设置值。 diff --git a/op-common/op-common-core/src/main/java/com/op/common/core/utils/DateUtils.java b/op-common/op-common-core/src/main/java/com/op/common/core/utils/DateUtils.java index 45a83a26..719c6df1 100644 --- a/op-common/op-common-core/src/main/java/com/op/common/core/utils/DateUtils.java +++ b/op-common/op-common-core/src/main/java/com/op/common/core/utils/DateUtils.java @@ -24,6 +24,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils { public static String YYYY_MM_DD = "yyyy-MM-dd"; public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; + public static String YYYYMMDDHHMMSSsss = "yyyyMMddHHmmssSSS"; public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/ProOrderController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/ProOrderController.java index 3be4af9b..6977db43 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/ProOrderController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/ProOrderController.java @@ -2,6 +2,8 @@ package com.op.mes.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.op.mes.domain.dto.SplitOrderDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -29,67 +31,122 @@ import com.op.common.core.utils.poi.ExcelUtil; @RestController @RequestMapping("/order") public class ProOrderController extends BaseController { - @Autowired - private IProOrderService proOrderService; + @Autowired + private IProOrderService proOrderService; + + /** + * 获取工单信息列表 + * + * @param id + * @return + */ + @GetMapping(value = "/getWorkOrderList/{id}") + public AjaxResult getWorkOrderList(@PathVariable("id") String id) { + return proOrderService.getWorkOrderList(id); + } + + ; + + /** + * 获取当前订单信息列表 + * + * @param id + * @return + */ + @GetMapping(value = "/getOrderList/{id}") + public AjaxResult getOrderList(@PathVariable("id") String id) { + return proOrderService.getOrderList(id); + } + + /** + * 提交拆分订单接口 + * + * @param splitOrderDTO + * @return + */ + @PostMapping("/subSplitOrder") + public AjaxResult subSplitOrder(@RequestBody SplitOrderDTO splitOrderDTO) { + return proOrderService.subSplitOrder(splitOrderDTO); + } + + /** + * 获取换算值 + * + * @return + */ + @GetMapping("/getConvert") + public AjaxResult getConvert() { + return success(proOrderService.getConvert()); + } + + /** + * 获取线体 + * + * @return + */ + @GetMapping("/getProdLineShift") + public AjaxResult getProdLineShift() { + return success(proOrderService.getProdLineShift()); + } - /** - * 查询订单列表 - */ - @RequiresPermissions("mes:pro:order:list") - @GetMapping("/list") - public AjaxResult list(ProOrder proOrder) { - List list = proOrderService.selectProOrderList(proOrder); - return success(list); - } + /** + * 查询订单列表 + */ + @RequiresPermissions("mes:pro:order:list") + @GetMapping("/list") + public AjaxResult list(ProOrder proOrder) { + List list = proOrderService.selectProOrderList(proOrder); + return success(list); + } - /** - * 导出订单列表 - */ - @RequiresPermissions("mes:pro:order:export") - @Log(title = "订单", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, ProOrder proOrder) { - List list = proOrderService.selectProOrderList(proOrder); - ExcelUtil util = new ExcelUtil(ProOrder.class); - util.exportExcel(response, list, "订单数据"); - } + /** + * 导出订单列表 + */ + @RequiresPermissions("mes:pro:order:export") + @Log(title = "订单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ProOrder proOrder) { + List list = proOrderService.selectProOrderList(proOrder); + ExcelUtil util = new ExcelUtil(ProOrder.class); + util.exportExcel(response, list, "订单数据"); + } - /** - * 获取订单详细信息 - */ - @RequiresPermissions("mes:pro:order:query") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") String id) { - return success(proOrderService.selectProOrderById(id)); - } + /** + * 获取订单详细信息 + */ + @RequiresPermissions("mes:pro:order:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(proOrderService.selectProOrderById(id)); + } - /** - * 新增订单 - */ - @RequiresPermissions("mes:pro:order:add") - @Log(title = "订单", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody ProOrder proOrder) { - return toAjax(proOrderService.insertProOrder(proOrder)); - } + /** + * 新增订单 + */ + @RequiresPermissions("mes:pro:order:add") + @Log(title = "订单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ProOrder proOrder) { + return toAjax(proOrderService.insertProOrder(proOrder)); + } - /** - * 修改订单 - */ - @RequiresPermissions("mes:pro:order:edit") - @Log(title = "订单", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody ProOrder proOrder) { - return toAjax(proOrderService.updateProOrder(proOrder)); - } + /** + * 修改订单 + */ + @RequiresPermissions("mes:pro:order:edit") + @Log(title = "订单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ProOrder proOrder) { + return toAjax(proOrderService.updateProOrder(proOrder)); + } - /** - * 删除订单 - */ - @RequiresPermissions("mes:pro:order:remove") - @Log(title = "订单", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable String[] ids) { - return toAjax(proOrderService.deleteProOrderByIds(ids)); - } + /** + * 删除订单 + */ + @RequiresPermissions("mes:pro:order:remove") + @Log(title = "订单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(proOrderService.deleteProOrderByIds(ids)); + } } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/Batch.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/Batch.java new file mode 100644 index 00000000..dcff2e6b --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/Batch.java @@ -0,0 +1,38 @@ +package com.op.mes.domain; + +/** + * 拆分批次实体类 + */ +public class Batch { + // 批次号 + private String batchCode; + // 批次数量 + private Long batchQuantity; + + @Override + public String toString() { + return "Batch{" + + "batchCode='" + batchCode + '\'' + + ", batchQuantity=" + batchQuantity + + '}'; + } + + public String getBatchCode() { + return batchCode; + } + + public void setBatchCode(String batchCode) { + this.batchCode = batchCode; + } + + public Long getBatchQuantity() { + return batchQuantity; + } + + public void setBatchQuantity(Long batchQuantity) { + this.batchQuantity = batchQuantity; + } + + public Batch() { + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/Convert.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/Convert.java new file mode 100644 index 00000000..cf0ccc16 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/Convert.java @@ -0,0 +1,61 @@ +package com.op.mes.domain; + +//换算值实体类 +public class Convert { + private Integer dictCode; + private String dictLabel; + private String dictValue; + private String dictSort; + + @Override + public String toString() { + return "Convert{" + + "dictCode=" + dictCode + + ", dictLabel='" + dictLabel + '\'' + + ", dictValue='" + dictValue + '\'' + + ", dictSort='" + dictSort + '\'' + + '}'; + } + + public Integer getDictCode() { + return dictCode; + } + + public void setDictCode(Integer dictCode) { + this.dictCode = dictCode; + } + + public String getDictLabel() { + return dictLabel; + } + + public void setDictLabel(String dictLabel) { + this.dictLabel = dictLabel; + } + + public String getDictValue() { + return dictValue; + } + + public void setDictValue(String dictValue) { + this.dictValue = dictValue; + } + + public String getDictSort() { + return dictSort; + } + + public void setDictSort(String dictSort) { + this.dictSort = dictSort; + } + + public Convert(Integer dictCode, String dictLabel, String dictValue, String dictSort) { + this.dictCode = dictCode; + this.dictLabel = dictLabel; + this.dictValue = dictValue; + this.dictSort = dictSort; + } + + public Convert() { + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/ProLine.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProLine.java new file mode 100644 index 00000000..7b7dbe63 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProLine.java @@ -0,0 +1,39 @@ +package com.op.mes.domain; + +//线体实体类 +public class ProLine { + private String key; + private String label; + + @Override + public String toString() { + return "ProLine{" + + "key='" + key + '\'' + + ", label='" + label + '\'' + + '}'; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public ProLine(String key, String label) { + this.key = key; + this.label = label; + } + + public ProLine() { + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrder.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrder.java index 2c6740a3..ac8fd4c9 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrder.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrder.java @@ -1,6 +1,7 @@ package com.op.mes.domain; import java.util.Date; + import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -108,6 +109,18 @@ public class ProOrder extends TreeEntity { /** 产品类型 */ @Excel(name = "产品类型") private String prodType; + /** 物料型号 */ + @Excel(name = "物料名称") + private String prodSpc; + + public String getProdSpc() { + return prodSpc; + } + + public void setProdSpc(String prodSpc) { + this.prodSpc = prodSpc; + } + public void setId(String id) { this.id = id; @@ -253,6 +266,7 @@ public class ProOrder extends TreeEntity { .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("prodType", getProdType()) + .append("prodSpc", getProdSpc()) .toString(); } } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrderWorkorder.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrderWorkorder.java new file mode 100644 index 00000000..6ee767bd --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrderWorkorder.java @@ -0,0 +1,345 @@ +package com.op.mes.domain; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.op.common.core.web.domain.TreeEntity; +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; + +/** + * 生产工单对象 pro_order_workorder + * + * @author Open Platform + * @date 2023-07-18 + */ +public class ProOrderWorkorder extends TreeEntity { + private static final long serialVersionUID = 1L; + + /** 工单ID */ + private String workorderId; + + /** 工单编码 */ + @Excel(name = "工单编码") + private String workorderCode; + + /** 工单名称 */ + @Excel(name = "工单名称") + private String workorderName; + + /** 订单id */ + @Excel(name = "订单id") + private String orderId; + + /** 订单编码 */ + @Excel(name = "订单编码") + private String orderCode; + + /** 产品ID */ + @Excel(name = "产品ID") + private String productId; + + /** 产品编号 */ + @Excel(name = "产品编号") + private String productCode; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String productSpc; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 已生产数量 */ + @Excel(name = "已生产数量") + private Long quantityProduced; + + /** 已拆分数量 */ + @Excel(name = "已拆分数量") + private Long quantitySplit; + + /** 工艺编码 */ + @Excel(name = "工艺编码") + private String routeCode; + + /** 产线编码 */ + @Excel(name = "产线编码") + private String prodLineCode; + + /** 工单生产日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "工单生产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date productDate; + + /** 班次 */ + @Excel(name = "班次") + private String shiftId; + + /** 父工单 */ + @Excel(name = "父工单") + private String parentOrder; + + /** 所有父节点ID */ + @Excel(name = "所有父节点ID") + private String ancestors; + + /** 单据状态 */ + @Excel(name = "单据状态") + private String status; + + /** 预留字段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; + + /** 产品类型 */ + @Excel(name = "产品类型") + private String prodType; + + /** 批次号 */ + private StringBuilder batchCodeList; + + public StringBuilder getBatchCodeList() { + return batchCodeList; + } + + public void setBatchCodeList(StringBuilder batchCodeList) { + this.batchCodeList = batchCodeList; + } + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String factoryCode; + + public void setWorkorderId(String workorderId) { + this.workorderId = workorderId; + } + + public String getWorkorderId() { + return workorderId; + } + public void setWorkorderCode(String workorderCode) { + this.workorderCode = workorderCode; + } + + public String getWorkorderCode() { + return workorderCode; + } + public void setWorkorderName(String workorderName) { + this.workorderName = workorderName; + } + + public String getWorkorderName() { + return workorderName; + } + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public String getOrderId() { + return orderId; + } + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public String getOrderCode() { + return orderCode; + } + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductId() { + return productId; + } + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getProductCode() { + return productCode; + } + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductName() { + return productName; + } + public void setProductSpc(String productSpc) { + this.productSpc = productSpc; + } + + public String getProductSpc() { + return productSpc; + } + public void setUnit(String unit) { + this.unit = unit; + } + + public String getUnit() { + return unit; + } + public void setQuantityProduced(Long quantityProduced) { + this.quantityProduced = quantityProduced; + } + + public Long getQuantityProduced() { + return quantityProduced; + } + public void setQuantitySplit(Long quantitySplit) { + this.quantitySplit = quantitySplit; + } + + public Long getQuantitySplit() { + return quantitySplit; + } + public void setRouteCode(String routeCode) { + this.routeCode = routeCode; + } + + public String getRouteCode() { + return routeCode; + } + public void setProdLineCode(String prodLineCode) { + this.prodLineCode = prodLineCode; + } + + public String getProdLineCode() { + return prodLineCode; + } + public void setProductDate(Date productDate) { + this.productDate = productDate; + } + + public Date getProductDate() { + return productDate; + } + public void setShiftId(String shiftId) { + this.shiftId = shiftId; + } + + public String getShiftId() { + return shiftId; + } + public void setParentOrder(String parentOrder) { + this.parentOrder = parentOrder; + } + + public String getParentOrder() { + return parentOrder; + } + public void setAncestors(String ancestors) { + this.ancestors = ancestors; + } + + public String getAncestors() { + return ancestors; + } + public void setStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + 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 setProdType(String prodType) { + this.prodType = prodType; + } + + public String getProdType() { + return prodType; + } + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("workorderId", getWorkorderId()) + .append("workorderCode", getWorkorderCode()) + .append("workorderName", getWorkorderName()) + .append("orderId", getOrderId()) + .append("orderCode", getOrderCode()) + .append("productId", getProductId()) + .append("productCode", getProductCode()) + .append("productName", getProductName()) + .append("productSpc", getProductSpc()) + .append("unit", getUnit()) + .append("quantityProduced", getQuantityProduced()) + .append("quantitySplit", getQuantitySplit()) + .append("routeCode", getRouteCode()) + .append("prodLineCode", getProdLineCode()) + .append("productDate", getProductDate()) + .append("shiftId", getShiftId()) + .append("parentOrder", getParentOrder()) + .append("ancestors", getAncestors()) + .append("status", getStatus()) + .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("prodType", getProdType()) + .append("factoryCode", getFactoryCode()) + .append("batchCodeList",getBatchCodeList()) + .toString(); + } +} \ No newline at end of file diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrderWorkorderBatch.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrderWorkorderBatch.java new file mode 100644 index 00000000..affd2908 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrderWorkorderBatch.java @@ -0,0 +1,159 @@ +package com.op.mes.domain; + +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; + +/** + * 生产工单批次对象 pro_order_workorder_batch + * + * @author Open Platform + * @date 2023-07-18 + */ +public class ProOrderWorkorderBatch extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 批次ID */ + @Excel(name = "批次ID") + private String batchId; + + /** 工单ID */ + private String workorderId; + + /** 批次号 */ + @Excel(name = "批次号") + private String batchCode; + + /** 批次数量 */ + @Excel(name = "批次数量") + private Long batchQuantity; + + /** 单据状态 */ + @Excel(name = "单据状态") + private String status; + + /** 预留字段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; + + /** 产品类型 */ + @Excel(name = "产品类型") + private String prodType; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String factoryCode; + + public void setBatchId(String batchId) { + this.batchId = batchId; + } + + public String getBatchId() { + return batchId; + } + public void setWorkorderId(String workorderId) { + this.workorderId = workorderId; + } + + public String getWorkorderId() { + return workorderId; + } + public void setBatchCode(String batchCode) { + this.batchCode = batchCode; + } + + public String getBatchCode() { + return batchCode; + } + public void setBatchQuantity(Long batchQuantity) { + this.batchQuantity = batchQuantity; + } + + public Long getBatchQuantity() { + return batchQuantity; + } + public void setStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + 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 setProdType(String prodType) { + this.prodType = prodType; + } + + public String getProdType() { + return prodType; + } + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("batchId", getBatchId()) + .append("workorderId", getWorkorderId()) + .append("batchCode", getBatchCode()) + .append("batchQuantity", getBatchQuantity()) + .append("status", getStatus()) + .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("prodType", getProdType()) + .append("factoryCode", getFactoryCode()) + .toString(); + } +} \ No newline at end of file diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/ProShift.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProShift.java new file mode 100644 index 00000000..92dd4fbc --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProShift.java @@ -0,0 +1,39 @@ +package com.op.mes.domain; + +//班次实体类 +public class ProShift { + private Integer shiftId; + private String shiftDesc; + + @Override + public String toString() { + return "ProShift{" + + "shiftId=" + shiftId + + ", shiftDesc='" + shiftDesc + '\'' + + '}'; + } + + public Integer getShiftId() { + return shiftId; + } + + public void setShiftId(Integer shiftId) { + this.shiftId = shiftId; + } + + public String getShiftDesc() { + return shiftDesc; + } + + public void setShiftDesc(String shiftDesc) { + this.shiftDesc = shiftDesc; + } + + public ProShift(Integer shiftId, String shiftDesc) { + this.shiftId = shiftId; + this.shiftDesc = shiftDesc; + } + + public ProShift() { + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/dto/ProOrderDTO.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/dto/ProOrderDTO.java new file mode 100644 index 00000000..cb68ffb4 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/dto/ProOrderDTO.java @@ -0,0 +1,254 @@ +package com.op.mes.domain.dto; + +import java.util.Date; +import java.util.List; + +public class ProOrderDTO { + /** ID */ + private String id; + + /** 计划工厂编码 */ + private String factoryCode; + + /** 订单类型 */ + private String orderType; + + /** 订单号 */ + private String orderCode; + + /** 物料号 */ + private String prodCode; + + /** 物料名称 */ + private String prodDesc; + + /** 订单数量 */ + private Long quantity; + + /** 已拆分数量 */ + private Long quantitySplit; + + /** 单位 */ + private String unit; + + /** 任务清单 */ + private String workerOrder; + + /** 计划生产日期 */ + private Date planProDate; + + /** 计划完成日期 */ + private Date planComplete; + + /** */ + private String atrr1; + + /** */ + private String atrr2; + + /** */ + private String atrr3; + + /** 0未拆分 */ + private String status; + + /** 上级工单 */ + private String parentOrder; + + /** 产品类型 */ + private String prodType; + + /** 物料型号 */ + private String ProdSpc; + + private List children; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getFactoryCode() { + return factoryCode; + } + + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getOrderType() { + return orderType; + } + + public void setOrderType(String orderType) { + this.orderType = orderType; + } + + public String getOrderCode() { + return orderCode; + } + + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public String getProdCode() { + return prodCode; + } + + public void setProdCode(String prodCode) { + this.prodCode = prodCode; + } + + public String getProdDesc() { + return prodDesc; + } + + public void setProdDesc(String prodDesc) { + this.prodDesc = prodDesc; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public Long getQuantitySplit() { + return quantitySplit; + } + + public void setQuantitySplit(Long quantitySplit) { + this.quantitySplit = quantitySplit; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getWorkerOrder() { + return workerOrder; + } + + public void setWorkerOrder(String workerOrder) { + this.workerOrder = workerOrder; + } + + public Date getPlanProDate() { + return planProDate; + } + + public void setPlanProDate(Date planProDate) { + this.planProDate = planProDate; + } + + public Date getPlanComplete() { + return planComplete; + } + + public void setPlanComplete(Date planComplete) { + this.planComplete = planComplete; + } + + public String getAtrr1() { + return atrr1; + } + + public void setAtrr1(String atrr1) { + this.atrr1 = atrr1; + } + + public String getAtrr2() { + return atrr2; + } + + public void setAtrr2(String atrr2) { + this.atrr2 = atrr2; + } + + public String getAtrr3() { + return atrr3; + } + + public void setAtrr3(String atrr3) { + this.atrr3 = atrr3; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getParentOrder() { + return parentOrder; + } + + public void setParentOrder(String parentOrder) { + this.parentOrder = parentOrder; + } + + public String getProdType() { + return prodType; + } + + public void setProdType(String prodType) { + this.prodType = prodType; + } + + public String getProdSpc() { + return ProdSpc; + } + + public void setProdSpc(String prodSpc) { + ProdSpc = prodSpc; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + @Override + public String toString() { + return "ProOrderDTO{" + + "id='" + id + '\'' + + ", factoryCode='" + factoryCode + '\'' + + ", orderType='" + orderType + '\'' + + ", orderCode='" + orderCode + '\'' + + ", prodCode='" + prodCode + '\'' + + ", prodDesc='" + prodDesc + '\'' + + ", quantity=" + quantity + + ", quantitySplit=" + quantitySplit + + ", unit='" + unit + '\'' + + ", workerOrder='" + workerOrder + '\'' + + ", planProDate=" + planProDate + + ", planComplete=" + planComplete + + ", atrr1='" + atrr1 + '\'' + + ", atrr2='" + atrr2 + '\'' + + ", atrr3='" + atrr3 + '\'' + + ", status='" + status + '\'' + + ", parentOrder='" + parentOrder + '\'' + + ", prodType='" + prodType + '\'' + + ", ProdSpc='" + ProdSpc + '\'' + + ", children=" + children + + '}'; + } + + public ProOrderDTO() { + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/dto/SplitOrderDTO.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/dto/SplitOrderDTO.java new file mode 100644 index 00000000..aee3464e --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/dto/SplitOrderDTO.java @@ -0,0 +1,86 @@ +package com.op.mes.domain.dto; + +import com.op.mes.domain.Batch; +import com.op.mes.domain.ProOrder; + +import java.util.Date; +import java.util.List; + +//接受前端拆分模型 +public class SplitOrderDTO { + //批次号与批次数量 + private List formFields; + //产线 + private String prodLineCode; + //日期 + private Date productDate; + //班次 + private String shiftId; + //拆分数量 + private Long splitNum; + //所有改变的订单列表 + private ProOrderDTO product; + + public List getFormFields() { + return formFields; + } + + public void setFormFields(List formFields) { + this.formFields = formFields; + } + + public String getProdLineCode() { + return prodLineCode; + } + + public void setProdLineCode(String prodLineCode) { + this.prodLineCode = prodLineCode; + } + + public Date getProductDate() { + return productDate; + } + + public void setProductDate(Date productDate) { + this.productDate = productDate; + } + + public String getShiftId() { + return shiftId; + } + + public void setShiftId(String shiftId) { + this.shiftId = shiftId; + } + + public Long getSplitNum() { + return splitNum; + } + + public void setSplitNum(Long splitNum) { + this.splitNum = splitNum; + } + + public ProOrderDTO getProduct() { + return product; + } + + public void setProduct(ProOrderDTO product) { + this.product = product; + } + + @Override + public String toString() { + return "SplitOrderDTO{" + + "formFields=" + formFields + + ", prodLineCode='" + prodLineCode + '\'' + + ", productDate=" + productDate + + ", shiftId='" + shiftId + '\'' + + ", splitNum=" + splitNum + + ", product=" + product + + '}'; + } + + public SplitOrderDTO() { + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/LineAndShiftVo.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/LineAndShiftVo.java new file mode 100644 index 00000000..e6363b92 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/LineAndShiftVo.java @@ -0,0 +1,45 @@ +package com.op.mes.domain.vo; + +import com.op.mes.domain.ProLine; +import com.op.mes.domain.ProShift; + +import java.util.List; + +public class LineAndShiftVo { + //线体 + private List lines; + //班次 + private List shifts; + + @Override + public String toString() { + return "LineAndShiftVo{" + + "lines=" + lines + + ", shifts=" + shifts + + '}'; + } + + public List getLines() { + return lines; + } + + public void setLines(List lines) { + this.lines = lines; + } + + public List getShifts() { + return shifts; + } + + public void setShifts(List shifts) { + this.shifts = shifts; + } + + public LineAndShiftVo(List lines, List shifts) { + this.lines = lines; + this.shifts = shifts; + } + + public LineAndShiftVo() { + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProOrderMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProOrderMapper.java index 814275d7..debb1074 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProOrderMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProOrderMapper.java @@ -2,60 +2,137 @@ package com.op.mes.mapper; import java.util.List; +import com.op.mes.domain.Convert; +import com.op.mes.domain.ProLine; import com.op.mes.domain.ProOrder; +import com.op.mes.domain.ProShift; +import org.apache.ibatis.annotations.Select; /** * 订单Mapper接口 - * + * * @author Open Platform * @date 2023-07-13 */ public interface ProOrderMapper { - /** - * 查询订单 - * - * @param id 订单主键 - * @return 订单 - */ - public ProOrder selectProOrderById(String id); - - /** - * 查询订单列表 - * - * @param proOrder 订单 - * @return 订单集合 - */ - public List selectProOrderList(ProOrder proOrder); - - /** - * 新增订单 - * - * @param proOrder 订单 - * @return 结果 - */ - public int insertProOrder(ProOrder proOrder); - - /** - * 修改订单 - * - * @param proOrder 订单 - * @return 结果 - */ - public int updateProOrder(ProOrder proOrder); - - /** - * 删除订单 - * - * @param id 订单主键 - * @return 结果 - */ - public int deleteProOrderById(String id); - - /** - * 批量删除订单 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteProOrderByIds(String[] ids); + + /** + * 更新订单表(拆分模块) + * + * @param proOrder + * @return + */ + public int updateOrder(ProOrder proOrder); + + /** + * 查询订单 + * + * @param id 订单主键 + * @return 订单 + */ + public ProOrder selectProOrderById(String id); + + /** + * 查询订单列表 + * + * @param proOrder 订单 + * @return 订单集合 + */ + public List selectProOrderList(ProOrder proOrder); + + /** + * 新增订单 + * + * @param proOrder 订单 + * @return 结果 + */ + public int insertProOrder(ProOrder proOrder); + + /** + * 修改订单 + * + * @param proOrder 订单 + * @return 结果 + */ + public int updateProOrder(ProOrder proOrder); + + /** + * 删除订单 + * + * @param id 订单主键 + * @return 结果 + */ + public int deleteProOrderById(String id); + + /** + * 批量删除订单 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteProOrderByIds(String[] ids); + + /** + * 获取线体 + * + * @return + */ + @Select(" SELECT sf.f_code [key],sf.factory_name label FROM sys_factory sf WHERE sf.f_type='l' AND sf.status = '1' AND sf.del_flag = '0' ") + public List selectProdLine(); + + /** + * 获取班次 + * + * @return + */ + @Select("SELECT bst.Shift_Id shiftId,bst.Shift_Desc_Global shiftDesc FROM base_shifts_t bst") + public List selectProShift(); + + /** + * 获取换算值 + * + * @return + */ + public List selectConvert(); + + /** + * 根据code查询产线名称 + * + * @return + */ + @Select("SELECT sf.factory_name name FROM sys_factory sf WHERE sf.f_type='l' AND sf.status = '1' AND sf.del_flag = '0' AND sf.f_code = #{prodLineCode}") + String selectProdLineName(String prodLineCode); + + /** + * 查询所有batchCode + * + * @return + */ + @Select("SELECT batch_code FROM pro_order_workorder_batch WHERE status = '1' GROUP BY batch_code") + List selectBatchCodes(); + + + /** + * 通过parent_order查询订单信息 + * + * @param orderCode + * @return + */ + List selectChildProOrderByCode(String orderCode); + + /** + * 通过code获取产线名称 + * @param prodLineCode + * @return + */ + @Select("SELECT sf.factory_name FROM sys_factory sf WHERE sf.f_code = #{prodLineCode}") + String selectBatchNameByCode(String prodLineCode); + + /** + * 通过工单id查询批次号list + * @param workorderId + * @return + */ + @Select("SELECT powb.batch_code FROM pro_order_workorder_batch powb LEFT JOIN pro_order_workorder pow ON powb.workorder_id = pow.workorder_id WHERE pow.workorder_id = #{workorderId}") + List selectBatchCodesById(String workorderId); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProOrderWorkorderBatchMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProOrderWorkorderBatchMapper.java new file mode 100644 index 00000000..dd225b61 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProOrderWorkorderBatchMapper.java @@ -0,0 +1,64 @@ +package com.op.mes.mapper; + +import com.op.mes.domain.Batch; +import com.op.mes.domain.ProOrderWorkorderBatch; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * 生产工单批次Mapper接口 + * + * @author Open Platform + * @date 2023-07-18 + */ +public interface ProOrderWorkorderBatchMapper { + /** + * 查询生产工单批次 + * + * @param workorderId 生产工单批次主键 + * @return 生产工单批次 + */ + public ProOrderWorkorderBatch selectProOrderWorkorderBatchByWorkorderId(String workorderId); + + /** + * 查询生产工单批次列表 + * + * @param proOrderWorkorderBatch 生产工单批次 + * @return 生产工单批次集合 + */ + public List selectProOrderWorkorderBatchList(ProOrderWorkorderBatch proOrderWorkorderBatch); + + /** + * 新增生产工单批次 + * + * @param proOrderWorkorderBatch 生产工单批次 + * @return 结果 + */ + public int insertProOrderWorkorderBatch(ProOrderWorkorderBatch proOrderWorkorderBatch); + + /** + * 修改生产工单批次 + * + * @param proOrderWorkorderBatch 生产工单批次 + * @return 结果 + */ + public int updateProOrderWorkorderBatch(ProOrderWorkorderBatch proOrderWorkorderBatch); + + /** + * 删除生产工单批次 + * + * @param workorderId 生产工单批次主键 + * @return 结果 + */ + public int deleteProOrderWorkorderBatchByWorkorderId(String workorderId); + + /** + * 批量删除生产工单批次 + * + * @param workorderIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteProOrderWorkorderBatchByWorkorderIds(String[] workorderIds); + +} \ No newline at end of file diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProOrderWorkorderMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProOrderWorkorderMapper.java new file mode 100644 index 00000000..ee90eedd --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProOrderWorkorderMapper.java @@ -0,0 +1,77 @@ +package com.op.mes.mapper; + +import com.op.mes.domain.ProOrderWorkorder; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * 生产工单Mapper接口 + * + * @author Open Platform + * @date 2023-07-18 + */ +public interface ProOrderWorkorderMapper { + /** + * 查询生产工单 + * + * @param workorderId 生产工单主键 + * @return 生产工单 + */ + public ProOrderWorkorder selectProOrderWorkorderByWorkorderId(String workorderId); + + /** + * 查询生产工单列表 + * + * @param proOrderWorkorder 生产工单 + * @return 生产工单集合 + */ + public List selectProOrderWorkorderList(ProOrderWorkorder proOrderWorkorder); + + /** + * 新增生产工单 + * + * @param proOrderWorkorder 生产工单 + * @return 结果 + */ + public int insertProOrderWorkorder(ProOrderWorkorder proOrderWorkorder); + + /** + * 修改生产工单 + * + * @param proOrderWorkorder 生产工单 + * @return 结果 + */ + public int updateProOrderWorkorder(ProOrderWorkorder proOrderWorkorder); + + /** + * 删除生产工单 + * + * @param workorderId 生产工单主键 + * @return 结果 + */ + public int deleteProOrderWorkorderByWorkorderId(String workorderId); + + /** + * 批量删除生产工单 + * + * @param workorderIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteProOrderWorkorderByWorkorderIds(String[] workorderIds); + + /** + * 通过订单id查询工单信息 + * + * @param id + * @return + */ + List selectFirWorkOrder(String id); + + /** + * 通过code查询子工单 + * @param workorderCode + * @return + */ + List selectChildWorkOrder(String workorderCode); +} \ No newline at end of file diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IProOrderService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IProOrderService.java index f766c184..43ccc371 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IProOrderService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IProOrderService.java @@ -1,60 +1,104 @@ package com.op.mes.service; import java.util.List; + +import com.op.common.core.web.domain.AjaxResult; +import com.op.mes.domain.Convert; import com.op.mes.domain.ProOrder; +import com.op.mes.domain.dto.SplitOrderDTO; +import com.op.mes.domain.vo.LineAndShiftVo; /** * 订单Service接口 - * + * * @author Open Platform * @date 2023-07-13 */ public interface IProOrderService { - /** - * 查询订单 - * - * @param id 订单主键 - * @return 订单 - */ - public ProOrder selectProOrderById(String id); - - /** - * 查询订单列表 - * - * @param proOrder 订单 - * @return 订单集合 - */ - public List selectProOrderList(ProOrder proOrder); - - /** - * 新增订单 - * - * @param proOrder 订单 - * @return 结果 - */ - public int insertProOrder(ProOrder proOrder); - - /** - * 修改订单 - * - * @param proOrder 订单 - * @return 结果 - */ - public int updateProOrder(ProOrder proOrder); - - /** - * 批量删除订单 - * - * @param ids 需要删除的订单主键集合 - * @return 结果 - */ - public int deleteProOrderByIds(String[] ids); - - /** - * 删除订单信息 - * - * @param id 订单主键 - * @return 结果 - */ - public int deleteProOrderById(String id); + + /** + * 获取线体 + * + * @return + */ + public LineAndShiftVo getProdLineShift(); + + /** + * 查询订单 + * + * @param id 订单主键 + * @return 订单 + */ + public ProOrder selectProOrderById(String id); + + /** + * 查询订单列表 + * + * @param proOrder 订单 + * @return 订单集合 + */ + public List selectProOrderList(ProOrder proOrder); + + /** + * 新增订单 + * + * @param proOrder 订单 + * @return 结果 + */ + public int insertProOrder(ProOrder proOrder); + + /** + * 修改订单 + * + * @param proOrder 订单 + * @return 结果 + */ + public int updateProOrder(ProOrder proOrder); + + /** + * 批量删除订单 + * + * @param ids 需要删除的订单主键集合 + * @return 结果 + */ + public int deleteProOrderByIds(String[] ids); + + /** + * 删除订单信息 + * + * @param id 订单主键 + * @return 结果 + */ + public int deleteProOrderById(String id); + + /** + * 获取换算值 + * + * @return + */ + public List getConvert(); + + /** + * 提交拆分订单接口 + * + * @param splitOrderDTO + * @return + */ + public AjaxResult subSplitOrder(SplitOrderDTO splitOrderDTO); + + /** + * 获取工单信息列表 + * + * @param id + * @return + */ + public AjaxResult getWorkOrderList(String id); + + /** + * 获取当前订单信息列表 + * + * @param id + * @return + */ + public AjaxResult getOrderList(String id); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IProOrderWorkorderBatchService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IProOrderWorkorderBatchService.java new file mode 100644 index 00000000..1061900f --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IProOrderWorkorderBatchService.java @@ -0,0 +1,61 @@ +package com.op.mes.service; + +import com.op.mes.domain.ProOrderWorkorderBatch; + +import java.util.List; + +/** + * 生产工单批次Service接口 + * + * @author Open Platform + * @date 2023-07-18 + */ +public interface IProOrderWorkorderBatchService { + /** + * 查询生产工单批次 + * + * @param workorderId 生产工单批次主键 + * @return 生产工单批次 + */ + public ProOrderWorkorderBatch selectProOrderWorkorderBatchByWorkorderId(String workorderId); + + /** + * 查询生产工单批次列表 + * + * @param proOrderWorkorderBatch 生产工单批次 + * @return 生产工单批次集合 + */ + public List selectProOrderWorkorderBatchList(ProOrderWorkorderBatch proOrderWorkorderBatch); + + /** + * 新增生产工单批次 + * + * @param proOrderWorkorderBatch 生产工单批次 + * @return 结果 + */ + public int insertProOrderWorkorderBatch(ProOrderWorkorderBatch proOrderWorkorderBatch); + + /** + * 修改生产工单批次 + * + * @param proOrderWorkorderBatch 生产工单批次 + * @return 结果 + */ + public int updateProOrderWorkorderBatch(ProOrderWorkorderBatch proOrderWorkorderBatch); + + /** + * 批量删除生产工单批次 + * + * @param workorderIds 需要删除的生产工单批次主键集合 + * @return 结果 + */ + public int deleteProOrderWorkorderBatchByWorkorderIds(String[] workorderIds); + + /** + * 删除生产工单批次信息 + * + * @param workorderId 生产工单批次主键 + * @return 结果 + */ + public int deleteProOrderWorkorderBatchByWorkorderId(String workorderId); +} \ No newline at end of file diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IProOrderWorkorderService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IProOrderWorkorderService.java new file mode 100644 index 00000000..be181667 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IProOrderWorkorderService.java @@ -0,0 +1,62 @@ +package com.op.mes.service; + + +import com.op.mes.domain.ProOrderWorkorder; + +import java.util.List; + +/** + * 生产工单Service接口 + * + * @author Open Platform + * @date 2023-07-18 + */ +public interface IProOrderWorkorderService { + /** + * 查询生产工单 + * + * @param workorderId 生产工单主键 + * @return 生产工单 + */ + public ProOrderWorkorder selectProOrderWorkorderByWorkorderId(String workorderId); + + /** + * 查询生产工单列表 + * + * @param proOrderWorkorder 生产工单 + * @return 生产工单集合 + */ + public List selectProOrderWorkorderList(ProOrderWorkorder proOrderWorkorder); + + /** + * 新增生产工单 + * + * @param proOrderWorkorder 生产工单 + * @return 结果 + */ + public int insertProOrderWorkorder(ProOrderWorkorder proOrderWorkorder); + + /** + * 修改生产工单 + * + * @param proOrderWorkorder 生产工单 + * @return 结果 + */ + public int updateProOrderWorkorder(ProOrderWorkorder proOrderWorkorder); + + /** + * 批量删除生产工单 + * + * @param workorderIds 需要删除的生产工单主键集合 + * @return 结果 + */ + public int deleteProOrderWorkorderByWorkorderIds(String[] workorderIds); + + /** + * 删除生产工单信息 + * + * @param workorderId 生产工单主键 + * @return 结果 + */ + public int deleteProOrderWorkorderByWorkorderId(String workorderId); +} \ No newline at end of file diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProOrderServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProOrderServiceImpl.java index 9b0109ad..9b3746c3 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProOrderServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProOrderServiceImpl.java @@ -1,15 +1,27 @@ package com.op.mes.service.impl; -import java.util.List; +import java.util.*; import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.context.SecurityContextHolder; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.core.web.domain.AjaxResult; +import com.op.mes.domain.*; +import com.op.mes.domain.dto.ProOrderDTO; +import com.op.mes.domain.dto.SplitOrderDTO; +import com.op.mes.domain.vo.LineAndShiftVo; +import com.op.mes.mapper.ProOrderWorkorderBatchMapper; +import com.op.mes.mapper.ProOrderWorkorderMapper; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.mes.mapper.ProOrderMapper; -import com.op.mes.domain.ProOrder; import com.op.mes.service.IProOrderService; +import org.springframework.transaction.annotation.Transactional; + +import static com.op.common.core.web.domain.AjaxResult.error; +import static com.op.common.core.web.domain.AjaxResult.success; /** * 订单Service业务层处理 @@ -19,81 +31,360 @@ import com.op.mes.service.IProOrderService; */ @Service public class ProOrderServiceImpl implements IProOrderService { - @Autowired - private ProOrderMapper proOrderMapper; - - /** - * 查询订单 - * - * @param id 订单主键 - * @return 订单 - */ - @Override - @DS("#header.poolName") - public ProOrder selectProOrderById(String id) { - return proOrderMapper.selectProOrderById(id); - } - - /** - * 查询订单列表 - * - * @param proOrder 订单 - * @return 订单 - */ - @Override - @DS("#header.poolName") - public List selectProOrderList(ProOrder proOrder) { - return proOrderMapper.selectProOrderList(proOrder); - } - - /** - * 新增订单 - * - * @param proOrder 订单 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int insertProOrder(ProOrder proOrder) { - proOrder.setId(IdUtils.fastSimpleUUID()); - proOrder.setCreateTime(DateUtils.getNowDate()); - return proOrderMapper.insertProOrder(proOrder); - } - - /** - * 修改订单 - * - * @param proOrder 订单 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int updateProOrder(ProOrder proOrder) { - proOrder.setUpdateTime(DateUtils.getNowDate()); - return proOrderMapper.updateProOrder(proOrder); - } - - /** - * 批量删除订单 - * - * @param ids 需要删除的订单主键 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int deleteProOrderByIds(String[] ids) { - return proOrderMapper.deleteProOrderByIds(ids); - } - - /** - * 删除订单信息 - * - * @param id 订单主键 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int deleteProOrderById(String id) { - return proOrderMapper.deleteProOrderById(id); - } -} + @Autowired + private ProOrderMapper proOrderMapper; + @Autowired + private ProOrderWorkorderMapper proOrderWorkorderMapper; + @Autowired + private ProOrderWorkorderBatchMapper proOrderWorkorderBatchMapper; + + /** + * 获取换算值 + * + * @return + */ + @Override + @DS("master") + public List getConvert() { + return proOrderMapper.selectConvert(); + } + + /** + * 提交拆分订单接口 + * + * @param splitOrderDTO + * @return + */ + @Override + @Transactional + @DS("#header.poolName") + public AjaxResult subSplitOrder(SplitOrderDTO splitOrderDTO) { + boolean checkout = true; + // 校验批次编号是否存在(重复问题) + List batchCodes = proOrderMapper.selectBatchCodes(); + for (int i = 0; i < batchCodes.size(); i++) { + for (int j = 0; j < splitOrderDTO.getFormFields().size(); j++) { + if (batchCodes.get(i).equals(splitOrderDTO.getFormFields().get(j).getBatchCode())) { + checkout = false; + } + } + } + + // 如果不重复 + if (checkout) { + ProOrder product = new ProOrder(); + BeanUtils.copyProperties(splitOrderDTO.getProduct(), product); + // 设置通用属性 + ProOrderWorkorder proOrderWorkorder = setCommonWorkAttribute(product, splitOrderDTO.getProductDate(), splitOrderDTO.getProdLineCode(), splitOrderDTO.getShiftId()); + // 生成对应工单表 + // 一级 + ProOrderWorkorder firWorkOrder = setWorkOrder(proOrderWorkorder, product); + // 更新到数据库 + proOrderWorkorderMapper.insertProOrderWorkorder(firWorkOrder); + // 创建通用批次表对象 + ProOrderWorkorderBatch workBatch = setCommonBatchAttribute(); + // 生成批次表并更新到数据库 + setBatch(workBatch, splitOrderDTO.getFormFields(), firWorkOrder.getWorkorderId()); + + // 二级 + if (splitOrderDTO.getProduct().getChildren() != null) { + List secProOrderList = splitOrderDTO.getProduct().getChildren(); + BeanUtils.copyProperties(secProOrderList.get(0), product); + // 设置父工单 + proOrderWorkorder.setParentOrder(firWorkOrder.getWorkorderCode()); + ProOrderWorkorder secWorkOrder = setWorkOrder(proOrderWorkorder, product); + // 更新到数据库 + proOrderWorkorderMapper.insertProOrderWorkorder(secWorkOrder); + // 生成批次表并更新到数据库 + setBatch(workBatch, splitOrderDTO.getFormFields(), secWorkOrder.getWorkorderId()); + + // 三级 + if (secProOrderList.get(0).getChildren() != null) { + List thiProOrderList = secProOrderList.get(0).getChildren(); + BeanUtils.copyProperties(thiProOrderList.get(0), product); + // 设置父工单 + proOrderWorkorder.setParentOrder(secWorkOrder.getWorkorderCode()); + ProOrderWorkorder thiWorkOrder = setWorkOrder(proOrderWorkorder, product); + // 更新到数据库 + proOrderWorkorderMapper.insertProOrderWorkorder(thiWorkOrder); + // 生成批次表并更新到数据库 + setBatch(workBatch, splitOrderDTO.getFormFields(), thiWorkOrder.getWorkorderId()); + } + } + + return success(); + + } + + return error(500, "批次号不能重复"); + } + + /** + * 获取工单信息列表 + * + * @param id + * @return + */ + @Override + @DS("#header.poolName") + public AjaxResult getWorkOrderList(String id) { + // 通过订单id查询所有工单信息list + List proOrderWorkorderList = proOrderWorkorderMapper.selectFirWorkOrder(id); + // 母工单循环遍历 + for (int i = 0;i < proOrderWorkorderList.size();i++){ + // 通过设备code查询出设备名称 + String prodLineName = proOrderMapper.selectProdLineName(proOrderWorkorderList.get(i).getProdLineCode()); + // 这里因为没有相对应字段所以用atrr1来表示批次号list + // 通过工单id查询批次号 + List batchCodeList = proOrderMapper.selectBatchCodesById(proOrderWorkorderList.get(i).getWorkorderId()); + // 格式化数据 + StringBuilder batchCodes = new StringBuilder(); + for (int j = 0;j < batchCodeList.size();j++){ + batchCodes.append(batchCodeList.get(j)); + batchCodes.append(";"); + } + // 通过母工单workorder_id查询子工单 + // 二级 + List secProOrderWorkorder = proOrderWorkorderMapper.selectChildWorkOrder(proOrderWorkorderList.get(i).getWorkorderCode()); + if (secProOrderWorkorder.size() > 0 && secProOrderWorkorder != null){ + // 三级 + List thiProOrderWorkorders = proOrderWorkorderMapper.selectChildWorkOrder(secProOrderWorkorder.get(0).getWorkorderCode()); + if (thiProOrderWorkorders.size() > 0 && thiProOrderWorkorders != null){ + // 将三级放入二级child + thiProOrderWorkorders.get(0).setProdLineCode(prodLineName); + thiProOrderWorkorders.get(0).setBatchCodeList(batchCodes); + secProOrderWorkorder.get(0).setChildren(thiProOrderWorkorders); + } + // 将二级放入到母工单child + secProOrderWorkorder.get(0).setProdLineCode(prodLineName); + secProOrderWorkorder.get(0).setBatchCodeList(batchCodes); + proOrderWorkorderList.get(i).setChildren(secProOrderWorkorder); + } + proOrderWorkorderList.get(i).setProdLineCode(prodLineName); + proOrderWorkorderList.get(i).setBatchCodeList(batchCodes); + } + return success(proOrderWorkorderList); + } + + /** + * 获取当前订单信息列表 + * + * @param id + * @return + */ + @Override + @DS("#header.poolName") + public AjaxResult getOrderList(String id) { + // 注意判空不为空则放入 (避免空指针) + // 通过母工单id查询母订单详情 + ProOrder proOrder = proOrderMapper.selectProOrderById(id); + // 查询二级 + List secProOrderList = proOrderMapper.selectChildProOrderByCode(proOrder.getOrderCode()); + if (secProOrderList != null || secProOrderList.size() > 0) { + // 查询三级 + List thiProOrderList = proOrderMapper.selectChildProOrderByCode(secProOrderList.get(0).getOrderCode()); + if (thiProOrderList != null || thiProOrderList.size() > 0) { + // 将三级Order放入二级 + secProOrderList.get(0).setChildren(thiProOrderList); + } + } + // 将二级Order放入母订单 + proOrder.setChildren(secProOrderList); + + return success(proOrder); + } + + /** + * 获取线体 + * + * @return + */ + @Override + @DS("#header.poolName") + public LineAndShiftVo getProdLineShift() { + LineAndShiftVo lineAndShiftVo = new LineAndShiftVo(proOrderMapper.selectProdLine(), proOrderMapper.selectProShift()); + return lineAndShiftVo; + } + + /** + * 查询订单 + * + * @param id 订单主键 + * @return 订单 + */ + @Override + @DS("#header.poolName") + public ProOrder selectProOrderById(String id) { + return proOrderMapper.selectProOrderById(id); + } + + /** + * 查询订单列表 + * + * @param proOrder 订单 + * @return 订单 + */ + @Override + @DS("#header.poolName") + public List selectProOrderList(ProOrder proOrder) { + return proOrderMapper.selectProOrderList(proOrder); + } + + /** + * 新增订单 + * + * @param proOrder 订单 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertProOrder(ProOrder proOrder) { + proOrder.setId(IdUtils.fastSimpleUUID()); + proOrder.setCreateTime(DateUtils.getNowDate()); + return proOrderMapper.insertProOrder(proOrder); + } + + /** + * 修改订单 + * + * @param proOrder 订单 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateProOrder(ProOrder proOrder) { + proOrder.setUpdateTime(DateUtils.getNowDate()); + return proOrderMapper.updateProOrder(proOrder); + } + + /** + * 批量删除订单 + * + * @param ids 需要删除的订单主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteProOrderByIds(String[] ids) { + return proOrderMapper.deleteProOrderByIds(ids); + } + + /** + * 删除订单信息 + * + * @param id 订单主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteProOrderById(String id) { + return proOrderMapper.deleteProOrderById(id); + } + + /** + * 设置工单通用属性 + * + * @param proOrder + * @return + */ + private ProOrderWorkorder setCommonWorkAttribute(ProOrder proOrder, Date date, String proLineCode, String shiftId) { + ProOrderWorkorder proOrderWorkorder = new ProOrderWorkorder(); + // 更新者 + proOrderWorkorder.setUpdateBy(SecurityContextHolder.getUserName()); + // 创建者 + proOrderWorkorder.setCreateBy(SecurityContextHolder.getUserName()); + // 工单生产日期 + proOrderWorkorder.setProductDate(date); + // 产品(物料)编码 + proOrderWorkorder.setProductCode(proOrder.getProdCode()); + // TODO 产品(物料)名称 + proOrderWorkorder.setProductName("测试ing"); + // 产品(物料)规格型号 + proOrderWorkorder.setProductSpc(proOrder.getProdSpc()); + // 产线 + proOrderWorkorder.setProdLineCode(proLineCode); + // 班次 + proOrderWorkorder.setShiftId(shiftId); + // TODO 产品类型(pro_type) + // 单据状态(1为正常) + proOrderWorkorder.setStatus("1"); + return proOrderWorkorder; + } + + /** + * 设置工单属性 + * + * @param proOrderWorkorder + * @param proOrder + * @return + */ + private ProOrderWorkorder setWorkOrder(ProOrderWorkorder proOrderWorkorder, ProOrder proOrder) { + // 获取当前时间 + Date date = new Date(); + // 订单表更新时间/更新者 + proOrder.setUpdateBy(SecurityContextHolder.getUserName()); + proOrder.setUpdateTime(date); + // 更新订单表 + proOrderMapper.updateOrder(proOrder); + // 生成对应的工单表 + // 生成id + proOrderWorkorder.setWorkorderId(IdUtils.fastSimpleUUID()); + // 生成工单号 + proOrderWorkorder.setWorkorderCode("GD" + DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSSsss, date)); + // TODO 工单名称 + proOrderWorkorder.setWorkorderName("测试ing"); + // 订单id + proOrderWorkorder.setOrderId(proOrder.getId()); + // 订单编码 + proOrderWorkorder.setOrderCode(proOrder.getOrderCode()); + // 单位 + proOrderWorkorder.setUnit(proOrder.getUnit()); + // 已拆分数量 + proOrderWorkorder.setQuantitySplit(Long.valueOf(proOrder.getAtrr1())); + // TODO 工艺编码 + // TODO 所有父节点 + return proOrderWorkorder; + } + + /** + * 设置批次表通用 + * + * @return + */ + private ProOrderWorkorderBatch setCommonBatchAttribute() { + ProOrderWorkorderBatch workBatch = new ProOrderWorkorderBatch(); + Date date = new Date(); + // 更新者 + workBatch.setUpdateBy(SecurityContextHolder.getUserName()); + // 创建者 + workBatch.setCreateBy(SecurityContextHolder.getUserName()); + // 设置单据状态(1正常) + workBatch.setStatus("1"); + return workBatch; + } + + /** + * 生成批次表并更新至数据库 + * + * @param workBatch + * @param batchList + * @param workOrderId + */ + private void setBatch(ProOrderWorkorderBatch workBatch, List batchList, String workOrderId) { + // 工单id + workBatch.setWorkorderId(workOrderId); + // TODO 产品类型 + for (int i = 0; i < batchList.size(); i++) { + // 生成批次id + workBatch.setBatchId(IdUtils.fastSimpleUUID()); + Batch batch = batchList.get(i); + // 获取批次号 + workBatch.setBatchCode(batch.getBatchCode()); + // 获取批次数量 + workBatch.setBatchQuantity(batch.getBatchQuantity()); + // 更新至数据库 + proOrderWorkorderBatchMapper.insertProOrderWorkorderBatch(workBatch); + } + } + +} \ No newline at end of file diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProOrderWorkorderBatchServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProOrderWorkorderBatchServiceImpl.java new file mode 100644 index 00000000..b4807d24 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProOrderWorkorderBatchServiceImpl.java @@ -0,0 +1,90 @@ +package com.op.mes.service.impl; + +import com.op.common.core.utils.DateUtils; +import com.op.mes.domain.ProOrderWorkorderBatch; +import com.op.mes.mapper.ProOrderWorkorderBatchMapper; +import com.op.mes.service.IProOrderWorkorderBatchService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 生产工单批次Service业务层处理 + * + * @author Open Platform + * @date 2023-07-18 + */ +@Service +public class ProOrderWorkorderBatchServiceImpl implements IProOrderWorkorderBatchService { + @Autowired + private ProOrderWorkorderBatchMapper proOrderWorkorderBatchMapper; + + /** + * 查询生产工单批次 + * + * @param workorderId 生产工单批次主键 + * @return 生产工单批次 + */ + @Override + public ProOrderWorkorderBatch selectProOrderWorkorderBatchByWorkorderId(String workorderId) { + return proOrderWorkorderBatchMapper.selectProOrderWorkorderBatchByWorkorderId(workorderId); + } + + /** + * 查询生产工单批次列表 + * + * @param proOrderWorkorderBatch 生产工单批次 + * @return 生产工单批次 + */ + @Override + public List selectProOrderWorkorderBatchList(ProOrderWorkorderBatch proOrderWorkorderBatch) { + return proOrderWorkorderBatchMapper.selectProOrderWorkorderBatchList(proOrderWorkorderBatch); + } + + /** + * 新增生产工单批次 + * + * @param proOrderWorkorderBatch 生产工单批次 + * @return 结果 + */ + @Override + public int insertProOrderWorkorderBatch(ProOrderWorkorderBatch proOrderWorkorderBatch) { + proOrderWorkorderBatch.setCreateTime(DateUtils.getNowDate()); + return proOrderWorkorderBatchMapper.insertProOrderWorkorderBatch(proOrderWorkorderBatch); + } + + /** + * 修改生产工单批次 + * + * @param proOrderWorkorderBatch 生产工单批次 + * @return 结果 + */ + @Override + public int updateProOrderWorkorderBatch(ProOrderWorkorderBatch proOrderWorkorderBatch) { + proOrderWorkorderBatch.setUpdateTime(DateUtils.getNowDate()); + return proOrderWorkorderBatchMapper.updateProOrderWorkorderBatch(proOrderWorkorderBatch); + } + + /** + * 批量删除生产工单批次 + * + * @param workorderIds 需要删除的生产工单批次主键 + * @return 结果 + */ + @Override + public int deleteProOrderWorkorderBatchByWorkorderIds(String[] workorderIds) { + return proOrderWorkorderBatchMapper.deleteProOrderWorkorderBatchByWorkorderIds(workorderIds); + } + + /** + * 删除生产工单批次信息 + * + * @param workorderId 生产工单批次主键 + * @return 结果 + */ + @Override + public int deleteProOrderWorkorderBatchByWorkorderId(String workorderId) { + return proOrderWorkorderBatchMapper.deleteProOrderWorkorderBatchByWorkorderId(workorderId); + } +} \ No newline at end of file diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProOrderWorkorderServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProOrderWorkorderServiceImpl.java new file mode 100644 index 00000000..362c81d1 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProOrderWorkorderServiceImpl.java @@ -0,0 +1,91 @@ +package com.op.mes.service.impl; + +import com.op.common.core.utils.DateUtils; +import com.op.mes.domain.ProOrderWorkorder; +import com.op.mes.mapper.ProOrderWorkorderMapper; +import com.op.mes.service.IProOrderWorkorderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * 生产工单Service业务层处理 + * + * @author Open Platform + * @date 2023-07-18 + */ +@Service +public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { + @Autowired + private ProOrderWorkorderMapper proOrderWorkorderMapper; + + /** + * 查询生产工单 + * + * @param workorderId 生产工单主键 + * @return 生产工单 + */ + @Override + public ProOrderWorkorder selectProOrderWorkorderByWorkorderId(String workorderId) { + return proOrderWorkorderMapper.selectProOrderWorkorderByWorkorderId(workorderId); + } + + /** + * 查询生产工单列表 + * + * @param proOrderWorkorder 生产工单 + * @return 生产工单 + */ + @Override + public List selectProOrderWorkorderList(ProOrderWorkorder proOrderWorkorder) { + return proOrderWorkorderMapper.selectProOrderWorkorderList(proOrderWorkorder); + } + + /** + * 新增生产工单 + * + * @param proOrderWorkorder 生产工单 + * @return 结果 + */ + @Override + public int insertProOrderWorkorder(ProOrderWorkorder proOrderWorkorder) { + proOrderWorkorder.setCreateTime(DateUtils.getNowDate()); + return proOrderWorkorderMapper.insertProOrderWorkorder(proOrderWorkorder); + } + + /** + * 修改生产工单 + * + * @param proOrderWorkorder 生产工单 + * @return 结果 + */ + @Override + public int updateProOrderWorkorder(ProOrderWorkorder proOrderWorkorder) { + proOrderWorkorder.setUpdateTime(DateUtils.getNowDate()); + return proOrderWorkorderMapper.updateProOrderWorkorder(proOrderWorkorder); + } + + /** + * 批量删除生产工单 + * + * @param workorderIds 需要删除的生产工单主键 + * @return 结果 + */ + @Override + public int deleteProOrderWorkorderByWorkorderIds(String[] workorderIds) { + return proOrderWorkorderMapper.deleteProOrderWorkorderByWorkorderIds(workorderIds); + } + + /** + * 删除生产工单信息 + * + * @param workorderId 生产工单主键 + * @return 结果 + */ + @Override + public int deleteProOrderWorkorderByWorkorderId(String workorderId) { + return proOrderWorkorderMapper.deleteProOrderWorkorderByWorkorderId(workorderId); + } +} \ No newline at end of file diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/ProOrderMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/ProOrderMapper.xml index 766646ef..1147d24c 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/ProOrderMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/ProOrderMapper.xml @@ -28,13 +28,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select id, plan_factory_code, order_type, order_code, prod_code, prod_desc, quantity, quantity_split + select id, plan_factory_code, order_type, order_code, prod_code, prod_desc, quantity, quantity_split, unit, worker_order, plan_pro_date, plan_complete, atrr1, atrr2, atrr3, status, parent_order, create_by, create_time, update_by, update_time, prod_type, - factory_code + factory_code, prod_spc from pro_order @@ -58,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and status = #{status} and parent_order = #{parentOrder} and prod_type = #{prodType} + and prod_spc = #{prodSpc} @@ -66,6 +68,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} + + + + insert into pro_order @@ -92,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by, update_time, prod_type, + prod_spc, #{id}, @@ -117,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateBy}, #{updateTime}, #{prodType}, + #{prodSpc}, @@ -145,6 +158,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by = #{updateBy}, update_time = #{updateTime}, prod_type = #{prodType}, + prod_spc = #{prodSpc}, + + where id = #{id} + + + update pro_order + + quantity_split += #{atrr1}, + create_by = #{updateBy}, + create_time = #{updateTime}, + status = 1, where id = #{id} diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/ProOrderWorkorderBatchMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/ProOrderWorkorderBatchMapper.xml new file mode 100644 index 00000000..f82c4367 --- /dev/null +++ b/op-modules/op-mes/src/main/resources/mapper/mes/ProOrderWorkorderBatchMapper.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select batch_id, workorder_id, batch_code, batch_quantity, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, prod_type, factory_code from pro_order_workorder_batch + + + + + + + + insert into pro_order_workorder_batch + + batch_id, + workorder_id, + batch_code, + batch_quantity, + status, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + prod_type, + factory_code, + + + #{batchId}, + #{workorderId}, + #{batchCode}, + #{batchQuantity}, + #{status}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{prodType}, + #{factoryCode}, + + + + + update pro_order_workorder_batch + + batch_id = #{batchId}, + batch_code = #{batchCode}, + batch_quantity = #{batchQuantity}, + status = #{status}, + remark = #{remark}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + prod_type = #{prodType}, + factory_code = #{factoryCode}, + + where workorder_id = #{workorderId} + + + + delete from pro_order_workorder_batch where workorder_id = #{workorderId} + + + + delete from pro_order_workorder_batch where workorder_id in + + #{workorderId} + + + \ No newline at end of file diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/ProOrderWorkorderMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/ProOrderWorkorderMapper.xml new file mode 100644 index 00000000..ef444ef7 --- /dev/null +++ b/op-modules/op-mes/src/main/resources/mapper/mes/ProOrderWorkorderMapper.xml @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select workorder_id, workorder_code, workorder_name, order_id, order_code, product_id, product_code, product_name, product_spc, unit, quantity_produced, quantity_split, route_code, prod_line_code, product_date, shift_id, parent_order, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, prod_type, factory_code from pro_order_workorder + + + + + + + + + + insert into pro_order_workorder + + workorder_id, + workorder_code, + workorder_name, + order_id, + order_code, + product_id, + product_code, + product_name, + product_spc, + unit, + quantity_produced, + quantity_split, + route_code, + prod_line_code, + product_date, + shift_id, + parent_order, + ancestors, + status, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + prod_type, + factory_code, + + + #{workorderId}, + #{workorderCode}, + #{workorderName}, + #{orderId}, + #{orderCode}, + #{productId}, + #{productCode}, + #{productName}, + #{productSpc}, + #{unit}, + #{quantityProduced}, + #{quantitySplit}, + #{routeCode}, + #{prodLineCode}, + #{productDate}, + #{shiftId}, + #{parentOrder}, + #{ancestors}, + #{status}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{prodType}, + #{factoryCode}, + + + + + update pro_order_workorder + + workorder_code = #{workorderCode}, + workorder_name = #{workorderName}, + order_id = #{orderId}, + order_code = #{orderCode}, + product_id = #{productId}, + product_code = #{productCode}, + product_name = #{productName}, + product_spc = #{productSpc}, + unit = #{unit}, + quantity_produced = #{quantityProduced}, + quantity_split = #{quantitySplit}, + route_code = #{routeCode}, + prod_line_code = #{prodLineCode}, + product_date = #{productDate}, + shift_id = #{shiftId}, + parent_order = #{parentOrder}, + ancestors = #{ancestors}, + status = #{status}, + remark = #{remark}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + prod_type = #{prodType}, + factory_code = #{factoryCode}, + + where workorder_id = #{workorderId} + + + + delete from pro_order_workorder where workorder_id = #{workorderId} + + + + delete from pro_order_workorder where workorder_id in + + #{workorderId} + + + \ No newline at end of file