1.多线程

2.去除测试Logger
main
sunhao 2 days ago
parent c3f82d4b7b
commit 725874a567

@ -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<QdToLineupResultCheDO> 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<Integer> 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<Long> ltInt = solve(values, weights, capacities);
@ -1303,7 +1304,8 @@ public class SubController {
}
//根据实际订单再计算
p.setHead_Len(intHead);
p.setTail_Len(intTail);
});

@ -65,10 +65,10 @@ public class Knapsack {
ArrayList<Long> 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);

Loading…
Cancel
Save