From 0da428ce6f6f3ea2e9b6bfdcdd920e0cc229bf70 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Sat, 23 Sep 2023 01:23:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B9=BF=E6=96=99=E8=AE=A1=E5=88=92=E9=9B=86?= =?UTF-8?q?=E6=88=90=E5=88=B0=E7=99=BD=E8=83=9A=E8=AE=A2=E5=8D=95=E6=8B=86?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/op/plan/domain/ProOrder.java | 18 +++++++ .../com/op/plan/domain/dto/SplitOrderDTO.java | 19 +++++++ .../ProWetMaterialPlanDetailMapper.java | 7 ++- .../service/impl/ProOrderServiceImpl.java | 31 ++++++++++- .../impl/ProOrderWorkorderServiceImpl.java | 52 ++++++++++++++++--- .../plan/ProWetMaterialPlanDetailMapper.xml | 40 ++++++++++---- .../sap/service/impl/SapOrderServiceImpl.java | 24 +++++---- 7 files changed, 161 insertions(+), 30 deletions(-) diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java index d5d2a5f8..282f3de9 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java @@ -136,6 +136,9 @@ public class ProOrder extends TreeEntity { @Excel(name = "更新日期", width = 20, dateFormat = "yyyy-MM-dd") private Date updateTime; + private String materialCode; + private String materialName; + // 车数 private Integer carNum; @@ -191,6 +194,21 @@ public class ProOrder extends TreeEntity { this.prodSpc = prodSpc; } + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } public void setId(String id) { this.id = id; diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/dto/SplitOrderDTO.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/dto/SplitOrderDTO.java index d9d128d8..97e10046 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/domain/dto/SplitOrderDTO.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/dto/SplitOrderDTO.java @@ -27,6 +27,25 @@ public class SplitOrderDTO { private ProOrderWorkorder proOrderWorkorder; private Integer carNum; + private String materialCode; + private String materialName; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + public Integer getCarNum() { return carNum; } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWetMaterialPlanDetailMapper.java b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWetMaterialPlanDetailMapper.java index a9aebfe6..6dc1977d 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWetMaterialPlanDetailMapper.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWetMaterialPlanDetailMapper.java @@ -5,6 +5,7 @@ import com.op.plan.domain.ProOrderWorkorder; import com.op.plan.domain.ProWetMaterialPlan; import com.op.plan.domain.ProWetMaterialPlanDetail; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -115,11 +116,15 @@ public interface ProWetMaterialPlanDetailMapper { * @param orderCode * @return */ - ProWetMaterialPlanDetail selectProWetMaterialPlanDetailByOrderCode(String orderCode); + //ProWetMaterialPlanDetail selectProWetMaterialPlanDetailByOrderCode(String orderCode); /** * 通过湿料主计划id删除湿料计划性情 * @param id */ void deleteProWetMaterialPlanDetailByPlanId(String id); + + void batchAddWetDetails(@Param("list") List wetDetails); + + ProWetMaterialPlanDetail getWetInfoByWorkId(String workorderId); } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java index 7b99a2de..c7bd63cd 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java @@ -200,6 +200,35 @@ public class ProOrderServiceImpl implements IProOrderService { setBatch(proOrderWorkorderBatch,splitOrderDTO.getFormFields(),proOrderWorkorder.getWorkorderId(),1L); + //生成湿料计划------------------------------开始 + List wetDetails = new ArrayList<>(); + //设备-根据工单获取实际规划设备路线 + String[][] lineCodes = splitOrderDTO.getProdLineCodeArray();//proRfidProcessDetailMapper.getActuaEquips(rfidInfo); + ProWetMaterialPlanDetail wetDetail = null; + for(int c1= 0;c1"+workBatch.getBatchQuantity()); } + //生成湿料计划------------------------------开始 + List wetDetails = new ArrayList<>(); + //设备-根据工单获取实际规划设备路线 + String[][] lineCodes = splitOrderDTO.getProdLineCodeArray();//proRfidProcessDetailMapper.getActuaEquips(rfidInfo); + ProWetMaterialPlanDetail wetDetail = null; + for(int c1= 0;c1 - - + select top 1 material_code materialCode, + material_name materialName + from pro_wet_material_plan_detail where workorder_id = #{workorderId} + + + + + + + + + + insert into pro_wet_material_plan_detail @@ -185,6 +190,23 @@ #{planTime}, + + insert into pro_wet_material_plan_detail + ( + id, factory_code, workorder_id, + create_by, create_time, bucket_code, + material_code,material_name, shift_id, + plan_time,sync_flag + )values + + ( + #{item.id},#{item.factoryCode},#{item.workorderId}, + #{item.createBy},#{item.createTime},#{item.bucketCode}, + #{item.materialCode},#{item.materialName},#{item.shiftId}, + #{item.planTime}, 'N' + ) + + update pro_wet_material_plan_detail diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java index 37f1dd41..23974955 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java @@ -23,6 +23,8 @@ import java.util.List; @Service public class SapOrderServiceImpl implements SapOrderService { + private static final String END_DATE="99991231"; + @Override public R> shopOrderSync(SapProOrder sapProOrder) { @@ -39,9 +41,9 @@ public class SapOrderServiceImpl implements SapOrderService { JCoTable jCoTable = func.getTableParameterList().getTable("S_ERDAT"); jCoTable.appendRow(); jCoTable.setValue("SIGN", "I"); - jCoTable.setValue("OPTION", "EQ"); + jCoTable.setValue("OPTION", "BT"); jCoTable.setValue("LOW", DateUtils.parseDateToStr("yyyyMMdd", sapProOrder.getCreateTime())); - + jCoTable.setValue("HIGH", END_DATE); func.execute(dest);//执行调用函数 // 获取 内表 - ZMES_PRO @@ -163,15 +165,15 @@ public class SapOrderServiceImpl implements SapOrderService { if (StringUtils.isEmpty(shopOrder)){ return R.fail("订单号为空"); } - jCoParameterList.setValue("P_AUFNR",shopOrder); - func.execute(dest);//执行调用函数 - JCoParameterList J= func.getExportParameterList(); - System.out.println(J); - L_MSG= func.getExportParameterList().getString("L_MSG"); - if (StringUtils.isEmpty(L_MSG)){ - return R.fail("订单关闭失败"); - } - return R.ok(L_MSG); + jCoParameterList.setValue("P_AUFNR",shopOrder); + func.execute(dest);//执行调用函数 + JCoParameterList J= func.getExportParameterList(); + System.out.println(J); + L_MSG= func.getExportParameterList().getString("L_MSG"); + if (StringUtils.isEmpty(L_MSG)){ + return R.fail("订单关闭失败"); + } + return R.ok(L_MSG); }catch (Exception e){ return R.fail(e.getMessage());