From f242f2f1366476e6ecc79754bf9dfa334dd5322b Mon Sep 17 00:00:00 2001 From: sunhao <479527147@qq.com> Date: Thu, 16 Jan 2025 18:20:52 +0800 Subject: [PATCH] =?UTF-8?q?BUG=20=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shopmanager/controller/SubController.java | 27 ++++++++++++++----- .../src/main/resources/mapper/SubMapper.xml | 2 +- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/1024shop-manager/1024shop-manager/src/main/java/net/xdclass/shopmanager/controller/SubController.java b/1024shop-manager/1024shop-manager/src/main/java/net/xdclass/shopmanager/controller/SubController.java index 56b9943..b6ca8db 100644 --- a/1024shop-manager/1024shop-manager/src/main/java/net/xdclass/shopmanager/controller/SubController.java +++ b/1024shop-manager/1024shop-manager/src/main/java/net/xdclass/shopmanager/controller/SubController.java @@ -46,7 +46,7 @@ public class SubController { private static List gltGCalGrp = new CopyOnWriteArrayList<>(); //计算结果数据 - private static List gltGGrpCalRslt = new CopyOnWriteArrayList<>(); + private static List gltGGrpCalRslt = Collections.synchronizedList(new ArrayList<>()); //组板板坯表 private static List pmPdSlabDOList = new ArrayList<>(); @@ -161,15 +161,16 @@ public class SubController { //循环板坯 plistSlab.forEach(p -> { - + logger.info("*************板坯开始{}************* " , p.getSlabNo()); try { + gltGCalGrp=new ArrayList<>(); //二次分组 SetGrpDataBySlab(p); logger.info("***二次分组数量*** " + gltGCalGrp.size()); if (gltGCalGrp.size() > 0) { - + gltGGrpCalRslt = new ArrayList<>(); SetGroupCalRslt(p); logger.info("结果数据板坯号:{};数量:{}",p.getSlabNo(), gltGGrpCalRslt.size()); } @@ -177,12 +178,15 @@ public class SubController { // SetSaveDate(p); //} } catch (Exception e) { - logger.info(e.toString()); + logger.error("An error occurred", e); } - + logger.info("*************板坯结束{}************* " , p.getSlabNo()); + logger.info(""); } ); logger.info("*****处理结束*****"); + logger.info(""); + logger.info("-"); return JsonData.buildSuccess(); } @@ -1217,6 +1221,10 @@ public class SubController { gltGGrpCalRslt.add(GGCR); }); + if (gltGGrpCalRslt.size()==0) + { + return; + } //分组计算 // gltGGrpCalRslt.parallelStream().forEach(p -> { gltGGrpCalRslt.parallelStream().forEach(p -> { @@ -1226,8 +1234,13 @@ public class SubController { List ltweights= new ArrayList<>(); List ltOrder= new ArrayList<>(); - logger.info( "订单总数量:" + p.getLtInfoGPreOrder().size()); - +// logger.info( "订单总数量:" + p.getLtInfoGPreOrder().size()); + if (p== null) { + return; + } + if (p.getLtInfoGPreOrder() == null) { + return; + } //计算可处理数据最大值 p.getLtInfoGPreOrder().forEach(e->{ diff --git a/1024shop-manager/1024shop-manager/src/main/resources/mapper/SubMapper.xml b/1024shop-manager/1024shop-manager/src/main/resources/mapper/SubMapper.xml index 18bf7dd..2368abd 100644 --- a/1024shop-manager/1024shop-manager/src/main/resources/mapper/SubMapper.xml +++ b/1024shop-manager/1024shop-manager/src/main/resources/mapper/SubMapper.xml @@ -28,7 +28,7 @@ LEFT JOIN PM_PD_CONST_BT PPCB ON PPCB.ROLL_LINE_NO = SUBSTR(MS.MSC_LINE_NO,3,2) WHERE 1=1 AND MS.MSC_LINE_NO='1030' --5米轧线 - AND MS.SLAB_NO = 'C50000230200' +-- AND MS.SLAB_NO = 'C50000230200' -- AND ((SELECT SUM(NVL(P1.NEED_SLAB_WT,0)) FROM PM_PD_SLAB P1 WHERE P1.SLAB_NO = MS.SLAB_NO)= MS.SLAB_ACT_WGT -- OR (SELECT SUM(NVl(P1.NEED_SLAB_WT,0)) FROM PM_PD_SLAB P1 WHERE P1.SLAB_NO = MS.SLAB_NO) = 0)--重量相同 -- AND SUBSTR(MS.NEXT_WHOLE_BACKLOG_CODE,2,1) !='B' --全程工序代码第二位不能是B,不嫩是火切工序