浏览代码

Merge branch 'master' of http://123.57.213.14:3001/zgzt/dosb-java into master

lingpeng.li 1 月之前
父节点
当前提交
d817372875

+ 23 - 23
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/controller/BilletHotsendChangeShiftController.java

@@ -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 执行的任务逻辑
 

+ 2 - 2
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/service/impl/BilletHotsendChangeShiftServiceImpl.java

@@ -156,8 +156,8 @@ public class BilletHotsendChangeShiftServiceImpl extends ServiceImpl<BilletHotse
     public JSONObject autoChangeShiftHandle(BilletHotsendChangeShift billetHotsendChangeShiftVo) {
         JSONObject result = new JSONObject();
         // 缓存交班索引ID
-        String nextshiftIdKey = String.format("class:nextshift:Id:%s", "5-6");
-        List<String> ccmNoList = Arrays.asList("5", "6");
+        String nextshiftIdKey = String.format("class:nextshift:Id:%s", "6");
+        List<String> ccmNoList = Arrays.asList("6");
         for (String ccmNo : ccmNoList){
             String keyShiftGroup = String.format("class:shift:group:%s", ccmNo);
             String keyShift = String.format("class:shift:%s", ccmNo);