Browse Source

Merge branch 'V0.0.7' of http://10.87.21.221:8000/jzyd_yyds/soc into V0.0.7

zhulu 1 year ago
parent
commit
4d046c5759
35 changed files with 851 additions and 399 deletions
  1. 1 0
      project_data/sql/0.0.6-iot/soc/soc.sql
  2. 39 0
      project_data/sql/0.0.7/soc/soc.sql
  3. 22 4
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteSmsService.java
  4. 4 0
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/AccessDataVo.java
  5. 2 1
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/SafeCheckTaskRegisterBookVo.java
  6. 11 2
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteSmsFallbackFactory.java
  7. 111 0
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/vo/SmsInfoVo.java
  8. 4 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/mediator/domain/IotAlarmData.java
  9. 4 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/mediator/domain/IotAlarmRuleExpress.java
  10. 7 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/controller/TMonitoringRetrievalPlanController.java
  11. 10 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/domain/CoreMonitoringTaskRegistrationMonitor.java
  12. 7 6
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/CoreMonitoringTaskMonitorInfoServiceImpl.java
  13. 2 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java
  14. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/CoreSafecheckPlanController.java
  15. 13 11
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/domain/CoreSafetyTask.java
  16. 43 29
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanServiceImpl.java
  17. 1 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/SafetyCheckRegisterSericeImpl.java
  18. 6 6
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/regsiter/TaskRegisterVo.java
  19. 2 1
      soc-modules/soc-modules-core/src/main/resources/mapper/access/TMonitoringRetrievalPlanMapper.xml
  20. 16 10
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/service/LocalSysFileServiceImpl.java
  21. 71 22
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java
  22. 3 0
      soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/dto/alarm/IotAlarmRuleExpressDto.java
  23. 1 0
      soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/IotAlarmRuleServiceImpl.java
  24. 4 0
      soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/vo/alarm/IotAlarmRuleExpressEditVo.java
  25. 3 0
      soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/vo/alarm/IotAlarmSystemFieldVo.java
  26. 16 1
      soc-modules/soc-modules-mediator/src/main/java/com/xunmei/mediator/api/service/impl/IotAlarmDataServiceImpl.java
  27. 3 0
      soc-modules/soc-modules-sms/pom.xml
  28. 8 5
      soc-modules/soc-modules-sms/src/main/java/com/xunmei/sms/controller/SmsController.java
  29. 0 28
      soc-modules/soc-modules-sms/src/main/java/com/xunmei/sms/controller/TestController.java
  30. 9 1
      soc-modules/soc-modules-sms/src/main/java/com/xunmei/sms/service/ISmsService.java
  31. 102 7
      soc-modules/soc-modules-sms/src/main/java/com/xunmei/sms/service/SmsService.java
  32. 313 0
      soc-modules/soc-modules-sms/src/main/java/com/xunmei/sms/utils/SmsUtil.java
  33. 0 262
      soc-modules/soc-modules-sms/src/main/java/com/xunmei/sms/vo/SmsInfoVo.java
  34. 4 0
      soc-modules/soc-modules-sms/src/main/resources/esb-client.properties
  35. 8 0
      soc-modules/soc-modules-sms/src/main/resources/naocs.yml

+ 1 - 0
project_data/sql/0.0.6-iot/soc/soc.sql

@@ -771,6 +771,7 @@ CREATE TABLE `iot_alarm_rule_express` (
   `operator` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作符,GT(大于)、GTE(大于等于)、LT(小于)、LTE(小于等\r\n于)、EQUALS(等于)、STARTS_WITH(以什么开始)、\r\nENDS_WITH(以什么结束)、CONTAIN(包含)',
   `value` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '对比值',
   `value_text` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '对比值',
+  `sms_type` int NULL DEFAULT NULL COMMENT '是否需要发送短信:0不需要,1需要',
   `source_type` int NOT NULL COMMENT '报警源类型:4:烟雾传感器;5: 温湿度采集器;6:水浸; 7:门磁、窗磁;8:卷帘门门磁;9:地磁;10燃气报警器;50:报警防区',
   `week_day` int DEFAULT NULL COMMENT '规则使用周期:1.周一,2.周二,3.周三,4.周四,5.周五,6.周六,7.周日',
   `start_time` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '开始时间如:07:30',

+ 39 - 0
project_data/sql/0.0.7/soc/soc.sql

@@ -88,6 +88,29 @@ CREATE PROCEDURE schema_change () BEGIN
                 COMMENT = '出入申请表';
     END IF;
 
+	-- 安全检查增加签名图片字段
+    IF NOT EXISTS (
+                SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE () AND TABLE_NAME = 'core_safety_task' AND COLUMN_NAME = 'sign_img' ) THEN
+        alter table core_safety_task add sign_img varchar(125) null comment '签名图片';
+    END IF;
+
+
+
+    -- 监控调阅任务详情表有调阅设备更改为调阅区域,增加区域字段
+    IF NOT EXISTS (
+            SELECT * FROM INFORMATION_SCHEMA.COLUMNS
+                     WHERE table_schema = DATABASE ()
+                       AND TABLE_NAME = 'core_monitoring_task_registration_monitor'
+                       AND COLUMN_NAME = 'area_code' )
+        THEN
+                alter table core_monitoring_task_registration_monitor
+                    add area_code varchar(36) null comment '调阅区域,字典取值';
+
+                alter table core_monitoring_task_registration_monitor
+                    add area_name varchar(64) null comment '调阅区域名称';
+    END IF;
+
+
 END ??
 DELIMITER ;
 CALL schema_change ();
@@ -95,3 +118,19 @@ CALL schema_change ();
 -- 清空 来访申请和 来访记录数据
 delete from core_introduce_letter_out_in_request;
 delete from core_out_in_record;
+
+delete from sys_dict_type where dict_type = 'video_retrieval_area';
+delete from sys_dict_data where dict_type = 'video_retrieval_area';
+INSERT INTO sys_dict_type (dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark) VALUES ('监控调阅区域', 'video_retrieval_area', '0', '超级管理员', '2024-03-20 18:18:26', '', null, null);
+INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (0, '营业场所', '0', 'video_retrieval_area', null, 'default', 'N', '0', '超级管理员', '2024-03-20 18:20:59', '超级管理员', '2024-03-20 18:22:46', null);
+INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (1, '客户活动区', '1', 'video_retrieval_area', null, 'default', 'N', '0', '超级管理员', '2024-03-20 18:21:17', '超级管理员', '2024-03-20 18:22:55', null);
+INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (2, '非现金业务区', '2', 'video_retrieval_area', null, 'default', 'N', '0', '超级管理员', '2024-03-20 18:23:26', '', null, null);
+INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (3, '现金业务区', '3', 'video_retrieval_area', null, 'default', 'N', '0', '超级管理员', '2024-03-20 18:23:39', '', null, null);
+INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (4, '办公区', '4', 'video_retrieval_area', null, 'default', 'N', '0', '超级管理员', '2024-03-20 18:23:54', '', null, null);
+INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (5, '设备间', '5', 'video_retrieval_area', null, 'default', 'N', '0', '超级管理员', '2024-03-20 18:24:03', '', null, null);
+INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (6, '自助银行', '6', 'video_retrieval_area', null, 'default', 'N', '0', '超级管理员', '2024-03-20 18:24:22', '', null, null);
+INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (7, '加钞间', '7', 'video_retrieval_area', null, 'default', 'N', '0', '超级管理员', '2024-03-20 18:24:39', '', null, null);
+INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (8, '业务库', '8', 'video_retrieval_area', null, 'default', 'N', '0', '超级管理员', '2024-03-20 18:24:56', '', null, null);
+INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (9, '保管箱库', '9', 'video_retrieval_area', null, 'default', 'N', '0', '超级管理员', '2024-03-20 18:25:08', '', null, null);
+
+

+ 22 - 4
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteSmsService.java

@@ -1,15 +1,33 @@
 package com.xunmei.system.api;
 
 import com.xunmei.common.core.constant.ServiceNameConstants;
-import com.xunmei.system.api.factory.RemoteUserFallbackFactory;
+import com.xunmei.common.core.domain.R;
+import com.xunmei.common.core.web.domain.AjaxResult;
+import com.xunmei.system.api.factory.RemoteSmsFallbackFactory;
+import com.xunmei.system.api.vo.SmsInfoVo;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 
-@FeignClient(contextId = "remoteSmsService", value = ServiceNameConstants.SMS, fallbackFactory = RemoteUserFallbackFactory.class)
+@FeignClient(contextId = "remoteSmsService", value = ServiceNameConstants.SMS, fallbackFactory = RemoteSmsFallbackFactory.class)
 public interface RemoteSmsService {
+    /**
+     * 自定义发送
+     * @param smsData
+     * @return
+     */
+    @PostMapping("/api/sms/send")
+    R<AjaxResult> sendSms(@RequestBody SmsInfoVo smsData);
 
-    @GetMapping("/test/send")
-    String testSms(@RequestParam(value = "orgId") Long orgId);
 
+    /**
+     * 发送动环告警
+     * @param orgId
+     * @param alarmContent
+     * @return
+     */
+    @PostMapping("/api/sms/sendSmsIot")
+    void sendSmsIot(@RequestParam("orgId") Long orgId,@RequestParam("alarmContent") String alarmContent,@RequestParam("alarmTime") String alarmTime);
 }

+ 4 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/AccessDataVo.java

@@ -1,5 +1,6 @@
 package com.xunmei.system.api.domain;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -18,5 +19,8 @@ public class AccessDataVo {
     private String videoChannelName;
     private String project;
     private String situation;
+    @ApiModelProperty(value = "0正常1异常")
+    private Integer status;
     private String abnormalIllustrate;
+    private String areaName;
 }

+ 2 - 1
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/SafeCheckTaskRegisterBookVo.java

@@ -1,6 +1,5 @@
 package com.xunmei.system.api.domain;
 
-import com.xunmei.system.api.domain.CheckDataVo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
@@ -53,5 +52,7 @@ public class SafeCheckTaskRegisterBookVo {
 
   private String fileName;
 
+  private String signImg;
+
 
 }

+ 11 - 2
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteSmsFallbackFactory.java

@@ -1,6 +1,9 @@
 package com.xunmei.system.api.factory;
 
+import com.xunmei.common.core.domain.R;
+import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.system.api.RemoteSmsService;
+import com.xunmei.system.api.vo.SmsInfoVo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.cloud.openfeign.FallbackFactory;
@@ -19,9 +22,15 @@ public class RemoteSmsFallbackFactory implements FallbackFactory<RemoteSmsServic
         log.error("用户服务调用失败:{}", throwable.getMessage());
         return new RemoteSmsService() {
             @Override
-            public String testSms(Long orgId) {
-                return "error";
+            public R<AjaxResult> sendSms(SmsInfoVo smsData) {
+                return null;
             }
+
+            @Override
+            public void sendSmsIot(Long orgId, String alarmContent, String alarmTime) {
+
+            }
+
         };
     }
 }

