Browse Source

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

zhulu 1 year ago
parent
commit
88581fbae1

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

@@ -340,7 +340,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         PdfUtil.createPDFCell(titleFont, table, "调阅人签字", Element.ALIGN_MIDDLE, 4, 1);
         List<String> list = new ArrayList<>();
         list.add(data.getSignImg());
-        dealImageCell(list, table, 1, 70, 40,15,1);
+        dealImageCell(list, table, 1, 80, 30,15,1);
 
         PdfUtil.createPDFCell(titleFont, table, "监控调阅情况", Element.ALIGN_MIDDLE, 19, 1);
 

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

@@ -176,7 +176,7 @@ public class PdfUtil {
         createPDFCell(tableFont, table, "总结", Element.ALIGN_MIDDLE, 1, 1);
         createPDFCell(tableFont, table, data.get("note").toString(), Element.ALIGN_LEFT, 5, 1);
         createPDFCell(tableFont, table, "参会人员签字", Element.ALIGN_MIDDLE, 1, 1);
-        dealEduImageCell((List<String>) data.get("signImage"), table, 5, 40, 40);
+        dealEduImageCell((List<String>) data.get("signImage"), table, 5, 80, 30);
         document.add(table);
 
         //第二页
@@ -363,9 +363,9 @@ public class PdfUtil {
 
         //第七行
         createPDFCell(tableFont, table, "审批人签字", Element.ALIGN_MIDDLE, 1, 1);
-        dealImageCell((List<String>) data.get("approveSign"), table, 1, 50, 40, 2, 1);
+        dealImageCell((List<String>) data.get("approveSign"), table, 1, 80, 30, 2, 1);
         createPDFCell(tableFont, table, "登记人签字", Element.ALIGN_MIDDLE, 1, 1);
-        dealImageCell((List<String>) data.get("submitSign"), table, 1, 50, 40, 2, 1);
+        dealImageCell((List<String>) data.get("submitSign"), table, 1, 80, 30, 2, 1);
 //           /statics/2023/12/05/20231205183106A001.png
         //证件图片
         createPDFCell(tableFont, table, "证件图片", Element.ALIGN_MIDDLE, 1, 1);
@@ -445,7 +445,7 @@ public class PdfUtil {
         createPDFCell(tableFont, table, data.get("comment").toString(), Element.ALIGN_LEFT, 5, 1);
         //参会人员签字
         createPDFCell(tableFont, table, "参演人员", Element.ALIGN_MIDDLE, 1, 1);
-        dealEduImageCell((List<String>) data.get("signImage"), table, 5, 40, 40);
+        dealEduImageCell((List<String>) data.get("signImage"), table, 5, 80, 30);
         document.add(table);
 
         //第二页
@@ -676,7 +676,7 @@ public class PdfUtil {
         PdfUtil.createPDFCell(tableFont, table, "主查人签字", Element.ALIGN_MIDDLE, 3, 1);
         List<String> list = new ArrayList<>();
         list.add(data.getSignImg());
-        dealEduImageCell(list, table, 1, 70, 40);
+        dealEduImageCell(list, table, 1, 80, 30);
 
         PdfUtil.createPDFCell(tableFont, table, "检查工作情况", Element.ALIGN_MIDDLE, 14, 1);
 

+ 6 - 4
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/IotBoardServiceImpl.java

@@ -319,13 +319,13 @@ public class IotBoardServiceImpl implements IotBoardService {
         for (Map<String, String> map : deviceNums) {
             String aLong = map.get(MAP_VALUE);
             int res = Integer.parseInt(aLong);
-            if (CategoryDataEnum.IOT_DETECTION_DEVICE.getId().toString().equals(map.get(CATEGORY_ID))) {
+            if (CategoryDataEnum.IOT_DETECTION_DEVICE.getId().equals(map.get(CATEGORY_ID))) {
                 deviceOverview.setEdgeComputingHosts(res);
             }
-            if (CategoryDataEnum.ALARM_HOST_DEVICE.getId().toString().equals(map.get(CATEGORY_ID))) {
+            if (CategoryDataEnum.ALARM_HOST_DEVICE.getId().equals(map.get(CATEGORY_ID))) {
                 deviceOverview.setAlarmControllers(res);
             }
-            if (CategoryDataEnum.MONITOR_HOST_DEVICE.getId().toString().equals(map.get(CATEGORY_ID))) {
+            if (CategoryDataEnum.MONITOR_HOST_DEVICE.getId().equals(map.get(CATEGORY_ID))) {
                 deviceOverview.setHardDiskRecorders(res);
             }
         }
@@ -420,7 +420,9 @@ public class IotBoardServiceImpl implements IotBoardService {
         if (ObjectUtil.isEmpty(videoIntegrityCheckLogs)) {
             videoInspection.setLostRate("-");
         } else {
-            videoInspection.setUpdateTime(videoIntegrityCheckLogs.get(0).getUpdateTime());
+            final Optional<MediatorVideoIntegrityCheckLog> optional = videoIntegrityCheckLogs.stream().max(Comparator.comparing(MediatorVideoIntegrityCheckLog::getCreateTime));
+            optional.ifPresent(d->videoInspection.setUpdateTime(d.getUpdateTime()));
+           // videoInspection.setUpdateTime(videoIntegrityCheckLogs.get(0).getUpdateTime());
         }
         //获取通道数量
         Integer channelNums = dvrChannelMapper.selectChannelCount(org.getPath());

+ 21 - 11
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/VideoDiagnosisServiceImpl.java

@@ -1,7 +1,6 @@
 package com.xunmei.iot.service.impl;
 
 import cn.hutool.core.date.DateField;
-import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson2.JSON;
@@ -251,23 +250,34 @@ public class VideoDiagnosisServiceImpl extends ServiceImpl<IotDvrChannelMapper,
         if (ObjectUtil.isEmpty(logList)) {
             return videoDiagnostic;
         }
-        List<Map> res = new ArrayList<>();
+        int singleLostAlarmNums = 0;
+        int occludeAlarmNums = 0;
         for (MediatorVideoDiagnosisLog diagnosisLog : logList) {
             String detailInfo = diagnosisLog.getDetailInfo();
             if (ObjectUtil.isEmpty(detailInfo)) {
                 continue;
             }
             List<Map> maps = JSON.parseArray(detailInfo, Map.class);
-            res.addAll(maps);
+            for (Map map : maps) {
+                final Object type = map.get("type");
+                final Object state = map.get("state");
+                if (ObjectUtil.hasNull(type, state)) {
+                    continue;
+                }
+                final String typeStr = type.toString();
+                final String stateStr = state.toString();
+                if ("0".equals(stateStr)) {
+                    continue;
+                }
+                if ("0".equals(typeStr)) {
+                    singleLostAlarmNums++;
+                }
+                if ("1".equals(typeStr)) {
+                    occludeAlarmNums++;
+                }
+            }
         }
-        long singleLostAlarmNums = res.stream()
-                .filter(map -> ObjectUtil.equal(String.valueOf(map.get("type")), "0"))
-                .filter(map -> ObjectUtil.equal(String.valueOf(map.get("state")), "1"))
-                .count();
-        long occludeAlarmNums = res.stream()
-                .filter(map -> ObjectUtil.equal(String.valueOf(map.get("type")), "1"))
-                .filter(map -> ObjectUtil.equal(String.valueOf(map.get("state")), "1"))
-                .count();
+
         videoDiagnostic.setSingleLostAlarmNums((int) singleLostAlarmNums);
         videoDiagnostic.setOccludeAlarmNums((int) occludeAlarmNums);
         return videoDiagnostic;

+ 2 - 1
soc-modules/soc-modules-iot/src/main/resources/mapper/IotDvrChannelMapper.xml

@@ -397,11 +397,12 @@
     </select>
 
     <select id="selectData" resultType="com.xunmei.common.core.domain.video.MediatorVideoDiagnosisLog">
-        select *
+        select l.id,detail_info
         from mediator_video_diagnosis_log l
                  inner join sys_org o on o.id = l.org_id
         where o.deleted = 0
           and l.create_time >= #{startTime}
+          and (detail_info like '%"state":1,"type":0%' or detail_info like '%"state":1,"type":1%')
           and o.path like concat(#{orgPath}, '%')
     </select>
 </mapper>