|
@@ -1181,6 +1181,10 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
.groupBy(ProductionProcesses::getEquipmentId, ConstraintCollectors.toList())
|
|
|
.filter((equipmentId,processes) -> {
|
|
|
if(processes != null && processes.size()>0){
|
|
|
+ for (ProductionProcesses process : processes) {
|
|
|
+ process.getConflictRoptions().remove("soft-seriesProduceZz");
|
|
|
+ process.getConflictRoptions().remove("soft-seriesProduceLz");
|
|
|
+ }
|
|
|
return true;
|
|
|
}else{
|
|
|
return false;
|
|
@@ -1244,20 +1248,23 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
Map<String, String> conflictRoptions1 = hasStartTimeProcess.get(i).getConflictRoptions();
|
|
|
Map<String, String> conflictRoptions2 = hasStartTimeProcess.get(i+1).getConflictRoptions();
|
|
|
if("铸轧".equals(hasStartTimeProcess.get(i).getProcessType())){
|
|
|
- if(conflictRoptions1.containsKey("soft-seriesProduceZz")){
|
|
|
+ /*if(conflictRoptions1.containsKey("soft-seriesProduceZz")){
|
|
|
conflictRoptions1.remove("soft-seriesProduceZz");
|
|
|
}
|
|
|
if(conflictRoptions2.containsKey("soft-seriesProduceZz")){
|
|
|
conflictRoptions2.remove("soft-seriesProduceZz");
|
|
|
- }
|
|
|
+ }*/
|
|
|
String[] serspre = hasStartTimeProcess.get(i).getSeriesProduceMark().split("\\^_\\^");
|
|
|
String[] sersafter = hasStartTimeProcess.get(i+1).getSeriesProduceMark().split("\\^_\\^");
|
|
|
if(serspre.length == 5 && sersafter.length == 5){
|
|
|
// 合金不同或者产品类型不同则需要换辊和立板
|
|
|
if(!serspre[0].equals(sersafter[0]) || !serspre[1].equals(sersafter[1])){
|
|
|
b = b+15;
|
|
|
- conflictRoptions1.put("soft-seriesProduceZz","和后一道工序违反换辊和立板的连续约束");
|
|
|
- conflictRoptions2.put("soft-seriesProduceZz","和前一道工序违反换辊和立板的连续约束");
|
|
|
+ if(hasStartTimeProcess.get(i).getId() != null){
|
|
|
+ conflictRoptions1.put("soft-seriesProduceZz",conflictRoptions1.get("soft-seriesProduceZz") == null ? "和后一道工序违反换辊和立板的连续约束" : conflictRoptions1.get("soft-seriesProduceZz")+";和后一道工序违反换辊和立板的连续约束");
|
|
|
+ }else{
|
|
|
+ conflictRoptions2.put("soft-seriesProduceZz","和前一道工序违反换辊和立板的连续约束");
|
|
|
+ }
|
|
|
}else{
|
|
|
// 合金相同情况下后面的宽度大于前面的宽度需要换辊和立板
|
|
|
// 合金相同情况下后面的宽度小于前面的宽度需要立板
|
|
@@ -1269,12 +1276,18 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
BigDecimal i2 = new BigDecimal(s2);
|
|
|
if(i1.compareTo(i2)<0){
|
|
|
b = b+15;
|
|
|
- conflictRoptions1.put("soft-seriesProduceZz","和后一道工序违反换辊和立板的连续约束");
|
|
|
- conflictRoptions2.put("soft-seriesProduceZz","和前一道工序违反换辊和立板的连续约束");
|
|
|
+ if(hasStartTimeProcess.get(i).getId() != null){
|
|
|
+ conflictRoptions1.put("soft-seriesProduceZz",conflictRoptions1.get("soft-seriesProduceZz") == null ? "和后一道工序违反换辊和立板的连续约束" : conflictRoptions1.get("soft-seriesProduceZz")+";和后一道工序违反换辊和立板的连续约束");
|
|
|
+ }else{
|
|
|
+ conflictRoptions2.put("soft-seriesProduceZz","和前一道工序违反换辊和立板的连续约束");
|
|
|
+ }
|
|
|
}else if(i1.compareTo(i2)>0){
|
|
|
b = b+8;
|
|
|
- conflictRoptions1.put("soft-seriesProduceZz","和后一道工序违反立板的连续约束");
|
|
|
- conflictRoptions2.put("soft-seriesProduceZz","和前一道工序违反立板的连续约束");
|
|
|
+ if(hasStartTimeProcess.get(i).getId() != null){
|
|
|
+ conflictRoptions1.put("soft-seriesProduceZz",conflictRoptions1.get("soft-seriesProduceZz") == null ? "和后一道工序违反立板的连续约束" : conflictRoptions1.get("soft-seriesProduceZz")+";和后一道工序违反立板的连续约束");
|
|
|
+ }else{
|
|
|
+ conflictRoptions2.put("soft-seriesProduceZz","和前一道工序违反立板的连续约束");
|
|
|
+ }
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
@@ -1282,15 +1295,12 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
}
|
|
|
}
|
|
|
} else if ("冷轧".equals(hasStartTimeProcess.get(i).getProcessType())) {
|
|
|
- /*if(hasStartTimeProcess.size() == 2){
|
|
|
- System.out.println(hasStartTimeProcess);
|
|
|
- }*/
|
|
|
- if(conflictRoptions1.containsKey("soft-seriesProduceLz")){
|
|
|
+ /*if(conflictRoptions1.containsKey("soft-seriesProduceLz")){
|
|
|
conflictRoptions1.remove("soft-seriesProduceLz");
|
|
|
}
|
|
|
if(conflictRoptions2.containsKey("soft-seriesProduceLz")){
|
|
|
conflictRoptions2.remove("soft-seriesProduceLz");
|
|
|
- }
|
|
|
+ }*/
|
|
|
String[] serspre = hasStartTimeProcess.get(i).getSeriesProduceMark().split("\\^_\\^");
|
|
|
String[] sersafter = hasStartTimeProcess.get(i+1).getSeriesProduceMark().split("\\^_\\^");
|
|
|
// 前后道所属作业ID
|
|
@@ -1299,8 +1309,11 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
if(serspre.length == 5 && sersafter.length == 5){
|
|
|
if(!serspre[0].equals(sersafter[0]) || !serspre[1].equals(sersafter[1])){
|
|
|
b = b+10;
|
|
|
- conflictRoptions1.put("soft-seriesProduceLz","和后一道工序违反换辊的连续约束");
|
|
|
- conflictRoptions2.put("soft-seriesProduceLz","和前一道工序违反换辊的连续约束");
|
|
|
+ if(hasStartTimeProcess.get(i).getId() != null){
|
|
|
+ conflictRoptions1.put("soft-seriesProduceLz",conflictRoptions1.get("soft-seriesProduceLz") == null ? "和后一道工序违反换辊的连续约束" : conflictRoptions1.get("soft-seriesProduceLz")+";和后一道工序违反换辊的连续约束");
|
|
|
+ }else{
|
|
|
+ conflictRoptions2.put("soft-seriesProduceLz","和前一道工序违反换辊的连续约束");
|
|
|
+ }
|
|
|
}else{
|
|
|
// 前道工序宽度、输入物料厚度、输出物料厚度
|
|
|
String s1 = serspre[2];
|
|
@@ -1316,14 +1329,20 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
// 后端工序大于前道工序,并且大于30mm
|
|
|
if((i1.add(new BigDecimal("30"))).compareTo(i2)<0){
|
|
|
b = b+7;
|
|
|
- conflictRoptions1.put("soft-seriesProduceLz","和后一道工序违反换辊的连续约束");
|
|
|
- conflictRoptions2.put("soft-seriesProduceLz","和前一道工序违反换辊的连续约束");
|
|
|
+ if(hasStartTimeProcess.get(i).getId() != null){
|
|
|
+ conflictRoptions1.put("soft-seriesProduceLz",conflictRoptions1.get("soft-seriesProduceLz") == null ? "和后一道工序违反换辊的连续约束" : conflictRoptions1.get("soft-seriesProduceLz")+";和后一道工序违反换辊的连续约束");
|
|
|
+ }else{
|
|
|
+ conflictRoptions2.put("soft-seriesProduceLz","和前一道工序违反换辊的连续约束");
|
|
|
+ }
|
|
|
}
|
|
|
// 后端工序大于前道工序,并且小于30mm
|
|
|
else if(i1.compareTo(i2)<0 && (i1.add(new BigDecimal("30"))).compareTo(i2)>=0){
|
|
|
b = b+6;
|
|
|
- conflictRoptions1.put("soft-seriesProduceLz","和后一道工序违反换辊的连续约束");
|
|
|
- conflictRoptions2.put("soft-seriesProduceLz","和前一道工序违反换辊的连续约束");
|
|
|
+ if(hasStartTimeProcess.get(i).getId() != null){
|
|
|
+ conflictRoptions1.put("soft-seriesProduceLz",conflictRoptions1.get("soft-seriesProduceLz") == null ? "和后一道工序违反换辊的连续约束" : conflictRoptions1.get("soft-seriesProduceLz")+";和后一道工序违反换辊的连续约束");
|
|
|
+ }else{
|
|
|
+ conflictRoptions2.put("soft-seriesProduceLz","和前一道工序违反换辊的连续约束");
|
|
|
+ }
|
|
|
}
|
|
|
// 后端工序小于前道工序
|
|
|
else if(i1.compareTo(i2)>0){
|