|
@@ -295,39 +295,58 @@ public class ApsServiceImpl implements ApsService {
|
|
@Override
|
|
@Override
|
|
public void tuihuoApsSch(ApsSolution apsSolution,List<ProductionProcesses> otherThproces,List<ProductionProcesses> otherNotZzFirstProces
|
|
public void tuihuoApsSch(ApsSolution apsSolution,List<ProductionProcesses> otherThproces,List<ProductionProcesses> otherNotZzFirstProces
|
|
,ProductionScheduleVo productionScheduleVo,Map<String,List<String>> ordergrous){
|
|
,ProductionScheduleVo productionScheduleVo,Map<String,List<String>> ordergrous){
|
|
- if(otherNotZzFirstProces != null && otherNotZzFirstProces.size()>0){
|
|
|
|
- otherNotZzFirstProces = new ArrayList<>();
|
|
|
|
-
|
|
|
|
- List<ProductionProcesses> processesList = this.zzProcessAps(productionScheduleVo, apsSolution, otherNotZzFirstProces);
|
|
|
|
- if(processesList != null && processesList.size()>0 && !processesList.get(0).getProcessType().equals("铸轧")){
|
|
|
|
- for (ProductionProcesses productionProcesses : processesList) {
|
|
|
|
- for (ProductionProcesses processes : apsSolution.getProcessesList()) {
|
|
|
|
- if(processes.getId().equals(productionProcesses.getId())){
|
|
|
|
- processes.setStartTime(productionProcesses.getStartTime());
|
|
|
|
- processes.setEndTime(productionProcesses.getEndTime());
|
|
|
|
|
|
+ ApsSolution apsSolutionTh = null;
|
|
|
|
+ Map<String,Map<String,List<ProductionProcesses>>> relPros = new HashMap<>();
|
|
|
|
+ // 调度退火排程
|
|
|
|
+ if("dd".equals(productionScheduleVo.getScheduleType().getScheduleType())){
|
|
|
|
+ apsSolutionTh = new ApsSolution();
|
|
|
|
+ List<ProductionProcesses> tuihuos = new ArrayList<>();
|
|
|
|
+ for (ProductionProcesses process : apsSolution.getProcessesList()) {
|
|
|
|
+ if((process.getProcessType().equals("成退") || process.getProcessType().equals("中退") || process.getProcessType().equals("小卷成退")) && !process.getIfLock()){
|
|
|
|
+ tuihuos.add(process);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ apsSolutionTh.setProcessesList(tuihuos);
|
|
|
|
+ apsSolutionTh.setEquipmentList(apsSolution.getEquipmentList());
|
|
|
|
+ }
|
|
|
|
+ // 退火预排程
|
|
|
|
+ else{
|
|
|
|
+ if(otherNotZzFirstProces != null && otherNotZzFirstProces.size()>0){
|
|
|
|
+ otherNotZzFirstProces = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ List<ProductionProcesses> processesList = this.zzProcessAps(productionScheduleVo, apsSolution, otherNotZzFirstProces);
|
|
|
|
+ if(processesList != null && processesList.size()>0 && !processesList.get(0).getProcessType().equals("铸轧")){
|
|
|
|
+ for (ProductionProcesses productionProcesses : processesList) {
|
|
|
|
+ for (ProductionProcesses processes : apsSolution.getProcessesList()) {
|
|
|
|
+ if(processes.getId().equals(productionProcesses.getId())){
|
|
|
|
+ processes.setStartTime(productionProcesses.getStartTime());
|
|
|
|
+ processes.setEndTime(productionProcesses.getEndTime());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- Map<String,Map<String,List<ProductionProcesses>>> relPros = new HashMap<>();
|
|
|
|
- ApsSolution apsSolutionTh = tuihuoAps(apsSolution,relPros);
|
|
|
|
- if(otherNotZzFirstProces != null && otherNotZzFirstProces.size()>0){
|
|
|
|
- // 取消第一道工序非铸轧提前排程的锁定状态
|
|
|
|
|
|
+
|
|
|
|
+ apsSolutionTh = tuihuoAps(apsSolution,relPros);
|
|
if(otherNotZzFirstProces != null && otherNotZzFirstProces.size()>0){
|
|
if(otherNotZzFirstProces != null && otherNotZzFirstProces.size()>0){
|
|
- for (ProductionProcesses otherSerProcesMerge : apsSolution.getProcessesList()) {
|
|
|
|
- List<ProductionProcesses> list1 = otherNotZzFirstProces.stream().filter(v -> v.getId().equals(otherSerProcesMerge.getId())).collect(Collectors.toList());
|
|
|
|
- if(list1 != null && list1.size()>0){
|
|
|
|
- otherSerProcesMerge.setIfLock(false);
|
|
|
|
- otherSerProcesMerge.setStartTime(null);
|
|
|
|
- otherSerProcesMerge.setEndTime(null);
|
|
|
|
- otherSerProcesMerge.setEquipment(null);
|
|
|
|
- otherSerProcesMerge.setEquipmentId(null);
|
|
|
|
- otherSerProcesMerge.setDelay(null);
|
|
|
|
|
|
+ // 取消第一道工序非铸轧提前排程的锁定状态
|
|
|
|
+ if(otherNotZzFirstProces != null && otherNotZzFirstProces.size()>0){
|
|
|
|
+ for (ProductionProcesses otherSerProcesMerge : apsSolution.getProcessesList()) {
|
|
|
|
+ List<ProductionProcesses> list1 = otherNotZzFirstProces.stream().filter(v -> v.getId().equals(otherSerProcesMerge.getId())).collect(Collectors.toList());
|
|
|
|
+ if(list1 != null && list1.size()>0){
|
|
|
|
+ otherSerProcesMerge.setIfLock(false);
|
|
|
|
+ otherSerProcesMerge.setStartTime(null);
|
|
|
|
+ otherSerProcesMerge.setEndTime(null);
|
|
|
|
+ otherSerProcesMerge.setEquipment(null);
|
|
|
|
+ otherSerProcesMerge.setEquipmentId(null);
|
|
|
|
+ otherSerProcesMerge.setDelay(null);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
// 退火工序求解器运行
|
|
// 退火工序求解器运行
|
|
int processNum1 = apsSolutionTh.getProcessesList().size();
|
|
int processNum1 = apsSolutionTh.getProcessesList().size();
|
|
int runPlanSeconds1 = (processNum1)*30;
|
|
int runPlanSeconds1 = (processNum1)*30;
|
|
@@ -422,7 +441,7 @@ public class ApsServiceImpl implements ApsService {
|
|
if(productionProcesses.getRooprocess() != null){
|
|
if(productionProcesses.getRooprocess() != null){
|
|
productionProcesses.getApsOverallConfig().setStartTime(productionProcesses.getRooprocess().getApsOverallConfig().getStartTime());
|
|
productionProcesses.getApsOverallConfig().setStartTime(productionProcesses.getRooprocess().getApsOverallConfig().getStartTime());
|
|
}
|
|
}
|
|
- if(relPros.containsKey(productionProcesses.getId())){
|
|
|
|
|
|
+ if(relPros.size()>1 && relPros.containsKey(productionProcesses.getId())){
|
|
Map<String, List<ProductionProcesses>> stringListMap = relPros.get(productionProcesses.getId());
|
|
Map<String, List<ProductionProcesses>> stringListMap = relPros.get(productionProcesses.getId());
|
|
productionProcesses.setPreviousProcesses(stringListMap.get("pres"));
|
|
productionProcesses.setPreviousProcesses(stringListMap.get("pres"));
|
|
productionProcesses.setNextProcesses(stringListMap.get("nexts"));
|
|
productionProcesses.setNextProcesses(stringListMap.get("nexts"));
|