|
@@ -26,10 +26,10 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
public Constraint[] defineConstraints(ConstraintFactory constraintFactory) {
|
|
|
return new Constraint[]{
|
|
|
// HARD
|
|
|
-// hasOnePreGbAfterNowNew(constraintFactory),
|
|
|
-// nextLockProNew(constraintFactory),
|
|
|
- hasOnePreGbAfterNow(constraintFactory),
|
|
|
- nextLockPro(constraintFactory),
|
|
|
+ hasOnePreGbAfterNowNew(constraintFactory),
|
|
|
+ nextLockProNew(constraintFactory),
|
|
|
+// hasOnePreGbAfterNow(constraintFactory),
|
|
|
+// nextLockPro(constraintFactory),
|
|
|
eqTimeCross(constraintFactory),
|
|
|
seriesProduceTimeWait(constraintFactory),
|
|
|
seriesProduceWashTimeWait(constraintFactory),
|
|
@@ -38,7 +38,7 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
eqTimeCrossMinTuihuo(constraintFactory),
|
|
|
// twoLineZz(constraintFactory),
|
|
|
// MEDIUM
|
|
|
-// deliveryDate(constraintFactory),
|
|
|
+ deliveryDate(constraintFactory),
|
|
|
expecteddays(constraintFactory),
|
|
|
seriesProduce(constraintFactory),
|
|
|
seriesProduceWashingFurnace(constraintFactory),
|
|
@@ -945,6 +945,28 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }else if ("箔轧".equals(hasStartTimeProcess.get(i).getProcessType())) {
|
|
|
+ // 宽度从大到小
|
|
|
+ String[] serspre = hasStartTimeProcess.get(i).getSeriesProduceMark().split("\\^_\\^");
|
|
|
+ String[] sersafter = hasStartTimeProcess.get(i+1).getSeriesProduceMark().split("\\^_\\^");
|
|
|
+ if(serspre.length == 5 && sersafter.length == 5){
|
|
|
+ String s1 = serspre[2];
|
|
|
+ String s2 = sersafter[2];
|
|
|
+ try {
|
|
|
+ BigDecimal volumeWidth = new BigDecimal(s1);
|
|
|
+ BigDecimal volumeWidth1 = new BigDecimal(s2);
|
|
|
+ if(volumeWidth.compareTo(volumeWidth1)<0){
|
|
|
+ if(hasStartTimeProcess.get(i).getEndTime().plusMinutes(hasStartTimeProcess.get(i).getCutfinishmin())
|
|
|
+ .plusMinutes(hasStartTimeProcess.get(i+1).getPrepressworkmin()).compareTo(hasStartTimeProcess.get(i+1).getStartTime())>0){
|
|
|
+ b++;
|
|
|
+ conflictRoptions1.put("hard-seriesProduceTimeWait","和下道工序没有预留足够的上机准备时间和下机收尾时间");
|
|
|
+ conflictRoptions2.put("hard-seriesProduceTimeWait","和上道工序没有预留足够的上机准备时间和下机收尾时间");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1561,7 +1583,7 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
Long expecteddays = expecteddaysCount(productionProcesses);
|
|
|
return (int)(expecteddays*10000);
|
|
|
})
|
|
|
- .asConstraint("deliveryDate");
|
|
|
+ .asConstraint("expecteddays");
|
|
|
}
|
|
|
|
|
|
private Long expecteddaysCount(ProductionProcesses productionProcesses){
|
|
@@ -1678,7 +1700,7 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
*/
|
|
|
private Constraint seriesProduce(ConstraintFactory constraintFactory){
|
|
|
return constraintFactory.forEach(ProductionProcesses.class)
|
|
|
- .filter((processes) -> "铸轧".equals(processes.getProcessType()) || "冷轧".equals(processes.getProcessType()))
|
|
|
+ .filter((processes) -> "铸轧".equals(processes.getProcessType()) || "冷轧".equals(processes.getProcessType()) || "箔轧".equals(processes.getProcessType()))
|
|
|
.groupBy(ProductionProcesses::getEquipmentId, ConstraintCollectors.toList())
|
|
|
.filter((equipmentId,processes) -> {
|
|
|
if(processes != null && processes.size()>0){
|
|
@@ -1880,6 +1902,28 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }else if ("箔轧".equals(hasStartTimeProcess.get(i).getProcessType())) {
|
|
|
+ // 宽度从大到小
|
|
|
+ String[] serspre = hasStartTimeProcess.get(i).getSeriesProduceMark().split("\\^_\\^");
|
|
|
+ String[] sersafter = hasStartTimeProcess.get(i+1).getSeriesProduceMark().split("\\^_\\^");
|
|
|
+ if(serspre.length == 5 && sersafter.length == 5){
|
|
|
+ String s1 = serspre[2];
|
|
|
+ String s2 = sersafter[2];
|
|
|
+ try {
|
|
|
+ BigDecimal volumeWidth = new BigDecimal(s1);
|
|
|
+ BigDecimal volumeWidth1 = new BigDecimal(s2);
|
|
|
+ if(volumeWidth.compareTo(volumeWidth1)<0){
|
|
|
+ b = b+5;
|
|
|
+ if(hasStartTimeProcess.get(i).getId() != null){
|
|
|
+ conflictRoptions1.put("soft-seriesProduceLz",conflictRoptions1.get("soft-seriesProduceLz") == null ? "和后一道工序违反换辊的连续约束" : conflictRoptions1.get("soft-seriesProduceLz")+";和后一道工序违反换辊的连续约束");
|
|
|
+ }else{
|
|
|
+ conflictRoptions2.put("soft-seriesProduceLz","和前一道工序违反换辊的连续约束");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|