459242451@qq.com 3 lat temu
rodzic
commit
27ee57ab81
20 zmienionych plików z 477 dodań i 153 usunięć
  1. 1 0
      ruoyi-admin/nacos/yjzh-sq-dev.yaml
  2. 24 27
      ruoyi-admin/nacos/yjzh-sq-prod.yaml
  3. 1 0
      ruoyi-admin/nacos/yjzh-sq-test.yaml
  4. 155 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
  5. 92 53
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/NoticeInfoListiner.java
  6. 4 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/IncidentController.java
  7. 4 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/ResourceController.java
  8. 39 36
      ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java
  9. 11 5
      ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java
  10. 86 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/SecurityInterceptor.java
  11. 1 5
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
  12. 10 1
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/GatewayUserDetail.java
  13. 18 14
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/BacklogMessagePushBo.java
  14. 1 1
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/BacklogMessageUpdateBo.java
  15. 3 0
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/IncidentBo.java
  16. 12 6
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/MessagePushBo.java
  17. 9 0
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/MessagePushUser.java
  18. 1 1
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/IncidentProcessServiceImpl.java
  19. 2 1
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/IncidentServiceImpl.java
  20. 3 0
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/ResourceServiceImpl.java

+ 1 - 0
ruoyi-admin/nacos/yjzh-sq-dev.yaml

@@ -165,5 +165,6 @@ third:
     keepalive: http://10.211.55.3:6699/videoService/accounts/token/keepalive # 大华会话保活
     dhDeviceTree: http://10.211.55.3:6699/videoService/devicesManager/deviceTree # 大华设备树
     incidentUrl: http://sqmb.xt.wenhq.top:8083/#/status/3/detaillite?id=#incidentId&taskid=#taskId # 移动端待办跳转链接
+    incidentDetailUrl: http://sqmb.xt.wenhq.top:8083/#/status/3/detail?id=#incidentId # 事件详情页面
     resourceUrl: http://sqmb.xt.wenhq.top:8083/#/warehouse/detail # 移动端资源跳转链接
     chemicalUrl: http://sqmb.xt.wenhq.top:8083/#/chemical/detail?id= # 危化品详情页面

+ 24 - 27
ruoyi-admin/nacos/yjzh-sq-prod.yaml

@@ -5,16 +5,16 @@ spring:
         # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
         dynamic:
             # 性能分析插件(有性能损耗 不建议生产环境使用)
-            p6spy: false
+            p6spy: true
             # 设置默认的数据源或者数据源组,默认值即为 master
             primary: master
             datasource:
                 # 主库数据源
                 master:
-                    driverClassName: com.mysql.cj.jdbc.Driver
-                    url: jdbc:mysql://172.30.0.36:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
-                    username: root
-                    password: root
+                    driverClassName: org.postgresql.Driver
+                    url: jdbc:postgresql://10.11.230.131:54032/yjzh?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+                    username: huashe
+                    password: huashe@2021
                 # 从库数据源
                 slave:
                     lazy: true
@@ -38,7 +38,7 @@ spring:
                 # 配置一个连接在池中最大生存的时间,单位是毫秒
                 maxEvictableIdleTimeMillis: 900000
                 # 配置检测连接是否有效
-                validationQuery: SELECT 1 FROM DUAL
+                validationQuery: SELECT 1
                 testWhileIdle: true
                 testOnBorrow: false
                 testOnReturn: false
@@ -74,13 +74,13 @@ spring:
 spring:
     redis:
         # 地址
-        host: 172.30.0.48
+        host: 10.11.230.132
         # 端口,默认为6379
         port: 6379
         # 数据库索引
-        database: 0
+        database: 10
         # 密码
-        password:
+        password: superman
         # 连接超时时间
         timeout: 10s
         # 是否开启ssl
@@ -118,26 +118,11 @@ redisson:
         # DNS监测时间间隔,单位:毫秒
         dnsMonitoringInterval: 5000
 
---- # 监控配置
-spring:
-    boot:
-        admin:
-            # Spring Boot Admin Client 客户端的相关配置
-            client:
-                # 增加客户端开关
-                enabled: true
-                # 设置 Spring Boot Admin Server 地址
-                url: http://172.30.0.90:9090/admin
-                instance:
-                    prefer-ip: true # 注册实例时,优先使用 IP
-                username: ruoyi
-                password: 123456
-
 --- # kafaka 配置
 spring:
     kafka:
         # 指定kafkaserver的地址,集群配多个,中间,逗号隔开
-        bootstrap-servers: 200.200.19.121:9092
+        bootstrap-servers: 10.11.230.139:9092
         producer:
             #procedure要求leader在考虑完成请求之前收到的确认数,用于控制发送记录在服务端的持久化,其值可以为如下:
             #acks = 0 如果设置为零,则生产者将不会等待来自服务器的任何确认,该记录将立即添加到套接字缓冲区并视为已发送。在这种情况下,无法保证服务器已收到记录,并且重试配置将不会生效(因为客户端通常不会知道任何故障),为每条记录返回的偏移量始终设置为-1。
@@ -157,12 +142,24 @@ spring:
             value-serializer: org.apache.kafka.common.serialization.StringSerializer
         consumer:
             # 默认的消费组ID
-            group-id: defaultConsumerGroup
+            group-id: huashe-consumer-group
             enable-auto-commit: true
             auto-offset-reset: latest
             key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
             value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
             auto-commit-interval: 1000
+---
 ruoyi:
     # 文件路径 示例( Windows配置D:/tocc/uploadPath,Linux配置 /xintong/server/uploadPath)
-    profile: /xintong/server
+    profile: /home/tocc
+
+third:
+    messagepush: http://61.147.254.211:30876/notice-info/messagepushinfo #发送消息
+    messagepushlist: http://61.147.254.211:30876/notice-info/messagepushinfo/list # 消息列表
+    dhAuthorize: http://10.55.134.3:6699/videoService/accounts/authorize # 大华鉴权创建用户会话
+    keepalive: http://10.55.134.3:6699/videoService/accounts/token/keepalive # 大华会话保活
+    dhDeviceTree: http://10.55.134.3:6699/videoService/devicesManager/deviceTree # 大华设备树
+    incidentUrl: http://sqmb.xt.wenhq.top:8083/#/status/3/detaillite?id=#incidentId&taskid=#taskId # 移动端待办跳转链接
+    incidentDetailUrl: http://sqmb.xt.wenhq.top:8083/#/status/3/detail?id=#incidentId # 事件详情页面
+    resourceUrl: http://sqmb.xt.wenhq.top:8083/#/warehouse/list?taskid=#taskId # 移动端资源跳转链接
+    chemicalUrl: http://sqmb.xt.wenhq.top:8083/#/chemical/detail?id= # 危化品详情页面

