|
@@ -368,7 +368,7 @@ public class BilletHotsendChangeShiftController extends JeecgController<BilletHo
|
|
|
String currentShiftGroupName = ShiftGroupEnum.fromCode(sixShiftGroup).name();
|
|
|
String currentShiftName = ShiftEnum.fromCode(sixShift).name().replace("班", "");
|
|
|
|
|
|
- String nextshiftIdKey = String.format("class:nextshift:Id:%s", "5-6");
|
|
|
+ String nextshiftIdKey = String.format("class:nextshift:Id:%s", "6");
|
|
|
String currentCacheId = oConvertUtils.getString(redisTemplate.opsForValue().get(nextshiftIdKey));
|
|
|
|
|
|
log.info(DateUtils.date2Str(new Date(), DateUtils.datetimeFormat.get()) + " 当前班次信息值:" + sixShift+ ","+ sixShiftGroup);
|
|
@@ -404,25 +404,25 @@ public class BilletHotsendChangeShiftController extends JeecgController<BilletHo
|
|
|
log.info(DateUtils.date2Str(new Date(), DateUtils.datetimeFormat.get()) + " 下一个班次信息名:" + nextUniqueShiftId + "," + nextShiftGroupName + ","+ nextShiftName);
|
|
|
|
|
|
// 查询当天的交班记录
|
|
|
- LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapperCS = new LambdaQueryWrapper<>();
|
|
|
- queryWrapperCS.between(BilletHotsendChangeShift::getCreateTime, DateUtils.getStartOfDay(), DateUtils.getEndOfDay());
|
|
|
- List<BilletHotsendChangeShift> billetHotsendChangeShiftList = billetHotsendChangeShiftService.list(queryWrapperCS);
|
|
|
-
|
|
|
- String nextShiftAndShiftGroupInfo = String.join(",", finalNextShiftVal, finalNextShiftGroupVal);
|
|
|
-
|
|
|
- if (oConvertUtils.listIsNotEmpty(billetHotsendChangeShiftList)) {
|
|
|
- boolean exists = billetHotsendChangeShiftList.stream()
|
|
|
- .map(x -> String.join(",", x.getShift(), x.getShiftGroup()))
|
|
|
- .anyMatch(s -> s.equals(nextShiftAndShiftGroupInfo));
|
|
|
- if (exists) {
|
|
|
- log.info("自动交班,当天不能重复交班! {}", new Date());
|
|
|
- // 自动交班失败,交班ID索引值回滚,保证交班顺序
|
|
|
- String nextCacheIdRollBack = oConvertUtils.getString(redisTemplate.opsForValue().get(nextshiftIdKey));
|
|
|
- int nextCacheIdRollBacks = Integer.parseInt(nextCacheIdRollBack);
|
|
|
- redisTemplate.opsForValue().set(nextshiftIdKey, nextCacheIdRollBacks - 1);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
+// LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapperCS = new LambdaQueryWrapper<>();
|
|
|
+// queryWrapperCS.between(BilletHotsendChangeShift::getCreateTime, DateUtils.getStartOfDay(), DateUtils.getEndOfDay());
|
|
|
+// List<BilletHotsendChangeShift> billetHotsendChangeShiftList = billetHotsendChangeShiftService.list(queryWrapperCS);
|
|
|
+//
|
|
|
+// String nextShiftAndShiftGroupInfo = String.join(",", finalNextShiftVal, finalNextShiftGroupVal);
|
|
|
+//
|
|
|
+// if (oConvertUtils.listIsNotEmpty(billetHotsendChangeShiftList)) {
|
|
|
+// boolean exists = billetHotsendChangeShiftList.stream()
|
|
|
+// .map(x -> String.join(",", x.getShift(), x.getShiftGroup()))
|
|
|
+// .anyMatch(s -> s.equals(nextShiftAndShiftGroupInfo));
|
|
|
+// if (exists) {
|
|
|
+// log.info("自动交班,当天不能重复交班! {}", new Date());
|
|
|
+// // 自动交班失败,交班ID索引值回滚,保证交班顺序
|
|
|
+// String nextCacheIdRollBack = oConvertUtils.getString(redisTemplate.opsForValue().get(nextshiftIdKey));
|
|
|
+// int nextCacheIdRollBacks = Integer.parseInt(nextCacheIdRollBack);
|
|
|
+// redisTemplate.opsForValue().set(nextshiftIdKey, nextCacheIdRollBacks - 1);
|
|
|
+// return;
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
BilletHotsendChangeShift billetHotsendChangeShiftVo = new BilletHotsendChangeShift();
|
|
|
billetHotsendChangeShiftVo.setShiftGroup(finalNextShiftGroupVal);
|
|
@@ -432,7 +432,7 @@ public class BilletHotsendChangeShiftController extends JeecgController<BilletHo
|
|
|
}
|
|
|
|
|
|
|
|
|
- @Scheduled(cron = "0 1 0 * * ?")
|
|
|
+ @Scheduled(cron = "0 5 0 * * ?")
|
|
|
public void runAtMidnight() {
|
|
|
// 每天 00:00:05 执行的任务逻辑
|
|
|
|
|
@@ -454,7 +454,7 @@ public class BilletHotsendChangeShiftController extends JeecgController<BilletHo
|
|
|
executeShiftTask88();
|
|
|
}
|
|
|
|
|
|
- @Scheduled(cron = "0 1 8 * * ?")
|
|
|
+ @Scheduled(cron = "0 5 8 * * ?")
|
|
|
public void runAtEight() {
|
|
|
// 08:05:00 执行的任务逻辑
|
|
|
|
|
@@ -476,7 +476,7 @@ public class BilletHotsendChangeShiftController extends JeecgController<BilletHo
|
|
|
executeShiftTask88();
|
|
|
}
|
|
|
|
|
|
- @Scheduled(cron = "0 1 16 * * ?")
|
|
|
+ @Scheduled(cron = "0 5 16 * * ?")
|
|
|
public void runAtFourPm() {
|
|
|
// 16:00:05 执行的任务逻辑
|
|
|
|