|
@@ -115,7 +115,8 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
}
|
|
}
|
|
});
|
|
});
|
|
// optaplanner 求解器数据装配
|
|
// optaplanner 求解器数据装配
|
|
- ApsSolution apsSolution = getPreApsSolution(productionScheduleVo);
|
|
|
|
|
|
+ List<ProductionProcesses> otherThproces = new ArrayList<>();
|
|
|
|
+ ApsSolution apsSolution = getPreApsSolution(productionScheduleVo,otherThproces);
|
|
// 去掉锁定工序
|
|
// 去掉锁定工序
|
|
List<ProductionProcesses> notLocks = new ArrayList<>();
|
|
List<ProductionProcesses> notLocks = new ArrayList<>();
|
|
List<ProductionProcesses> hasLocks = new ArrayList<>();
|
|
List<ProductionProcesses> hasLocks = new ArrayList<>();
|
|
@@ -182,7 +183,41 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
productionScheduleRetVo.setProcesses(solvedBalance.getProcessesList());
|
|
productionScheduleRetVo.setProcesses(solvedBalance.getProcessesList());
|
|
// 循环引用ProductionProcesses置空
|
|
// 循环引用ProductionProcesses置空
|
|
// solvedBalance.getProcessesList().addAll(solvedBalance1.getProcessesList());
|
|
// solvedBalance.getProcessesList().addAll(solvedBalance1.getProcessesList());
|
|
|
|
+ if(otherThproces != null && otherThproces.size()>0){
|
|
|
|
+ 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(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());
|
|
|
|
|
|
|
|
+ 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());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ solvedBalance.getProcessesList().addAll(otherThproces);
|
|
for (ProductionProcesses productionProcesses : solvedBalance.getProcessesList()) {
|
|
for (ProductionProcesses productionProcesses : solvedBalance.getProcessesList()) {
|
|
productionProcesses.setPreviousProcesses(null);
|
|
productionProcesses.setPreviousProcesses(null);
|
|
productionProcesses.setNextProcesses(null);
|
|
productionProcesses.setNextProcesses(null);
|
|
@@ -222,13 +257,10 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
ProductionProcesses newPre = null;
|
|
ProductionProcesses newPre = null;
|
|
List<ProductionProcesses> previousProcesses = process.getPreviousProcesses();
|
|
List<ProductionProcesses> previousProcesses = process.getPreviousProcesses();
|
|
if(previousProcesses != null){
|
|
if(previousProcesses != null){
|
|
- ProductionProcesses preProcess = previousProcesses.get(0);
|
|
|
|
|
|
+ ProductionProcesses preProcess = process;
|
|
if(!preProcess.getProcessType().equals("成退") && !preProcess.getProcessType().equals("中退") && !preProcess.getProcessType().equals("小卷成退")){
|
|
if(!preProcess.getProcessType().equals("成退") && !preProcess.getProcessType().equals("中退") && !preProcess.getProcessType().equals("小卷成退")){
|
|
- if(process.getId().equals("2294c17bb20549d28cbe9af149669988") || process.getId().equals("e23ea38146fb4f7bbb4a042c9a84dcba")){
|
|
|
|
- int a = 0;
|
|
|
|
- }
|
|
|
|
Equipment equipment = preProcess.getEquipment();
|
|
Equipment equipment = preProcess.getEquipment();
|
|
- newPre = maxWaitSet(equipment, process, processes, preProcess);
|
|
|
|
|
|
+ newPre = maxWaitSet(equipment, process.getNextProcesses().get(0), processes, preProcess);
|
|
if(newPre == null){
|
|
if(newPre == null){
|
|
for (Equipment equipment1 : equipments) {
|
|
for (Equipment equipment1 : equipments) {
|
|
if(preProcess.getOptionalEquipments().contains(equipment1.getId()) && !equipment1.getId().equals(equipment.getId())){
|
|
if(preProcess.getOptionalEquipments().contains(equipment1.getId()) && !equipment1.getId().equals(equipment.getId())){
|
|
@@ -611,7 +643,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
* @param productionScheduleVo
|
|
* @param productionScheduleVo
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- private ApsSolution getPreApsSolution(ProductionScheduleVo productionScheduleVo){
|
|
|
|
|
|
+ private ApsSolution getPreApsSolution(ProductionScheduleVo productionScheduleVo,List<ProductionProcesses> otherThproces){
|
|
ApsSolution unsolvedCloudBalance = new ApsSolution();
|
|
ApsSolution unsolvedCloudBalance = new ApsSolution();
|
|
// 排程全局配置
|
|
// 排程全局配置
|
|
ApsOverallConfig apsOverallConfig = new ApsOverallConfig();
|
|
ApsOverallConfig apsOverallConfig = new ApsOverallConfig();
|
|
@@ -636,6 +668,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);
|
|
for (ProductionProcesses process : productionScheduleVo.getProcesses()) {
|
|
for (ProductionProcesses process : productionScheduleVo.getProcesses()) {
|
|
// 全局配置设置
|
|
// 全局配置设置
|
|
if(process.getApsOverallConfig() == null){
|
|
if(process.getApsOverallConfig() == null){
|
|
@@ -1010,7 +1044,8 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
if(productionScheduleVo.getEnvironmentMode() != null && productionScheduleVo.getEnvironmentMode() == 1){
|
|
if(productionScheduleVo.getEnvironmentMode() != null && productionScheduleVo.getEnvironmentMode() == 1){
|
|
mode = EnvironmentMode.FULL_ASSERT;
|
|
mode = EnvironmentMode.FULL_ASSERT;
|
|
}
|
|
}
|
|
- ApsSolution apsSolution = getPreApsSolution(productionScheduleVo);
|
|
|
|
|
|
+ List<ProductionProcesses> otherThproces = new ArrayList<>();
|
|
|
|
+ ApsSolution apsSolution = getPreApsSolution(productionScheduleVo,otherThproces);
|
|
// 退火提前排序
|
|
// 退火提前排序
|
|
ApsSolution apsSolutionTh = apsService.tuihuoAps(apsSolution);
|
|
ApsSolution apsSolutionTh = apsService.tuihuoAps(apsSolution);
|
|
if(apsSolutionTh.getProcessesList() != null && apsSolutionTh.getProcessesList().size()>0){
|
|
if(apsSolutionTh.getProcessesList() != null && apsSolutionTh.getProcessesList().size()>0){
|