|
@@ -736,7 +736,7 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
|
|
|
*/
|
|
|
@Override
|
|
|
public void blankOrderAps(List<ApsBlankOrderVo> apsBlankOrders) {
|
|
|
- apsService.apsSchedule(apsBlankOrders, new ApsTypeVo(), null, null);
|
|
|
+ apsService.apsSchedule(apsBlankOrders, new ApsTypeVo(), null, null, null);
|
|
|
// //调度排程
|
|
|
// //判断是否是 18:00:00-24:00:00/00:00:00-5:00:00
|
|
|
// // 获取当前时间
|
|
@@ -3443,7 +3443,7 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
|
|
|
public void insertSchedule(Map<String, Object> params) {
|
|
|
List<ApsBlankOrderVo> apsBlankOrders = apsBlankOrderDao.getByOrderBlanckId(params.get("PRODUCTIONORDERID").toString(), params.get("BLANKORDERID").toString());
|
|
|
if (apsBlankOrders != null && apsBlankOrders.size() > 0) {
|
|
|
- apsService.apsSchedule(apsBlankOrders, new ApsTypeVo(), null, null);
|
|
|
+ apsService.apsSchedule(apsBlankOrders, new ApsTypeVo(), null, null, null);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -4144,30 +4144,37 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void apsScheduleRestart(Integer hour) {
|
|
|
+ public void apsScheduleRestart(Integer hour, String chongpaiStartDateStr, String chongpaiEndDateStr) {
|
|
|
ApsUtils.checkScheduling(null);
|
|
|
String needScheduleDate = "";
|
|
|
- DateTime nowDate = DateUtil.date();
|
|
|
- String time1 = DateUtil.format(nowDate, "yyyy-MM-dd 00:00:00");
|
|
|
- String time2 = DateUtil.format(nowDate, "yyyy-MM-dd 12:00:00");
|
|
|
- String time3 = DateUtil.format(nowDate, "yyyy-MM-dd 23:59:59");
|
|
|
- String now = DateUtil.format(nowDate, "yyyy-MM-dd HH:mm:ss");
|
|
|
- //如果当前时间在0-12点,重排明天的
|
|
|
- //如果当前时间在12-24点,重排后天的
|
|
|
- if (now.compareTo(time1) >= 0 && now.compareTo(time2) < 0) {
|
|
|
- needScheduleDate = DateUtil.format(DateUtil.offsetDay(nowDate, 1), "yyyy-MM-dd");
|
|
|
- }
|
|
|
- if (now.compareTo(time2) >= 0 && now.compareTo(time3) <= 0) {
|
|
|
- needScheduleDate = DateUtil.format(DateUtil.offsetDay(nowDate, 2), "yyyy-MM-dd");
|
|
|
- }
|
|
|
-
|
|
|
- if (ObjectUtil.isNotEmpty(needScheduleDate)) {
|
|
|
+ DateTime chongpaiStartDate = null;
|
|
|
+ DateTime chongpaiEndDate = null;
|
|
|
+ if (ObjectUtil.isEmpty(chongpaiStartDateStr) || ObjectUtil.isEmpty(chongpaiEndDateStr)) {
|
|
|
+ DateTime nowDate = DateUtil.date();
|
|
|
+ String time1 = DateUtil.format(nowDate, "yyyy-MM-dd 00:00:00");
|
|
|
+ String time2 = DateUtil.format(nowDate, "yyyy-MM-dd 12:00:00");
|
|
|
+ String time3 = DateUtil.format(nowDate, "yyyy-MM-dd 23:59:59");
|
|
|
+ String now = DateUtil.format(nowDate, "yyyy-MM-dd HH:mm:ss");
|
|
|
+ //如果当前时间在0-12点,重排明天的
|
|
|
+ //如果当前时间在12-24点,重排后天的
|
|
|
+ if (now.compareTo(time1) >= 0 && now.compareTo(time2) < 0) {
|
|
|
+ needScheduleDate = DateUtil.format(DateUtil.offsetDay(nowDate, 1), "yyyy-MM-dd");
|
|
|
+ }
|
|
|
+ if (now.compareTo(time2) >= 0 && now.compareTo(time3) <= 0) {
|
|
|
+ needScheduleDate = DateUtil.format(DateUtil.offsetDay(nowDate, 2), "yyyy-MM-dd");
|
|
|
+ }
|
|
|
//计算重排开始时间和结束时间
|
|
|
- DateTime chongpaiStartDate = DateUtil.parseDate(needScheduleDate);
|
|
|
- DateTime chongpaiEndDate = DateUtil.endOfDay(chongpaiStartDate);
|
|
|
+ chongpaiStartDate = DateUtil.parseDate(needScheduleDate);
|
|
|
+ chongpaiEndDate = DateUtil.endOfDay(chongpaiStartDate);
|
|
|
if (ObjectUtil.isNotEmpty(hour)) {
|
|
|
chongpaiEndDate = DateUtil.offsetHour(chongpaiStartDate, hour);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ chongpaiStartDate = DateUtil.parseDate(chongpaiEndDateStr);
|
|
|
+ chongpaiEndDate = DateUtil.parseDate(chongpaiEndDateStr);
|
|
|
+ needScheduleDate = DateUtil.format(chongpaiStartDate, "yyyy-MM-dd");
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(needScheduleDate)) {
|
|
|
|
|
|
//将实际完工时间大于明天的作业挪到实际完工时间
|
|
|
this.baseMapper.updateFinishDateAboutProcessEqu(needScheduleDate, CXCommonUtils.getCurrentUserFactoryId(null));
|
|
@@ -4453,7 +4460,7 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
|
|
|
needUnLockProcessIdList.addAll(notNeedUnLockProcessIdList);
|
|
|
needUnLockProcessIdList = needUnLockProcessIdList.stream().distinct().collect(Collectors.toList());
|
|
|
log.info("所有传入退火排程的作业ID:{}", needUnLockProcessIdList);
|
|
|
- apsService.apsSchedule(new ArrayList<>(), apsTypeVo, null, needUnLockProcessIdList);
|
|
|
+ apsService.apsSchedule(new ArrayList<>(), apsTypeVo, null, needUnLockProcessIdList, chongpaiStartDate);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -4617,7 +4624,7 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
|
|
|
needUnLockProcessIdList.addAll(notNeedUnLockProcessIdList);
|
|
|
needUnLockProcessIdList = needUnLockProcessIdList.stream().distinct().collect(Collectors.toList());
|
|
|
log.info("所有传入冷轧排程的作业ID:{}", needUnLockProcessIdList);
|
|
|
- apsService.apsSchedule(new ArrayList<>(), apsTypeVo, null, needUnLockProcessIdList);
|
|
|
+ apsService.apsSchedule(new ArrayList<>(), apsTypeVo, null, needUnLockProcessIdList, chongpaiStartDate);
|
|
|
|
|
|
}
|
|
|
|