Przeglądaj źródła

设备子系统———保修商导入bug修复,大修超期任务提醒内容调整取消年份拼接

zhoudazhuang 1 rok temu
rodzic
commit
7bcb99d570

+ 1 - 1
bs-common/src/main/java/com/rongwei/safecommon/utils/SaveConstans.java

@@ -355,7 +355,7 @@ public class SaveConstans {
         /**
          * 大修任务超期提醒内容
          */
-        public static final String PLANNING_TASK_CONTENT = "【%s】年【%s】大修任务有【%s】个大修任务现已超期未完成,请各车间相关负责人及时跟进处理并调促督协尽快完成,具体任务详见附件清单。";
+        public static final String PLANNING_TASK_CONTENT = "【%s】近一年大修任务有【%s】个大修任务现已超期未完成,请各车间相关负责人及时跟进处理并调促督协尽快完成,具体任务详见附件清单。";
 
         /**
          * 设备报废申请审批通过提醒内容

+ 1 - 2
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/EquipmentSendNotifyService.java

@@ -52,14 +52,13 @@ public interface EquipmentSendNotifyService {
 
     /**
      * 大修任务发送消息提醒
-     * @param planyear
      * @param belongfactory
      * @param taskquantity
      * @param taskId
      * @param userId
      * @param fileItemId
      */
-    void sendPlanningTasksNotify(String planyear, String belongfactory, Integer taskquantity, String taskId,List<String> userId,String fileItemId);
+    void sendPlanningTasksNotify(String belongfactory, Integer taskquantity, String taskId,List<String> userId,String fileItemId);
 
     /**
      * 设备报废通知提醒

+ 1 - 1
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquOverhaulPlanningTasksServiceImpl.java

@@ -202,7 +202,7 @@ public class EquOverhaulPlanningTasksServiceImpl extends ServiceImpl<EquOverhaul
                         userId = useDeptRoleUserIds.stream().distinct().collect(Collectors.toList());
                     }
                     try {
-                        equipmentSendNotifyService.sendPlanningTasksNotify(planningTasksVo.getPlanyear(),planningTasksVo.getBelongfactory(),planningTasksVo.getTaskquantity(), planningTasksVo.getId(),userId,fileItemId);
+                        equipmentSendNotifyService.sendPlanningTasksNotify(planningTasksVo.getBelongfactory(),planningTasksVo.getTaskquantity(), planningTasksVo.getId(),userId,fileItemId);
                     }catch (Exception e){
                         ExceptionUtils.printExceptionDetail(e,"发送消息异常");
                     }

+ 22 - 21
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquWarrantyProviderServiceImpl.java

@@ -112,29 +112,30 @@ public class EquWarrantyProviderServiceImpl extends ServiceImpl<EquWarrantyProvi
                 }
                 if (StringUtils.isNotBlank(factory)){
                     List<SysOrganizationVo> resultList = factoryList.stream().filter(p -> p.getFullname().equals(factory)).collect(Collectors.toList());
-                    factoryId = resultList.get(0).getId();
-                    if (StringUtil.isBlank(factoryId)){
-                        stringBuilder.append("所属工厂填写有误");
-                    }
-                    //当前用户所属工厂、【保修商名称】作唯一校验
-                    if (StringUtils.isNotBlank(name)){
-                        QueryWrapper<EquWarrantyProviderDo> entity = new QueryWrapper<EquWarrantyProviderDo>().eq("DELETED", 0).eq("WARRANTYPROVIDER",name).eq("TENANTID",factoryId).last("limit 1");
-                        EquWarrantyProviderDo providerNameDo = equWarrantyProviderService.getOne(entity);
-                        if (providerNameDo!= null){
-                            stringBuilder.append(String.format("在%s中%s已存在,不可重复导入",factory,name));
-                        }
-                    }
-                    //当前用户所属工厂、【统一社会信用代码】作唯一校验
-                    if (StringUtils.isNotBlank(zuscc)){
-                        if (StringUtil.isScience(zuscc)){
-                            BigDecimal formatAccount = new BigDecimal(zuscc);
-                            zuscc = formatAccount.setScale(0,BigDecimal.ROUND_HALF_UP).toPlainString();
+                    if (resultList.size()>0){
+                        factoryId = resultList.get(0).getId();
+                        //当前用户所属工厂、【保修商名称】作唯一校验
+                        if (StringUtils.isNotBlank(name)){
+                            QueryWrapper<EquWarrantyProviderDo> entity = new QueryWrapper<EquWarrantyProviderDo>().eq("DELETED", 0).eq("WARRANTYPROVIDER",name).eq("TENANTID",factoryId).last("limit 1");
+                            EquWarrantyProviderDo providerNameDo = equWarrantyProviderService.getOne(entity);
+                            if (providerNameDo!= null){
+                                stringBuilder.append(String.format("在%s中%s已存在,不可重复导入",factory,name));
+                            }
                         }
-                        QueryWrapper<EquWarrantyProviderDo> entity = new QueryWrapper<EquWarrantyProviderDo>().eq("DELETED", 0).eq("ZUSCC",zuscc).eq("TENANTID",factoryId).last("limit 1");
-                        EquWarrantyProviderDo providerZusccDo = equWarrantyProviderService.getOne(entity);
-                        if (providerZusccDo!= null){
-                            stringBuilder.append(String.format("在%s中%s保修商已存在,不可重复导入",factory,zuscc));
+                        //当前用户所属工厂、【统一社会信用代码】作唯一校验
+                        if (StringUtils.isNotBlank(zuscc)){
+                            if (StringUtil.isScience(zuscc)){
+                                BigDecimal formatAccount = new BigDecimal(zuscc);
+                                zuscc = formatAccount.setScale(0,BigDecimal.ROUND_HALF_UP).toPlainString();
+                            }
+                            QueryWrapper<EquWarrantyProviderDo> entity = new QueryWrapper<EquWarrantyProviderDo>().eq("DELETED", 0).eq("ZUSCC",zuscc).eq("TENANTID",factoryId).last("limit 1");
+                            EquWarrantyProviderDo providerZusccDo = equWarrantyProviderService.getOne(entity);
+                            if (providerZusccDo!= null){
+                                stringBuilder.append(String.format("在%s中%s保修商已存在,不可重复导入",factory,zuscc));
+                            }
                         }
+                    }else {
+                        stringBuilder.append("所属工厂填写有误");
                     }
                 }else {
                     stringBuilder.append("所属工厂必填");

+ 3 - 2
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquipmentSendNotifyServiceImpl.java

@@ -216,12 +216,13 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
     }
 
     @Override
-    public void sendPlanningTasksNotify(String planyear, String belongfactory, Integer taskquantity, String taskId, List<String> userId, String fileItemId) {
+    public void sendPlanningTasksNotify(String belongfactory, Integer taskquantity, String taskId, List<String> userId, String fileItemId) {
+        String taskContent = String.format(PLANNING_TASK_CONTENT, belongfactory, taskquantity);
         String notifyId = SecurityUtil.getUUID();
         String formatFileNameAndId = PLANNING_TASK_FILE_NAME + "-;-" + fileItemId;
         // 发送消息提醒
         CXCommonUtils.sendNotify(notifyId, PLANNING_TASK_TITLE,
-                String.format(PLANNING_TASK_CONTENT, planyear, belongfactory, taskquantity), formatFileNameAndId
+                taskContent, formatFileNameAndId
                 , userId.stream().distinct().collect(Collectors.toList()), taskId, MOBILE_PLANNING_TASK, true);
         SysFileItemDo sysFileItemDo = new SysFileItemDo();
         sysFileItemDo.setId(fileItemId);