+ 111 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/vo/SmsInfoVo.java

@@ -0,0 +1,111 @@
+package com.xunmei.system.api.vo;
+
+import lombok.Data;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author wubiyu[2024/03/18]
+ */
+@Data
+public class SmsInfoVo {
+    private static Logger logger = LoggerFactory.getLogger(SmsInfoVo.class);
+    /**
+     * 交易类型
+     */
+    private String tranType;
+    /**
+     * 机构号
+     */
+    private String branchId;
+    /**
+     * 所属机构号
+     */
+    private String belongBranchId;
+    /**
+     * 消费者系统流水号
+     */
+    private String consumerSeqNo;
+    /**
+     * 客户号
+     */
+    private String custNo;
+    /**
+     * 客户姓名
+     */
+    private String custName;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 手机号
+     */
+    private String mobile;
+
+    /**
+     * 帐号
+     */
+    private String acctNo;
+    /**
+     * 发生日期 格式:yyyy-MM-dd
+     */
+    private String occurDate;
+    /**
+     * 发生时间:格式:Hh:mm:ss
+     */
+    private String occurTime;
+    /**
+     * 交易金额1
+     */
+    private String tranAmt1;
+    /**
+     * 交易金额1
+     */
+    private String tranAmt2;
+    /**
+     * 交易金额1
+     */
+    private String tranAmt3;
+
+    /**
+     * 支出/存入位1
+     */
+    private String payoutStoreBit1;
+    /**
+     * 支出/存入位2
+     */
+    private String payoutStoreBit2;
+    /**
+     * 支出/存入位1
+     */
+    private String payoutStoreBit3;
+
+    /**
+     * 交易摘要
+     */
+    private String tranRemark;
+    /**
+     * 帐户状态
+     */
+    private String acctStatus;
+    /**
+     * 渠道类型
+     */
+    private String channelType;
+    /**
+     * 备用1
+     */
+    private String bak1;
+    /**
+     * 备用2
+     */
+    private String bak2;
+    /**
+     * 备用3
+     */
+    private String bak3;
+
+}

+ 4 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/mediator/domain/IotAlarmData.java

@@ -110,5 +110,9 @@ public class IotAlarmData extends BaseEntity {
     @TableField("do_type")
     private Integer doType;
 
+    @ApiModelProperty(value = "是否需要发送短信")
+    @TableField(exist = false)
+    private Boolean smsType;
+
 
 }

+ 4 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/mediator/domain/IotAlarmRuleExpress.java

@@ -57,6 +57,10 @@ public class IotAlarmRuleExpress implements Serializable {
     @TableField("source_type")
     private Integer sourceType;
 
+    @ApiModelProperty(value = "是否需要发送短信:0.不需要发送短信;1.需要发送短信")
+    @TableField("sms_type")
+    private Boolean smsType = false;
+
     /**
      * 采用时间段方式,农信版本不使用时间模板,不撤防不加入报警列表
      */

+ 7 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/controller/TMonitoringRetrievalPlanController.java

@@ -133,4 +133,11 @@ public class TMonitoringRetrievalPlanController extends BaseController {
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tMonitoringRetrievalPlanService.deleteTMonitoringRetrievalPlanByIds(ids));
     }
+
+    @ApiOperation(value = "根据任务id生成pdf")
+    @GetMapping(value = "/buildPdf/{id}")
+    public AjaxResult buildPdf(@PathVariable("id") Long id) {
+        tMonitoringRetrievalPlanService.buildPdf(id);
+        return AjaxResult.success("生成监控调阅登记簿成功!");
+    }
 }

+ 10 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/domain/CoreMonitoringTaskRegistrationMonitor.java

