|
@@ -4358,7 +4358,7 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void apsScheduleRestart(Integer hour, String chongpaiStartDateStr, String chongpaiEndDateStr, SysUserVo currentUser, String blankIds, Boolean haveLenZha, Boolean haveTuiHuo) {
|
|
|
+ public void apsScheduleRestart(Integer hour, String chongpaiStartDateStr, String chongpaiEndDateStr, SysUserVo currentUser, String blankIds, Boolean haveLenZha, Boolean haveTuiHuo, Boolean needPushData) {
|
|
|
if (currentUser == null) {
|
|
|
currentUser = CXCommonUtils.getCurrentUser();
|
|
|
}
|
|
@@ -4417,19 +4417,6 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
|
|
|
|
|
|
//将实际完工时间大于明天的作业挪到实际完工时间
|
|
|
this.baseMapper.updateFinishDateAboutProcessEqu(needScheduleDate, tenantId, chongpaiStartDate, chongpaiEndDate);
|
|
|
- //错误数据纠正挪动
|
|
|
- int safeCount = 0;
|
|
|
- while (true) {
|
|
|
- int updateCount = this.baseMapper.moveErrorProcessEqu(chongpaiStartDate, chongpaiEndDate, CXCommonUtils.getCurrentUserFactoryId(currentUser), apsScheduleConfigDo.getWorkshopin(), apsScheduleConfigDo.getWorkshopcross());
|
|
|
- if (updateCount <= 0) {
|
|
|
- break;
|
|
|
- }
|
|
|
- //安全设置,防止死循环
|
|
|
- safeCount += 1;
|
|
|
- if (safeCount >= 50) {
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
// int safeCount2 = 0;
|
|
|
// while (true) {
|
|
|
// int updateCount2 = this.baseMapper.moveErrorProcessEqu2(chongpaiStartDate, chongpaiEndDate, CXCommonUtils.getCurrentUserFactoryId(currentUser));
|
|
@@ -4526,12 +4513,13 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
|
|
|
.set(ApsProcessOperationDo::getLockmark, "n")
|
|
|
.in(ApsProcessOperationDo::getId, unLockingProcessIdList));
|
|
|
}
|
|
|
-
|
|
|
- log.info("开始推算调度时间之后的重叠数据");
|
|
|
- //推算非退火、非铸轧的重叠数据,按序排列
|
|
|
- sortLenZha(chongpaiEndDate, tenantId);
|
|
|
- //推算退火,按序排列
|
|
|
- sortTuiHuo(chongpaiEndDate, tenantId);
|
|
|
+ if (needPushData) {
|
|
|
+ log.info("开始推算调度时间之后的重叠数据");
|
|
|
+ //推算非退火、非铸轧的重叠数据,按序排列
|
|
|
+ sortLenZha(chongpaiEndDate, tenantId);
|
|
|
+ //推算退火,按序排列
|
|
|
+ sortTuiHuo(chongpaiEndDate, tenantId);
|
|
|
+ }
|
|
|
log.info("调度排程结束");
|
|
|
}
|
|
|
}
|
|
@@ -4788,7 +4776,11 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- apsScheduleRestart(null, needScheduleStartDate, needScheduleEndDate, currentUser, null, true, true);
|
|
|
+ //冷轧1天
|
|
|
+ String lenzhaEndDate = DateUtil.format(DateUtil.offsetDay(DateUtil.parse(needScheduleStartDate), 1), "yyyy-MM-dd HH:mm:ss");
|
|
|
+ apsScheduleRestart(null, needScheduleStartDate, lenzhaEndDate, currentUser, null, true, false, false);
|
|
|
+ //退火5天
|
|
|
+ apsScheduleRestart(null, needScheduleStartDate, needScheduleEndDate, currentUser, null, false, true, true);
|
|
|
} catch (Exception e) {
|
|
|
log.error(e);
|
|
|
return "success";
|
|
@@ -4853,6 +4845,19 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
|
|
|
}
|
|
|
|
|
|
private void tuihuoChongpai(DateTime chongpaiStartDate, DateTime chongpaiEndDate, ApsScheduleConfigDo apsScheduleConfigDo, SysUserVo currentUser, List<String> blankIdsList) {
|
|
|
+ //错误数据纠正挪动
|
|
|
+ int safeCount = 0;
|
|
|
+ while (true) {
|
|
|
+ int updateCount = this.baseMapper.moveErrorProcessEqu(chongpaiStartDate, chongpaiEndDate, CXCommonUtils.getCurrentUserFactoryId(currentUser), apsScheduleConfigDo.getWorkshopin(), apsScheduleConfigDo.getWorkshopcross(), "退火");
|
|
|
+ if (updateCount <= 0) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ //安全设置,防止死循环
|
|
|
+ safeCount += 1;
|
|
|
+ if (safeCount >= 50) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
//退火重排
|
|
|
//查询在重排时间段的所有作业明细信息,只包括:成退、中退、小卷成退
|
|
|
List<ApsProcessOperationProcessEquDo> needScheduleList = this.baseMapper.selectNeedRescheduleEqu2(chongpaiStartDate, chongpaiEndDate, CXCommonUtils.getCurrentUserFactoryId(currentUser), apsScheduleConfigDo.getWorkshopin(), apsScheduleConfigDo.getWorkshopcross(), blankIdsList);
|
|
@@ -4953,6 +4958,19 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
|
|
|
}
|
|
|
|
|
|
private void lenzhaChongpai(DateTime chongpaiStartDate, DateTime chongpaiEndDate, ApsScheduleConfigDo apsScheduleConfigDo, SysUserVo currentUser, List<String> blankIdsList) {
|
|
|
+ //错误数据纠正挪动
|
|
|
+ int safeCount = 0;
|
|
|
+ while (true) {
|
|
|
+ int updateCount = this.baseMapper.moveErrorProcessEqu(chongpaiStartDate, chongpaiEndDate, CXCommonUtils.getCurrentUserFactoryId(currentUser), apsScheduleConfigDo.getWorkshopin(), apsScheduleConfigDo.getWorkshopcross(), "冷轧");
|
|
|
+ if (updateCount <= 0) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ //安全设置,防止死循环
|
|
|
+ safeCount += 1;
|
|
|
+ if (safeCount >= 50) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
//查询需要重排的所有明细信息
|
|
|
List<ApsProcessOperationProcessEquDo> needScheduleList = this.baseMapper.selectNeedRescheduleEqu3(chongpaiStartDate, chongpaiEndDate, CXCommonUtils.getCurrentUserFactoryId(currentUser), apsScheduleConfigDo.getWorkshopin(), apsScheduleConfigDo.getWorkshopcross(), blankIdsList);
|
|
|
if (needScheduleList.isEmpty()) {
|