Browse Source

bugFix
1.解决任务没有按照次数生成的问题

xiahan 10 months ago
parent
commit
e4e925a728

+ 2 - 1
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/CheckTemplateServiceImpl.java

@@ -313,6 +313,7 @@ public class CheckTemplateServiceImpl extends ServiceImpl<CheckTemplateDao, Chec
         List<PointCheckDo> pointChecks = new ArrayList<>();
         List<PointCheckItemDo> pointCheckItems = new ArrayList<>();
         Map<PointCheckNewsVo,List<String>> notifyType = new HashMap<>();
+        int index=0;
         // 每班几次就生成几个任务
         for(List<CheckTemplateItemsDo> checkItems:items){
             // 点检名称 班次+模板名称+当前日期
@@ -323,7 +324,6 @@ public class CheckTemplateServiceImpl extends ServiceImpl<CheckTemplateDao, Chec
             String templatetype = checkTemplate.getTemplatetype();
             if(StringUtils.isNotEmpty(checkitemsids)){
                 String[] checkitemsidArray = checkitemsids.split(",");
-                int index=0;
                 for (String checkitemsid : checkitemsidArray) {
                     // 每个设备生成一条点检任务
                     CheckItemsDo checkItemsdo = checkItemsService.getById(checkitemsid);
@@ -452,6 +452,7 @@ public class CheckTemplateServiceImpl extends ServiceImpl<CheckTemplateDao, Chec
         }
 
         if(!notifyType.isEmpty()){
+            logger.debug("如下数据:{}需要生产点检任务,班次为:{}",notifyType,shift);
             List<SysDictDo> dictsByType = commonDictService.getDictsByType("template-type");
             notifyType.forEach((k,v)-> {
                 String pointcheckname = k.getPointcheckname();