|
@@ -3,6 +3,7 @@ package com.rongwei.bscommon.sys.service.impl;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.date.DateField;
|
|
import cn.hutool.core.date.DateField;
|
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.StopWatch;
|
|
import cn.hutool.core.date.StopWatch;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
@@ -3939,4 +3940,33 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
|
|
}
|
|
}
|
|
return R.ok(res);
|
|
return R.ok(res);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void apsScheduleRestart() {
|
|
|
|
+ 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)) {
|
|
|
|
+ //将实际完工时间大于明天的作业挪到实际完工时间
|
|
|
|
+ this.baseMapper.updateFinishDateAboutProcessEqu();
|
|
|
|
+ //解锁明天有开工作业明细的坯料计划的所有作业明细
|
|
|
|
+ this.baseMapper.removeLockNextDayProcessEqu(needScheduleDate);
|
|
|
|
+ //解锁后天开工的所有作业明细
|
|
|
|
+ this.baseMapper.removeLockNextTwoDayProcessEqu(needScheduleDate);
|
|
|
|
+ //重新排程
|
|
|
|
+ apsService.apsSchedule(new ArrayList<>(), null, null);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|