From 0425f44ef91a30e359d90c57b40d916c0b6433fd Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Fri, 28 Jul 2023 10:58:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AE=A1=E5=88=92=E7=AE=A1?= =?UTF-8?q?=E7=90=86(=E5=B7=A5=E5=8D=95=E7=8F=AD=E6=AC=A1=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E8=8E=B7=E5=8F=96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/op/mes/mapper/ProOrderMapper.java | 8 ++++++++ .../java/com/op/mes/service/impl/ProOrderServiceImpl.java | 5 +++++ .../src/main/resources/mapper/mes/ProOrderMapper.xml | 8 +++++++- 3 files changed, 20 insertions(+), 1 deletion(-) 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 42c9beb7..d76ec4ae 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 @@ -143,4 +143,12 @@ public interface ProOrderMapper { public List selectPackageLine(); public void updateOrderBatch(@Param("workers") List workers); + + /** + * 通过id查询班次名称 + * + * @param shiftId + * @return + */ + String selectShiftNameById(String shiftId); } 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 d88a1a18..1a147ff0 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 @@ -175,6 +175,8 @@ public class ProOrderServiceImpl implements IProOrderService { List proOrderWorkorderList = proOrderWorkorderMapper.selectFirWorkOrder(id); // 母工单循环遍历 for (int i = 0; i < proOrderWorkorderList.size(); i++) { + // 通过班次id查询班次名称 + String shiftDesc = proOrderMapper.selectShiftNameById(proOrderWorkorderList.get(i).getShiftId()); // 通过设备code查询出机型名称 String prodLineName = proOrderMapper.selectProdLineName(proOrderWorkorderList.get(i).getProdLineCode()); // 通过工单id查询批次号 @@ -192,15 +194,18 @@ public class ProOrderServiceImpl implements IProOrderService { List thiProOrderWorkorders = proOrderWorkorderMapper.selectChildWorkOrder(secProOrderWorkorder.get(0).getWorkorderCode()); if (thiProOrderWorkorders.size() > 0 && thiProOrderWorkorders != null) { // 将三级放入二级child + thiProOrderWorkorders.get(0).setShiftDesc(shiftDesc); thiProOrderWorkorders.get(0).setProdLineCode(prodLineName); thiProOrderWorkorders.get(0).setBatchCodeList(batchCodes); secProOrderWorkorder.get(0).setChildren(thiProOrderWorkorders); } // 将二级放入到母工单child + secProOrderWorkorder.get(0).setShiftDesc(shiftDesc); secProOrderWorkorder.get(0).setProdLineCode(prodLineName); secProOrderWorkorder.get(0).setBatchCodeList(batchCodes); proOrderWorkorderList.get(i).setChildren(secProOrderWorkorder); } + proOrderWorkorderList.get(i).setShiftDesc(shiftDesc); proOrderWorkorderList.get(i).setProdLineCode(prodLineName); proOrderWorkorderList.get(i).setBatchCodeList(batchCodes); } 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 302369cb..e8908a5f 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 @@ -121,7 +121,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE equipment_type_code = 'equ_type_bzx' - + + + insert into pro_order id,