|
@@ -32,6 +32,7 @@ import java.math.RoundingMode;
|
|
|
import java.time.Duration;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
+import java.time.temporal.ChronoUnit;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -67,7 +68,7 @@ public class ApsServiceImpl implements ApsService {
|
|
|
Integer losinttime = lostime.setScale(0, RoundingMode.CEILING).intValue();
|
|
|
totaltime = totaltime + losinttime;
|
|
|
}*/
|
|
|
- totaltime = totaltime + 60*6;
|
|
|
+// totaltime = totaltime + 60*6;
|
|
|
// 全局配置
|
|
|
ApsOverallConfig apsOverallConfig = new ApsOverallConfig();
|
|
|
BeanUtil.copyProperties(process.getApsOverallConfig(),apsOverallConfig);
|
|
@@ -427,6 +428,51 @@ public class ApsServiceImpl implements ApsService {
|
|
|
}*/
|
|
|
return a;
|
|
|
});
|
|
|
+
|
|
|
+ // 非整点退火炉设置可合并的
|
|
|
+ List<EquipmentRunTime> fzds = new ArrayList<>();
|
|
|
+ for (Equipment equipment : apsSolutionTh.getEquipmentList()) {
|
|
|
+ if(equipment.getEquipmentRunTimes() != null && equipment.getEquipmentRunTimes().size() > 0 && equipment.getEquipmentName().contains("退火")){
|
|
|
+ for (EquipmentRunTime equipmentRunTime : equipment.getEquipmentRunTimes()) {
|
|
|
+ if(equipmentRunTime.getStartRunTime() != null){
|
|
|
+ // 非整点数据添加
|
|
|
+ if(equipmentRunTime.getStartRunTime().getMinute()>0 || equipmentRunTime.getStartRunTime().getSecond()>0){
|
|
|
+ fzds.add(equipmentRunTime);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(fzds != null && fzds.size()>0){
|
|
|
+ for (EquipmentRunTime fzd : fzds) {
|
|
|
+ for (ProductionProcesses productionProcesses : apsSolutionTh.getProcessesList()) {
|
|
|
+ if (fzd.getStartRunTime().compareTo(productionProcesses.getApsOverallConfig().getStartTime())>0 && (fzd.getStartRunTime().getMinute()>0 || fzd.getStartRunTime().getSecond()>0)){
|
|
|
+ if(fzd.getStartRunTime().getSecond()>0){
|
|
|
+ fzd.setStartRunTime(fzd.getStartRunTime().truncatedTo(ChronoUnit.MINUTES));
|
|
|
+ }
|
|
|
+ if(fzd.getEndRunTime().getSecond()>0){
|
|
|
+ fzd.setEndRunTime(fzd.getEndRunTime().truncatedTo(ChronoUnit.MINUTES));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 使用Duration类计算两个LocalDateTime之间的差异
|
|
|
+ Duration duration = Duration.between(productionProcesses.getApsOverallConfig().getStartTime(), fzd.getStartRunTime());
|
|
|
+ // 将差异转换为分钟
|
|
|
+ long minutes = duration.toMinutes();
|
|
|
+ if(productionProcesses.getThFzdDelays() == null){
|
|
|
+ productionProcesses.setThFzdDelays(new ArrayList<>());
|
|
|
+ productionProcesses.getThFzdDelays().add((int) minutes);
|
|
|
+ }else{
|
|
|
+ productionProcesses.getThFzdDelays().add((int) minutes);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (ProductionProcesses productionProcesses : apsSolutionTh.getProcessesList()) {
|
|
|
+ Collections.sort(productionProcesses.getThFzdDelays());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
ApsSolution solvedBalance1 = solver1.solve(apsSolutionTh);
|