From 725874a567f230173e9c1b3e11621e9f955e627a Mon Sep 17 00:00:00 2001 From: sunhao <479527147@qq.com> Date: Thu, 16 Jan 2025 16:13:47 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A4=9A=E7=BA=BF=E7=A8=8B=202.=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E6=B5=8B=E8=AF=95Logger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shopmanager/controller/SubController.java | 34 ++++++++++--------- .../xdclass/shopmanager/util/Knapsack.java | 8 ++--- 2 files changed, 22 insertions(+), 20 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 4a2f5f2..56b9943 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 @@ -159,7 +159,6 @@ public class SubController { logger.info("***初次分组数量*** " + gltGrpOrderFir.size()); - //循环板坯 plistSlab.forEach(p -> { @@ -172,18 +171,18 @@ public class SubController { if (gltGCalGrp.size() > 0) { SetGroupCalRslt(p); - - } - if (gltGGrpCalRslt.size() > 0) { - SetSaveDate(p); + logger.info("结果数据板坯号:{};数量:{}",p.getSlabNo(), gltGGrpCalRslt.size()); } + //if (gltGGrpCalRslt.size() > 0) { + // SetSaveDate(p); + //} } catch (Exception e) { logger.info(e.toString()); } } ); - + logger.info("*****处理结束*****"); return JsonData.buildSuccess(); } @@ -458,7 +457,7 @@ public class SubController { // // }); - gltGrpOrderFir.forEach(e -> { + gltGrpOrderFir.parallelStream().forEach(e -> { // gltGCalGrp 产生可计算分组 @@ -571,6 +570,8 @@ public class SubController { //订单要求化学成分 // logger.info("化学成分订单号:" + GrpOrd.getOrderNo()); List ltLrc = new ArrayList<>(); +// int i =plistQdToLineupResultCheDO.stream().filter(p->p.getCheType().equals(null)).collect(Collectors.toList()).size(); +// logger.info("化学成分订单号:{}-{}" , GrpOrd.getOrderNo(),i); if (plistQdToLineupResultCheDO.stream().anyMatch(p -> p.getOrderNo().equals(GrpOrd.getOrderNo()) && p.getCheType().equals("RX"))) { ltLrc = plistQdToLineupResultCheDO.stream().filter(p -> p.getOrderNo().equals(SInfo.getOrderNo()) && p.getCheType().equals("RX")).collect(Collectors.toList()); } @@ -1074,10 +1075,10 @@ public class SubController { pcmt = plistPmContMscTechDO.stream().filter(p -> p.getOrderNo().equals(i.getOrderNo())).findFirst().orElseThrow(() -> new NoSuchElementException("No PmContMscTechDO found with name Charlie " + i.getOrderNo())); SetAllOrder(i, ppcpa, pcmt); } else { - logger.info("缺少产线信息:" + i.getOrderNo()); +// logger.info("缺少产线信息:" + i.getOrderNo()); } } else { - logger.info("缺少属性信息:" + i.getOrderNo()); +// logger.info("缺少属性信息:" + i.getOrderNo()); } } catch (NullPointerException ex1) { @@ -1218,7 +1219,7 @@ public class SubController { //分组计算 // gltGGrpCalRslt.parallelStream().forEach(p -> { - gltGGrpCalRslt.forEach(p -> { + gltGGrpCalRslt.parallelStream().forEach(p -> { // 测试数据 //处理数据多处理 List ltValues= new ArrayList<>(); @@ -1285,11 +1286,11 @@ public class SubController { Loader.loadNativeLibraries(); // logger.info("values Size:{}", p.getLtInfoGPreOrder().size()); - for (int i = 0; i < ltweights.size(); i++) { - - logger.info("weights:{}", ltweights.get(i)); - - } +// for (int i = 0; i < ltweights.size(); i++) { +// +// logger.info("weights:{}", ltweights.get(i)); +// +// } // 调用 solve 方法来解决问题 ArrayList ltInt = solve(values, weights, capacities); @@ -1303,7 +1304,8 @@ public class SubController { } //根据实际订单再计算 - + p.setHead_Len(intHead); + p.setTail_Len(intTail); }); diff --git a/1024shop-manager/1024shop-manager/src/main/java/net/xdclass/shopmanager/util/Knapsack.java b/1024shop-manager/1024shop-manager/src/main/java/net/xdclass/shopmanager/util/Knapsack.java index 39765d3..8b57141 100644 --- a/1024shop-manager/1024shop-manager/src/main/java/net/xdclass/shopmanager/util/Knapsack.java +++ b/1024shop-manager/1024shop-manager/src/main/java/net/xdclass/shopmanager/util/Knapsack.java @@ -65,10 +65,10 @@ public class Knapsack { ArrayList packedWeights = new ArrayList<>(); int totalWeight = 0; - System.out.println("values = " + Arrays.stream(values).count()); - System.out.println("weights = " + Arrays.stream(values).count()); - // 输出计算结果 - System.out.println("Total value = " + computedValue); +// System.out.println("values = " + Arrays.stream(values).count()); +// System.out.println("weights = " + Arrays.stream(values).count()); +// // 输出计算结果 +// System.out.println("Total value = " + computedValue); for (int i = 0; i < values.length; i++) { if (solver.bestSolutionContains(i)) { //packedItems.add(i);