+ 1 - 0
ruoyi-admin/nacos/yjzh-sq-test.yaml

@@ -160,5 +160,6 @@ third:
     keepalive: http://10.55.134.3:6699/videoService/accounts/token/keepalive # 大华会话保活
     dhDeviceTree: http://10.55.134.3:6699/videoService/devicesManager/deviceTree # 大华设备树
     incidentUrl: http://sqmb.xt.wenhq.top:8083/#/status/3/detaillite?id=#incidentId&taskid=#taskId # 移动端待办跳转链接
+    incidentDetailUrl: http://sqmb.xt.wenhq.top:8083/#/status/3/detail?id=#incidentId # 事件详情页面
     resourceUrl: http://sqmb.xt.wenhq.top:8083/#/warehouse/list?taskid=#taskId # 移动端资源跳转链接
     chemicalUrl: http://sqmb.xt.wenhq.top:8083/#/chemical/detail?id= # 危化品详情页面

+ 155 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@@ -1,11 +1,16 @@
 package com.ruoyi.web.controller.system;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.convert.Convert;
+import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.Security;
 import com.ruoyi.common.core.controller.BaseController;
@@ -15,17 +20,23 @@ import com.ruoyi.common.core.domain.entity.SysRole;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.UserUtil;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.system.domain.vo.SysUserExportVo;
 import com.ruoyi.system.domain.vo.SysUserImportVo;
+import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.system.service.ISysRoleService;
 import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.zhdd.domain.GatewayUserDetail;
 import com.ruoyi.zhdd.domain.GatewayUserPage;
+import com.ruoyi.zhdd.domain.Resource;
+import com.ruoyi.zhdd.domain.bo.ResourceBo;
 import com.ruoyi.zhdd.feign.FeignUserManageService;
