|
@@ -289,6 +289,16 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ List<LocalDateTime> nextStartTimes = new ArrayList<>();
|
|
|
+ getAllNextProTime(productionProcesses,nextStartTimes,0);
|
|
|
+ if(nextStartTimes != null && nextStartTimes.size()>0){
|
|
|
+ for (LocalDateTime nextStartTime : nextStartTimes) {
|
|
|
+ if(preEndTime.compareTo(nextStartTime)>=0){
|
|
|
+ bln = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return bln;
|
|
|
})
|
|
@@ -296,6 +306,29 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
.asConstraint("nextLockPro");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 递归计算是否比所有下道工序开始时间晚
|
|
|
+ * @param productionProcesses
|
|
|
+ * @param nextStartTimes
|
|
|
+ * @param totalMinWaitTime
|
|
|
+ */
|
|
|
+ private void getAllNextProTime(ProductionProcesses productionProcesses,List<LocalDateTime> nextStartTimes,Integer totalMinWaitTime){
|
|
|
+ List<ProductionProcesses> nextProcesses = productionProcesses.getNextProcesses();
|
|
|
+ if(nextProcesses != null && nextProcesses.size()>0){
|
|
|
+ for (ProductionProcesses nextProcess : nextProcesses) {
|
|
|
+ if(nextProcess.getStartTime() != null){
|
|
|
+ LocalDateTime startTime = nextProcess.getStartTime();
|
|
|
+ if(nextProcess.getMinWaitTime() != null && nextProcess.getMinWaitTime()>0){
|
|
|
+ totalMinWaitTime = totalMinWaitTime + nextProcess.getMinWaitTime();
|
|
|
+ startTime = startTime.minusMinutes(totalMinWaitTime);
|
|
|
+ }
|
|
|
+ nextStartTimes.add(startTime);
|
|
|
+ }
|
|
|
+ getAllNextProTime(nextProcess,nextStartTimes,totalMinWaitTime);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 汇总所有下道工序的加工时间
|
|
|
* @param nextProcess
|
|
@@ -1286,8 +1319,8 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
pp.setVolumeMetal(equipmentRunTime.getVolumeMetal());
|
|
|
pp.setVolumeMetalstate(equipmentRunTime.getVolumeMetalstate());
|
|
|
pp.setBsProcessesId(Arrays.asList(new String[]{"haspcprocess"}));
|
|
|
- pp.setVolumeWidth(equipmentRunTime.getTotalVolumeWidth());
|
|
|
- pp.setSinglerollweight(equipmentRunTime.getTotalSinglerollweight());
|
|
|
+ pp.setTotalVolumeWidth(equipmentRunTime.getTotalVolumeWidth());
|
|
|
+ pp.setTotalSinglerollweight(equipmentRunTime.getTotalSinglerollweight());
|
|
|
pp.setVolumeThickness(equipmentRunTime.getTotalThickness());
|
|
|
pp.setConflictRoptions(new HashMap<>());
|
|
|
if(equipmentRunTime.getOccupyType().equals("process")){
|
|
@@ -1305,6 +1338,10 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
for(int i=0;i<hasStartTimeProcess.size()-1;i++){
|
|
|
ProductionProcesses prePro = hasStartTimeProcess.get(i);
|
|
|
ProductionProcesses nextPro = hasStartTimeProcess.get(i+1);
|
|
|
+ // 没有本次待排程的退火作业不考虑合并问题
|
|
|
+ if(prePro.getId().indexOf("equipmentRunTime") == 0 && nextPro.getId().indexOf("equipmentRunTime") == 0){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
Map<String, String> conflictRoptions1 = prePro.getConflictRoptions();
|
|
|
Map<String, String> conflictRoptions2 = nextPro.getConflictRoptions();
|
|
|
// 开始时间相等为合并工序
|
|
@@ -1404,24 +1441,26 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
BigDecimal minSinglerollweight = null;
|
|
|
|
|
|
for (ProductionProcesses productionProcesses : v) {
|
|
|
- totalWidth = totalWidth.add(productionProcesses.getVolumeWidth()).add(productionProcesses.getEquipment().getEquipmentParameter().getFurnace());
|
|
|
- totalWeight = totalWeight.add(productionProcesses.getSinglerollweight());
|
|
|
+ totalWidth = totalWidth.add(productionProcesses.getTotalVolumeWidth()).add(productionProcesses.getEquipment().getEquipmentParameter().getFurnace());
|
|
|
+ totalWeight = totalWeight.add(productionProcesses.getTotalSinglerollweight());
|
|
|
metalSet.add(productionProcesses.getVolumeMetal());
|
|
|
processTypeSet.add(productionProcesses.getProcessType());
|
|
|
metalstateSet.add(productionProcesses.getVolumeMetalstate());
|
|
|
// 宽度
|
|
|
- if(maxVolumeWidth == null){
|
|
|
- maxVolumeWidth = productionProcesses.getVolumeWidth();
|
|
|
- }else{
|
|
|
- if(productionProcesses.getVolumeWidth().compareTo(maxVolumeWidth)>0){
|
|
|
+ if(productionProcesses.getVolumeWidth() != null){
|
|
|
+ if(maxVolumeWidth == null){
|
|
|
maxVolumeWidth = productionProcesses.getVolumeWidth();
|
|
|
+ }else{
|
|
|
+ if(productionProcesses.getVolumeWidth().compareTo(maxVolumeWidth)>0){
|
|
|
+ maxVolumeWidth = productionProcesses.getVolumeWidth();
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if(minVolumeWidth == null){
|
|
|
- minVolumeWidth = productionProcesses.getVolumeWidth();
|
|
|
- }else{
|
|
|
- if(productionProcesses.getVolumeWidth().compareTo(minVolumeWidth)<0){
|
|
|
+ if(minVolumeWidth == null){
|
|
|
minVolumeWidth = productionProcesses.getVolumeWidth();
|
|
|
+ }else{
|
|
|
+ if(productionProcesses.getVolumeWidth().compareTo(minVolumeWidth)<0){
|
|
|
+ minVolumeWidth = productionProcesses.getVolumeWidth();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// 厚度
|
|
@@ -1440,18 +1479,20 @@ public class ApsConstraintProvider implements ConstraintProvider {
|
|
|
}
|
|
|
}
|
|
|
// 重量
|
|
|
- if(maxSinglerollweight == null){
|
|
|
- maxSinglerollweight = productionProcesses.getSinglerollweight();
|
|
|
- }else{
|
|
|
- if(productionProcesses.getSinglerollweight().compareTo(maxSinglerollweight)>0){
|
|
|
+ if(productionProcesses.getSinglerollweight() != null){
|
|
|
+ if(maxSinglerollweight == null){
|
|
|
maxSinglerollweight = productionProcesses.getSinglerollweight();
|
|
|
+ }else{
|
|
|
+ if(productionProcesses.getSinglerollweight().compareTo(maxSinglerollweight)>0){
|
|
|
+ maxSinglerollweight = productionProcesses.getSinglerollweight();
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if(minSinglerollweight == null){
|
|
|
- minSinglerollweight = productionProcesses.getSinglerollweight();
|
|
|
- }else{
|
|
|
- if(productionProcesses.getSinglerollweight().compareTo(minSinglerollweight)<0){
|
|
|
+ if(minSinglerollweight == null){
|
|
|
minSinglerollweight = productionProcesses.getSinglerollweight();
|
|
|
+ }else{
|
|
|
+ if(productionProcesses.getSinglerollweight().compareTo(minSinglerollweight)<0){
|
|
|
+ minSinglerollweight = productionProcesses.getSinglerollweight();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|