@@ -1,5 +1,6 @@
 package com.xunmei.core.access.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@@ -65,6 +66,15 @@ public class CoreMonitoringTaskRegistrationMonitor extends BaseEntity {
      */
     private String delFlag;
 
+    @TableField(value = "area_code")
+    @ApiModelProperty(value = "区域id",notes = "字典取值")
+    private String areaCode;
+
+    @TableField(value = "area_name")
+    @ApiModelProperty(value = "区域名")
+    private String areaName
+            ;
+
 
     @Override
     public String toString() {

+ 7 - 6
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/CoreMonitoringTaskMonitorInfoServiceImpl.java

@@ -1,8 +1,7 @@
 package com.xunmei.core.access.service.impl;
 
-import java.util.List;
-
 import com.alibaba.nacos.common.utils.CollectionUtils;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.common.core.constant.SecurityConstants;
@@ -18,13 +17,11 @@ import com.xunmei.system.api.RemoteDeviceService;
 import com.xunmei.system.api.domain.SysDevice;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-
-import java.util.Arrays;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.util.Arrays;
+import java.util.List;
 
 
 /**
@@ -121,6 +118,8 @@ private RemoteDeviceService remoteDeviceService;
           coreMonitoringTaskRegistrationMonitor.setVideoChannel(coreMonitoringTaskRegistrationMonitorDTO.getVideoChannel());
           coreMonitoringTaskRegistrationMonitor.setUpdateTime(DateUtils.getNowDate());
           coreMonitoringTaskRegistrationMonitor.setUpdateBy(SecurityUtils.getUsername());
+          coreMonitoringTaskRegistrationMonitor.setAreaCode(coreMonitoringTaskRegistrationMonitorDTO.getAreaCode());
+          coreMonitoringTaskRegistrationMonitor.setAreaName(coreMonitoringTaskRegistrationMonitorDTO.getAreaName());
           coreMonitoringTaskRegistrationMonitorMapper.updateById(coreMonitoringTaskRegistrationMonitor);
           QueryWrapper<CoreMonitoringTaskMonitorInfo> queryWrapper = new QueryWrapper();
           queryWrapper.eq("task_monitor_id", coreMonitoringTaskRegistrationMonitor.getId());
@@ -152,6 +151,8 @@ private RemoteDeviceService remoteDeviceService;
           coreMonitoringTaskMonitorInfo1.setCreateTime(DateUtils.getNowDate());
           coreMonitoringTaskMonitorInfo1.setCreateBy(SecurityUtils.getUsername());
           coreMonitoringTaskMonitorInfo1.setId(IdWorker.getId());
+          coreMonitoringTaskMonitorInfo1.setAreaCode(coreMonitoringTaskRegistrationMonitorDTO.getAreaCode());
+          coreMonitoringTaskMonitorInfo1.setAreaName(coreMonitoringTaskRegistrationMonitorDTO.getAreaName());
           coreMonitoringTaskMonitorInfo1.setTaskRegistrationId(coreMonitoringTaskRegistrationMonitorDTO.getTaskRegistrationId());
           SysDevice sysDevice = remoteDeviceService.getInfoById(coreMonitoringTaskRegistrationMonitorDTO.getHost(), SecurityConstants.INNER);
           SysDevice sysDevice1 = remoteDeviceService.getInfoById(coreMonitoringTaskRegistrationMonitorDTO.getVideoChannel(), SecurityConstants.INNER);

+ 2 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java

@@ -1601,13 +1601,13 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         accessPdf.setOrgName(accessPdfVO.getOrgName());
         List<AccessDataVo> dataVos = new ArrayList<>();
         List<AccessDataVo> accessDataVos = baseMapper.selectPointByTask(accessPdfVO.getTaskId());
-        for (AccessDataVo vo :
-                accessDataVos) {
+        for (AccessDataVo vo : accessDataVos) {
             AccessDataVo v = new AccessDataVo();
             v.setHostName(vo.getHostName());
             v.setVideoChannelName(vo.getVideoChannelName());
             v.setProject(vo.getProject());
             v.setSituation(vo.getSituation());
+            v.setAreaName(vo.getAreaName());
             v.setAbnormalIllustrate(vo.getAbnormalIllustrate());
             dataVos.add(v);
         }

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/CoreSafecheckPlanController.java

@@ -184,6 +184,6 @@ public class CoreSafecheckPlanController extends BaseController {
     @GetMapping(value = "/buildPdf/{id}")
     public AjaxResult buildPdf(@PathVariable("id") Long id) {
         coreSafecheckPlanService.buildPdf(id);
-        return AjaxResult.success("开始更新安全检查状态!");
+        return AjaxResult.success("生成安全检查登记簿成功!");
     }
 }

+ 13 - 11
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/domain/CoreSafetyTask.java

@@ -1,26 +1,22 @@
 package com.xunmei.core.safetyCheck.domain;
 
-import java.util.Date;
-import java.util.List;
-
-import com.alibaba.excel.annotation.ExcelProperty;
-import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.xunmei.common.core.web.domain.BaseEntity;
 import com.xunmei.core.safetyCheck.vo.plan.SafetyPlanRoleVo;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.IdType;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import com.xunmei.common.core.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+import java.util.List;
 
 /**
  * 【请填写功能名称】对象 core_safety_task
@@ -284,6 +280,12 @@ public class CoreSafetyTask extends BaseEntity {
     @ApiModelProperty(value = "任务的执行角色")
     private List<SafetyPlanRoleVo> roles;
 
+
+    @TableField(value = "sign_img")
+    private String signImg;
+
+
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 43 - 29
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanServiceImpl.java

@@ -1,44 +1,38 @@
 package com.xunmei.core.safetyCheck.service.impl;
 
-import java.io.File;
-import java.text.MessageFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.excel.util.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.common.core.constant.DictConstants;
 import com.xunmei.common.core.constant.ErrorMsgConstants;
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.domain.DateRange;
 import com.xunmei.common.core.domain.registerbook.domain.CoreRegisterBookPdf;
-import com.xunmei.common.core.enums.CycleCommonEnum;
 import com.xunmei.common.core.enums.OrgTypeEnum;
 import com.xunmei.common.core.enums.PlanStatus;
 import com.xunmei.common.core.enums.RegisterBookType;
-import com.xunmei.common.core.enums.resumption.ResumptionTaskStatus;
 import com.xunmei.common.core.exception.ServiceException;
 import com.xunmei.common.core.exception.SystemException;
 import com.xunmei.common.core.utils.DateHelper;
 import com.xunmei.common.core.utils.DateUtils;
+import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.common.redis.utils.RedisUtils;
 import com.xunmei.common.security.utils.DictUtils;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.question.QuestionSrcType;
 import com.xunmei.core.question.service.IQuestionService;
 import com.xunmei.core.registerbook.service.ICoreRegisterBookPdfService;
-import com.xunmei.core.resumption.domain.AppPlan;
-import com.xunmei.core.resumption.domain.Resumption;
 import com.xunmei.core.resumption.dto.DistributeDto;
 import com.xunmei.core.resumption.dto.DistributeStatusDto;
 import com.xunmei.core.resumption.mapper.AppPlanMapper;
-import com.xunmei.core.resumption.vo.appPlan.ResumptionPlanPageVo;
 import com.xunmei.core.safetyCheck.domain.*;
 import com.xunmei.core.safetyCheck.enums.SafetyCheckTaskStatus;
 import com.xunmei.core.safetyCheck.enums.SafetyPlanCycle;
@@ -46,11 +40,11 @@ import com.xunmei.core.safetyCheck.job.SafetyCheckJobBusiness;
 import com.xunmei.core.safetyCheck.mapper.*;
 import com.xunmei.core.safetyCheck.service.ICoreSafecheckPlanService;
 import com.xunmei.core.safetyCheck.vo.regsiter.AppTaskRegisterPointVo;
+import com.xunmei.core.safetyCheck.vo.ruleItem.SafetyCheckRulePointVo;
 import com.xunmei.system.api.RemoteFileService;
+import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.domain.CheckDataVo;
 import com.xunmei.system.api.domain.SafeCheckTaskRegisterBookVo;
-import com.xunmei.core.safetyCheck.vo.ruleItem.SafetyCheckRulePointVo;
-import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.function.RemoteCallHandlerExecutor;
 import io.netty.util.internal.StringUtil;
@@ -59,16 +53,18 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
-
-import java.util.stream.Collectors;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.xunmei.common.core.web.page.TableDataInfo;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.io.File;
+import java.text.MessageFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
 /**
  * 常规安全检查计划Service业务层处理
  *
@@ -300,7 +296,7 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
         }
 
         if (immediateEffect) {
-            safetyCheckJobBusiness.createTaskByPlans(hsPlans,dto.getId());
+            safetyCheckJobBusiness.createTaskByPlans(hsPlans, dto.getId());
         }
     }
 
@@ -374,7 +370,7 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
         }
 
         if (ObjectUtil.isNotEmpty(newlist)) {
-            safetyCheckJobBusiness.createTaskByPlans(newlist,id);
+            safetyCheckJobBusiness.createTaskByPlans(newlist, id);
         }
 
         return 1;
@@ -391,17 +387,18 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
             throw new ServiceException("已超过无周期任务的结束时间");
         }
     }
-    private void checkPlanIsCreatingTask(Long planId,String msg)
-    {
-        String redisKey="SafeCheck_Creating_Task" + planId;
+
+    private void checkPlanIsCreatingTask(Long planId, String msg) {
+        String redisKey = "SafeCheck_Creating_Task" + planId;
         Boolean hasKey = RedisUtils.hasKey(redisKey);
         if (hasKey) {
-            throw new ServiceException("该任务正在生成中,现在不能被"+msg+",请稍后再试。");
+            throw new ServiceException("该任务正在生成中,现在不能被" + msg + ",请稍后再试。");
         }
     }
+
     @Override
     public void cheHui(Long id) {
-        checkPlanIsCreatingTask(id,"撤回");
+        checkPlanIsCreatingTask(id, "撤回");
         Date now = new Date();
         CoreSafecheckPlan plan = baseMapper.selectById(id);
         if (ObjectUtil.equal(plan.getTaskHasCompleted(), 1)) {
@@ -868,7 +865,7 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
     @Override
     public int deleteCoreSafecheckPlanByIds(Long[] ids) {
         for (Long id : ids) {
-            checkPlanIsCreatingTask(id,"删除");
+            checkPlanIsCreatingTask(id, "删除");
             CoreSafecheckPlan plan = baseMapper.selectById(id);
             List<CoreSafecheckPlan> plans = baseMapper.selectList(new LambdaQueryWrapper<CoreSafecheckPlan>()
                     .in(CoreSafecheckPlan::getId, ids).or().in(CoreSafecheckPlan::getParentId, ids)
@@ -1018,7 +1015,11 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
     }
 
     public SafeCheckTaskRegisterBookVo buildSafetyCheckRegisterBookData(CoreSafetyTask appSafetyCheckTask) {
+        String prefixPath = RemoteCallHandlerExecutor.executeRemoteCall(() -> fileService.getLocalPathPrefix(), ErrorMsgConstants.QUERY_FILE_PATH_ERROR).getData();
+        String staticsPath = RemoteCallHandlerExecutor.executeRemoteCall(() -> fileService.getStaticPathPrefix(), ErrorMsgConstants.QUERY_FILE_PATH_ERROR).getData();
+
         SafeCheckTaskRegisterBookVo registerBookVo = new SafeCheckTaskRegisterBookVo();
+        registerBookVo.setSignImg(getFileRealPath(appSafetyCheckTask.getSignImg(), prefixPath, staticsPath));
         registerBookVo.setTaskTitle(appSafetyCheckTask.getTitle() /*+ getRegisterBookCycleText(Math.toIntExact(appSafetyCheckTask.getCheckCycle()), appSafetyCheckTask.getSubmitTime())*/);
         final SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日");
         String dateStr = format.format(appSafetyCheckTask.getSubmitTime());
@@ -1040,12 +1041,12 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
 
         List<CheckDataVo> pointCheckDataList = new ArrayList<>();
         List<AppTaskRegisterPointVo> appTaskRegisterPointVos = coreSafetyTaskMapper.selectPointByTask(appSafetyCheckTask.getId());
-        for (AppTaskRegisterPointVo vo :
-                appTaskRegisterPointVos) {
+        for (AppTaskRegisterPointVo vo : appTaskRegisterPointVos) {
             CheckDataVo v = new CheckDataVo();
             v.setItemName(vo.getItemName());
             v.setPointName(vo.getPointName());
             v.setResRemark(vo.getRemark());
+            v.setCheckStatus(vo.getStatus() == 0);
             v.setRectificationDeadline(vo.getRectificationDeadline());
             pointCheckDataList.add(v);
         }
@@ -1057,6 +1058,19 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
         return registerBookVo;
     }
 
+    private String getFileRealPath(String filePath, String prefixPath, String staticsPath) {
+
+        if (ObjectUtil.isEmpty(filePath)) {
+            return StringUtil.EMPTY_STRING;
+        }
+
+        if (filePath.contains(staticsPath)) {
+            //删除 /statics 前缀路径
+            filePath = filePath.replace(staticsPath, StringUtil.EMPTY_STRING);
+        }
+        return prefixPath + filePath;
+    }
+
     private String getRegisterBookCycleText(int cycle, Date checkDate) {
 
 

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/SafetyCheckRegisterSericeImpl.java

@@ -602,6 +602,7 @@ public class SafetyCheckRegisterSericeImpl extends ServiceImpl<CoreSafetyTaskMap
                 .set(CoreSafetyTask::getSubmitorId, SecurityUtils.getUserId())
                 .set(CoreSafetyTask::getSubmitBy, SecurityUtils.getLoginUser().getName())
                 .set(CoreSafetyTask::getExceptionCount, exceptionCount)
+                .set(CoreSafetyTask::getSignImg, data.getSignImg())
                 .set(CoreSafetyTask::getCheckTeam, data.getCheckTeam());
         if (ObjectUtil.equal(isSubmit, 1) && ObjectUtil.notEqual(SecurityUtils.getUserId(), data.getGrantUserId())) {
             //不是被授权人完成的该任务,则清空被授权人信息

+ 6 - 6
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/vo/regsiter/TaskRegisterVo.java

@@ -1,21 +1,18 @@
 package com.xunmei.core.safetyCheck.vo.regsiter;
 
-import java.util.Date;
-import java.util.List;
-
-import cn.hutool.core.date.DateUtil;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.vo.IdNameVo;
 import com.xunmei.core.safetyCheck.domain.CoreSafetyTask;
 import com.xunmei.system.api.domain.SysOrg;
 import io.swagger.annotations.ApiModelProperty;
-import lombok.Builder;
 import lombok.Data;
 import org.hibernate.validator.constraints.Length;
 
+import java.util.Date;
+import java.util.List;
+
 /**
  * 任务登记信息
  */
@@ -93,6 +90,9 @@ public class TaskRegisterVo<T> {
     @ApiModelProperty(value = "检查列表")
     private List<T> checkList;
 
+    @ApiModelProperty(value = "签名图片")
+    private String signImg;
+
     public static TaskRegisterVo of(CoreSafetyTask task, SysOrg beCheckedOrg, List<IdNameVo> checkRoles, int inRegisterTime) {
         TaskRegisterVo vo = new TaskRegisterVo();
         vo.setId(task.getId());

+ 2 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/access/TMonitoringRetrievalPlanMapper.xml

@@ -131,6 +131,8 @@
             e.device_name AS hostName,
             d.device_name AS videoChannelName,
             f.dict_label AS project,
+            c.situation as status,
+            b.area_name as areaName,
             IF
                 ( c.situation = 0, '正常', '异常' ) AS situation,
             c.abnormal_illustrate AS abnormalIllustrate
@@ -144,7 +146,6 @@
                 AND f.dict_type = 'core_registration_project'
         WHERE
             c.project IS NOT NULL
-          AND c.situation = 1
           AND a.task_id = #{taskId}
     </select>
     <select id="selectTask" resultType="com.xunmei.core.access.vo.AccessPdfVO">

+ 16 - 10
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/service/LocalSysFileServiceImpl.java

@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.ArrayUtil;
-import cn.hutool.core.util.ByteUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson2.JSON;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@@ -35,7 +34,6 @@ import com.xunmei.system.api.domain.SafeCheckTaskRegisterBookVo;
 import com.xunmei.system.api.vo.SysOrgVO;
 import io.netty.util.internal.StringUtil;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.text.StringEscapeUtils;
 import org.apache.tools.zip.ZipEntry;
@@ -314,7 +312,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         PdfFilePathVo pathVo = getLocalFilePath("access", data.getDest());
         String afterStr = StringEscapeUtils.escapeEcmaScript(pathVo.getAbsolutePath());
         log.info("开始生成监控调阅登记簿,当前绝对地址为:{}", afterStr);
-        final ItextPdfTableVo pdfTableVo = PdfUtil.createTable(pathVo.getAbsolutePath(), 46, 10);
+        final ItextPdfTableVo pdfTableVo = PdfUtil.createTable(pathVo.getAbsolutePath(), 19, 10);
         final Document document = pdfTableVo.getDocument();
         final PdfWriter writer = pdfTableVo.getWriter();
         final PdfPTable table = pdfTableVo.getTable();
@@ -326,14 +324,22 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         String checkUser = data.getCheckUser();
 
         Font titleFont = new Font(fs, 10, Font.NORMAL);
-        PdfUtil.createPDFCell(titleFont, table, "调阅单位", Element.ALIGN_MIDDLE, 10, 0);
-        PdfUtil.createPDFCell(titleFont, table, data.getOrgName(), Element.ALIGN_MIDDLE, 13, 0);
-        PdfUtil.createPDFCell(titleFont, table, "调阅人", Element.ALIGN_MIDDLE, 8, 0);
-        PdfUtil.createPDFCell(titleFont, table, checkUser, Element.ALIGN_MIDDLE, 15, 0);
-        PdfUtil.createPDFCell(titleFont, table, "调阅时间", Element.ALIGN_MIDDLE, 10, 0);
-        PdfUtil.createPDFCell(titleFont, table, checkTime, Element.ALIGN_MIDDLE, 36, 0);
-        PdfUtil.createPDFCell(titleFont, table, "发现问题情况", Element.ALIGN_MIDDLE, 46, 0);
+        PdfUtil.createPDFCell(titleFont, table, "调阅单位", Element.ALIGN_MIDDLE, 4, 1);
+        PdfUtil.createPDFCell(titleFont, table, data.getOrgName(), Element.ALIGN_MIDDLE, 6, 1);
+
+        PdfUtil.createPDFCell(titleFont, table, "调阅人", Element.ALIGN_MIDDLE, 3, 1);
+        PdfUtil.createPDFCell(titleFont, table, checkUser, Element.ALIGN_MIDDLE, 6, 1);
+
+        PdfUtil.createPDFCell(titleFont, table, "调阅时间", Element.ALIGN_MIDDLE, 4, 1);
+        PdfUtil.createPDFCell(titleFont, table, checkTime, Element.ALIGN_MIDDLE, 15, 1);
+
+        PdfUtil.createPDFCell(titleFont, table, "调阅人签字", Element.ALIGN_MIDDLE, 4, 1);
+        PdfUtil.createPDFCell(titleFont, table, checkTime, Element.ALIGN_MIDDLE, 15, 1);
+
+        PdfUtil.createPDFCell(titleFont, table, "监控调阅情况", Element.ALIGN_MIDDLE, 19, 1);
+
         PdfUtil.dealAccessPBody(document, table, tableFont, titleFont, data.getDataVos());
+        document.add(table);
         document.close();
         writer.close();
         log.info("监控调阅登记簿生成结束,当前绝对地址为:{}", afterStr);

+ 71 - 22
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

@@ -13,7 +13,6 @@ import com.xunmei.system.api.domain.AccessDataVo;
 import com.xunmei.system.api.domain.CheckDataVo;
 import com.xunmei.system.api.domain.SafeCheckTaskRegisterBookVo;
 import com.xunmei.system.api.domain.SysDictData;
-import com.xunmei.system.api.vo.QuestionPdfVo;
 import io.netty.util.internal.StringUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.FileUtils;
@@ -209,7 +208,7 @@ public class PdfUtil {
         PdfUtil.createPDFCell(tableFont, table, "单位名称", Element.ALIGN_MIDDLE, 2, 0);
         PdfUtil.createPDFCell(tableFont, table, data.get("orgName").toString(), Element.ALIGN_MIDDLE, 3, 0);
         PdfUtil.createPDFCell(tableFont, table, "检查时间", Element.ALIGN_MIDDLE, 2, 0);
-        PdfUtil.createPDFCell(tableFont, table,ObjectUtil.isNotEmpty(data.get("submiterNames"))? data.get("dateStr").toString():"", Element.ALIGN_MIDDLE, 3, 0);
+        PdfUtil.createPDFCell(tableFont, table, ObjectUtil.isNotEmpty(data.get("submiterNames")) ? data.get("dateStr").toString() : "", Element.ALIGN_MIDDLE, 3, 0);
         // 第二行
         PdfUtil.createPDFCell(tableFont, table, "检查人", Element.ALIGN_MIDDLE, 2, 0);
         PdfUtil.createPDFCell(tableFont, table, data.get("submiterNames").toString(), Element.ALIGN_MIDDLE, 8, 0);
@@ -243,7 +242,7 @@ public class PdfUtil {
                 String rowContent = o + "、" + listVo.get("pointName");
                 PdfUtil.createPDFCell(tableFont, table, rowContent, Element.ALIGN_LEFT, 6, 0);
                 // 检查情况
-                PdfUtil.createPDFCell(tableFont, table, ObjectUtil.isEmpty(listVo.get("resValue"))? "" : (((Integer) listVo.get("resValue")) == 0 ? "正常" : "异常"), Element.ALIGN_MIDDLE, 2, 0);
+                PdfUtil.createPDFCell(tableFont, table, ObjectUtil.isEmpty(listVo.get("resValue")) ? "" : (((Integer) listVo.get("resValue")) == 0 ? "正常" : "异常"), Element.ALIGN_MIDDLE, 2, 0);
                 // 检查人
                 //PdfUtil.createPDFCell(tableFont, table, String.valueOf(listVo.get("submitName")), Element.ALIGN_CENTER, 0, 0);
                 o++;
@@ -562,22 +561,53 @@ public class PdfUtil {
     }
 
     public static void dealAccessPBody(Document document, PdfPTable table, Font tableFont, Font tableTitleFont, List<AccessDataVo> data) throws DocumentException {
-        PdfUtil.createPDFCell(tableTitleFont, table, "序号", Element.ALIGN_MIDDLE, 5, 0);
-        PdfUtil.createPDFCell(tableTitleFont, table, "硬盘录像机", Element.ALIGN_MIDDLE, 8, 0);
-        PdfUtil.createPDFCell(tableTitleFont, table, "通道名称", Element.ALIGN_MIDDLE, 9, 0);
-        PdfUtil.createPDFCell(tableTitleFont, table, "检查项目", Element.ALIGN_MIDDLE, 8, 0);
-        PdfUtil.createPDFCell(tableTitleFont, table, "存在问题", Element.ALIGN_MIDDLE, 16, 0);
-        for (int i = 1; i <= data.size(); i++) {
-            PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 5, 0);
-            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getHostName(), Element.ALIGN_MIDDLE, 8, 0);
-            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getVideoChannelName(), Element.ALIGN_MIDDLE, 9, 0);
-            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getProject(), Element.ALIGN_MIDDLE, 8, 0);
-            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getAbnormalIllustrate(), Element.ALIGN_MIDDLE, 16, 0);
+        PdfUtil.createPDFCell(tableTitleFont, table, "序号", Element.ALIGN_MIDDLE, 2, 1);
+        PdfUtil.createPDFCell(tableTitleFont, table, "区域名称", Element.ALIGN_MIDDLE, 6, 1);
+        PdfUtil.createPDFCell(tableTitleFont, table, "调阅项目", Element.ALIGN_MIDDLE, 5, 1);
+        PdfUtil.createPDFCell(tableTitleFont, table, "调阅情况", Element.ALIGN_MIDDLE, 6, 1);
+        List<AccessDataVo> normalDataList = data.stream().filter(d -> ObjectUtil.equal(0, d.getStatus())).collect(Collectors.toList());
+        if (ObjectUtil.isNotEmpty(normalDataList)) {
+            for (int i = 1; i <= normalDataList.size(); i++) {
+                AccessDataVo accessDataVo = data.get(i - 1);
+                PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 2, 1);
+                PdfUtil.createPDFCell(tableFont, table, accessDataVo.getAreaName(), Element.ALIGN_MIDDLE, 6, 1);
+                PdfUtil.createPDFCell(tableFont, table, accessDataVo.getProject(), Element.ALIGN_MIDDLE, 5, 1);
+                PdfUtil.createPDFCell(tableFont, table, "正常", Element.ALIGN_MIDDLE, 6, 1);
+            }
+        } else {
+            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 2, 1);
+            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 6, 1);
+            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 5, 1);
+            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 6, 1);
+        }
+
+        PdfUtil.createPDFCell(tableTitleFont, table, "发现问题情况", Element.ALIGN_MIDDLE, 19, 1);
+
+        PdfUtil.createPDFCell(tableTitleFont, table, "序号", Element.ALIGN_MIDDLE, 2, 1);
+        PdfUtil.createPDFCell(tableTitleFont, table, "区域名称", Element.ALIGN_MIDDLE, 6, 1);
+        PdfUtil.createPDFCell(tableTitleFont, table, "调阅项目", Element.ALIGN_MIDDLE, 5, 1);
+        PdfUtil.createPDFCell(tableTitleFont, table, "存在问题", Element.ALIGN_MIDDLE, 6, 1);
+
+        List<AccessDataVo> exceptionDataList = data.stream().filter(d -> ObjectUtil.equal(0, d.getStatus())).collect(Collectors.toList());
+        if (ObjectUtil.isNotEmpty(exceptionDataList)) {
+            for (int i = 1; i <= exceptionDataList.size(); i++) {
+                AccessDataVo accessDataVo = data.get(i - 1);
+                PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 2, 1);
+                PdfUtil.createPDFCell(tableFont, table, accessDataVo.getAreaName(), Element.ALIGN_MIDDLE, 6, 1);
+                PdfUtil.createPDFCell(tableFont, table, accessDataVo.getProject(), Element.ALIGN_MIDDLE, 5, 1);
+                PdfUtil.createPDFCell(tableFont, table, accessDataVo.getAbnormalIllustrate(), Element.ALIGN_MIDDLE, 6, 1);
+            }
+        } else {
+            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 2, 1);
+            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 6, 1);
+            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 5, 1);
+            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 6, 1);
+
         }
