|
@@ -100,7 +100,7 @@ public class ApsServiceImpl implements ApsService {
|
|
|
* @param needUnLockProcessIdList 需要过滤的工序作业ID集合
|
|
|
*/
|
|
|
@Override
|
|
|
- public void apsSchedule(List<ApsBlankOrderVo> apsBlankOrders, ApsTypeVo apsType, SysUserVo currentUser, List<String> needUnLockProcessIdList, DateTime scheduleStartDate) {
|
|
|
+ public void apsSchedule(List<ApsBlankOrderVo> apsBlankOrders, ApsTypeVo apsType, SysUserVo currentUser, List<String> needUnLockProcessIdList, DateTime scheduleStartDate, DateTime apsPlanEndDate) {
|
|
|
logger.info("**********排程请求开始**********");
|
|
|
DateTime startTime = DateUtil.date();
|
|
|
if (apsType.getScheduleType() == null) {
|
|
@@ -163,7 +163,7 @@ public class ApsServiceImpl implements ApsService {
|
|
|
redisService.redisCatchInit("aps-blankids-" + tenantId, bidsStr, 3600 * 24);
|
|
|
// 冷轧连续性问题重排
|
|
|
if (apsType != null && StrUtil.isNotBlank(apsType.getScheduleType()) && "dd".equals(apsType.getScheduleType())) {
|
|
|
- lzlxOrderSchedule(apsBlankOrders, currentUser, apsType, needUnLockProcessIdList, scheduleStartDate, startTime);
|
|
|
+ lzlxOrderSchedule(apsBlankOrders, currentUser, apsType, needUnLockProcessIdList, scheduleStartDate, apsPlanEndDate, startTime);
|
|
|
} else {
|
|
|
apsOrderScheduleNew(apsBlankOrders, currentUser, apsType, needUnLockProcessIdList, startTime);
|
|
|
}
|
|
@@ -399,7 +399,7 @@ public class ApsServiceImpl implements ApsService {
|
|
|
Date finalApsPlanStartDate = apsPlanStartDate;
|
|
|
if (cdorders != null && cdorders.size() > 0) {
|
|
|
try {
|
|
|
- apsOrderScheduleApsNew(cdorders, currentUser, allEqs, finalApsPlanStartDate, apsType, needUnLockProcessIdList, startTime);
|
|
|
+ apsOrderScheduleApsNew(cdorders, currentUser, allEqs, finalApsPlanStartDate, null, apsType, needUnLockProcessIdList, startTime);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
logger.info("排程异常", e);
|
|
@@ -495,7 +495,7 @@ public class ApsServiceImpl implements ApsService {
|
|
|
}
|
|
|
return a;
|
|
|
});
|
|
|
- apsOrderScheduleApsNew(v, currentUser, allEqs, finalApsPlanStartDate, apsType, null, startTime);
|
|
|
+ apsOrderScheduleApsNew(v, currentUser, allEqs, finalApsPlanStartDate, null, apsType, null, startTime);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
logger.info("排程异常", e);
|
|
@@ -526,7 +526,7 @@ public class ApsServiceImpl implements ApsService {
|
|
|
* @param apsBlankOrders
|
|
|
* @param currentUser
|
|
|
*/
|
|
|
- private void lzlxOrderSchedule(List<ApsBlankOrderVo> apsBlankOrders, SysUserVo currentUser, ApsTypeVo apsType, List<String> needUnLockProcessIdList, DateTime scheduleStartDate, DateTime startTime) {
|
|
|
+ private void lzlxOrderSchedule(List<ApsBlankOrderVo> apsBlankOrders, SysUserVo currentUser, ApsTypeVo apsType, List<String> needUnLockProcessIdList, DateTime scheduleStartDate, DateTime apsPlanEndDate, DateTime startTime) {
|
|
|
logger.info("调度排程开始...");
|
|
|
// 坯料计划排序
|
|
|
Collections.sort(apsBlankOrders, (v1, v2) -> {
|
|
@@ -630,10 +630,10 @@ public class ApsServiceImpl implements ApsService {
|
|
|
// needScheduleDate = DateUtil.format(DateUtil.offsetDay(nowDate, 2), "yyyy-MM-dd");
|
|
|
// }
|
|
|
// DateTime chongpaiStartDate = DateUtil.parseDate(needScheduleDate);
|
|
|
- apsOrderScheduleApsNew(apsBlankOrders, currentUser, allEqs, scheduleStartDate, apsType, needUnLockProcessIdList, startTime);
|
|
|
+ apsOrderScheduleApsNew(apsBlankOrders, currentUser, allEqs, scheduleStartDate, apsPlanEndDate, apsType, needUnLockProcessIdList, startTime);
|
|
|
}
|
|
|
|
|
|
- private void apsOrderScheduleApsNew(List<ApsBlankOrderVo> apsBlankOrders, SysUserVo currentUser, Map<String, Equipment> allEqs, Date apsPlanStartDate, ApsTypeVo apsType, List<String> needUnLockProcessIdList, DateTime startTime) {
|
|
|
+ private void apsOrderScheduleApsNew(List<ApsBlankOrderVo> apsBlankOrders, SysUserVo currentUser, Map<String, Equipment> allEqs, Date apsPlanStartDate, Date apsPlanEndDate, ApsTypeVo apsType, List<String> needUnLockProcessIdList, DateTime startTime) {
|
|
|
// 设备数据每批次开始清空
|
|
|
allEqs.clear();
|
|
|
// 排程前解锁所有待排程订单
|
|
@@ -784,7 +784,7 @@ public class ApsServiceImpl implements ApsService {
|
|
|
//日志写入文件
|
|
|
logWriter(JSONUtil.toJsonStr(apsProductionSchedule, jsonConfig), JSONUtil.toJsonStr(productionScheduleRetVo, jsonConfig), apsType.getScheduleType());
|
|
|
//排程日志存入数据库
|
|
|
- logSave(currentUser, startTime, endTime, apsType, apsPlanStartDate, productionScheduleRetVo);
|
|
|
+ logSave(currentUser, startTime, endTime, apsType, apsPlanStartDate, apsPlanEndDate, productionScheduleRetVo);
|
|
|
if (!"200".equals(productionScheduleRetVo.getCode())) {
|
|
|
logger.info("排程异常,坯料计划ID:" + blankOrderIds);
|
|
|
// 排程异常后恢复历史排程结果为锁定状态
|
|
@@ -857,7 +857,7 @@ public class ApsServiceImpl implements ApsService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void logSave(SysUserVo currentUser, DateTime startTime, DateTime endTime, ApsTypeVo apsType, Date apsPlanStartDate, ProductionScheduleRetVo productionScheduleRetVo) {
|
|
|
+ private void logSave(SysUserVo currentUser, DateTime startTime, DateTime endTime, ApsTypeVo apsType, Date apsPlanStartDate, Date apsPlanEndDate, ProductionScheduleRetVo productionScheduleRetVo) {
|
|
|
try {
|
|
|
ApsScheduleLogDo apsScheduleLogDo = new ApsScheduleLogDo();
|
|
|
apsScheduleLogDo.setId(SecurityUtil.getUUID());
|
|
@@ -869,7 +869,7 @@ public class ApsServiceImpl implements ApsService {
|
|
|
if ("dd".equals(apsType.getScheduleType())) {
|
|
|
apsScheduleLogDo.setScheduletype("调度排程");
|
|
|
apsScheduleLogDo.setSchedulestarttime(apsPlanStartDate);
|
|
|
- apsScheduleLogDo.setScheduleendtime(DateUtil.endOfDay(apsPlanStartDate));
|
|
|
+ apsScheduleLogDo.setScheduleendtime(apsPlanEndDate);
|
|
|
} else {
|
|
|
apsScheduleLogDo.setScheduletype("预排程");
|
|
|
}
|