Ver código fonte

监控调阅登记簿样式修改,调阅设备更改为调阅区域

jingyuanchao 1 ano atrás
pai
commit
2e0eeabfac

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

@@ -96,6 +96,21 @@ CREATE PROCEDURE schema_change () BEGIN
 
 
 
+    -- 监控调阅任务详情表有调阅设备更改为调阅区域,增加区域字段
+    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 ();
@@ -103,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);
+
+

+ 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;
 }

+ 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 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java

@@ -40,7 +40,6 @@ import com.xunmei.system.api.RemoteRoleService;
 import com.xunmei.system.api.RemoteUserService;
 import com.xunmei.system.api.domain.*;
 import com.xunmei.system.api.function.RemoteCallHandlerExecutor;
-import com.xunmei.system.api.function.RemoteCallHandlerExecutor;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -1228,13 +1227,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);
         }

+ 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">

+ 36 - 16
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

@@ -208,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);
@@ -242,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++;
@@ -565,12 +565,22 @@ public class PdfUtil {
         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);
-        for (int i = 1; i <= data.size(); i++) {
-            PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 2, 1);
-            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getHostName(), Element.ALIGN_MIDDLE, 6, 1);
-            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getVideoChannelName(), Element.ALIGN_MIDDLE, 5, 1);
-            PdfUtil.createPDFCell(tableFont, 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);
@@ -578,14 +588,26 @@ public class PdfUtil {
         PdfUtil.createPDFCell(tableTitleFont, table, "调阅项目", Element.ALIGN_MIDDLE, 5, 1);
         PdfUtil.createPDFCell(tableTitleFont, table, "存在问题", 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, 5, 1);
-        PdfUtil.createPDFCell(tableFont, 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);
 
+        }
     }
 
-    public static void dealSafeCheckPBody(Document document, PdfPTable table, Font tableFont, SafeCheckTaskRegisterBookVo data) throws Exception {
+    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);
@@ -611,20 +633,18 @@ public class PdfUtil {
         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){
+        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, 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, 14, 1);
 
         PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_MIDDLE, 2, 1);