From 38f48e54bcdc43a51d8f5862fac3703157a57e40 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Fri, 15 Sep 2023 11:41:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E6=A8=A1=E5=9D=97(=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E7=AE=A1=E7=90=86=E6=B9=BF=E6=96=99=E6=A3=80=E9=AA=8C?= =?UTF-8?q?+=E6=89=93=E5=8D=B0=E5=8A=9F=E8=83=BD=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=98=BE=E7=A4=BABUG=E8=A7=A3=E5=86=B3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/plan/mapper/ProWetMaterialPlanMapper.java | 6 ++++++ .../service/impl/ProOrderWorkorderServiceImpl.java | 11 +++++++++++ .../mapper/plan/ProWetMaterialPlanMapper.xml | 8 ++++++++ 3 files changed, 25 insertions(+) diff --git a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWetMaterialPlanMapper.java b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWetMaterialPlanMapper.java index 5f048d8d..290205ea 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWetMaterialPlanMapper.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWetMaterialPlanMapper.java @@ -123,4 +123,10 @@ public interface ProWetMaterialPlanMapper { */ String selectBucketNameById(String bucketId); + /** + * 通过工单id查询已下发的湿料计划 + * @param workorderId + * @return + */ + ProWetMaterialPlan selectProWetMaterialPlanByWorkId(String workorderId); } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java index f0f60c3a..5a8ea5c9 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java @@ -55,6 +55,8 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { private ProWetMaterialPlanDetailMapper proWetMaterialPlanDetailMapper; @Autowired private RemoteSapService remoteSapService; + @Autowired + private ProWetMaterialPlanMapper proWetMaterialPlanMapper; /** * 查询生产工单 @@ -697,6 +699,13 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { if (!(proOrderWorkorder.getStatus().equals("w0") || proOrderWorkorder.getStatus().equals("w1"))) { return error("工单已生产,不可变更!"); } + // 白坯工单所在湿料计划下发不允许变更 + if (proOrderWorkorder.getProdType().equals("white")) { + ProWetMaterialPlan plan = proWetMaterialPlanMapper.selectProWetMaterialPlanByWorkId(proOrderWorkorder.getWorkorderId()); + if (plan != null) { + return error("工单所在湿料计划已下发,不允许变更!"); + } + } return success(); } @@ -726,6 +735,7 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { List proOrderWorkorderList = new ArrayList(); // 查询该工单信息 ProOrderWorkorder proOrderWorkorder = proOrderWorkorderMapper.selectWorkOrderByCode(code); + formatProOrderWorkorder(proOrderWorkorder); proOrderWorkorderList.add(proOrderWorkorder); boolean flag = true; @@ -736,6 +746,7 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { while (flag) { ProOrderWorkorder workorder = proOrderWorkorderMapper.selectWorkOrderByCode(tempCode.toString()); if (workorder != null) { + formatProOrderWorkorder(workorder); proOrderWorkorderList.add(workorder); tempCode.setLength(0); tempCode.append(workorder.getParentOrder()); diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProWetMaterialPlanMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProWetMaterialPlanMapper.xml index ccf19338..6a9fce23 100644 --- a/op-modules/op-plan/src/main/resources/mapper/plan/ProWetMaterialPlanMapper.xml +++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProWetMaterialPlanMapper.xml @@ -92,6 +92,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where equipment_type_code = 'equ_type_lg' and equipment_id = #{bucketId} + + insert into pro_wet_material_plan