|
@@ -96,7 +96,9 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
newPro.setId(productionProcesses.getId());
|
|
newPro.setId(productionProcesses.getId());
|
|
newPro.setEquipmentId(productionProcesses.getEquipmentId());
|
|
newPro.setEquipmentId(productionProcesses.getEquipmentId());
|
|
Equipment eq = new Equipment();
|
|
Equipment eq = new Equipment();
|
|
- eq.setId(productionProcesses.getEquipment().getId());
|
|
|
|
|
|
+ if(productionProcesses.getEquipment() != null){
|
|
|
|
+ eq.setId(productionProcesses.getEquipment().getId());
|
|
|
|
+ }
|
|
newPro.setEquipment(eq);
|
|
newPro.setEquipment(eq);
|
|
newPro.setProduceTime(productionProcesses.getProduceTime());
|
|
newPro.setProduceTime(productionProcesses.getProduceTime());
|
|
newPro.setStartTime(productionProcesses.getStartTime());
|
|
newPro.setStartTime(productionProcesses.getStartTime());
|
|
@@ -136,6 +138,9 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
List<ProductionProcesses> otherNotZzFirstProces = new ArrayList<>();
|
|
List<ProductionProcesses> otherNotZzFirstProces = new ArrayList<>();
|
|
// 铸轧提前排序
|
|
// 铸轧提前排序
|
|
apsService.zzProcessAps(productionScheduleVo,apsSolution,otherNotZzFirstProces);
|
|
apsService.zzProcessAps(productionScheduleVo,apsSolution,otherNotZzFirstProces);
|
|
|
|
+ /*if(1 == 1){
|
|
|
|
+ return null;
|
|
|
|
+ }*/
|
|
// 取消第一道工序非铸轧提前排程的锁定状态
|
|
// 取消第一道工序非铸轧提前排程的锁定状态
|
|
if(otherNotZzFirstProces != null && otherNotZzFirstProces.size()>0){
|
|
if(otherNotZzFirstProces != null && otherNotZzFirstProces.size()>0){
|
|
for (ProductionProcesses otherSerProcesMerge : apsSolution.getProcessesList()) {
|
|
for (ProductionProcesses otherSerProcesMerge : apsSolution.getProcessesList()) {
|
|
@@ -166,6 +171,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
apsSolution.setProcessesList(otherSerProcesMerges);
|
|
apsSolution.setProcessesList(otherSerProcesMerges);
|
|
// 排程作业排序
|
|
// 排程作业排序
|
|
sortProcess(apsSolution.getProcessesList(),1);
|
|
sortProcess(apsSolution.getProcessesList(),1);
|
|
|
|
+
|
|
// 取消第一道工序非铸轧提前排程的锁定状态
|
|
// 取消第一道工序非铸轧提前排程的锁定状态
|
|
if(otherNotZzFirstProces != null && otherNotZzFirstProces.size()>0){
|
|
if(otherNotZzFirstProces != null && otherNotZzFirstProces.size()>0){
|
|
for (ProductionProcesses otherSerProcesMerge : apsSolution.getProcessesList()) {
|
|
for (ProductionProcesses otherSerProcesMerge : apsSolution.getProcessesList()) {
|
|
@@ -181,7 +187,8 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 退火提前排序
|
|
// 退火提前排序
|
|
- apsService.tuihuoApsSch(apsSolution,otherThproces);
|
|
|
|
|
|
+ apsService.tuihuoApsSch(apsSolution,otherThproces,otherNotZzFirstProces,productionScheduleVo);
|
|
|
|
+
|
|
/*if(1 == 1){
|
|
/*if(1 == 1){
|
|
return null;
|
|
return null;
|
|
}*/
|
|
}*/
|
|
@@ -285,7 +292,7 @@ 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());
|
|
- solvedBalance.getProcessesList().addAll(hasLocks);
|
|
|
|
|
|
+// solvedBalance.getProcessesList().addAll(hasLocks);
|
|
// 退火合并工序排程完拆分
|
|
// 退火合并工序排程完拆分
|
|
if(otherThproces != null && otherThproces.size()>0){
|
|
if(otherThproces != null && otherThproces.size()>0){
|
|
for (ProductionProcesses otherThproce : otherThproces) {
|
|
for (ProductionProcesses otherThproce : otherThproces) {
|
|
@@ -406,6 +413,8 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
productionProcesses.setPreviousStep(null);
|
|
productionProcesses.setPreviousStep(null);
|
|
productionProcesses.setOptionalProviderEquipments(null);
|
|
productionProcesses.setOptionalProviderEquipments(null);
|
|
productionProcesses.setEquass(null);
|
|
productionProcesses.setEquass(null);
|
|
|
|
+ productionProcesses.setMergeRooprocess(null);
|
|
|
|
+ productionProcesses.setOpeProducePcNum(1);
|
|
if(productionProcesses.getApsOverallConfig() != null){
|
|
if(productionProcesses.getApsOverallConfig() != null){
|
|
productionProcesses.getApsOverallConfig().setFurnaceInstallations(null);
|
|
productionProcesses.getApsOverallConfig().setFurnaceInstallations(null);
|
|
productionProcesses.getApsOverallConfig().setMergeFurnaces(null);
|
|
productionProcesses.getApsOverallConfig().setMergeFurnaces(null);
|
|
@@ -885,6 +894,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
if(StrUtil.isBlank(process.getTaskType())){
|
|
if(StrUtil.isBlank(process.getTaskType())){
|
|
process.setTaskType("processes");
|
|
process.setTaskType("processes");
|
|
}
|
|
}
|
|
|
|
+ process.setMergeRooprocess(new ArrayList<>());
|
|
process.setApsStatus("CH");
|
|
process.setApsStatus("CH");
|
|
process.setOrderId(process.getProduceOrder().get(0).getId());
|
|
process.setOrderId(process.getProduceOrder().get(0).getId());
|
|
process.setTotalSinglerollweight(process.getSinglerollweight());
|
|
process.setTotalSinglerollweight(process.getSinglerollweight());
|
|
@@ -938,7 +948,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
if(process.getUnitProduceTime() == null){
|
|
if(process.getUnitProduceTime() == null){
|
|
process.setUnitProduceTime((int)(Math.ceil((double)process.getProduceTime()/process.getProducePcNum())));
|
|
process.setUnitProduceTime((int)(Math.ceil((double)process.getProduceTime()/process.getProducePcNum())));
|
|
}
|
|
}
|
|
- process.setVolumeMetalAndState(process.getVolumeMetal() + process.getVolumeMetalstate() == null ? "" : process.getVolumeMetalstate() + process.getProcessType());
|
|
|
|
|
|
+ process.setVolumeMetalAndState(process.getVolumeMetal() + (process.getVolumeMetalstate() == null ? "" : process.getVolumeMetalstate()) + process.getProcessType());
|
|
// 可选设备初始化
|
|
// 可选设备初始化
|
|
if(process.getOptionalEquipments() != null){
|
|
if(process.getOptionalEquipments() != null){
|
|
List<Equipment> providedEq = new ArrayList<>();
|
|
List<Equipment> providedEq = new ArrayList<>();
|
|
@@ -970,8 +980,18 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
process.setCutfinishmin(0);
|
|
process.setCutfinishmin(0);
|
|
}
|
|
}
|
|
// 锁定工序处理
|
|
// 锁定工序处理
|
|
- if(process.getIfLock()){
|
|
|
|
|
|
+ if(process.getIfLock() && process.getOptionalProviderEquipments().size()>0){
|
|
process.setIfLock(false);
|
|
process.setIfLock(false);
|
|
|
|
+ int ai = -1;
|
|
|
|
+ for (int i = 0; i < process.getOptionalProviderEquipments().get(0).getEquipmentRunTimes().size(); i++) {
|
|
|
|
+ EquipmentRunTime equipmentRunTime = process.getOptionalProviderEquipments().get(0).getEquipmentRunTimes().get(i);
|
|
|
|
+ if(equipmentRunTime.getStartRunTime().compareTo(process.getStartTime()) == 0 && equipmentRunTime.getEndRunTime().compareTo(process.getEndTime()) == 0){
|
|
|
|
+ ai = i;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(ai>-1){
|
|
|
|
+ process.getOptionalProviderEquipments().get(0).getEquipmentRunTimes().remove(ai);
|
|
|
|
+ }
|
|
// 锁定工序的设备即可选设备
|
|
// 锁定工序的设备即可选设备
|
|
process.setEquipment(process.getOptionalProviderEquipments().get(0));
|
|
process.setEquipment(process.getOptionalProviderEquipments().get(0));
|
|
process.setIfLock(true);
|
|
process.setIfLock(true);
|
|
@@ -1113,11 +1133,17 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
// 按坯料计划分组
|
|
// 按坯料计划分组
|
|
Map<String, List<ProductionProcesses>> orderProcess = processesSort.stream().collect(Collectors.groupingBy(ProductionProcesses::getOrderId));
|
|
Map<String, List<ProductionProcesses>> orderProcess = processesSort.stream().collect(Collectors.groupingBy(ProductionProcesses::getOrderId));
|
|
List<ProduceOrder> produceOrders = new ArrayList<>();
|
|
List<ProduceOrder> produceOrders = new ArrayList<>();
|
|
|
|
+ List<ProduceOrder> produceOrdersnotDeliveryDate = new ArrayList<>();
|
|
orderProcess.forEach((k,v)->{
|
|
orderProcess.forEach((k,v)->{
|
|
- produceOrders.add(v.get(0).getProduceOrder().get(0));
|
|
|
|
|
|
+ if(v.get(0).getProduceOrder().get(0).getDeliveryDate() != null){
|
|
|
|
+ produceOrders.add(v.get(0).getProduceOrder().get(0));
|
|
|
|
+ }else{
|
|
|
|
+ produceOrdersnotDeliveryDate.add(v.get(0).getProduceOrder().get(0));
|
|
|
|
+ }
|
|
});
|
|
});
|
|
-// Collections.sort(produceOrders, Comparator.comparing(pro -> pro.getDeliveryDate()));
|
|
|
|
- Collections.sort(produceOrders, (pro1, pro2) -> {
|
|
|
|
|
|
+ Collections.sort(produceOrders, Comparator.comparing(pro -> pro.getDeliveryDate()));
|
|
|
|
+ produceOrders.addAll(produceOrdersnotDeliveryDate);
|
|
|
|
+ /*Collections.sort(produceOrders, (pro1, pro2) -> {
|
|
int a = 0;
|
|
int a = 0;
|
|
if(pro1 != null && pro2 != null){
|
|
if(pro1 != null && pro2 != null){
|
|
if(pro1.getDeliveryDate() != null && pro2.getDeliveryDate() != null){
|
|
if(pro1.getDeliveryDate() != null && pro2.getDeliveryDate() != null){
|
|
@@ -1131,7 +1157,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return a;
|
|
return a;
|
|
- });
|
|
|
|
|
|
+ });*/
|
|
Map<String,Integer> sortMap = new HashMap<>();
|
|
Map<String,Integer> sortMap = new HashMap<>();
|
|
sortMap.put("sortInt",0);
|
|
sortMap.put("sortInt",0);
|
|
if(produceOrders != null && produceOrders.size()>0){
|
|
if(produceOrders != null && produceOrders.size()>0){
|
|
@@ -1178,6 +1204,9 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
if(nowpro.getNextProcesses() != null && nowpro.getNextProcesses().size()>0){
|
|
if(nowpro.getNextProcesses() != null && nowpro.getNextProcesses().size()>0){
|
|
for (ProductionProcesses nextProcess : nowpro.getNextProcesses()) {
|
|
for (ProductionProcesses nextProcess : nowpro.getNextProcesses()) {
|
|
nextProcess.setRooprocess(root);
|
|
nextProcess.setRooprocess(root);
|
|
|
|
+ if (nextProcess.getMergeRooprocess().size() == 0){
|
|
|
|
+ nextProcess.getMergeRooprocess().add(root);
|
|
|
|
+ }
|
|
setNextProRoot(root,nextProcess);
|
|
setNextProRoot(root,nextProcess);
|
|
}
|
|
}
|
|
}
|
|
}
|