|
@@ -226,11 +226,35 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
}
|
|
|
|
|
|
solvedBalance.getProcessesList().addAll(hasLocks);
|
|
|
- log.info("**************排程最终评分分析***************");
|
|
|
+ /*log.info("**************排程最终评分分析***************");
|
|
|
+ if(notLocks != null && notLocks.size()>0){
|
|
|
+ for (ProductionProcesses notLock : notLocks) {
|
|
|
+ for (ProductionProcesses productionProcesses : solvedBalance.getProcessesList()) {
|
|
|
+ if(notLock.getId().equals(productionProcesses.getId())){
|
|
|
+ notLock.setEquipment(productionProcesses.getEquipment());
|
|
|
+ notLock.setEquipmentId(productionProcesses.getEquipmentId());
|
|
|
+ notLock.setDelay(productionProcesses.getDelay());
|
|
|
+ notLock.setStartTime(productionProcesses.getStartTime());
|
|
|
+ notLock.setEndTime(productionProcesses.getEndTime());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (ProductionProcesses productionProcesses : solvedBalance.getProcessesList()) {
|
|
|
+ if(productionProcesses.getDelay() == null){
|
|
|
+ if(productionProcesses.getIfLock()){
|
|
|
+ productionProcesses.setIfLock(false);
|
|
|
+ productionProcesses.setDelay(0);
|
|
|
+ productionProcesses.setIfLock(true);
|
|
|
+ }else{
|
|
|
+ productionProcesses.setDelay(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
ScoreExplanation<ApsSolution, HardSoftScore> explain2 = scoreManager.explain(solvedBalance);
|
|
|
log.info(explain2.toString());
|
|
|
- log.info("**************排程最终评分分析***************");
|
|
|
- softExplain(explain2,solvedBalance.getProcessesList());
|
|
|
+ log.info("**************排程最终评分分析***************");*/
|
|
|
+ softExplain(explain,solvedBalance.getProcessesList());
|
|
|
|
|
|
productionScheduleRetVo.setProcesses(solvedBalance.getProcessesList());
|
|
|
// 循环引用ProductionProcesses置空
|
|
@@ -913,69 +937,80 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
List<EquipmentRunTime> equipmentRunTimesMerge = new ArrayList<>();
|
|
|
List<EquipmentRunTime> equipmentRunTimes = equipment.getEquipmentRunTimes();
|
|
|
if(equipmentRunTimes != null && equipmentRunTimes.size()>0){
|
|
|
- if("成退,中退,小卷成退".contains(equipmentRunTimes.get(0).getProcessType())){
|
|
|
+ boolean hasMerge = false;
|
|
|
+ for (EquipmentRunTime equipmentRunTime : equipmentRunTimes) {
|
|
|
+ if("maintenance".equals(equipmentRunTime.getOccupyType())){
|
|
|
+ equipmentRunTimesMerge.add(equipmentRunTime);
|
|
|
+ }else{
|
|
|
+ if("成退,中退,小卷成退".contains(equipmentRunTime.getProcessType())){
|
|
|
+ hasMerge = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(hasMerge) {
|
|
|
for (EquipmentRunTime equipmentRunTime : equipmentRunTimes) {
|
|
|
- if("maintenance".equals(equipmentRunTime.getOccupyType())){
|
|
|
+ if ("maintenance".equals(equipmentRunTime.getOccupyType())) {
|
|
|
equipmentRunTimesMerge.add(equipmentRunTime);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
boolean isMerged = false;
|
|
|
String groupname = null;
|
|
|
for (ApsFurnaceInstallationDo furnaceInstallation : productionScheduleVo.getFurnaceInstallations()) {
|
|
|
- if(equipmentRunTime.getVolumeMetal().equals(furnaceInstallation.getAlloy())){
|
|
|
+ if (equipmentRunTime.getVolumeMetal().equals(furnaceInstallation.getAlloy())) {
|
|
|
boolean a = true;
|
|
|
- if((furnaceInstallation.getAlloystatus() != null && equipmentRunTime.getVolumeMetalstate() != null && furnaceInstallation.getAlloystatus().contains(equipmentRunTime.getVolumeMetalstate()))
|
|
|
- || (furnaceInstallation.getAlloystatus() == null && equipmentRunTime.getVolumeMetalstate() == null)){
|
|
|
+ if ((furnaceInstallation.getAlloystatus() != null && equipmentRunTime.getVolumeMetalstate() != null && furnaceInstallation.getAlloystatus().contains(equipmentRunTime.getVolumeMetalstate()))
|
|
|
+ || (furnaceInstallation.getAlloystatus() == null && equipmentRunTime.getVolumeMetalstate() == null)) {
|
|
|
a = true;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
a = false;
|
|
|
}
|
|
|
- if(furnaceInstallation.getStartthickness() != null && furnaceInstallation.getStartthickness().compareTo(equipmentRunTime.getTotalThickness())>0){
|
|
|
+ if (furnaceInstallation.getStartthickness() != null && furnaceInstallation.getStartthickness().compareTo(equipmentRunTime.getTotalThickness()) > 0) {
|
|
|
a = false;
|
|
|
}
|
|
|
- if(furnaceInstallation.getEndthickness() != null && furnaceInstallation.getEndthickness().compareTo(equipmentRunTime.getTotalThickness())<0){
|
|
|
+ if (furnaceInstallation.getEndthickness() != null && furnaceInstallation.getEndthickness().compareTo(equipmentRunTime.getTotalThickness()) < 0) {
|
|
|
a = false;
|
|
|
}
|
|
|
- if(furnaceInstallation.getStartwidth() != null && new BigDecimal(furnaceInstallation.getStartwidth()).compareTo(equipmentRunTime.getTotalVolumeWidth())>0){
|
|
|
+ if (furnaceInstallation.getStartwidth() != null && new BigDecimal(furnaceInstallation.getStartwidth()).compareTo(equipmentRunTime.getTotalVolumeWidth()) > 0) {
|
|
|
a = false;
|
|
|
}
|
|
|
- if(furnaceInstallation.getEndwidth() != null && new BigDecimal(furnaceInstallation.getEndwidth()).compareTo(equipmentRunTime.getTotalVolumeWidth())<0){
|
|
|
+ if (furnaceInstallation.getEndwidth() != null && new BigDecimal(furnaceInstallation.getEndwidth()).compareTo(equipmentRunTime.getTotalVolumeWidth()) < 0) {
|
|
|
a = false;
|
|
|
}
|
|
|
- if(a){
|
|
|
+ if (a) {
|
|
|
groupname = furnaceInstallation.getId();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(groupname == null){
|
|
|
+ if (groupname == null) {
|
|
|
groupname = "group-self-" + equipmentRunTime.getVolumeMetal() + equipmentRunTime.getVolumeMetalstate() + equipmentRunTime.getProducttype() + equipmentRunTime.getTotalVolumeWidth() + equipmentRunTime.getTotalThickness();
|
|
|
}
|
|
|
Set<String> minThGroupNames = new HashSet<>();
|
|
|
minThGroupNames.add(groupname);
|
|
|
for (EquipmentRunTime runTime : equipmentRunTimesMerge) {
|
|
|
// 时间相等
|
|
|
- if(runTime.getStartRunTime().compareTo(equipmentRunTime.getStartRunTime())==0){
|
|
|
+ if (runTime.getStartRunTime().compareTo(equipmentRunTime.getStartRunTime()) == 0) {
|
|
|
runTime.setTotalVolumeWidth(runTime.getTotalVolumeWidth().add(equipmentRunTime.getTotalVolumeWidth()));
|
|
|
runTime.setTotalSinglerollweight(runTime.getTotalSinglerollweight().add(equipmentRunTime.getTotalSinglerollweight()));
|
|
|
// 最大、最小宽度
|
|
|
- if(equipmentRunTime.getTotalVolumeWidth().compareTo(runTime.getMinVolumeWidth())<0){
|
|
|
+ if (equipmentRunTime.getTotalVolumeWidth().compareTo(runTime.getMinVolumeWidth()) < 0) {
|
|
|
runTime.setMinVolumeWidth(equipmentRunTime.getTotalVolumeWidth());
|
|
|
}
|
|
|
- if(equipmentRunTime.getTotalVolumeWidth().compareTo(runTime.getMaxVolumeWidth())>0){
|
|
|
+ if (equipmentRunTime.getTotalVolumeWidth().compareTo(runTime.getMaxVolumeWidth()) > 0) {
|
|
|
runTime.setMaxVolumeWidth(equipmentRunTime.getTotalVolumeWidth());
|
|
|
}
|
|
|
// 最大、最小厚度
|
|
|
- if(equipmentRunTime.getTotalThickness().compareTo(runTime.getMinThickness())<0){
|
|
|
+ if (equipmentRunTime.getTotalThickness().compareTo(runTime.getMinThickness()) < 0) {
|
|
|
runTime.setMinThickness(equipmentRunTime.getTotalThickness());
|
|
|
}
|
|
|
- if(equipmentRunTime.getTotalThickness().compareTo(runTime.getMaxThickness())>0){
|
|
|
+ if (equipmentRunTime.getTotalThickness().compareTo(runTime.getMaxThickness()) > 0) {
|
|
|
runTime.setMaxThickness(equipmentRunTime.getTotalThickness());
|
|
|
}
|
|
|
// 最大、最小重量
|
|
|
- if(equipmentRunTime.getTotalSinglerollweight().compareTo(runTime.getMinSinglerollweight())<0){
|
|
|
+ if (equipmentRunTime.getTotalSinglerollweight().compareTo(runTime.getMinSinglerollweight()) < 0) {
|
|
|
runTime.setMinSinglerollweight(equipmentRunTime.getTotalSinglerollweight());
|
|
|
}
|
|
|
- if(equipmentRunTime.getTotalSinglerollweight().compareTo(runTime.getMaxSinglerollweight())>0){
|
|
|
+ if (equipmentRunTime.getTotalSinglerollweight().compareTo(runTime.getMaxSinglerollweight()) > 0) {
|
|
|
runTime.setMaxSinglerollweight(equipmentRunTime.getTotalSinglerollweight());
|
|
|
}
|
|
|
runTime.getMinThGroupNames().addAll(minThGroupNames);
|
|
@@ -983,7 +1018,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!isMerged){
|
|
|
+ if (!isMerged) {
|
|
|
equipmentRunTime.setMinVolumeWidth(equipmentRunTime.getTotalVolumeWidth());
|
|
|
equipmentRunTime.setMaxVolumeWidth(equipmentRunTime.getTotalVolumeWidth());
|
|
|
equipmentRunTime.setMinThickness(equipmentRunTime.getTotalThickness());
|