-        document.add(table);
     }
 
-    public static void dealSafeCheckPBody(Document document, PdfPTable table, Font tableFont, SafeCheckTaskRegisterBookVo data) throws DocumentException {
+    public static void dealSafeCheckPBody(Document document, PdfPTable table, Font
+            tableFont, SafeCheckTaskRegisterBookVo data) throws Exception {
         PdfUtil.createPDFCell(tableFont, table, "被查单位", Element.ALIGN_MIDDLE, 3, 1);
         PdfUtil.createPDFCell(tableFont, table, data.getOrgName(), Element.ALIGN_MIDDLE, 4, 1);
         PdfUtil.createPDFCell(tableFont, table, "检查日期", Element.ALIGN_MIDDLE, 3, 1);
@@ -590,11 +620,30 @@ public class PdfUtil {
 
         PdfUtil.createPDFCell(tableFont, table, "检查单位", Element.ALIGN_MIDDLE, 3, 1);
         PdfUtil.createPDFCell(tableFont, table, data.getCheckOrgName(), Element.ALIGN_MIDDLE, 4, 1);
-        PdfUtil.createPDFCell(tableFont, table, "检查人", Element.ALIGN_MIDDLE, 3, 1);
+        PdfUtil.createPDFCell(tableFont, table, "检查组成员", Element.ALIGN_MIDDLE, 3, 1);
+        PdfUtil.createPDFCell(tableFont, table, data.getCheckTeam(), Element.ALIGN_MIDDLE, 4, 1);
+
+        PdfUtil.createPDFCell(tableFont, table, "主查人", Element.ALIGN_MIDDLE, 3, 1);
         PdfUtil.createPDFCell(tableFont, table, data.getCheckUserInfo(), Element.ALIGN_MIDDLE, 4, 1);
+        PdfUtil.createPDFCell(tableFont, table, "主查人签字", Element.ALIGN_MIDDLE, 3, 1);
+        List<String> list = new ArrayList<>();
+        list.add(data.getSignImg());
+        dealEduImageCell(list, table, 1, 70, 40);
+
+        PdfUtil.createPDFCell(tableFont, table, "检查工作情况", Element.ALIGN_MIDDLE, 14, 1);
+
+        List<CheckDataVo> normalDataList = data.getCheckDatas().stream().filter(d -> ObjectUtil.equal(Boolean.TRUE, d.getCheckStatus())).collect(Collectors.toList());
+        if (normalDataList.size() > 0) {
+            PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_MIDDLE, 2, 1);
+            PdfUtil.createPDFCell(tableFont, table, "检查内容", Element.ALIGN_MIDDLE, 6, 1);
+            PdfUtil.createPDFCell(tableFont, table, "检查情况", Element.ALIGN_MIDDLE, 6, 1);
+            for (CheckDataVo checkDataVo : normalDataList) {
+                PdfUtil.createPDFCell(tableFont, table, String.valueOf(normalDataList.indexOf(checkDataVo) + 1), Element.ALIGN_MIDDLE, 2, 1);
+                PdfUtil.createPDFCell(tableFont, table, checkDataVo.getPointName(), Element.ALIGN_MIDDLE, 10, 1);
+                PdfUtil.createPDFCell(tableFont, table, "正常", Element.ALIGN_MIDDLE, 2, 1);
+            }
+        }
 
-        PdfUtil.createPDFCell(tableFont, table, "检查组成员", Element.ALIGN_MIDDLE, 3, 1);
-        PdfUtil.createPDFCell(tableFont, table, data.getCheckTeam(), Element.ALIGN_MIDDLE, 11, 1);
 
         PdfUtil.createPDFCell(tableFont, table, "发现问题情况", Element.ALIGN_MIDDLE, 14, 1);
 
@@ -603,9 +652,9 @@ public class PdfUtil {
         PdfUtil.createPDFCell(tableFont, table, "存在问题", Element.ALIGN_MIDDLE, 6, 1);
         final Optional<CheckDataVo> optional = data.getCheckDatas().stream().filter(res -> ObjectUtil.isNotEmpty(res.getResRemark())).findAny();
         if (!optional.isPresent()) {
-            PdfUtil.createPDFCell(tableFont, table, "", Element.ALIGN_MIDDLE, 2, 1);
-            PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_MIDDLE, 6, 1);
-            PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_MIDDLE, 6, 1);
+            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 2, 1);
+            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 6, 1);
+            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 6, 1);
             document.add(table);
             return;
         }

