|
@@ -122,7 +122,9 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
/*if(1 == 1){
|
|
/*if(1 == 1){
|
|
return null;
|
|
return null;
|
|
}*/
|
|
}*/
|
|
-
|
|
|
|
|
|
+ // 退火合并
|
|
|
|
+ List<ProductionProcesses> thList = apsService.thProcessMerge(productionScheduleVo,apsSolution,otherThproces);
|
|
|
|
+ apsSolution.setProcessesList(thList);
|
|
// 去掉锁定工序
|
|
// 去掉锁定工序
|
|
List<ProductionProcesses> notLocks = new ArrayList<>();
|
|
List<ProductionProcesses> notLocks = new ArrayList<>();
|
|
List<ProductionProcesses> hasLocks = new ArrayList<>();
|
|
List<ProductionProcesses> hasLocks = new ArrayList<>();
|
|
@@ -139,6 +141,8 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
throw new ApsException("没有可排程的工序");
|
|
throw new ApsException("没有可排程的工序");
|
|
}
|
|
}
|
|
apsSolution.setProcessesList(notLocks);
|
|
apsSolution.setProcessesList(notLocks);
|
|
|
|
+
|
|
|
|
+ sortProcess(apsSolution.getProcessesList());
|
|
ApsSolution solvedBalance = solver.solve(apsSolution);
|
|
ApsSolution solvedBalance = solver.solve(apsSolution);
|
|
log.info("**************排程评分分析***************");
|
|
log.info("**************排程评分分析***************");
|
|
SolutionManager<ApsSolution, HardSoftScore> scoreManager = SolutionManager.create(solverFactory);
|
|
SolutionManager<ApsSolution, HardSoftScore> scoreManager = SolutionManager.create(solverFactory);
|
|
@@ -191,34 +195,45 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
// solvedBalance.getProcessesList().addAll(solvedBalance1.getProcessesList());
|
|
// solvedBalance.getProcessesList().addAll(solvedBalance1.getProcessesList());
|
|
if(otherThproces != null && otherThproces.size()>0){
|
|
if(otherThproces != null && otherThproces.size()>0){
|
|
for (ProductionProcesses otherThproce : otherThproces) {
|
|
for (ProductionProcesses otherThproce : otherThproces) {
|
|
- String preid = otherThproce.getPreviousProcessesIds().get(0);
|
|
|
|
- ProductionProcesses pres = null;
|
|
|
|
- for (ProductionProcesses productionProcesses : solvedBalance.getProcessesList()) {
|
|
|
|
- if(productionProcesses.getId().equals(preid)){
|
|
|
|
- pres = productionProcesses;
|
|
|
|
- break;
|
|
|
|
|
|
+ if(StrUtil.isNotBlank(otherThproce.getMergeThMainId())){
|
|
|
|
+ ProductionProcesses thpro = null;
|
|
|
|
+ for (ProductionProcesses productionProcesses : solvedBalance.getProcessesList()) {
|
|
|
|
+ if(productionProcesses.getId().equals(otherThproce.getMergeThMainId())){
|
|
|
|
+ thpro = productionProcesses;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if(pres.getNextProcesses() != null && pres.getNextProcesses().size()>0){
|
|
|
|
- ProductionProcesses thpro = pres.getNextProcesses().get(0);
|
|
|
|
- otherThproce.setStartTime(thpro.getStartTime());
|
|
|
|
- otherThproce.setEndTime(thpro.getEndTime());
|
|
|
|
- otherThproce.setEquipmentId(thpro.getEquipmentId());
|
|
|
|
- otherThproce.setEquipment(thpro.getEquipment());
|
|
|
|
- otherThproce.setConflictRoptions(thpro.getConflictRoptions());
|
|
|
|
|
|
+ if(thpro != null){
|
|
|
|
+ otherThproce.setStartTime(thpro.getStartTime());
|
|
|
|
+ otherThproce.setEndTime(thpro.getEndTime());
|
|
|
|
+ otherThproce.setEquipmentId(thpro.getEquipmentId());
|
|
|
|
+ otherThproce.setEquipment(thpro.getEquipment());
|
|
|
|
+ otherThproce.setConflictRoptions(thpro.getConflictRoptions());
|
|
|
|
|
|
- thpro.setOpeProducePcNum(1);
|
|
|
|
- List<String> preids = new ArrayList<>();
|
|
|
|
- preids.add(thpro.getPreviousProcessesIds().get(0));
|
|
|
|
- thpro.setPreviousProcessesIds(preids);
|
|
|
|
- if(thpro.getNextProcessesIds() != null && thpro.getNextProcessesIds().size()>0){
|
|
|
|
- List<String> nextids = new ArrayList<>();
|
|
|
|
- nextids.add(thpro.getNextProcessesIds().get(0));
|
|
|
|
- thpro.setNextProcessesIds(nextids);
|
|
|
|
- }
|
|
|
|
- if(thpro.getProcessType().equals("小卷成退")){
|
|
|
|
- thpro.setMinThPcNum(thpro.getMinThPcNum()-otherThproce.getMinThPcNum());
|
|
|
|
|
|
+ thpro.setOpeProducePcNum(1);
|
|
|
|
+ List<String> preids = new ArrayList<>();
|
|
|
|
+ preids.add(thpro.getPreviousProcessesIds().get(0));
|
|
|
|
+ thpro.setPreviousProcessesIds(preids);
|
|
|
|
+ if(thpro.getNextProcessesIds() != null && thpro.getNextProcessesIds().size()>0){
|
|
|
|
+ for (String nextProcessesId : otherThproce.getNextProcessesIds()) {
|
|
|
|
+ int i = thpro.getNextProcessesIds().indexOf(nextProcessesId);
|
|
|
|
+ if(i>=0){
|
|
|
|
+ thpro.getNextProcessesIds().remove(i);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /*if(otherThproce.getPreviousProcesses() != null && otherThproce.getPreviousProcesses().size()>0){
|
|
|
|
+ for (ProductionProcesses previousProcess : otherThproce.getPreviousProcesses()) {
|
|
|
|
+ List<String> nextids = new ArrayList<>();
|
|
|
|
+ nextids.add(otherThproce.getId());
|
|
|
|
+ previousProcess.setNextProcessesIds(nextids);
|
|
|
|
+ }
|
|
|
|
+ }*/
|
|
|
|
+ if(thpro.getProcessType().equals("小卷成退")){
|
|
|
|
+ thpro.setMinThPcNum(thpro.getMinThPcNum()-otherThproce.getMinThPcNum());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -226,6 +241,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
solvedBalance.getProcessesList().addAll(otherThproces);
|
|
solvedBalance.getProcessesList().addAll(otherThproces);
|
|
for (ProductionProcesses productionProcesses : solvedBalance.getProcessesList()) {
|
|
for (ProductionProcesses productionProcesses : solvedBalance.getProcessesList()) {
|
|
productionProcesses.setPreviousProcesses(null);
|
|
productionProcesses.setPreviousProcesses(null);
|
|
|
|
+ productionProcesses.setRooprocess(null);
|
|
productionProcesses.setNextProcesses(null);
|
|
productionProcesses.setNextProcesses(null);
|
|
productionProcesses.getEquipment().setProcessesList(null);
|
|
productionProcesses.getEquipment().setProcessesList(null);
|
|
productionProcesses.getEquipment().setEquipmentRunTimes(null);
|
|
productionProcesses.getEquipment().setEquipmentRunTimes(null);
|
|
@@ -235,6 +251,12 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
productionProcesses.getApsOverallConfig().setFurnaceInstallations(null);
|
|
productionProcesses.getApsOverallConfig().setFurnaceInstallations(null);
|
|
productionProcesses.getApsOverallConfig().setMergeFurnaces(null);
|
|
productionProcesses.getApsOverallConfig().setMergeFurnaces(null);
|
|
}
|
|
}
|
|
|
|
+ if(productionProcesses.getOldNextProcessesIds() != null){
|
|
|
|
+ productionProcesses.setNextProcessesIds(productionProcesses.getOldNextProcessesIds());
|
|
|
|
+ }
|
|
|
|
+ if(productionProcesses.getOldPreviousProcessesIds() != null){
|
|
|
|
+ productionProcesses.setPreviousProcessesIds(productionProcesses.getOldPreviousProcessesIds());
|
|
|
|
+ }
|
|
// 冲突约束补充处理
|
|
// 冲突约束补充处理
|
|
if(productionProcesses.getConflictRoptions() != null && productionProcesses.getConflictRoptions().size()>0){
|
|
if(productionProcesses.getConflictRoptions() != null && productionProcesses.getConflictRoptions().size()>0){
|
|
productionProcesses.getConflictRoptions().forEach((k,v)->{
|
|
productionProcesses.getConflictRoptions().forEach((k,v)->{
|
|
@@ -683,8 +705,8 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
for (ProductionProcesses process : productionScheduleVo.getProcesses()) {
|
|
for (ProductionProcesses process : productionScheduleVo.getProcesses()) {
|
|
idMaps.put(String.join(",",process.getId()),process);
|
|
idMaps.put(String.join(",",process.getId()),process);
|
|
}
|
|
}
|
|
- List<ProductionProcesses> thList = apsService.thProcessMerge(productionScheduleVo,otherThproces);
|
|
|
|
- productionScheduleVo.setProcesses(thList);
|
|
|
|
|
|
+ /*List<ProductionProcesses> thList = apsService.thProcessMerge(productionScheduleVo,otherThproces);
|
|
|
|
+ productionScheduleVo.setProcesses(thList);*/
|
|
for (ProductionProcesses process : productionScheduleVo.getProcesses()) {
|
|
for (ProductionProcesses process : productionScheduleVo.getProcesses()) {
|
|
// 全局配置设置
|
|
// 全局配置设置
|
|
if(process.getApsOverallConfig() == null){
|
|
if(process.getApsOverallConfig() == null){
|
|
@@ -914,6 +936,10 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(roots != null && roots.size()>0){
|
|
if(roots != null && roots.size()>0){
|
|
|
|
+ //设置下一节点的根目录
|
|
|
|
+ for (ProductionProcesses root : roots) {
|
|
|
|
+ setNextProRoot(root,root);
|
|
|
|
+ }
|
|
ProductionProcesses rootPro = roots.get(0);
|
|
ProductionProcesses rootPro = roots.get(0);
|
|
nextProSort(sortMap,bsMap,rootPro.getUniqueBsProcessesId());
|
|
nextProSort(sortMap,bsMap,rootPro.getUniqueBsProcessesId());
|
|
}
|
|
}
|
|
@@ -938,6 +964,18 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
return processes;
|
|
return processes;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 递归设置下一道工序的根节点
|
|
|
|
+ */
|
|
|
|
+ private void setNextProRoot(ProductionProcesses root,ProductionProcesses nowpro){
|
|
|
|
+ if(nowpro.getNextProcesses() != null && nowpro.getNextProcesses().size()>0){
|
|
|
|
+ for (ProductionProcesses nextProcess : nowpro.getNextProcesses()) {
|
|
|
|
+ nextProcess.setRooprocess(root);
|
|
|
|
+ setNextProRoot(root,nextProcess);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private void nextProSort(Map<String,Integer> sortMap,Map<String,List<ProductionProcesses>> bsMap,String uniqueBsProcessesId){
|
|
private void nextProSort(Map<String,Integer> sortMap,Map<String,List<ProductionProcesses>> bsMap,String uniqueBsProcessesId){
|
|
List<ProductionProcesses> processesList1 = bsMap.get(uniqueBsProcessesId);
|
|
List<ProductionProcesses> processesList1 = bsMap.get(uniqueBsProcessesId);
|
|
if(processesList1 != null && processesList1.size()>0){
|
|
if(processesList1 != null && processesList1.size()>0){
|