qiangxuan 3 ヶ月 前
コミット
c3e2141b2b

+ 21 - 21
zgzt-sys-java/jeecg-module-conn/src/main/java/org/jeecg/modules/billetActual/service/impl/BilletHotsendChangeShiftServiceImpl.java

@@ -59,7 +59,7 @@ public class BilletHotsendChangeShiftServiceImpl extends ServiceImpl<BilletHotse
         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", "5");
         String currentCacheId = oConvertUtils.getString(redisTemplate.opsForValue().get(nextshiftIdKey));
 
         log.info(DateUtils.date2Str(new Date(), DateUtils.datetimeFormat.get()) + " C端自动化当前班次信息值:" + sixShift+ ","+ sixShiftGroup);
@@ -95,25 +95,25 @@ public class BilletHotsendChangeShiftServiceImpl extends ServiceImpl<BilletHotse
         log.info(DateUtils.date2Str(new Date(), DateUtils.datetimeFormat.get()) + " C端自动化下一个班次信息名:" + nextUniqueShiftId + "," + nextShiftGroupName + ","+ nextShiftName);
 
         // 查询当天的交班记录
-        LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapperCS = new LambdaQueryWrapper<>();
-        queryWrapperCS.between(BilletHotsendChangeShift::getCreateTime, DateUtils.getStartOfDay(), DateUtils.getEndOfDay());
-        List<BilletHotsendChangeShift> billetHotsendChangeShiftList = baseMapper.selectList(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("C端自动化交班,当天不能重复交班! {}", 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 = baseMapper.selectList(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("C端自动化交班,当天不能重复交班! {}", 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);
@@ -125,7 +125,7 @@ public class BilletHotsendChangeShiftServiceImpl extends ServiceImpl<BilletHotse
     private 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", "5");
         List<String> ccmNoList = Arrays.asList("5");
         for (String ccmNo : ccmNoList){
             String keyShiftGroup = String.format("class:shift:group:%s", ccmNo);