|
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
import com.rongwei.rwapsserver.aps.domain.ApsSolution;
|
|
|
import com.rongwei.rwapsserver.aps.domain.EquipmentRunTime;
|
|
|
import com.rongwei.rwapsserver.aps.domain.ProductionProcesses;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.optaplanner.core.api.domain.variable.VariableListener;
|
|
|
import org.optaplanner.core.api.score.director.ScoreDirector;
|
|
|
import java.time.LocalDateTime;
|
|
@@ -13,6 +14,7 @@ import java.util.*;
|
|
|
/**
|
|
|
* 设备赋值后任务起止时间自动计算
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
public class TaskStartTimeListener implements VariableListener<ApsSolution, ProductionProcesses> {
|
|
|
|
|
|
@Override
|
|
@@ -113,9 +115,14 @@ public class TaskStartTimeListener implements VariableListener<ApsSolution, Prod
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ /*if("6473acca9af24b95956a891520b21357".equals(previousProcess.getId())){
|
|
|
+ log.info("最大等待时间处理-当前工序开始时间:"+startTime);
|
|
|
+ }*/
|
|
|
scoreDirector.beforeVariableChanged(process, "startTime");
|
|
|
previousProcess.setStartTime(startTime);
|
|
|
scoreDirector.afterVariableChanged(process, "startTime");
|
|
|
+ // 递归前道工序时间处理
|
|
|
+// preProcessCheck(scoreDirector,previousProcess);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -385,6 +392,13 @@ public class TaskStartTimeListener implements VariableListener<ApsSolution, Prod
|
|
|
}
|
|
|
toUpdateStartTime = proStartTime;
|
|
|
}
|
|
|
+
|
|
|
+ /*if("6473acca9af24b95956a891520b21357".equals(process.getId())){
|
|
|
+ log.info("前道工序开始时间:"+process.getPreviousProcesses().get(0).getStartTime());
|
|
|
+ log.info("前道工序结束时间:"+process.getPreviousProcesses().get(0).getEndTime());
|
|
|
+
|
|
|
+ log.info("当前工序开始时间:"+toUpdateStartTime);
|
|
|
+ }*/
|
|
|
}
|
|
|
return toUpdateStartTime;
|
|
|
}
|