+ 3 - 0
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/dto/alarm/IotAlarmRuleExpressDto.java

@@ -40,6 +40,9 @@ public class IotAlarmRuleExpressDto implements Serializable {
     @ApiModelProperty(value = "报警源类型:4:烟雾传感器;5: 温湿度采集器;6:水浸; 7:门磁、窗磁;8:卷帘门门磁;9:地磁;10燃气报警器;20:报警防区")
     private Integer sourceType;
 
+    @ApiModelProperty(value = "是否需要发送短信:0.不需要发送短信;1.需要发送短信")
+    private Boolean smsType = false;
+
     @ApiModelProperty(value = "规则使用周期:1.周一,2.周二,3.周三,4.周四,5.周五,6.周六,7.周日")
     @TableField("week_day")
     private Integer weekDay;

+ 1 - 0
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/IotAlarmRuleServiceImpl.java

@@ -89,6 +89,7 @@ public class IotAlarmRuleServiceImpl extends ServiceImpl<IotAlarmRuleMapper, Iot
             List<IotAlarmSystemFieldVo> systemFieldVos = appAlarmSystemFieldVoMapList.get(key);
             map.put("sourceTypeDes", systemFieldVos.get(0).getSourceTypeDes());
             map.put("sourceType", systemFieldVos.get(0).getSourceType());
+            map.put("smsType", systemFieldVos.get(0).getSmsType());
             List<Map<String, Object>> systemFieldsList = new ArrayList<>();
             for (IotAlarmSystemFieldVo vo : systemFieldVos) {
                 Map<String, Object> mapa = new HashMap<>();

+ 4 - 0
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/vo/alarm/IotAlarmRuleExpressEditVo.java

@@ -1,5 +1,6 @@
 package com.xunmei.iot.vo.alarm;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -37,6 +38,9 @@ public class IotAlarmRuleExpressEditVo implements Serializable {
     @ApiModelProperty(value = "报警源类型:4:烟雾传感器;5: 温湿度采集器;6:水浸; 7:门磁、窗磁;8:卷帘门门磁;9:地磁;10燃气报警器;20:报警防区")
     private Integer sourceType;
 
+    @ApiModelProperty(value = "是否需要发送短信:0.不需要发送短信;1.需要发送短信")
+    private Boolean smsType = false;
+
     @ApiModelProperty(value = "规则使用周期:1.周一,2.周二,3.周三,4.周四,5.周五,6.周六,7.周日")
     private Integer weekDay;
 

+ 3 - 0
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/vo/alarm/IotAlarmSystemFieldVo.java

@@ -26,6 +26,9 @@ public class IotAlarmSystemFieldVo implements Serializable {
     @ApiModelProperty(value = "报警源类型(设备类型):4:烟雾传感器;5: 温湿度采集器;6:水浸; 7:门磁、窗磁;8:卷帘门门磁;9:地磁;10燃气报警器;50:报警防区")
     private Integer sourceType;
 
+    @ApiModelProperty(value = "是否需要发送短信:0.不需要发送短信;1.需要发送短信")
+    private Boolean smsType = false;
+
     @ApiModelProperty(value = "报警源类型(设备类型) 中文")
     private String sourceTypeDes;
 

+ 16 - 1
soc-modules/soc-modules-mediator/src/main/java/com/xunmei/mediator/api/service/impl/IotAlarmDataServiceImpl.java

@@ -25,6 +25,7 @@ import com.xunmei.mediator.api.enums.AlarmRuleExpressOperateEnum;
 import com.xunmei.mediator.api.enums.AlarmVideoTypeEnum;
 import com.xunmei.mediator.api.mapper.*;
 import com.xunmei.mediator.api.service.IotAlarmDataService;
+import com.xunmei.system.api.RemoteSmsService;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
@@ -34,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
@@ -64,6 +66,9 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
     @Autowired
     private IotDeviceMapper iotDeviceMapper;
 
+    @Autowired
+    private RemoteSmsService remoteSmsService;
+
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void dealSensorData(IotSensor iotSensor) throws Exception {
@@ -103,6 +108,7 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
         boolean isExpress = false;
         List<IotAlarmData> list = new ArrayList<>();
         for (IotAlarmRuleExpress express : iotAlarmRuleExpresses) {
+            Boolean smsType = express.getSmsType();
             boolean isOk = compareTime(express, dateStr, now);
             if (!isOk) {
                 //不在时间段内
@@ -112,6 +118,7 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
             IotAlarmData alarmData = createAlarmData(iotSensor, express, fieldMap);
             if (alarmData != null) {
                 isAlarm = true;
+                alarmData.setSmsType(smsType);
                 list.add(alarmData);
             }
         }
@@ -125,6 +132,15 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
         if (isAlarm && alarms.size() == 0) {
             //报警中,且表中没有告警数据,则插入数据
             this.saveBatch(list);
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            for (IotAlarmData alarm : list) {
+                if(alarm.getSmsType()){
+                    //需要发送短信
+                    LocalDateTime time = alarm.getTime();
+                    String timeStr = time.format(formatter);
+                    remoteSmsService.sendSmsIot(iotSensor.getOrgId(),alarm.getContent(),timeStr);
+                }
+            }
             if (ObjectUtil.notEqual(iotSensor.getState(),1)) {
                 iotSensor.setState(1);
                 iotSensor.setStateUpdateTime(LocalDateTime.now());
@@ -138,7 +154,6 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
             if( alarms.size() != 0){
                 IotAlarmData iotAlarmData = alarms.get(0);
                 iotAlarmData.setEndTime(LocalDateTime.now());
-
                 this.updateById(iotAlarmData);
             }
 

+ 3 - 0
soc-modules/soc-modules-sms/pom.xml

@@ -135,6 +135,9 @@
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <includeSystemScope>true</includeSystemScope>
+                </configuration>
                 <executions>
                     <execution>
                         <goals>

+ 8 - 5
soc-modules/soc-modules-sms/src/main/java/com/xunmei/sms/controller/SmsController.java

@@ -3,11 +3,8 @@ package com.xunmei.sms.controller;
 import com.xunmei.common.core.web.controller.BaseController;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.sms.service.ISmsService;
-import com.xunmei.sms.vo.SmsInfoVo;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.xunmei.system.api.vo.SmsInfoVo;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 
@@ -35,4 +32,10 @@ public class SmsController extends BaseController {
     public AjaxResult send(@RequestBody SmsInfoVo smsData) {
         return smsService.send(smsData);
     }
+
+
+    @PostMapping("/sendSmsIot")
+    public void sendSmsIot(Long orgId,String alarmContent,String alarmTime){
+
+    };
 }

+ 0 - 28
soc-modules/soc-modules-sms/src/main/java/com/xunmei/sms/controller/TestController.java

@@ -1,28 +0,0 @@
-package com.xunmei.sms.controller;
-
-import com.xunmei.common.core.web.controller.BaseController;
-import com.xunmei.common.core.web.domain.AjaxResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @description:
- * @author: lj
- * @Date: 2024/2/22 16:26
- */
-@Api(tags = {"SmsTest"})
-@RestController
-@RequestMapping("/test")
-public class TestController extends BaseController {
-
-    @ApiOperation(value = "根据机构获取区域")
-    @GetMapping("/send")
-    public String getAreaByOrg(@RequestParam(value = "orgId") Long orgId) {
-        return "Ok"+ " " + orgId;
-    }
-}

+ 9 - 1
soc-modules/soc-modules-sms/src/main/java/com/xunmei/sms/service/ISmsService.java

@@ -1,7 +1,7 @@
 package com.xunmei.sms.service;
 
 import com.xunmei.common.core.web.domain.AjaxResult;
-import com.xunmei.sms.vo.SmsInfoVo;
+import com.xunmei.system.api.vo.SmsInfoVo;
 
 /**
  * 短信服务
@@ -14,4 +14,12 @@ public interface ISmsService {
      * @return {@link AjaxResult}
      */
     AjaxResult send(SmsInfoVo data);
+
+    /**
+     * 发送动环短信iot
+     * @param orgId
+     * @param alarmContent
+     * @return
+     */
+    void sendSmsIot(Long orgId,String alarmContent,String alarmTime);
 }

+ 102 - 7
soc-modules/soc-modules-sms/src/main/java/com/xunmei/sms/service/SmsService.java

@@ -1,43 +1,135 @@
 package com.xunmei.sms.service;
 
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.dc.eai.data.CompositeData;
 import com.dcfs.esb.client.ESBClient;
+import com.xunmei.common.core.constant.ErrorMsgConstants;
+import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.web.domain.AjaxResult;
-import com.xunmei.sms.vo.SmsInfoVo;
+import com.xunmei.sms.utils.SmsUtil;
+import com.xunmei.system.api.RemoteOrgService;
+import com.xunmei.system.api.RemoteRoleService;
+import com.xunmei.system.api.domain.SysOrg;
+import com.xunmei.system.api.domain.SysUser;
+import com.xunmei.system.api.function.RemoteCallHandlerExecutor;
+import com.xunmei.system.api.vo.SmsInfoVo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
+import java.util.List;
+
 @Service
 public class SmsService implements ISmsService {
 
     private static Logger logger = LoggerFactory.getLogger(SmsService.class);
 
+    @Autowired
+    private RemoteRoleService remoteRoleService;
+
+    @Autowired
+    private RemoteOrgService remoteOrgService;
+
+    //告警代码
+    private static final String ALARM_CODE="854002";
+    //逾期提醒代码
+    private static  final  String TODO_CODE="854001";
+
+    /**
+     * 在ESB系统里的 系统编码
+     */
+    @Value("${systemCode}")
+    private String systemCode;
+
+    /**
+     * 系统名称
+     */
+    @Value("${systemName}")
+    private String systemName;
+
+
+    /**
+     * 服务代码
+     */
+    @Value("${serviceCode}")
+    private String serviceCode;
+
+    /**
+     * 服务场景
+     */
+    @Value("${serviceScene}")
+    private String serviceScene;
+
+
+
+
     /**
      * 发送短信
      * @param data
      * @return {@link AjaxResult}
      */
     @Override
+    @Async
     public AjaxResult send(SmsInfoVo data) {
         try {
-            logger.debug("【发送短信】开始,数据:" + JSONObject.toJSONString(data));
-            CompositeData smsCompositeData = SmsInfoVo.convertTo(data);
-
+            logger.debug("【发送短信】开始,数据:" + JSONObject.toJSON(data));
+            CompositeData smsCompositeData = SmsUtil.createSmsBody(data,systemCode,systemName,serviceCode,serviceScene);
+            logger.debug("【发送短信】转换后数据:" + JSONObject.toJSON(smsCompositeData));
             if (smsCompositeData == null) {
-                logger.error("【发送短信】转换数据出错:原数据:"+JSONObject.toJSONString(data));
+                logger.error("【发送短信】转换数据出错:原数据:"+JSONObject.toJSON(data));
                 return AjaxResult.error("【发送短信】转换数据出错");
             }
             CompositeData rspData = ESBClient.request(smsCompositeData);
-            logger.debug("【发送短信】返回数据:" + JSONObject.toJSONString(rspData));
+            logger.debug("【发送短信】返回数据:" + JSONObject.toJSON(rspData));
             return getResult(rspData);
         } catch (Exception ex) {
-            logger.error("【发送短信】发送时内部异常:数据:"+JSONObject.toJSONString(data),ex);
+            logger.error("【发送短信】发送时内部异常:数据:"+JSONObject.toJSON(data),ex);
             return AjaxResult.error("【发送短信】发送时内部异常");
         }
     }
 
+    /**
+     * 根据机构获取机构下网点负责人角色,并发送告警短信
+     * @param orgId
+     * @param alarmContent
+     * @return
+     */
+    @Override
+    public void sendSmsIot(Long orgId, String alarmContent,String alarmTime) {
+        List<SysUser> userList = RemoteCallHandlerExecutor.executeRemoteCall(() ->
+                remoteRoleService.selectUserByRoleNameAndOrgId("网点负责人", orgId, 0, SecurityConstants.INNER), ErrorMsgConstants.QUERY_USER_DATA_ERROR);
+        SysOrg sysOrg = remoteOrgService.selectOrgById(orgId, SecurityConstants.INNER);
+        Date now = new Date();
+        String date = DateUtil.format(now, "yyyy-MM-dd");
+        String time = DateUtil.format(now, "hh:mm:ss");
+        if (ObjectUtil.isNotEmpty(userList)){
+            for (SysUser sysUser : userList) {
+                String phone = sysUser.getPhone();
+                SmsInfoVo smsInfoVo = new SmsInfoVo();
+                smsInfoVo.setBelongBranchId(sysOrg.getGuid());
+                smsInfoVo.setTranType(ALARM_CODE);
+                smsInfoVo.setMobile(phone);
+                smsInfoVo.setOccurDate(date);
+                smsInfoVo.setOccurTime(time);
+                smsInfoVo.setBak3(alarmContent);
+                CompositeData smsCompositeData = SmsUtil.createSmsBody(smsInfoVo,systemCode,systemName,serviceCode,serviceScene);
+                CompositeData rspData = null;
+                try {
+                    rspData = ESBClient.request(smsCompositeData);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                 getResult(rspData);
+            }
+        }
+    }
+
     private AjaxResult getResult(CompositeData repData) {
         boolean result = false;
         try {
@@ -56,4 +148,7 @@ public class SmsService implements ISmsService {
             return AjaxResult.error("【发送短信】解析发送结果时内部异常");
         }
     }
+
+
+
 }

+ 313 - 0
soc-modules/soc-modules-sms/src/main/java/com/xunmei/sms/utils/SmsUtil.java

@@ -0,0 +1,313 @@
+package com.xunmei.sms.utils;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.RandomUtil;
+import com.dc.eai.data.CompositeData;
+import com.dc.eai.data.Field;
+import com.dc.eai.data.FieldAttr;
+import com.dc.eai.data.FieldType;
+import com.xunmei.system.api.vo.SmsInfoVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Date;
+
+/**
+ * 短信工具类
+ */
+public class SmsUtil {
+
+    private static Logger logger = LoggerFactory.getLogger(SmsUtil.class);
+
+
+    /**
+     * 消费者系统流水号格式:系统编号(5位)+本系统交易日期(8位:YYYYMMDD)+业务流水序号(10位)
+     * @param systemCode 系统编号
+     * @return
+     */
+    public static String getConsumerSeqNo(String systemCode,String tranDate){
+        StringBuffer sb = new StringBuffer();
+
+        //系统编号
+        sb.append(systemCode);
+
+        //本系统交易日期
+        sb.append(tranDate);
+
+        //业务流水序号
+        String seqNo = RandomUtil.randomNumbers(10);
+        sb.append(seqNo);
+
+        return sb.toString();
+    }
+
+
+
+    /**
+     * 生成短信请求系统头
+     * @return
+     */
+    public static CompositeData getSysHead(String systemCode,String systemName,String serviceCode,String serviceScene){
+        CompositeData sysData = new CompositeData();
+
+        Date nowTime = new Date();
+
+        String yyyyMMdd = DateUtil.format(nowTime, "yyyyMMdd");
+
+        String hhmmss = DateUtil.format(nowTime, "hhmmss");
+
+        //发送方机构ID,当前系统没有设置为空
+        Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue("");
+        sysData.addField("BRANCH_ID", field);
+
+        //消费者系统编号  ESB分配的系统编号
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue(systemCode);
+        sysData.addField("CONSUMER_ID", field);
+
+        //消费者系统流水号(直接请求系统) 系统编号(5位)+本系统交易日期(8位:YYYYMMDD)+业务流水序号(10位)
+        String consumerSeqNo = SmsUtil.getConsumerSeqNo(systemCode,yyyyMMdd);
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue(consumerSeqNo);
+        sysData.addField("CONSUMER_SEQ_NO", field);
+
+        //文件标识 0-非文件,1-文件
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue("0");
+        sysData.addField("FILE_FLAG", field);
+
+        //原始发起方系统编号 和消费者系统编号一致
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue(systemCode);
+        sysData.addField("ORG_SYS_ID", field);
+
+        //原始发起方系统流水号 和 消费者系统编号一致
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue(consumerSeqNo);
+        sysData.addField("ORG_SYS_SEQ_NO", field);
+
+        //服务代码
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue(serviceCode);
+        sysData.addField("SERVICE_CODE", field);
+
+        //服务场景
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue(serviceScene);
+        sysData.addField("SERVICE_SCENE", field);
+
+        //发送方网点号,默认设置为空
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue("");
+        sysData.addField("SUB_BRANCH_ID", field);
+
+        //交易日期 yyyyMMdd
+
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue(yyyyMMdd);
+        sysData.addField("TRAN_DATE", field);
+
+        //交易时间 hh:mm:ss
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue(hhmmss);
+        sysData.addField("TRAN_TIMESTAMP", field);
+
+        //交易标志 0-正常,1-补正,2-冲销
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue("0");
+        sysData.addField("TRAN_FLAG", field);
+
+        //交易模式
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue("ONLINE");
+        sysData.addField("TRAN_MODE", field);
+
+
+        //交易柜员号,默认为空
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue("");
+        sysData.addField("USER_ID", field);
+
+        //交易系统名
+        field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
+        field.setValue(systemName);
+        sysData.addField("WS_ADDR", field);
+
+        return sysData;
+    }
+
+
+    /**
+     * 构建应用消息体
+     * @return
+     */
+    private static CompositeData getAppHead(){
+        CompositeData appData = new CompositeData();
+
+        //KEY_MSG_FLAG 0-无,1-多页式
+        Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 1, 0));
+        field.setValue("0");
+        appData.addField("KEY_MSG_FLAG", field);
+
+        return appData;
+    }
+
+    /**
+     * 构建发送消息体
+     * @param source
+     * @return
+     */
+    private static CompositeData getBody(SmsInfoVo source){
+        CompositeData body = new CompositeData();
+
+        if (source.getTranType() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 6, 0));
+            field.setValue(source.getTranType());
+            body.addField("TRAN_TYPE", field);
+        }
+
+        if (source.getBelongBranchId() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 9, 0));
+            field.setValue(source.getBelongBranchId());
+            body.addField("BELONG_BRANCH_ID", field);
+        }
+
+        if (source.getCustNo() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 22, 0));
+            field.setValue(source.getCustNo());
+            body.addField("CUST_NO", field);
+        }
+
+        if (source.getCustName() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 50, 0));
+            field.setValue(source.getCustNo());
+            body.addField("CUST_NAME", field);
+        }
+        if (source.getSex() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 2, 0));
+            field.setValue(source.getSex());
+            body.addField("SEX", field);
+        }
+        if (source.getMobile() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 20, 0));
+            field.setValue(source.getMobile());
+            body.addField("MOBILE", field);
+        }
+        if (source.getAcctNo() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 32, 0));
+            field.setValue(source.getAcctNo());
+            body.addField("ACCT_NO", field);
+        }
+
+        if (source.getOccurDate() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 10, 0));
+            field.setValue(source.getOccurDate());
+            body.addField("OCCUR_DATE", field);
+        }
+
+        if (source.getOccurTime() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 10, 0));
+            field.setValue(source.getOccurTime());
+            body.addField("OCCUR_TIME", field);
+        }
+
+        if (source.getTranAmt1() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 17, 0));
+            field.setValue(source.getTranAmt1());
+            body.addField("TRAN_AMT1", field);
+        }
+
+        if (source.getTranAmt2() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 17, 0));
+            field.setValue(source.getTranAmt2());
+            body.addField("TRAN_AMT2", field);
+        }
+
+        if (source.getTranAmt3() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 17, 0));
+            field.setValue(source.getTranAmt3());
+            body.addField("TRAN_AMT3", field);
+        }
+
+        if (source.getPayoutStoreBit1() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 1, 0));
+            field.setValue(source.getPayoutStoreBit1());
+            body.addField("PAYOUT_STORE_BIT1", field);
+        }
+        if (source.getPayoutStoreBit2() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 1, 0));
+            field.setValue(source.getPayoutStoreBit2());
+            body.addField("PAYOUT_STORE_BIT2", field);
+        }
+        if (source.getPayoutStoreBit3() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 1, 0));
+            field.setValue(source.getPayoutStoreBit3());
+            body.addField("PAYOUT_STORE_BIT3", field);
+        }
+        if (source.getTranRemark() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 30, 0));
+            field.setValue(source.getTranRemark());
+            body.addField("TRAN_REMARK", field);
+        }
+        if (source.getAcctStatus() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 100, 0));
+            field.setValue(source.getAcctStatus());
+            body.addField("ACCT_STATUS", field);
+        }
+        if (source.getChannelType() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 2, 0));
+            field.setValue(source.getChannelType());
+            body.addField("CHANNEL_TYPE", field);
+        }
+        if (source.getBak1() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 50, 0));
+            field.setValue(source.getBak1());
+            body.addField("BAK1", field);
+        }
+        if (source.getBak2() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 50, 0));
+            field.setValue(source.getBak2());
+            body.addField("BAK2", field);
+        }
+        if (source.getBak3() != null) {
+            Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 50, 0));
+            field.setValue(source.getBak3());
+            body.addField("BAK3", field);
+        }
+
+        return body;
+    }
+
+
+    /**
+     * 构建发送消息体
+     * @param source 构建body实体
+     * @param systemCode 系统编号
+     * @param systemName 系统名称
+     * @param serviceCode 服务code
+     * @param serviceScene 服务场景
+     * @return
+     */
+    public static CompositeData createSmsBody(SmsInfoVo source, String systemCode, String systemName, String serviceCode, String serviceScene) {
+        try {
+            /***********************************************************************
+             * *********构造请求数据,定义相关结构体*******
+             **********************************************************************/
+            CompositeData reqData = new CompositeData();
+            //构建服务
+            CompositeData sysHead = getSysHead(systemCode, systemName, serviceCode, serviceScene);
+            CompositeData appHead = getAppHead();
+            CompositeData body = getBody(source);
+            reqData.addStruct("SYS_HEAD", sysHead);
+            reqData.addStruct("APP_HEAD", appHead);
+            reqData.addStruct("BODY", body);
+
+            return reqData;
+        } catch (Exception ex) {
+            logger.error("【发送短信】转换数据异常", ex);
+            return null;
+        }
+    }
+
+}

