|
@@ -2,6 +2,7 @@ package com.rongwei.rwapsserver.aps.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.rongwei.rwapsserver.aps.domain.*;
|
|
|
import com.rongwei.rwapsserver.aps.score.ApsConstraintProvider;
|
|
|
import com.rongwei.rwapsserver.aps.service.ApsService;
|
|
@@ -193,7 +194,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
// 退火提前排序
|
|
|
Map<String,List<String>> ordergrous = new HashMap<>();
|
|
|
apsService.tuihuoApsSch(apsSolution,otherThproces,otherNotZzFirstProces,productionScheduleVo,ordergrous);
|
|
|
-
|
|
|
+ log.info("退火提前合并排程结束,合并订单列表:"+JSONUtil.toJsonStr(ordergrous));
|
|
|
/*if(1 == 1){
|
|
|
return null;
|
|
|
}*/
|
|
@@ -215,8 +216,10 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
// }
|
|
|
apsSolution.setProcessesList(notLocks);
|
|
|
|
|
|
+ List<String> exOrderIds = new ArrayList<>();
|
|
|
// 按照退火组炉分批排程
|
|
|
List<CommonJavaBean> orderMerges = produceOrderMerge(ordergrous,apsSolution);
|
|
|
+ log.info("退火组炉分批排程:"+ JSONUtil.toJsonStr(orderMerges));
|
|
|
Collections.sort(orderMerges, (pro1, pro2) -> {return pro2.getMaxVolumeWidth().compareTo(pro1.getMaxVolumeWidth());});
|
|
|
ApsSolution solvedBalance = new ApsSolution();
|
|
|
solvedBalance.setProcessesList(new ArrayList<>());
|
|
@@ -238,7 +241,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
.withSolutionClass(ApsSolution.class)
|
|
|
.withEntityClasses(ProductionProcesses.class)
|
|
|
.withConstraintProviderClass(ApsConstraintProvider.class)
|
|
|
- .withTerminationConfig(new TerminationConfig().withUnimprovedSecondsSpentLimit(120L))
|
|
|
+ .withTerminationConfig(new TerminationConfig().withUnimprovedSecondsSpentLimit(60L))
|
|
|
// .withTerminationSpentLimit(Duration.ofSeconds(runPlanSeconds))
|
|
|
.withMoveThreadCount(cores)
|
|
|
);
|
|
@@ -295,6 +298,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
// 排程结束的数据手动添加到设备占用列表中
|
|
|
setEqRunTimes(solvedBalance1.getProcessesList());
|
|
|
}catch (Exception e){
|
|
|
+ exOrderIds.addAll(v);
|
|
|
if(productionScheduleRetVo.getMsg() == null){
|
|
|
productionScheduleRetVo.setMsg("排程异常,");
|
|
|
}
|
|
@@ -335,7 +339,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
.withSolutionClass(ApsSolution.class)
|
|
|
.withEntityClasses(ProductionProcesses.class)
|
|
|
.withConstraintProviderClass(ApsConstraintProvider.class)
|
|
|
- .withTerminationConfig(new TerminationConfig().withUnimprovedSecondsSpentLimit(120L))
|
|
|
+ .withTerminationConfig(new TerminationConfig().withUnimprovedSecondsSpentLimit(60L))
|
|
|
// .withTerminationSpentLimit(Duration.ofSeconds(runPlanSeconds))
|
|
|
.withMoveThreadCount(cores)
|
|
|
);
|
|
@@ -391,6 +395,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
// 排程结束的数据手动添加到设备占用列表中
|
|
|
setEqRunTimes(solvedBalance1.getProcessesList());
|
|
|
}catch (Exception e){
|
|
|
+ exOrderIds.add(k);
|
|
|
if(productionScheduleRetVo.getMsg() == null){
|
|
|
productionScheduleRetVo.setMsg("排程异常,");
|
|
|
}
|
|
@@ -485,7 +490,6 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
productionScheduleRetVo.setScoreResult(explain2.toString());
|
|
|
softExplain(explain2,solvedBalance.getProcessesList());*/
|
|
|
|
|
|
- productionScheduleRetVo.setProcesses(solvedBalance.getProcessesList());
|
|
|
// 循环引用ProductionProcesses置空
|
|
|
// solvedBalance.getProcessesList().addAll(solvedBalance1.getProcessesList());
|
|
|
solvedBalance.getProcessesList().addAll(hasLocks);
|
|
@@ -620,6 +624,14 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
solvedBalance.getProcessesList().addAll(otherThproces);
|
|
|
solvedBalance.getProcessesList().addAll(sers);
|
|
|
// solvedBalance.getProcessesList().addAll(otherNotThproces);
|
|
|
+ // 过滤异常数据
|
|
|
+ if(exOrderIds != null && exOrderIds.size()>0){
|
|
|
+ List<ProductionProcesses> processes = solvedBalance.getProcessesList().stream().filter(v ->
|
|
|
+ !exOrderIds.contains(v.getProduceOrder().get(0).getId()) && v.getEquipment() != null)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ solvedBalance.setProcessesList(processes);
|
|
|
+ }
|
|
|
+
|
|
|
for (ProductionProcesses productionProcesses : solvedBalance.getProcessesList()) {
|
|
|
productionProcesses.setPreviousProcesses(null);
|
|
|
productionProcesses.setRooprocess(null);
|
|
@@ -666,6 +678,8 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ productionScheduleRetVo.setProcesses(solvedBalance.getProcessesList());
|
|
|
return productionScheduleRetVo;
|
|
|
}
|
|
|
|
|
@@ -701,6 +715,16 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
syids.add(iids);
|
|
|
}
|
|
|
}
|
|
|
+ List<List<String>> syids1 = new ArrayList<>();
|
|
|
+ for (List<String> syid : syids) {
|
|
|
+ boolean bl = CollUtil.containsAny(fids, syid);
|
|
|
+ if(bl){
|
|
|
+ CollUtil.addAllIfNotContains(fids,syid);
|
|
|
+ }else{
|
|
|
+ syids1.add(syid);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ syids = syids1;
|
|
|
cjb.setOrderids(fids);
|
|
|
BigDecimal maxVolumeWidth = null;
|
|
|
for (String orderid : cjb.getOrderids()) {
|