|
@@ -2168,6 +2168,34 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
// 前后道所属作业ID
|
|
|
String processId1 = hasStartTimeProcess.get(i).getBsProcessesId().get(0);
|
|
|
String processId2 = hasStartTimeProcess.get(i+1).getBsProcessesId().get(0);
|
|
|
+ // 判断原有前后两道历史工序是否连续
|
|
|
+ boolean ispreafterLx = false;
|
|
|
+ if(prepro.getId() == null && nextpro.getId() != null && hasStartTimeProcess.size()>i+2
|
|
|
+ && hasStartTimeProcess.get(i+2).getId() == null){
|
|
|
+ ProductionProcesses nextnextpro = hasStartTimeProcess.get(i + 2);
|
|
|
+ if(StrUtil.isNotBlank(prepro.getProZg()) && StrUtil.isNotBlank(nextnextpro.getProZg())){
|
|
|
+ if(prepro.getProZg().equals(nextnextpro.getProZg())){
|
|
|
+ String[] sersafterafter = nextnextpro.getSeriesProduceMark().split("\\^_\\^");
|
|
|
+ BigDecimal i3 = new BigDecimal(sersafterafter[2]);
|
|
|
+ if(i1.compareTo(i3)>=0){
|
|
|
+ ispreafterLx = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (prepro.getId() != null && nextpro.getId() == null && i>0
|
|
|
+ && hasStartTimeProcess.get(i-1).getId() == null) {
|
|
|
+ ProductionProcesses preprepro = hasStartTimeProcess.get(i-1);
|
|
|
+ if(StrUtil.isNotBlank(preprepro.getProZg()) && StrUtil.isNotBlank(nextpro.getProZg())){
|
|
|
+ if(preprepro.getProZg().equals(nextpro.getProZg())){
|
|
|
+ String[] sersprepre = preprepro.getSeriesProduceMark().split("\\^_\\^");
|
|
|
+ BigDecimal i0 = new BigDecimal(sersprepre[2]);
|
|
|
+ if(i0.compareTo(i2)>=0){
|
|
|
+ ispreafterLx = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(StrUtil.isNotBlank(prepro.getProZg()) && StrUtil.isNotBlank(nextpro.getProZg())){
|
|
|
String preZg = prepro.getProZg();
|
|
|
String nextZg = nextpro.getProZg();
|
|
@@ -2181,6 +2209,9 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
}else{
|
|
|
if((i1.add(new BigDecimal("30"))).compareTo(i2)<0){
|
|
|
b = b+8;
|
|
|
+ if(ispreafterLx){
|
|
|
+ b = b+8;
|
|
|
+ }
|
|
|
if(hasStartTimeProcess.get(i).getId() != null){
|
|
|
conflictRoptions1.put("soft-seriesProduceLz",conflictRoptions1.get("soft-seriesProduceLz") == null ? "和后一道工序违反换辊的连续约束" : conflictRoptions1.get("soft-seriesProduceLz")+";和后一道工序违反换辊的连续约束");
|
|
|
}else{
|
|
@@ -2188,6 +2219,9 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
}
|
|
|
}else if(i1.compareTo(i2)<0 && (i1.add(new BigDecimal("30"))).compareTo(i2)>=0){
|
|
|
b = b+7;
|
|
|
+ if(ispreafterLx){
|
|
|
+ b = b+8;
|
|
|
+ }
|
|
|
if(hasStartTimeProcess.get(i).getId() != null){
|
|
|
conflictRoptions1.put("soft-seriesProduceLz",conflictRoptions1.get("soft-seriesProduceLz") == null ? "和后一道工序违反换辊的连续约束" : conflictRoptions1.get("soft-seriesProduceLz")+";和后一道工序违反换辊的连续约束");
|
|
|
}else{
|