+ 0 - 262
soc-modules/soc-modules-sms/src/main/java/com/xunmei/sms/vo/SmsInfoVo.java

@@ -1,262 +0,0 @@
-package com.xunmei.sms.vo;
-
-import com.dc.eai.data.CompositeData;
-import com.dc.eai.data.Field;
-import com.dc.eai.data.FieldAttr;
-import com.dc.eai.data.FieldType;
-import lombok.Data;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author wubiyu[2024/03/18]
- */
-@Data
-public class SmsInfoVo {
-    private static Logger logger = LoggerFactory.getLogger(SmsInfoVo.class);
-    /**
-     * 交易类型
-     */
-    private String tranType;
-    /**
-     * 机构号
-     */
-    private String branchId;
-    /**
-     * 消费者系统流水号
-     */
-    private String consumerSeqNo;
-    /**
-     * 客户号
-     */
-    private String custNo;
-    /**
-     * 客户姓名
-     */
-    private String custName;
-
-    /**
-     * 性别
-     */
-    private String sex;
-
-    /**
-     * 手机号
-     */
-    private String mobile;
-
-    /**
-     * 帐号
-     */
-    private String acctNo;
-    /**
-     * 发生日期 格式:yyyy-MM-dd
-     */
-    private String occurDate;
-    /**
-     * 发生时间:格式:Hh:mm:ss
-     */
-    private String occurTime;
-    /**
-     * 交易金额1
-     */
-    private String tranAmt1;
-    /**
-     * 交易金额1
-     */
-    private String tranAmt2;
-    /**
-     * 交易金额1
-     */
-    private String tranAmt3;
-
-    /**
-     * 支出/存入位1
-     */
-    private String payoutStoreBit1;
-    /**
-     * 支出/存入位2
-     */
-    private String payoutStoreBit2;
-    /**
-     * 支出/存入位1
-     */
-    private String payoutStoreBit3;
-
-    /**
-     * 交易摘要
-     */
-    private String tranRemark;
-    /**
-     * 帐户状态
-     */
-    private String acctStatus;
-    /**
-     * 渠道类型
-     */
-    private String channelType;
-    /**
-     * 备用1
-     */
-    private String bak1;
-    /**
-     * 备用2
-     */
-    private String bak2;
-    /**
-     * 备用3
-     */
-    private String bak3;
-
-    public static CompositeData convertTo(SmsInfoVo source) {
-        try {
-            /***********************************************************************
-             * *********构造请求数据,定义相关结构体*******
-             **********************************************************************/
-            CompositeData reqData = new CompositeData();
-            CompositeData sysData = new CompositeData();
-            CompositeData appData = new CompositeData();
-            CompositeData body = new CompositeData();
-
-            reqData.addStruct("SYS_HEAD", sysData);
-            reqData.addStruct("APP_HEAD", appData);
-            reqData.addStruct("BODY", body);
-
-            /***********************************************************************
-             * ********* 系统头 ******************
-             **********************************************************************/
-            if (source.getConsumerSeqNo() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 15, 0));
-                field.setValue(source.getConsumerSeqNo());
-                sysData.addField("CONSUMER_SEQ_NO", field);
-            }
-
-            /***********************************************************************
-             * ********** 应用头 ***************
-             **********************************************************************/
-            if (source.getBranchId() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 9, 0));
-                field.setValue(source.getBranchId());
-                appData.addField("BRANCH_ID", field);
-            }
-
-            // 应用头其他需要上送的数据。。。
-
-            /***********************************************************************
-             * ************* 报文体 ************ 服务代码为11003000002,场景为07定义的输入数据
-             **********************************************************************/
-
-            if (source.getTranType() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 6, 0));
-                field.setValue(source.getTranType());
-                body.addField("TRAN_TYPE", field);
-            }
-            if (source.getCustNo() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 22, 0));
-                field.setValue(source.getCustNo());
-                body.addField("CUST_NO", field);
-            }
-
-            if (source.getCustName() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 50, 0));
-                field.setValue(source.getCustNo());
-                body.addField("CUST_NAME", field);
-            }
-            if (source.getSex() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 2, 0));
-                field.setValue(source.getSex());
-                body.addField("SEX", field);
-            }
-            if (source.getMobile() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 20, 0));
-                field.setValue(source.getMobile());
-                body.addField("MOBILE", field);
-            }
-            if (source.getAcctNo() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 32, 0));
-                field.setValue(source.getAcctNo());
-                body.addField("ACCT_NO", field);
-            }
-
-            if (source.getOccurDate() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 10, 0));
-                field.setValue(source.getOccurDate());
-                body.addField("OCCUR_DATE", field);
-            }
-
-            if (source.getOccurTime() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 10, 0));
-                field.setValue(source.getOccurTime());
-                body.addField("OCCUR_TIME", field);
-            }
-
-            if (source.getTranAmt1() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 17, 0));
-                field.setValue(source.getTranAmt1());
-                body.addField("TRAN_AMT1", field);
-            }
-
-            if (source.getTranAmt2() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 17, 0));
-                field.setValue(source.getTranAmt2());
-                body.addField("TRAN_AMT2", field);
-            }
-
-            if (source.getTranAmt3() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 17, 0));
-                field.setValue(source.getTranAmt3());
-                body.addField("TRAN_AMT3", field);
-            }
-
-            if (source.getPayoutStoreBit1() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 1, 0));
-                field.setValue(source.getPayoutStoreBit1());
-                body.addField("PAYOUT_STORE_BIT1", field);
-            }
-            if (source.getPayoutStoreBit2() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 1, 0));
-                field.setValue(source.getPayoutStoreBit2());
-                body.addField("PAYOUT_STORE_BIT2", field);
-            }
-            if (source.getPayoutStoreBit3() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 1, 0));
-                field.setValue(source.getPayoutStoreBit3());
-                body.addField("PAYOUT_STORE_BIT3", field);
-            }
-            if (source.getTranRemark() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 30, 0));
-                field.setValue(source.getTranRemark());
-                body.addField("TRAN_REMARK", field);
-            }
-            if (source.getAcctStatus() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 100, 0));
-                field.setValue(source.getAcctStatus());
-                body.addField("ACCT_STATUS", field);
-            }
-            if (source.getChannelType() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 2, 0));
-                field.setValue(source.getChannelType());
-                body.addField("CHANNEL_TYPE", field);
-            }
-            if (source.getBak1() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 50, 0));
-                field.setValue(source.getBak1());
-                body.addField("BAK1", field);
-            }
-            if (source.getBak2() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 50, 0));
-                field.setValue(source.getBak2());
-                body.addField("BAK2", field);
-            }
-            if (source.getBak3() != null) {
-                Field field = new Field(new FieldAttr(FieldType.FIELD_STRING, 50, 0));
-                field.setValue(source.getBak3());
-                body.addField("BAK3", field);
-            }
-            return reqData;
-        } catch (Exception ex) {
-            logger.error("【发送短信】转换数据异常", ex);
-            return null;
-        }
-    }
-}

+ 4 - 0
soc-modules/soc-modules-sms/src/main/resources/esb-client.properties

@@ -0,0 +1,4 @@
+url=http://192.111.37.206:30174/YDAQBWGLXT
+uid=YDAQBWGLXT
+readTimeout=60
+connTimeout=10

+ 8 - 0
soc-modules/soc-modules-sms/src/main/resources/naocs.yml

@@ -0,0 +1,8 @@
+# 在ESB系统配置的系统编号
+systemCode: 40421
+# 在ESB系统配置 系统名称
+systemName: 移动安全保卫管理系统
+# 服务代码
+serviceCode: 13002000013
+# 服务场景
+serviceScene: "01"