Quellcode durchsuchen

feature 代码提交

xiahan vor 1 Jahr
Ursprung
Commit
95f4718e25

+ 2 - 2
bs-common/src/main/java/com/rongwei/safecommon/fegin/CXCommonFeginClient.java

@@ -30,7 +30,7 @@ public interface CXCommonFeginClient {
     @PostMapping("sys/sysnotifyannounce/delete")
     R delete(@RequestBody List<String> ids);
 
-    @PostMapping(value = "sys/sysfile/upload?platform=ic-pc&foldercode=file_system&relationid=0"
+    @PostMapping(value = "sys/sysfile/upload?platform=ic-pc&foldercode=file_system&relationid={relationid}"
             ,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
-    R upload(@RequestPart(value = "file",required = true) MultipartFile file);
+    R upload(@RequestPart(value = "file",required = true) MultipartFile file,@PathVariable("relationid") String relationid);
 }

+ 30 - 7
bs-common/src/main/java/com/rongwei/safecommon/utils/CXCommonUtils.java

@@ -79,19 +79,41 @@ public class CXCommonUtils {
      */
     public static void sendNotify(String title, String content, String remark,
                                   List<String> recipientIds, String roption,
-                                  String notifyStatus,boolean pushWebsocket) {
+                                  String notifyStatus, boolean pushWebsocket) {
+        sendNotify(SecurityUtil.getUUID(), null, title, content, remark, recipientIds, roption, notifyStatus, pushWebsocket);
+    }
+
+    /**
+     * 发送消息提醒
+     *
+     * @param notifyId      消息提醒ID
+     * @param tenantId      消息提醒公司信息
+     * @param title         消息提醒标题
+     * @param content       消息提醒内容
+     * @param remark        消息提醒备注
+     * @param recipientIds  接收人ID
+     * @param roption       目前存的是业务数据ID
+     * @param notifyStatus  消息提醒类型
+     * @param pushWebsocket 是否向webSocket推送消息
+     */
+    public static void sendNotify(String notifyId, String tenantId, String title, String content, String remark,
+                                  List<String> recipientIds, String roption,
+                                  String notifyStatus, boolean pushWebsocket) {
         if (recipientIds == null || recipientIds.isEmpty()) {
             log.debug("接收人ID为空");
             return;
         }
         SysNotifyAnnounceVo sysNotifyAnnounceVo = new SysNotifyAnnounceVo();
-        sysNotifyAnnounceVo.setId(SecurityUtil.getUUID());
+        sysNotifyAnnounceVo.setId(notifyId);
         sysNotifyAnnounceVo.setSenderid("8672bf72ab274bec83052868ae336b38");
         sysNotifyAnnounceVo.setNotifytype(notifyStatus);
         sysNotifyAnnounceVo.setNotifystatus(DEFAULT_NOTIFY_STATUS);
         sysNotifyAnnounceVo.setNotifytitle(title);
-        sysNotifyAnnounceVo.setNotifycontent(content.replace("null"," "));
+        sysNotifyAnnounceVo.setNotifycontent(content.replace("null", " "));
         sysNotifyAnnounceVo.setRemark(remark);
+        if (StringUtils.isNotBlank(tenantId)) {
+            sysNotifyAnnounceVo.setTenantid(tenantId);
+        }
         // 特殊处理
         if (StringUtils.isNotBlank(roption)) {
             sysNotifyAnnounceVo.setRoption(roption);
@@ -100,14 +122,15 @@ public class CXCommonUtils {
         log.debug("开始通过fegin发送消息通知: {}", sysNotifyAnnounceVo);
         commonFeginClient.sendNotify(sysNotifyAnnounceVo);
         // 通过webSocket推送数据
-        if(pushWebsocket){
+        if (pushWebsocket) {
             //防止推送用户过多,导致调用接口报错,实行分流
-            Lists.partition(recipientIds, 10).forEach(userIds->{
+            Lists.partition(recipientIds, 10).forEach(userIds -> {
                 pushApp(title, content, userIds);
             });
         }
     }
 
+
     /**
      * 发送消息提醒
      *
@@ -230,8 +253,8 @@ public class CXCommonUtils {
         }
     }
 
-    public static R upload(MultipartFile file) {
-        return commonFeginClient.upload(file);
+    public static R upload(MultipartFile file, String relationid) {
+        return commonFeginClient.upload(file, relationid);
     }
 
 }

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

@@ -166,6 +166,15 @@ public class SaveConstans {
          */
         public static final String FAUL_STOP_REMIND = "faultstopremind";
 
+
+        /**
+         * 每周点检异常问题提醒类型 生产
+         */
+        public static final String HIDDEN_DANGER_TASK_PRODUCTION = "productionHiddenDanger";
+        /**
+         * 每周点检异常问题提醒类型 维修
+         */
+        public static final String HIDDEN_DANGER_TASK_MAINTAIN = "maintainHiddenDanger";
     }
 
     public static class NotifyTitle {
@@ -264,6 +273,11 @@ public class SaveConstans {
          * 保养/润滑月末未完成提醒
          */
         public static final String END_UNFINISHED_TASK_TITLE = "保养/润滑月末未完成提醒";
+
+        /**
+         * 每周点检异常问题提醒
+         */
+        public static final String WEEK_HIDDEN_DANGER_TASK = "每周点检异常问题提醒";
     }
 
     public static class NotifyContent {
@@ -363,6 +377,7 @@ public class SaveConstans {
          */
         public static final String END_UNFINISHED_TASK_CONTENT = "截止【%s】本月末【%s】有保养任务有【%s】个、润滑任务有【%s】个已经跨月未登记完成,请各车间相关保养负责人及时跟进处理,具体任务详见附件清单。";
 
+        public static final String HIDDEN_DANGER_TASK_CONTENT = "各车间在近一周内点巡检发现了【%d】个问题项,均已生成了隐患任务记录,请各部门车间及时安排人员对待整改问题及时跟踪处理,具体隐患信息详见附件清单";
     }
 
     /**
@@ -424,4 +439,26 @@ public class SaveConstans {
         public static final String DATE_PATTERN_YM_UNDERLINE = "yyyy_MM";
         public static final String DATE_PATTERN_YMD_POINT = "yyyy.MM.dd";
     }
+
+    /**
+     * 角色编码
+     */
+    public static class RoleCode {
+        /**
+         * 设备部部门长
+         */
+        public static final String HOED = "hoed";
+        /**
+         * 设备部维修主管
+         */
+        public static final String EDMS = "edms";
+        /**
+         * 车间主任
+         */
+        public static final String LCZG = "lczg";
+        /**
+         * 车间维修主管
+         */
+        public static final String WMS ="wms";
+    }
 }