+import com.ruoyi.zhdd.service.IResourceService;
+import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -59,6 +70,11 @@ public class SysUserController extends BaseController {
     @Autowired
     private FeignUserManageService feignUserManageService;
 
+    @Autowired
+    private ISysDeptService deptService;
+    @Autowired
+    private IResourceService resourceService;
+
     /**
      * 获取用户列表
      */
@@ -280,6 +296,70 @@ public class SysUserController extends BaseController {
         if (gatewayUserDetail.getCode() == 200 && gatewayUserDetail.getData() != null && StrUtil.isNotBlank(gatewayUserDetail.getData().getUserId())) {
             GatewayUserDetail.UserDetail data = gatewayUserDetail.getData();
             SysUser newUser = new SysUser();
+            // 如果是企业用户,则查询是否存在企业信息,存在则新增企业部门,同时往应急仓库新增一个数据
+            if (data.getUserGroupId() == 4) {
+                GatewayUserDetail.EntInfo entInfo = data.getEntInfo();
+                if (entInfo == null || StrUtil.isBlank(entInfo.getEntName()) || StrUtil.isBlank(entInfo.getOwnerId()) || StrUtil.isBlank(entInfo.getOwnerCategory())) {
+                    throw new ServiceException("企业用户未绑定企业,不能使用此系统");
+                }
+                newUser.setDeptId(entInfo.getOwnerId());
+                newUser.setOrgId(entInfo.getOwnerId());
+                SysDept sysDept = deptService.selectDeptById(entInfo.getOwnerId());
+                if (sysDept == null) {
+                    sysDept = new SysDept();
+                    sysDept.setDeptId(entInfo.getOwnerId());
+                    sysDept.setDeptName(entInfo.getEntName());
+                    sysDept.setFlag("0");
+                    // 根据企业类型放置不同的目录中
+                    if ("危货业户".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10001");
+                    } else if ("普货业户".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10002");
+                    } else if ("客运业户".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10003");
+                    } else if ("出租车业户".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10004");
+                    } else if ("公交运输业户".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10005");
+                    } else if ("汽车租赁业户".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10006");
+                    } else if ("检测站业户".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10007");
+                    } else if ("网约车平台".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10008");
+                    } else if ("维修站".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10009");
+                    } else if ("其他".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10010");
+                    } else if ("公路工程".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10011");
+                    } else if ("水运工程".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10012");
+                    } else if ("航运企业".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10013");
+                    } else if ("港口码头".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10014");
+                    } else if ("水上游览经营".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10015");
+                    } else if ("货运场站".equals(entInfo.getOwnerCategory())) {
+                        sysDept.setParentId("10016");
+                    }
+                    deptService.insertDept(sysDept);
+                }
+                List<Resource> resourcesList = resourceService.list(Wrappers.<Resource>lambdaQuery().eq(Resource::getManageUnitId, entInfo.getOwnerId()));
+                if (resourcesList == null || resourcesList.size() == 0) {
+                    // 新增应急仓库
+                    ResourceBo resource = new ResourceBo();
+                    resource.setResourceType(1);
+                    resource.setName(entInfo.getEntName() + "仓库");
+                    resource.setManageUnit(entInfo.getEntName());
+                    resource.setContactName(data.getName());
+                    resource.setContactPhone(data.getMobile());
+                    resource.setLocationType("2");
+                    resource.setManageUnitId(entInfo.getOwnerId());
+                    resourceService.insertByBo(resource);
+                }
+            }
             newUser.setUserId(data.getUserId());
             newUser.setUserName(data.getUserName());
             newUser.setNickName(data.getName());
@@ -299,4 +379,79 @@ public class SysUserController extends BaseController {
         return AjaxResult.success();
     }
 
+    @GetMapping("/compareDept")
+    public void compareDept() {
+        String s = FileUtil.readUtf8String("/Users/huangcheng/Desktop/siweidept");
+        JSONArray jsonArray = JSONUtil.parseArray(s);
+        List<SiweiDept> siweiDepts = JSONUtil.toList(jsonArray, SiweiDept.class);
+        List<SysDept> list = deptService.list();
+
+        /////////////////////////
+        List<String> siweiIds = siweiDepts.stream().map(SiweiDept::getId).collect(Collectors.toList());
+        List<String> hsIds = list.stream().map(SysDept::getDeptId).collect(Collectors.toList());
+        System.out.println("四维存在,华设不存在" + CollUtil.subtract(siweiIds, hsIds));
+        System.out.println("四维不存在,华设存在" + CollUtil.subtract(hsIds, siweiIds));
+
+        /////////////////////////
+
+
+        Map<String, SiweiDept> siweiDeptIds = siweiDepts.stream().collect(Collectors.toMap(SiweiDept::getId, a -> a));
+        for (SysDept sysDept : list) {
+            String deptid = sysDept.getDeptId();
+            SiweiDept siweiDept = siweiDeptIds.get(deptid);
+            if (siweiDept != null) {
+                if (StrUtil.isBlank(siweiDept.getParentId())) {
+                    siweiDept.setParentId("0");
+                }
+                if (StrUtil.isNotBlank(siweiDept.getFullName())) {
+                    siweiDept.setFullName(siweiDept.getFullName().replace("-", "/"));
+                }
+                try {
+                    if (!sysDept.getParentId().equals(siweiDept.getParentId()) || !sysDept.getDeptName().equals(siweiDept.getName()) || !sysDept.getFlag().equals(Convert.toStr(siweiDept.getFlag())) || !sysDept.getFullName().equals(siweiDept.getFullName())) {
+                        System.out.println("华设:" + sysDept.getDeptId() + "-" + sysDept.getParentId() + "-" + sysDept.getDeptName() + "-" + sysDept.getFullName());
+                        System.out.println("四维:" + siweiDept.getId() + "-" + siweiDept.getParentId() + "-" + siweiDept.getName() + "-" + siweiDept.getFullName());
+                    }
+//                    if (!sysDept.getDeptName().equals(siweiDept.getName())) {
+//                        System.out.println("华设:" + sysDept.getDeptId() + "-" + sysDept.getDeptName());
+//                        System.out.println("四维:" + siweiDept.getId() + "-" + siweiDept.getName());
+//                    }
+//                    if (!sysDept.getParentId().equals(siweiDept.getParentId()) || !sysDept.getFullName().equals(siweiDept.getFullName())) {
+//                        System.out.println("华设:" + sysDept.getDeptId() + "-" + sysDept.getParentId() + "-" + sysDept.getFullName());
+//                        System.out.println("四维:" + siweiDept.getId() + "-" + siweiDept.getParentId() + "-" + siweiDept.getFullName());
+//                    }
+
+                } catch (Exception e) {
+                    System.out.println("错误华设:" + sysDept);
+                    System.out.println("错误四维:" + siweiDept);
+                }
+            }
+        }
+    }
+
+    @Data
+    public static class SiweiDept {
+        private String id;
+        private String name;
+        private String parentId;
+        private Integer flag;
+        private String fullName;
+    }
+
+//    public static void main(String[] args) {
+//        String s = FileUtil.readUtf8String("/Users/huangcheng/Desktop/temp");
+//        JSONArray jsonArray = JSONUtil.parseArray(s);
+//        List<SiweiDept> siweiDepts = JSONUtil.toList(jsonArray, SiweiDept.class);
+//        for (SiweiDept siweiDept : siweiDepts) {
+//            System.out.println(StrUtil.concat(true, "INSERT INTO sys_dept (dept_id, parent_id, ancestors, dept_name, flag, full_name) VALUES ('",
+//                siweiDept.getId(),
+//                "', '",
+//                siweiDept.getParentId(),
+//                "', '0,35e6872a8c46440fbca1b1c01862a380,7298cf74a4ae4b0d9181286fa6647266', '",
+//                siweiDept.getName(),
+//                "', '1', '",
+//                siweiDept.getFullName().replace("-", "/"),
+//                "');"));
+//        }
+//    }
+
 }

+ 92 - 53
ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/NoticeInfoListiner.java

@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.crypto.SecureUtil;
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
@@ -72,6 +73,8 @@ public class NoticeInfoListiner {
 
     @Value("${third.incidentUrl}")
     private String incidentUrl;
+    @Value("${third.incidentDetailUrl}")
+    private String incidentDetailUrl;
     @Value("${third.resourceUrl}")
     private String resourceUrl;
 
@@ -95,7 +98,8 @@ public class NoticeInfoListiner {
             String type = msg.substring(1, 2);
             String title = "未知";
             String synopsis = "未知";
-            String text = "未知";
+            String msText = "";
+            String content = "";
             String messageUser = "";
             String incidentId;
             String url = "";
@@ -111,8 +115,7 @@ public class NoticeInfoListiner {
                 IncidentVo incidentVo = incidentService.queryById(msg.substring(2));
                 title = StrUtil.concat(true, "应急事件:", incidentVo.getName());
                 synopsis = "请查看派发应急事件消息";
-                text = getDetail(incidentVo);
-                text = text.replace("#task", "");
+                content = getDetail(incidentVo).toString();
                 incidentProcess.setDes("事件派发主办单位");
                 incidentProcess.setIncidentStatus(2);
                 incidentProcess.setIncidentId(msg.substring(2));
@@ -126,9 +129,7 @@ public class NoticeInfoListiner {
                 IncidentVo incidentVo = incidentService.queryById(incidentTaskVo.getIncidentId());
                 title = StrUtil.concat(true, "应急事件:", incidentVo.getName());
                 synopsis = incidentTaskVo.getTaskName();
-                text = getDetail(incidentVo);
-                String taskName = "<tr><td style=\"color: darkgray;width: 20%;vertical-align: top;\">处置指令</td><td style=\"text-align:left;\">#taskName</td></tr>".replace("#taskName", incidentTaskVo.getTaskName());
-                text = text.replace("#task", taskName).replace("#chemcials", incidentTaskVo.getChemicalsHtml());
+                content = getDetail(incidentVo).toString();
 
                 url = incidentUrl.replace("#incidentId", incidentId).replace("#taskId", incidentTaskVo.getId());
                 incidentProcess.setDes("发送处置方案:" + incidentTaskVo.getTaskName());
@@ -137,10 +138,10 @@ public class NoticeInfoListiner {
                 messageUser = incidentTaskVo.getExprJson();
                 if ("3".equals(messageType)) {
                     title = "应急资源维护";
-                    text = incidentTaskVo.getTaskName();
+                    msText = incidentTaskVo.getTaskName();
                     url = resourceUrl.replace("#taskId", incidentTaskVo.getId());
                 } else if ("2".equals(messageType)) {
-                    text = incidentTaskVo.getTaskName();
+                    msText = incidentTaskVo.getTaskName();
                 }
                 incidentProcess.setTaskId(incidentTaskVo.getId());
             }
@@ -160,11 +161,14 @@ public class NoticeInfoListiner {
             if (sendFlag) {
                 if ("1".equals(messageType)) {
                     // 普通消息
-                    messagePushBo.setMsTitle(title);
+                    messagePushBo.setTitle(title);
                     messagePushBo.setMsSynopsis(synopsis);
-                    messagePushBo.setMsText(text);
-                    messagePushBo.setMsNo(incidentProcess.getId());
+                    messagePushBo.setContent(content);
+//                    messagePushBo.setSenderId();
+                    messagePushBo.setUrl(incidentDetailUrl.replace("#incidentId", incidentProcess.getIncidentId()));
+                    messagePushBo.setUuId(incidentProcess.getId());
                     messagePushBo.setMessageReadInfoList(messagePushUsers);
+                    messagePushBo.setVerify(SecureUtil.md5(StrUtil.concat(true, messagePushBo.getAppId(), messagePushBo.getSendTime(), messagePushBo.getContent())));
                     log.info("发送普通消息 => {}", messagePushBo);
                     if (!"dev".equals(env)) {
                         JSONObject jsonObject = feignNoticeInfoService.messagePush(messagePushBo);
@@ -173,39 +177,39 @@ public class NoticeInfoListiner {
                 } else if ("2".equals(messageType) || "3".equals(messageType)) {
                     // 应急处置待办
                     BacklogMessagePushBo backlogMessagePushBo = new BacklogMessagePushBo();
-                    backlogMessagePushBo.setUuid(incidentProcess.getId());
+                    backlogMessagePushBo.setUuId(incidentProcess.getId());
                     backlogMessagePushBo.setTitle(title);
-                    backlogMessagePushBo.setSubhead(synopsis);
-                    backlogMessagePushBo.setText(text);
+                    backlogMessagePushBo.setContent(msText);
+                    backlogMessagePushBo.setVerify(SecureUtil.md5(StrUtil.concat(true, backlogMessagePushBo.getAppId(), backlogMessagePushBo.getSendTime(), backlogMessagePushBo.getContent())));
                     backlogMessagePushBo.setUrl(url);
-                    backlogMessagePushBo.setUrgency("5");
                     List<String> userIds = messagePushUsers.stream().map(MessagePushUser::getUserId).collect(Collectors.toList());
-                    backlogMessagePushBo.setUserId(userIds);
+                    backlogMessagePushBo.setReceiverId(userIds);
                     log.info("待办消息发送 => {}", backlogMessagePushBo);
                     if (!"dev".equals(env)) {
                         Object o = feignBacklogInfoService.backlogMessagePush(backlogMessagePushBo);
                         log.info("发送待办消息结果:{}", o);
                     }
-                }
 
-                // 查询发送用户的手机号
-                List<String> collect = messagePushUsers.stream().map(MessagePushUser::getUserId).collect(Collectors.toList());
-                List<SysUser> list = sysUserService.list(Wrappers.<SysUser>lambdaQuery().in(SysUser::getUserId, collect));
-                // 组装短信内容
-                List<SmsOutbox> smsOutboxes = new ArrayList<>();
-                for (SysUser sysUser : list) {
-                    if (StrUtil.isNotBlank(sysUser.getPhonenumber()) && Validator.isMobile(sysUser.getPhonenumber())) {
-                        SmsOutbox smsOutbox = new SmsOutbox();
-                        smsOutbox.setDestaddr(sysUser.getPhonenumber());
-                        smsOutbox.setMessagecontent("有新的应急事件或应急方案,请登录APP注意查看!");
-                        smsOutbox.setRequesttime(new Date());
-                        smsOutboxes.add(smsOutbox);
+                    // 查询发送用户的手机号(由于消息接口有发送了短信,则只在待办消息时发短信)
+                    List<String> collect = messagePushUsers.stream().map(MessagePushUser::getUserId).collect(Collectors.toList());
+                    List<SysUser> list = sysUserService.list(Wrappers.<SysUser>lambdaQuery().in(SysUser::getUserId, collect));
+                    // 组装短信内容
+                    List<SmsOutbox> smsOutboxes = new ArrayList<>();
+                    for (SysUser sysUser : list) {
+                        if (StrUtil.isNotBlank(sysUser.getPhonenumber()) && Validator.isMobile(sysUser.getPhonenumber())) {
+                            SmsOutbox smsOutbox = new SmsOutbox();
+                            smsOutbox.setDestaddr(sysUser.getPhonenumber());
+                            smsOutbox.setMessagecontent("有新的应急事件或应急方案,请登录APP注意查看!");
+                            smsOutbox.setRequesttime(new Date());
+                            smsOutboxes.add(smsOutbox);
+                        }
+                    }
+                    if (!"dev".equals(env)) {
+                        smsOutboxService.saveBatch(smsOutboxes);
+                        log.debug("发送短信 => {}", smsOutboxes);
                     }
                 }
-                if (!"dev".equals(env)) {
-                    smsOutboxService.saveBatch(smsOutboxes);
-                    log.debug("发送短信 => {}", smsOutboxes);
-                }
+
             }
         });
     }
@@ -216,7 +220,7 @@ public class NoticeInfoListiner {
      * @param incidentVo
      * @return
      */
-    private String getDetail(IncidentVo incidentVo) {
+    private JSONArray getDetail(IncidentVo incidentVo) {
         // 翻译事件类型、事件等级、事件来源、上报人员、上报单位
         String type = "";
         String level = "";
@@ -241,19 +245,37 @@ public class NoticeInfoListiner {
         if (sysDept != null) {
             incidentVo.setCreateDept(sysDept.getDeptName());
         }
-        String htmlContent = "<table style=\"font-size: 3vw;\"><tr><td style=\"color: darkgray;width: 20%;vertical-align: top;\">事件类型</td><td style=\"text-align:left;\">#typeText</td></tr><tr><td style=\"color: darkgray;width: 20%;vertical-align: " +
-            "top;\">事件等级</td><td style=\"text-align:left;\">#levelText</td></tr><tr><td style=\"color: darkgray;width: 20%;vertical-align: top;\">事件时间</td><td style=\"text-align:left;\">#createTime</td></tr><tr><td style=\"color: darkgray;width: " +
-            "20%;vertical-align: top;\">事件地点</td><td style=\"text-align:left;\">#addr</td></tr><tr><td style=\"color: darkgray;width: 20%;vertical-align: top;\">事件来源</td><td style=\"text-align:left;\">#source</td></tr><tr><td style=\"color: " +
-            "darkgray;width: 20%;vertical-align: top;\">上报人员</td><td style=\"text-align:left;\">#createBy</td></tr><tr><td style=\"color: darkgray;width: 20%;vertical-align: top;\">联系电话</td><td style=\"text-align:left;\">#expr1</td></tr><tr><td " +
-            "style=\"color: darkgray;width: 20%;vertical-align: top;\">上报单位</td><td style=\"text-align:left;\">#createDept</td></tr>#task#chemcials</table>";
-        return htmlContent.replace("#typeText", incidentVo.getTypeText())
-            .replace("#levelText", incidentVo.getLevelText())
-            .replace("#createTime", DateUtil.formatDateTime(incidentVo.getCreateTime()))
-            .replace("#addr", incidentVo.getAddr())
-            .replace("#source", incidentVo.getSource())
-            .replace("#createBy", incidentVo.getCreateBy())
-            .replace("#expr1", incidentVo.getExpr1())
-            .replace("#createDept", incidentVo.getCreateDept());
+        JSONArray array = new JSONArray();
+        JSONObject time = new JSONObject();
+//        jsonObject.set("key", "事件类型");
+//        jsonObject.set("val", incidentVo.getTypeText());
+//        array.add(jsonObject);
+//        jsonObject.set("key", "事件等级");
+//        jsonObject.set("val", incidentVo.getLevelText());
+//        array.add(jsonObject);
+        time.set("key", "事件时间");
+        time.set("val", DateUtil.formatDateTime(incidentVo.getCreateTime()));
+        array.add(time);
+        JSONObject address = new JSONObject();
+        address.set("key", "事件地点");
+        address.set("val", incidentVo.getAddr());
+        array.add(address);
+        JSONObject incSource = new JSONObject();
+        incSource.set("key", "事件来源");
+        incSource.set("val", incidentVo.getSource());
+        array.add(incSource);
+        JSONObject userName = new JSONObject();
+        userName.set("key", "上报人员");
+        userName.set("val", incidentVo.getCreateBy());
+        array.add(userName);
+//        jsonObject.set("key", "联系电话");
+//        jsonObject.set("val", incidentVo.getExpr1());
+//        array.add(jsonObject);
+//        jsonObject.set("key", "上报单位");
+//        jsonObject.set("val", incidentVo.getCreateDept());
+//        array.add(jsonObject);
+
+        return array;
     }
 
     /**
@@ -291,21 +313,27 @@ public class NoticeInfoListiner {
             IncidentVo incidentVo = incidentService.queryById(incidentId);
             title = StrUtil.concat(true, "应急事件:", incidentVo.getName());
             synopsis = "系统给您派发了应急事件,请查看";
-            text = StrUtil.concat(true, incidentVo.getAddr(), "发生应急事件,请关注消息,做好应急准备");
+//            text = StrUtil.concat(true, incidentVo.getAddr(), "发生应急事件,请关注消息,做好应急准备");
+            text = getDetail(incidentVo).toString();
 
             // 普通消息
-            messagePushBo.setMsTitle(title);
+            messagePushBo.setTitle(title);
             messagePushBo.setMsSynopsis(synopsis);
-            messagePushBo.setMsText(text);
-            messagePushBo.setMsNo(incidentProcess.getId());
+            messagePushBo.setContent(text);
+            messagePushBo.setUrl(incidentDetailUrl.replace("#incidentId", incidentProcess.getIncidentId()));
+            messagePushBo.setUuId(incidentProcess.getId());
             messagePushBo.setMessageReadInfoList(messagePushUsers);
+            messagePushBo.setVerify(SecureUtil.md5(StrUtil.concat(true, messagePushBo.getAppId(), messagePushBo.getSendTime(), messagePushBo.getContent())));
+//            messagePushBo.setContent(content);
+//            messagePushBo.setSenderId();
+
             log.info("发送普通消息 => {}", messagePushBo);
             if (!"dev".equals(env)) {
                 JSONObject jsonObject = feignNoticeInfoService.messagePush(messagePushBo);
                 log.info("发送普通消息结果:{}", jsonObject);
             }
 
-            // 查询发送用户的手机号
+            /*// 查询发送用户的手机号
             List<String> collect = messagePushUsers.stream().map(MessagePushUser::getUserId).collect(Collectors.toList());
             List<SysUser> list = sysUserService.list(Wrappers.<SysUser>lambdaQuery().in(SysUser::getUserId, collect));
             // 组装短信内容
@@ -322,7 +350,7 @@ public class NoticeInfoListiner {
             if (!"dev".equals(env)) {
                 smsOutboxService.saveBatch(smsOutboxes);
                 log.debug("发送短信 => {}", smsOutboxes);
-            }
+            }*/
         });
     }
 
@@ -387,4 +415,15 @@ public class NoticeInfoListiner {
         });
     }
 
+    public static void main(String[] args) {
+        MessagePushBo messagePushBo = new MessagePushBo();
+        List<MessagePushUser> list = new ArrayList<>();
+        MessagePushUser messagePushUser = new MessagePushUser();
+        messagePushUser.setUserId("231");
+        messagePushUser.setReadState("1");
+        list.add(messagePushUser);
+        messagePushBo.setMessageReadInfoList(list);
+        System.out.println(messagePushBo);
+    }
+
 }

+ 4 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/IncidentController.java

@@ -136,6 +136,8 @@ public class IncidentController extends BaseController {
                 rspData.setMsg("查询成功");
                 rspData.setRows(Collections.emptyList());
                 rspData.setTotal(0);
+                rspData.setPageSize(bo.getPageSize());
+                rspData.setPageNum(bo.getPageNum());
                 return rspData;
             }
             HashSet<Object> incidentIdSet = CollUtil.newHashSet(objects);
@@ -283,10 +285,10 @@ public class IncidentController extends BaseController {
                             StringBuilder message = new StringBuilder();
                             for (Object o1 : jsonArray) {
                                 JSONObject jsonObject = JSONUtil.parseObj(o1);
-                                if ("0".equals(jsonObject.getStr("readState"))) {
+                                if ("0".equals(jsonObject.getStr("status"))) {
                                     // 未读
                                     unMessage.append(jsonObject.getStr("nickName")).append("、");
-                                } else if ("1".equals(jsonObject.getStr("readState"))) {
+                                } else if ("1".equals(jsonObject.getStr("status"))) {
                                     // 已读
                                     message.append(jsonObject.getStr("nickName")).append("、");
                                 }

+ 4 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/ResourceController.java

@@ -86,6 +86,8 @@ public class ResourceController extends BaseController {
                 rspData.setMsg("查询成功");
                 rspData.setRows(Collections.emptyList());
                 rspData.setTotal(0);
+                rspData.setPageNum(bo.getPageNum());
+                rspData.setPageSize(bo.getPageSize());
                 return rspData;
             }
         }
@@ -127,6 +129,8 @@ public class ResourceController extends BaseController {
         rspData.setMsg("查询成功");
         rspData.setRows(resourceDetail);
         rspData.setTotal(resourceDetail.size());
+        rspData.setPageSize(bo.getPageSize());
+        rspData.setPageNum(bo.getPageNum());
         return rspData;
     }
 

+ 39 - 36
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java

@@ -20,41 +20,44 @@ import java.util.List;
 @Accessors(chain = true)
 @ApiModel("分页响应对象")
 public class TableDataInfo<T> implements Serializable {
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * 总记录数
-	 */
-	@ApiModelProperty("总记录数")
-	private long total;
-
-	/**
-	 * 列表数据
-	 */
-	@ApiModelProperty("列表数据")
-	private List<T> rows;
-
-	/**
-	 * 消息状态码
-	 */
-	@ApiModelProperty("消息状态码")
-	private int code;
-
-	/**
-	 * 消息内容
-	 */
-	@ApiModelProperty("消息内容")
-	private String msg;
-
-	/**
-	 * 分页
-	 *
-	 * @param list  列表数据
-	 * @param total 总记录数
-	 */
-	public TableDataInfo(List<T> list, long total) {
-		this.rows = list;
-		this.total = total;
-	}
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 总记录数
+     */
+    @ApiModelProperty("总记录数")
+    private long total;
+
+    private long pageNum;
+    private long pageSize;
+
+    /**
+     * 列表数据
+     */
+    @ApiModelProperty("列表数据")
+    private List<T> rows;
+
+    /**
+     * 消息状态码
+     */
+    @ApiModelProperty("消息状态码")
+    private int code;
+
+    /**
+     * 消息内容
+     */
+    @ApiModelProperty("消息内容")
+    private String msg;
+
+    /**
+     * 分页
+     *
+     * @param list  列表数据
+     * @param total 总记录数
+     */
+    public TableDataInfo(List<T> list, long total) {
+        this.rows = list;
+        this.total = total;
+    }
 
 }

+ 11 - 5
ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java

@@ -48,6 +48,7 @@ public class PageUtils {
 
     /**
      * 构建 plus 分页对象
+     *
      * @param <T> domain 实体
      * @param <K> vo 实体
      * @return 分页对象
@@ -66,12 +67,13 @@ public class PageUtils {
         return page;
     }
 
-	public static <T> Page<T> buildPage() {
-		return buildPage(null, null);
-	}
+    public static <T> Page<T> buildPage() {
+        return buildPage(null, null);
+    }
 
     /**
      * 构建 MP 普通分页对象
+     *
      * @param <T> domain 实体
      * @return 分页对象
      */
@@ -98,8 +100,8 @@ public class PageUtils {
         }
         if (StringUtils.isNotBlank(orderByColumn)) {
             String orderBy = SqlUtil.escapeOrderBySql(orderByColumn);
-			orderBy = StringUtils.toUnderScoreCase(orderBy);
-			if ("asc".equals(isAsc)) {
+            orderBy = StringUtils.toUnderScoreCase(orderBy);
+            if ("asc".equals(isAsc)) {
                 return OrderItem.asc(orderBy);
             } else if ("desc".equals(isAsc)) {
                 return OrderItem.desc(orderBy);
@@ -114,6 +116,8 @@ public class PageUtils {
         rspData.setMsg("查询成功");
         rspData.setRows(page.getRecordsVo());
         rspData.setTotal(page.getTotal());
+        rspData.setPageNum(page.getCurrent());
+        rspData.setPageSize(page.getSize());
         return rspData;
     }
 
@@ -123,6 +127,8 @@ public class PageUtils {
         rspData.setMsg("查询成功");
         rspData.setRows(page.getRecords());
         rspData.setTotal(page.getTotal());
+        rspData.setPageNum(page.getCurrent());
+        rspData.setPageSize(page.getSize());
         return rspData;
     }
 

+ 86 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/SecurityInterceptor.java

@@ -1,13 +1,16 @@
 package com.ruoyi.framework.interceptor;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.useragent.UserAgent;
 import cn.hutool.http.useragent.UserAgentUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ruoyi.common.annotation.Security;
 import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.exception.ServiceException;
@@ -16,9 +19,13 @@ import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.ip.AddressUtils;
 import com.ruoyi.framework.web.service.SysPermissionService;
+import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.zhdd.domain.GatewayUserDetail;
+import com.ruoyi.zhdd.domain.Resource;
+import com.ruoyi.zhdd.domain.bo.ResourceBo;
 import com.ruoyi.zhdd.feign.FeignUserManageService;
+import com.ruoyi.zhdd.service.IResourceService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -30,6 +37,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.net.URLDecoder;
 import java.util.Date;
+import java.util.List;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
@@ -46,6 +54,10 @@ public class SecurityInterceptor implements HandlerInterceptor {
     @Autowired
     private ISysUserService userService;
     @Autowired
+    private ISysDeptService deptService;
+    @Autowired
+    private IResourceService resourceService;
+    @Autowired
     private SysPermissionService permissionService;
     @Autowired
     private FeignUserManageService feignUserManageService;
@@ -70,7 +82,7 @@ public class SecurityInterceptor implements HandlerInterceptor {
                 userStr = URLDecoder.decode(userStr, "UTF-8");
                 JSONObject userJsonObject = JSONUtil.parseObj(userStr);
                 String id = userJsonObject.getStr("id");
-                log.info("userJsonObject:{}", userJsonObject);
+                log.info("网关传递用户信息:{}", userJsonObject);
                 // 先从缓存中获取
                 String userKey = Constants.LOGIN_TOKEN_KEY + id;
                 LoginUser user = RedisUtils.getCacheObject(userKey);
@@ -105,6 +117,70 @@ public class SecurityInterceptor implements HandlerInterceptor {
                 if (gatewayUserDetail.getCode() == 200 && gatewayUserDetail.getData() != null && StrUtil.isNotBlank(gatewayUserDetail.getData().getUserId())) {
                     GatewayUserDetail.UserDetail data = gatewayUserDetail.getData();
                     SysUser newUser = new SysUser();
+                    // 如果是企业用户,则查询是否存在企业信息,存在则新增企业部门,同时往应急仓库新增一个数据
+                    if (data.getUserGroupId() == 4) {
+                        GatewayUserDetail.EntInfo entInfo = data.getEntInfo();
+                        if (entInfo == null || StrUtil.isBlank(entInfo.getEntName()) || StrUtil.isBlank(entInfo.getOwnerId()) || StrUtil.isBlank(entInfo.getOwnerCategory())) {
+                            throw new ServiceException("企业用户未绑定企业,不能使用此系统");
+                        }
+                        newUser.setDeptId(entInfo.getOwnerId());
+                        newUser.setOrgId(entInfo.getOwnerId());
+                        SysDept sysDept = deptService.selectDeptById(entInfo.getOwnerId());
+                        if (sysDept == null) {
+                            sysDept = new SysDept();
+                            sysDept.setDeptId(entInfo.getOwnerId());
+                            sysDept.setDeptName(entInfo.getEntName());
+                            sysDept.setFlag("0");
+                            // 根据企业类型放置不同的目录中
+                            if ("危货业户".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10001");
+                            } else if ("普货业户".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10002");
+                            } else if ("客运业户".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10003");
+                            } else if ("出租车业户".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10004");
+                            } else if ("公交运输业户".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10005");
+                            } else if ("汽车租赁业户".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10006");
+                            } else if ("检测站业户".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10007");
+                            } else if ("网约车平台".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10008");
+                            } else if ("维修站".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10009");
+                            } else if ("其他".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10010");
+                            } else if ("公路工程".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10011");
+                            } else if ("水运工程".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10012");
+                            } else if ("航运企业".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10013");
+                            } else if ("港口码头".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10014");
+                            } else if ("水上游览经营".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10015");
+                            } else if ("货运场站".equals(entInfo.getOwnerCategory())) {
+                                sysDept.setParentId("10016");
+                            }
+                            deptService.insertDept(sysDept);
+                        }
+                        List<Resource> resourcesList = resourceService.list(Wrappers.<Resource>lambdaQuery().eq(Resource::getManageUnitId, entInfo.getOwnerId()));
+                        if (resourcesList == null || resourcesList.size() == 0) {
+                            // 新增应急仓库
+                            ResourceBo resource = new ResourceBo();
+                            resource.setResourceType(1);
+                            resource.setName(entInfo.getEntName() + "仓库");
+                            resource.setManageUnit(entInfo.getEntName());
+                            resource.setContactName(data.getName());
+                            resource.setContactPhone(data.getMobile());
+                            resource.setLocationType("2");
+                            resource.setManageUnitId(entInfo.getOwnerId());
+                            resourceService.insertByBo(resource);
+                        }
+                    }
                     newUser.setUserId(data.getUserId());
                     newUser.setUserName(data.getUserName());
                     newUser.setNickName(data.getName());
@@ -118,6 +194,15 @@ public class SecurityInterceptor implements HandlerInterceptor {
                     newUser.setCreateBy("gateway");
                     newUser.setCreateTime(new Date());
                     userService.insertUser(newUser);
+                    if (data.getUserGroupId() == 4) {
+                        // 设置redis缓存
+                        user = new LoginUser(newUser.getUserId(), newUser.getDeptId(), newUser, permissionService.getMenuPermission(newUser));
+                        user.setUserRole(CollUtil.newHashSet("2"));
+                        setUserAgent(user);
+                        user.setSuQian(true);
+                        RedisUtils.setCacheObject(userKey, user, 120, TimeUnit.MINUTES);
+                        return true;
+                    }
                     throw new ServiceException("请联系应急事件处置系统管理员分配组织及权限");
                 } else {
                     throw new ServiceException("该用户不存在,请重新登录");

+ 1 - 5
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java

@@ -43,8 +43,6 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
     @Autowired
     private SysUserMapper userMapper;
 
-    private List<SysDept> allDept;
-
     /**
      * 查询部门管理数据
      *
@@ -330,9 +328,7 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
         if ("0".equals(sysDept.getFlag())) {
             return sysDept;
         }
-        if (allDept == null) {
-            allDept = baseMapper.selectList(Wrappers.emptyWrapper());
-        }
+        List<SysDept> allDept = baseMapper.selectList(Wrappers.emptyWrapper());
         SysDept orgDept = allDept.stream().filter(x -> StrUtil.equals(x.getDeptId(), sysDept.getParentId())).findFirst().get();
         return getOrgDept(orgDept);
     }

+ 10 - 1
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/GatewayUserDetail.java

@@ -13,10 +13,19 @@ public class GatewayUserDetail {
         private String userId;
         private String name;
         private String userName;
-        private String roleId;
         private String orgId;
         private String idNumber;
         private String mobile;
+        // (1:局领导,2:执法人员,3:从业人员,4:企业,5:公众,9:非执法人员)
         private int userGroupId;
+        private EntInfo entInfo;
     }
+
+    @Data
+    public static class EntInfo {
+        private String entName;
+        private String ownerId;
+        private String ownerCategory;
+    }
+
 }

+ 18 - 14
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/BacklogMessagePushBo.java

@@ -13,29 +13,33 @@ import java.util.List;
  */
 @Data
 public class BacklogMessagePushBo {
-    private String uuid;
+    // 应用id号(与注册到统一登陆平台的一致)
+    private String appId = "3bcb760743ea456faba29a1dfb247bf4";
+    private String uuId;
+    // 签名(值为MD5(AppId+ SendTime +Content)
+    private String verify;
     // 标题(必填)
     private String title;
-    // 副标题
-    private String subhead;
-    // 内容(必填)
-    private String text;
-    // 发送部门/人
-    private String department;
+    // 事项具体内容
+    private String content;
+    // 发送部门/人员
+    private String senderId;
     // 待办类型(华设固定给“3”)
     private String type = "3";
+    // 发送的用户
+    private List<String> receiverId;
     // 备注 (访问详情页面预留的参数,例如activity)
     private String note;
     // 下发时间
-    private String createTime = DateUtil.now();
-    // 附件URL
-    private String accessory;
+    private String sendTime = DateUtil.now();
+    // 副标题(非必填)
+    private String subhead;
+    // 该事项紧急程度码,10:最高级,紧急处置;5:着重提醒;0:普通事项,正常显示处理
+    private Integer urgency = 5;
     // ”状态”, 0:未办 1:已办(必填0)
     private String status = "0";
     // 跳转的详情页面地址
     private String url;
-    // 发送的用户
-    private List<String> userId;
-    // 紧急程度(0,5,10)
-    private String urgency;
+
+
 }

+ 1 - 1
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/BacklogMessageUpdateBo.java

@@ -10,7 +10,7 @@ import lombok.Data;
  */
 @Data
 public class BacklogMessageUpdateBo {
-    private String uuid;
+    private String uuId;
     // 待办类型(华设固定给“3”)
     private String type = "3";
     private String status = "1";

+ 3 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/IncidentBo.java

@@ -206,4 +206,7 @@ public class IncidentBo extends BaseEntity {
     private Set<Object> ids;
 
     private Date happenTime;
+
+    // 当前调用接口的用户id
+    private String currentUserId;
 }

+ 12 - 6
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/MessagePushBo.java

@@ -13,21 +13,27 @@ import java.util.List;
  */
 @Data
 public class MessagePushBo {
+    private String appId = "3bcb760743ea456faba29a1dfb247bf4";
+    private String uuId;
+    // 签名(值为MD5(AppId+ SendTime +Content)
+    private String verify;
     // 标题(必填)
-    private String msTitle;
+    private String title;
     // 简介(必填)
     private String msSynopsis;
-    // 内容(必填)
+    // 没有格式的消息内容
     private String msText;
-    private String msSource = "1";
+    // 有格式的消息内容,是一个JSON字符串
+    private String content;
+    private String senderId = "1";
     // 消息类型1:综合执法,2:应急指挥,3:运行监测
     private String msType = "2";
     // 是否定制化推送,0:否,1:是
     private String msCustom = "1";
     // 时间。格式yyyy-MM-dd
-    private String msTime = DateUtil.now();
-    // 消息id
-    private String msNo;
+    private String sendTime = DateUtil.now();
     // 发送的用户
     private List<MessagePushUser> messageReadInfoList;
+    private String url;
+    private String[] sendType = {"1", "2"};
 }

+ 9 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/MessagePushUser.java

@@ -18,4 +18,13 @@ public class MessagePushUser {
     private String deptName;
     private String userName;
     private SysDept dept;
+
+    private String receiverId;
+    private String status = getReadState();
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+        this.receiverId = userId;
+    }
+
 }

+ 1 - 1
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/IncidentProcessServiceImpl.java

@@ -120,7 +120,7 @@ public class IncidentProcessServiceImpl extends ServicePlusImpl<IncidentProcessM
             // 办结
             List<BacklogMessageUpdateBo> list = new ArrayList<>();
             BacklogMessageUpdateBo bo = new BacklogMessageUpdateBo();
-            bo.setUuid(uuid);
+            bo.setUuId(uuid);
             // 查询事件的id
             IncidentTaskVo incidentTaskVo = incidentTaskService.queryById(id);
             if (incidentTaskVo == null) {

+ 2 - 1
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/IncidentServiceImpl.java

@@ -339,6 +339,7 @@ public class IncidentServiceImpl extends ServicePlusImpl<IncidentMapper, Inciden
                 sendJsonObject.set("incidentId", bo.getId());
                 sendJsonObject.set("messagePushUsers", sendUser);
                 sendJsonObject.set("taskId", task.getId());
+//                sendJsonObject.set("senderId", );
                 RedisUtils.publish(Constants.NOTICE_PUSH_SINGLE, sendJsonObject);
             }
 
@@ -366,7 +367,7 @@ public class IncidentServiceImpl extends ServicePlusImpl<IncidentMapper, Inciden
                     List<BacklogMessageUpdateBo> list = new ArrayList<>();
                     for (IncidentProcess incidentProcess : processList) {
                         BacklogMessageUpdateBo messageUpdateBo = new BacklogMessageUpdateBo();
-                        messageUpdateBo.setUuid(incidentProcess.getId());
+                        messageUpdateBo.setUuId(incidentProcess.getId());
                         incidentProcess.setDes(incidentProcess.getDes().replace("【待办】", "【已办】"));
                         list.add(messageUpdateBo);
                     }

+ 3 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/ResourceServiceImpl.java

@@ -205,6 +205,9 @@ public class ResourceServiceImpl extends ServicePlusImpl<ResourceMapper, Resourc
                     list.add(resourceDetail);
                 }
                 resourceDetailService.saveAll(list);
+            } else if (bo.getResourceDetailList() != null && bo.getResourceDetailList().size() == 0) {
+                // 清空物资
+                resourceDetailService.remove(Wrappers.<ResourceDetail>lambdaQuery().eq(ResourceDetail::getResourceId, update.getId()));
             }
         }
         return save;