qiangxuan 3 달 전
부모
커밋
1337333c0f

+ 20 - 20
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);

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

@@ -156,7 +156,7 @@ 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");
+        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);