luowei 1 vuosi sitten
vanhempi
commit
f96942bed2

+ 12 - 2
project_data/sql/0.0.4/soc/soc.sql

@@ -25,7 +25,10 @@ update sys_dict_data set dict_label='登记中' where dict_type='edu_training_do
 -- 履职状态描述变更
 update sys_dict_data set dict_label='履职中' where dict_type='resumption_status' and dict_label='进行中' and dict_value=2 LIMIT 1;
 
-delete from sys_menu where id in (1731872300761878529,1731503585113534466,1729308502301728769,1731496383090913282,1731498925506031618,1731499700525330433,1731501484262158338,1731502833360039937);
+delete from sys_menu where id in (1732284060286410753,1731872300761878529,1731503585113534466,1729308502301728769,1731496383090913282,1731498925506031618,1731499700525330433,1731501484262158338,1731502833360039937);
+INSERT INTO sys_menu (id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, platform_type, icon, image_path, create_by, create_time, update_by, update_time, remark)
+VALUES (1732284060286410753, '导出安全保卫工作情况统计', 103, 6, '', null, null, 1, 0, 'F', '0', '0', 'system:dept:exportSecurityWork', '1', null, null, null, now(), '', null, '');
+
 INSERT INTO sys_menu (id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, platform_type, icon, image_path, create_by, create_time, update_by, update_time, remark)
 VALUES (1729308502301728769, '导出全省农信系统物防建设达标情况', 103, 5, '', null, null, 1, 0, 'F', '0', '0', 'system:dept:exportConstruction', '1', null, null, null, now(), '', null, '');
 INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
@@ -44,7 +47,14 @@ INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `com
 VALUES (1731872300761878529, '导出', 1719892877586239490, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:evaluateTaskReport:export', '1', NULL, NULL, '省联社账号', '2023-11-28 15:52:54', '', NULL, '');
 
 
-delete from sys_role_menu where menu_id in (1731872300761878529,1731503585113534466,1731502833360039937,1729308502301728769,1731496383090913282,1731498925506031618,1731499700525330433,1731501484262158338);
+delete from sys_role_menu where menu_id in (1732284060286410753,1731872300761878529,1731503585113534466,1731502833360039937,1729308502301728769,1731496383090913282,1731498925506031618,1731499700525330433,1731501484262158338);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (115, 1732284060286410753);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (116, 1732284060286410753);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (117, 1732284060286410753);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (118, 1732284060286410753);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (119, 1732284060286410753);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (120, 1732284060286410753);
+
 INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (115, 1731872300761878529);
 INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (116, 1731872300761878529);
 INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (117, 1731872300761878529);

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/controller/SafetyInspectReportController.java

@@ -9,6 +9,7 @@ import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.reportForms.safetyInspect.dto.SafetyInspectDTO;
 import com.xunmei.core.reportForms.safetyInspect.service.SafetyInspectService;
 import com.xunmei.core.reportForms.safetyInspect.vo.SafetyInspectVO;
+import com.xunmei.core.reportForms.safetyInspect.vo.SelfInspectVO;
 import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.domain.SysOrg;
 import io.swagger.annotations.Api;
@@ -65,7 +66,7 @@ public class SafetyInspectReportController {
          LocalDate localDate= LocalDate.now();
          safetyInspectDTO.setYear(localDate.getYear()+"-"+  localDate.getMonthValue());
      }
-        List<SafetyInspectVO> report = safetyInspectService.selfInspectReport(safetyInspectDTO);
+        List<SelfInspectVO> report = safetyInspectService.selfInspectReport(safetyInspectDTO);
         ajax.put(AjaxResult.DATA_TAG, report);
         if (null == safetyInspectDTO.getOrgId()) {
             safetyInspectDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/service/SafetyInspectService.java

@@ -5,6 +5,7 @@ import com.xunmei.core.reportForms.monitor.dto.MonitoringAccessDTO;
 import com.xunmei.core.reportForms.monitor.vo.MonitoringAccessVO;
 import com.xunmei.core.reportForms.safetyInspect.dto.SafetyInspectDTO;
 import com.xunmei.core.reportForms.safetyInspect.vo.SafetyInspectVO;
+import com.xunmei.core.reportForms.safetyInspect.vo.SelfInspectVO;
 import com.xunmei.system.api.domain.SysOrg;
 
 import javax.servlet.http.HttpServletResponse;
@@ -24,7 +25,7 @@ public interface SafetyInspectService {
      * @param safetyInspectDTO
      * @return
      */
-    List<SafetyInspectVO> selfInspectReport(SafetyInspectDTO safetyInspectDTO);
+    List<SelfInspectVO> selfInspectReport(SafetyInspectDTO safetyInspectDTO);
 
     void export(SafetyInspectDTO safetyInspectDTO, HttpServletResponse response) throws IOException;
 

+ 6 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/service/impl/SafetyInspectServiceImpl.java

@@ -12,6 +12,7 @@ import com.xunmei.core.reportForms.safetyInspect.dto.SafetyInspectDTO;
 import com.xunmei.core.reportForms.safetyInspect.mapper.SafetyInspectMapper;
 import com.xunmei.core.reportForms.safetyInspect.service.SafetyInspectService;
 import com.xunmei.core.reportForms.safetyInspect.vo.SafetyInspectVO;
+import com.xunmei.core.reportForms.safetyInspect.vo.SelfInspectVO;
 import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.domain.SysOrg;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -91,7 +92,7 @@ public class SafetyInspectServiceImpl implements SafetyInspectService {
     }
 
     @Override
-    public List<SafetyInspectVO> selfInspectReport(SafetyInspectDTO safetyInspectDTO) {
+    public List<SelfInspectVO> selfInspectReport(SafetyInspectDTO safetyInspectDTO) {
         if (null == safetyInspectDTO.getOrgId()) {
             safetyInspectDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
         }
@@ -105,9 +106,9 @@ public class SafetyInspectServiceImpl implements SafetyInspectService {
         } else {
             return Collections.emptyList();
         }
-        List<SafetyInspectVO>safetyInspectVOList=new ArrayList<>();
+        List<SelfInspectVO>safetyInspectVOList=new ArrayList<>();
         sysOrgs.forEach(s->{
-            SafetyInspectVO safetyInspectVO=new SafetyInspectVO();
+            SelfInspectVO safetyInspectVO=new SelfInspectVO();
             SysOrg sysOrg1;
             if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
                 sysOrg1 = orgService.selectOrgById(s.getParentId(), SecurityConstants.INNER);
@@ -184,12 +185,12 @@ public class SafetyInspectServiceImpl implements SafetyInspectService {
             sysOrg = remoteOrgService.selectSysOrgById(safetyInspectDTO.getOrgId(), SecurityConstants.INNER);
         }
         orgName = sysOrg.getName();
-        List<SafetyInspectVO> safetyInspectVOS =  this.selfInspectReport(safetyInspectDTO);
+        List<SelfInspectVO> safetyInspectVOS =  this.selfInspectReport(safetyInspectDTO);
         if (ObjectUtil.isEmpty(safetyInspectVOS)) {
             throw new RuntimeException("导出数据为空!");
         }
         for (int i = 0; i < safetyInspectVOS.size(); i++) {
-            SafetyInspectVO safetyInspectVO = safetyInspectVOS.get(i);
+            SelfInspectVO safetyInspectVO = safetyInspectVOS.get(i);
             safetyInspectVO.setOrderNum(i + 1);
         }
         if (safetyInspectVOS.size() > 10000) {

+ 3 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/vo/SafetyInspectVO.java

@@ -19,13 +19,13 @@ public class SafetyInspectVO {
     @ExcelProperty("单位名称")
     @ApiModelProperty(value = "单位名称")
     private String orgName;
-    @ExcelProperty("网点数量")
+    @ExcelProperty("被查机构数量")
     @ApiModelProperty(value = "网点数量")
     private Integer planInspectOrg;
-    @ExcelIgnore
+    @ExcelProperty("已查机构数量")
     @ApiModelProperty(value = "已查机构数量")
     private Integer realityInspectOrg;
-    @ExcelIgnore
+    @ExcelProperty("检查覆盖率")
     @ApiModelProperty(value = "检查覆盖率")
     private String inspectCoverRate;
 

+ 53 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/vo/SelfInspectVO.java

@@ -0,0 +1,53 @@
+package com.xunmei.core.reportForms.safetyInspect.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author :LuoWei
+ * @date : 2023/12/5
+ */
+@Data
+public class SelfInspectVO {
+    @ExcelProperty("序号")
+    private Integer orderNum;
+    @ExcelProperty("地区")
+    private String city;
+    @ExcelProperty("单位名称")
+    @ApiModelProperty(value = "单位名称")
+    private String orgName;
+    @ExcelProperty("网点数量")
+    @ApiModelProperty(value = "网点数量")
+    private Integer planInspectOrg;
+    @ExcelIgnore
+    @ApiModelProperty(value = "已查机构数量")
+    private Integer realityInspectOrg;
+    @ExcelIgnore
+    @ApiModelProperty(value = "检查覆盖率")
+    private String inspectCoverRate;
+
+
+    @ExcelProperty("应检次数")
+    @ApiModelProperty(value = "应检查次数")
+    private Integer planInspectNumber;
+    @ExcelProperty("已检次数")
+    @ApiModelProperty(value = "实际检查次数")
+    private Integer realityInspectNumber;
+    @ExcelProperty("检查完成率")
+    @ApiModelProperty(value = "检查率")
+    private String inspectRate;
+    @ExcelProperty("隐患数量")
+    @ApiModelProperty(value = "隐患数量")
+    private Integer pitfallNumber;
+    @ExcelProperty("已整改数量")
+    @ApiModelProperty(value = "已整改数量")
+    private Integer rectificationNumber;
+    @ExcelProperty("整改完成率")
+    @ApiModelProperty(value = "整改完成率")
+    private String rectificationRate;
+    @ExcelIgnore
+    @ExcelProperty("机构路径")
+    private String path;
+}

+ 30 - 5
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysDeptController.java

@@ -32,10 +32,7 @@ import com.xunmei.system.api.vo.SysOrgVO;
 import com.xunmei.system.service.ISysDeptService;
 import com.xunmei.system.service.ISysOrgService;
 import com.xunmei.system.service.ISysUserService;
-import com.xunmei.system.util.ConstructionDetailExport;
-import com.xunmei.system.util.CustomerTitleHandler;
-import com.xunmei.system.util.OrgPhysicalDefenseConstructionExport;
-import com.xunmei.system.util.SecurityUserExport;
+import com.xunmei.system.util.*;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -103,7 +100,35 @@ public class SysDeptController extends BaseController {
             response.setCharacterEncoding("utf-8");
         }
     }
-
+    @RequiresPermissions("system:dept:exportSecurityWork")
+    @PostMapping("/exportSecurityWork")
+    public void exportSecurityWork(SysOrg dept, HttpServletResponse response) {
+        List<SecurityWorkExport> securityWorkExportList = orgService.securityWorkExport(dept);
+        if (ObjectUtil.isEmpty(securityWorkExportList)) {
+            throw new RuntimeException("导出数据为空!");
+        }
+        AtomicInteger xh = new AtomicInteger();
+        xh.getAndIncrement();
+        securityWorkExportList.forEach(e -> {
+            e.setXh(String.valueOf(xh.getAndIncrement()));
+        });
+        if (securityWorkExportList.size() > 10000) {
+            throw new RuntimeException("导出数据量过大(单次导出限量10000条数据),请填写条件分批导出");
+        }
+        try {
+            // 设置响应头
+            response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("用户数据", "utf-8"));
+            response.setContentType("application/octet-stream;charset=UTF-8");
+            response.setCharacterEncoding("utf-8");
+            // 数据导出
+            EasyExcel.write(response.getOutputStream(), SecurityWorkExport.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).sheet("用户数据").doWrite(securityWorkExportList);
+        } catch (Exception e) {
+            // 重置response
+            response.reset();
+            response.setContentType("application/json");
+            response.setCharacterEncoding("utf-8");
+        }
+    }
     @RequiresPermissions("system:dept:exportConstruction")
     @PostMapping("/exportConstruction")
     public void exportConstruction(SysOrg dept, HttpServletResponse response) {

+ 18 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysOrgMapper.java

@@ -11,6 +11,7 @@ import com.xunmei.system.util.OrgPhysicalDefenseConstructionExport;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Component;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -123,8 +124,25 @@ public interface SysOrgMapper extends BaseMapper<SysOrg> {
     Map getCamera(String orgPath);
 
     Map getRemote(String orgPath);
+
     Map getDuty(String orgPath);
 
+    Map getCertificate(String orgPath);
+
+    Integer getSafe(@Param("orgPath") String orgPath, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
+
+    Integer getEduNumber(@Param("orgPath") String orgPath, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
+
+    Integer getEduUser(String orgPath);
+
+    Integer getQuarterDrillNumber(@Param("orgPath") String orgPath, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
+
+    Integer getQuarterDrillPeopleNumber(String orgPath);
+
+    Integer getQuarterAllNetworkDrillNumber(@Param("orgPath") String orgPath, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
+
+    Integer getQuarterAllNetworkDrillPeopleNumber(String orgPath);
+
     /**
      * 物防达标情况
      *

+ 53 - 24
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java

@@ -2,6 +2,8 @@ package com.xunmei.system.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.collection.ListUtil;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -54,6 +56,16 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
     @Autowired
     private SysUserMapper sysUserMapper;
 
+    private static List<SysOrg> handleTree(Map<Long, List<SysOrg>> map, Long parentId) {
+        List<SysOrg> orgList = map.get(parentId);
+        if (ObjectUtil.isNotEmpty(orgList)) {
+            orgList.forEach(org -> {
+                final List<SysOrg> tree = handleTree(map, org.getId());
+                org.setChildren(tree);
+            });
+        }
+        return orgList;
+    }
 
     /**
      * 项目启动时,缓存机构数据
@@ -63,7 +75,6 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
         loadingOrgCache();
     }
 
-
     @Override
     public TableDataInfo<SysOrg> selectPage(SysOrg org) {
         //未删除
@@ -152,9 +163,9 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
         SysOrg sysOrg2 = baseMapper.selectSysOrgById(sysOrg.getId());
         List<SysOrg> sysOrgs;
         if (sysOrg2.getType() < 3 || sysOrg2.getShortName().endsWith("地区行社") || sysOrg2.getType() == 9) {
-            sysOrgs = this.selectSysOrgByPathAndType(sysOrg.getPath(), 3);
-        } else if (sysOrg.getType() == 3) {
-            sysOrgs = this.selectSysOrgByPathAndType(sysOrg.getPath(), 4);
+            sysOrgs = this.selectSysOrgByPathAndType(sysOrg2.getPath(), 3);
+        } else if (sysOrg2.getType() == 3) {
+            sysOrgs = this.selectSysOrgByPathAndType(sysOrg2.getPath(), 4);
         } else {
             return Collections.emptyList();
         }
@@ -162,7 +173,7 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
         sysOrgs.forEach(s -> {
             SecurityWorkExport securityWorkExport = new SecurityWorkExport();
             SysOrg sysOrg1;
-            if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
+            if (sysOrg2.getType() < 3 || sysOrg2.getShortName().endsWith("地区行社") || sysOrg2.getType() == 9) {
                 sysOrg1 = baseMapper.selectSysOrgById(s.getParentId());
             } else {
                 sysOrg1 = baseMapper.selectSysOrgById(baseMapper.selectSysOrgById(s.getParentId()).getParentId());
@@ -210,9 +221,12 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
             securityWorkExport.setDepartureThroughWalls(Integer.valueOf(selfEquipment.get("departureThroughWalls").toString()));
             //中心建设时间
             Map centerConstruction = baseMapper.getCenterConstruction(s.getId());
-            securityWorkExport.setCenterConstructionTime(centerConstruction.get("centerConstructionTime").toString());
-            securityWorkExport.setTransformTime(centerConstruction.get("transformTime").toString());
-            securityWorkExport.setBrand(centerConstruction.get("brand").toString());
+         if (null!=centerConstruction){
+             securityWorkExport.setCenterConstructionTime(centerConstruction.get("centerConstructionTime").toString());
+             securityWorkExport.setTransformTime(centerConstruction.get("transformTime").toString());
+             securityWorkExport.setBrand(centerConstruction.get("brand").toString());
+         }
+
             //高清摄像头
             Map camera = baseMapper.getCamera(s.getPath());
             securityWorkExport.setCameraTotal(Integer.valueOf(camera.get("cameraTotal").toString()));
@@ -225,9 +239,38 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
             Map duty = baseMapper.getDuty(s.getPath());
             securityWorkExport.setLocalDutyNetworkNumber(Integer.valueOf(duty.get("localDutyNetworkNumber").toString()));
             securityWorkExport.setRemoteDutyNetworkNumber(Integer.valueOf(duty.get("remoteDutyNetworkNumber").toString()));
-
+            //安保人数
+            Map certificate = baseMapper.getCertificate(s.getPath());
+            securityWorkExport.setCertificatePeopleNumber(Integer.valueOf(certificate.get("certificatePeopleNumber").toString()));
+            securityWorkExport.setCertificateTotal(Integer.valueOf(certificate.get("certificateTotal").toString()));
+            securityWorkExport.setInternalCertificateNumber(Integer.valueOf(certificate.get("internalCertificateNumber").toString()));
+            securityWorkExport.setOutsourceCertificateNumber(Integer.valueOf(certificate.get("outsourceCertificateNumber").toString()));
+            //安全检查
+            DateTime beginOfQuarter = DateUtil.beginOfQuarter(new java.util.Date());
+            DateTime endOfQuarter = DateUtil.endOfQuarter(new Date());
+
+            Integer safe = baseMapper.getSafe(s.getPath(), beginOfQuarter, endOfQuarter);
+            securityWorkExport.setQuarterSelfInspectNumber(safe);
+            //安全教育次数
+            Integer eduNumber = baseMapper.getEduNumber(s.getPath(), beginOfQuarter, endOfQuarter);
+            securityWorkExport.setQuarterSafetyEducationNumber(eduNumber);
+            //教育人数
+            Integer eduUser = baseMapper.getEduUser(s.getPath());
+            securityWorkExport.setSafetyEducationPeopleNumber(eduUser);
+            //总行演练次数
+            Integer quarterDrillNumber = baseMapper.getQuarterDrillNumber(s.getPath(), beginOfQuarter, endOfQuarter);
+            securityWorkExport.setQuarterDrillNumber(quarterDrillNumber);
+            //总行演练人数
+            Integer quarterDrillPeopleNumber = baseMapper.getQuarterDrillPeopleNumber(s.getPath());
+            securityWorkExport.setQuarterDrillPeopleNumber(quarterDrillPeopleNumber);
+            //营业网点预案演练
+            Integer quarterAllNetworkDrillNumber = baseMapper.getQuarterAllNetworkDrillNumber(s.getPath(), beginOfQuarter, endOfQuarter);
+            securityWorkExport.setQuarterAllNetworkDrillNumber(quarterAllNetworkDrillNumber);
+            Integer quarterAllNetworkDrillPeopleNumber = baseMapper.getQuarterAllNetworkDrillPeopleNumber(s.getPath());
+            securityWorkExport.setQuarterAllNetworkDrillPeopleNumber(quarterAllNetworkDrillPeopleNumber);
+            securityWorkExportList.add(securityWorkExport);
         });
-        return null;
+        return securityWorkExportList;
     }
 
     @Override
@@ -318,7 +361,6 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
         return list;
     }
 
-
     /**
      * 查询【请填写功能名称】列表
      *
@@ -468,7 +510,6 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
         return sysOrgVOS;
     }
 
-
     @Override
     public void clearOrgCache() {
         RedisUtils.deleteObject(CacheConstants.ORG_CACHE_LIST_KEY);
@@ -561,18 +602,6 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
         });
     }
 
-
-    private static List<SysOrg> handleTree(Map<Long, List<SysOrg>> map, Long parentId) {
-        List<SysOrg> orgList = map.get(parentId);
-        if (ObjectUtil.isNotEmpty(orgList)) {
-            orgList.forEach(org -> {
-                final List<SysOrg> tree = handleTree(map, org.getId());
-                org.setChildren(tree);
-            });
-        }
-        return orgList;
-    }
-
     @Override
     public List<SysOrg> selectParentHs(List<Long> orgList) {
 

+ 36 - 36
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/SecurityWorkExport.java

@@ -35,77 +35,77 @@ public class SecurityWorkExport {
     private Integer areaOutsideNumber;
     @ExcelProperty(value = "业务库总量", index = 7)
     private Integer businessLibraryTotal;
-    @ExcelProperty(value = "一类库", index = 7)
+    @ExcelProperty(value = "一类库", index = 8)
     private Integer oneLibrary;
-    @ExcelProperty(value = "二类库", index = 7)
+    @ExcelProperty(value = "二类库", index = 9)
     private Integer twoLibrary;
-    @ExcelProperty(value = "三类库", index = 7)
+    @ExcelProperty(value = "三类库", index = 10)
     private Integer threeLibrary;
-    @ExcelProperty(value = "四类库", index = 7)
+    @ExcelProperty(value = "四类库", index = 11)
     private Integer fourLibrary;
-    @ExcelProperty(value = "保管箱库", index = 7)
+    @ExcelProperty(value = "保管箱库", index = 12)
     private Integer collectLibrary;
-    @ExcelProperty(value = "在行式总量", index = 7)
+    @ExcelProperty(value = "在行式总量", index = 13)
     private Integer onLineTotal;
-    @ExcelProperty(value = "在行式达标数量(符合GA38-2021标准)", index = 7)
+    @ExcelProperty(value = "在行式达标数量(符合GA38-2021标准)", index = 14)
     private Integer onLineReachNumber;
-    @ExcelProperty(value = "离行式总量", index = 7)
+    @ExcelProperty(value = "离行式总量", index = 15)
     private Integer departureTotal;
-    @ExcelProperty(value = "离行式达标数量(符合GA38-2021标准)", index = 7)
+    @ExcelProperty(value = "离行式达标数量(符合GA38-2021标准)", index = 16)
     private Integer departureReachNumber;
-    @ExcelProperty(value = "自助设备总数", index = 7)
+    @ExcelProperty(value = "自助设备总数", index = 17)
     private Integer selfServiceDevicesTotal;
-    @ExcelProperty(value = "在行大堂式机具", index = 7)
+    @ExcelProperty(value = "在行大堂式机具", index = 18)
     private Integer onLineLobbyImplement;
-    @ExcelProperty(value = "在行式穿墙式机具", index = 7)
+    @ExcelProperty(value = "在行式穿墙式机具", index = 19)
     private Integer onLineThroughWalls;
-    @ExcelProperty(value = "离行式大堂式机具", index = 7)
+    @ExcelProperty(value = "离行式大堂式机具", index = 20)
     private Integer departureLobbyImplement;
-    @ExcelProperty(value = "离行式穿墙式机具", index = 7)
+    @ExcelProperty(value = "离行式穿墙式机具", index = 21)
     private Integer departureThroughWalls;
-    @ExcelProperty(value = "中心建设时间(年)", index = 7)
+    @ExcelProperty(value = "中心建设时间(年)", index = 22)
     private String centerConstructionTime;
-    @ExcelProperty(value = "监控平台最近一次升级改造时间(年", index = 7)
+    @ExcelProperty(value = "监控平台最近一次升级改造时间(年", index = 23)
     private String transformTime;
-    @ExcelProperty(value = "监控中心平台品牌", index = 7)
+    @ExcelProperty(value = "监控中心平台品牌", index = 24)
     private String brand;
-    @ExcelProperty(value = "视频监控摄像头总路数", index = 7)
+    @ExcelProperty(value = "视频监控摄像头总路数", index = 25)
     private Integer cameraTotal;
-    @ExcelProperty(value = "视频监控摄像头高清摄像机路数", index = 7)
+    @ExcelProperty(value = "视频监控摄像头高清摄像机路数", index = 26)
     private Integer definitionNumber;
-    @ExcelProperty(value = "是否实现远程控制和实时授权的功能", index = 7)
+    @ExcelProperty(value = "是否实现远程控制和实时授权的功能", index = 27)
     private String remoteControl;
-    @ExcelProperty(value = "离行式自助银行加钞间出入口设置数量", index = 7)
+    @ExcelProperty(value = "离行式自助银行加钞间出入口设置数量", index = 28)
     private Integer cashAddingRoom;
-    @ExcelProperty(value = "业务库(不含保管箱库)防控隔离门出入口设置数量", index = 7)
+    @ExcelProperty(value = "业务库(不含保管箱库)防控隔离门出入口设置数量", index = 29)
     private Integer remoteCount;
-    @ExcelProperty(value = "本地值守网点数量(由员工进行同楼异地值守)", index = 7)
+    @ExcelProperty(value = "本地值守网点数量(由员工进行同楼异地值守)", index = 30)
     private Integer localDutyNetworkNumber;
-    @ExcelProperty(value = "异地值守网点数量(由监控中心进行远程值守)", index = 7)
+    @ExcelProperty(value = "异地值守网点数量(由监控中心进行远程值守)", index = 31)
     private Integer remoteDutyNetworkNumber;
-    @ExcelProperty(value = "监控中心安保卫持证人数", index = 7)
+    @ExcelProperty(value = "监控中心安保卫持证人数", index = 32)
     private Integer certificatePeopleNumber;
-    @ExcelProperty(value = "人员合计", index = 7)
+    @ExcelProperty(value = "人员合计", index = 33)
     private Integer certificateTotal;
-    @ExcelProperty(value = "其中,内部保安人数(含派遣)", index = 7)
+    @ExcelProperty(value = "其中,内部保安人数(含派遣)", index = 34)
     private Integer internalCertificateNumber;
-    @ExcelProperty(value = "其中,外聘保安人数", index = 7)
+    @ExcelProperty(value = "其中,外聘保安人数", index = 35)
     private Integer outsourceCertificateNumber;
-    @ExcelProperty(value = "配有保安网点数 ", index = 7)
+    @ExcelProperty(value = "配有保安网点数 ", index = 36)
     private Integer haveSecurityNetworkNumber;
-    @ExcelProperty(value = "本季度辖内所有营业网点组织开展自查次数(每个网点检查数量的累计数)", index = 7)
+    @ExcelProperty(value = "本季度辖内所有营业网点组织开展自查次数(每个网点检查数量的累计数)", index = 37)
     private Integer quarterSelfInspectNumber;
-    @ExcelProperty(value = "本季度度总行(联社)组织开展安全教育次数", index = 7)
+    @ExcelProperty(value = "本季度度总行(联社)组织开展安全教育次数", index = 38)
     private Integer quarterSafetyEducationNumber;
-    @ExcelProperty(value = "共计参与安全教育员工人次", index = 7)
+    @ExcelProperty(value = "共计参与安全教育员工人次", index = 39)
     private Integer safetyEducationPeopleNumber;
-    @ExcelProperty(value = "本季度开展预案演练次数", index = 7)
+    @ExcelProperty(value = "本季度开展预案演练次数", index = 40)
     private Integer quarterDrillNumber;
-    @ExcelProperty(value = "参与预案演练员工人次", index = 7)
+    @ExcelProperty(value = "参与预案演练员工人次", index = 41)
     private Integer quarterDrillPeopleNumber;
-    @ExcelProperty(value = "本季度辖内所有营业网点开展预案演练次数(每个网点演练次数的累计数)", index = 7)
+    @ExcelProperty(value = "本季度辖内所有营业网点开展预案演练次数(每个网点演练次数的累计数)", index = 42)
     private Integer quarterAllNetworkDrillNumber;
-    @ExcelProperty(value = "辖内所有营业网点参与预案演练员工人次", index = 7)
+    @ExcelProperty(value = "辖内所有营业网点参与预案演练员工人次", index = 43)
     private Integer quarterAllNetworkDrillPeopleNumber;
 
 

+ 122 - 46
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -831,15 +831,15 @@ and
     </select>
     <select id="getLibrary" resultType="java.util.Map">
         SELECT
-            COUNT(a.business_library_type ) as total,
-            sum(IF(a.business_library_type=1,1,0)) AS one,
-            SUM(IF(a.business_library_type=2,1,0)) as two,
-            SUM(IF(a.business_library_type=3,1,0)) AS three,
-            SUM(IF(a.business_library_type=4,1,0)) AS four
+            COUNT( a.business_library_type ) AS total,
+            IFNULL( sum( IF ( a.business_library_type = 1, 1, 0 )), 0 ) AS one,
+            IFNULL( SUM( IF ( a.business_library_type = 2, 1, 0 )), 0 ) AS two,
+            IFNULL( SUM( IF ( a.business_library_type = 3, 1, 0 )), 0 ) AS three,
+            IFNULL( SUM( IF ( a.business_library_type = 4, 1, 0 )), 0 ) AS four
         FROM
             sys_org_extend a
                 LEFT JOIN sys_org b ON a.org_id = b.id
-                where
+        where
             b.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getCollectLibrary" resultType="java.lang.Integer">
@@ -855,12 +855,8 @@ and
     </select>
     <select id="getOnLine" resultType="java.util.Map">
         SELECT
-            SUM(
-                    IF
-                        ( a.type = 3, 1, 0 )) AS onLineTotal,
-            SUM(
-                    IF
-                        ( a.type = 3 AND a.standard =1, 1, 0 )) AS onLineReachNumber
+            IFNULL( SUM( IF ( a.type = 3, 1, 0 )), 0 ) AS onLineTotal,
+            IFNULL( SUM( IF ( a.type = 3 AND a.standard = 1, 1, 0 )), 0 ) AS onLineReachNumber
         FROM
             sys_org_physical_defense_construction a
                 LEFT JOIN sys_org b ON a.org_id = b.id
@@ -869,12 +865,8 @@ and
     </select>
     <select id="getDeparture" resultType="java.util.Map">
         SELECT
-            SUM(
-                    IF
-                        ( a.type = 4, 1, 0 )) AS departureTotal,
-            SUM(
-                    IF
-                        ( a.type = 4 AND a.standard = 1, 1, 0 )) AS departureReachNumber
+            IFNULL( SUM( IF ( a.type = 4, 1, 0 )), 0 ) AS departureTotal,
+            IFNULL( SUM( IF ( a.type = 4 AND a.standard = 1, 1, 0 )), 0 ) AS departureReachNumber
         FROM
             sys_org_physical_defense_construction a
                 LEFT JOIN sys_org b ON a.org_id = b.id
@@ -883,11 +875,14 @@ and
     </select>
     <select id="getSelfEquipment" resultType="java.util.Map">
         SELECT
-            SUM( a.lobby_equipment ) AS onLineLobbyImplement,
-            SUM( a.wall_penetrating_equipment ) AS onLineThroughWalls,
-            SUM( a.detached_lobby_equipment ) AS departureLobbyImplement,
-            SUM( a.detached_wall_penetrating_equipment ) AS departureThroughWalls,
-            SUM( a.lobby_equipment ) + SUM( a.wall_penetrating_equipment ) + SUM( a.detached_lobby_equipment ) + SUM( a.detached_wall_penetrating_equipment ) AS selfServiceDevicesTotal
+            IFNULL( SUM( a.lobby_equipment ), 0 ) AS onLineLobbyImplement,
+            IFNULL( SUM( a.wall_penetrating_equipment ), 0 ) AS onLineThroughWalls,
+            IFNULL( SUM( a.detached_lobby_equipment ), 0 ) AS departureLobbyImplement,
+            IFNULL( SUM( a.detached_wall_penetrating_equipment ), 0 ) AS departureThroughWalls,
+            IFNULL(
+                        SUM( a.lobby_equipment ) + SUM( a.wall_penetrating_equipment ) + SUM( a.detached_lobby_equipment ) + SUM( a.detached_wall_penetrating_equipment ),
+                        0
+                ) AS selfServiceDevicesTotal
         FROM
             sys_org_extend a
                 LEFT JOIN sys_org b ON a.org_id = b.id
@@ -896,49 +891,130 @@ and
     </select>
     <select id="getCenterConstruction" resultType="java.util.Map">
         SELECT
-            IF
-                ( a.construction_time IS NULL, '', SUBSTR( a.construction_time, 1, 4 ) ) AS centerConstructionTime,
-            IF
-                ( a.last_update_time IS NULL, '', SUBSTR( a.last_update_time, 1, 4 ) ) AS transformTime,
-            a.platform_brand AS brand
+            IFNULL( IF ( a.construction_time IS NULL, '0', SUBSTR( a.construction_time, 1, 4 ) ), '0' ) AS centerConstructionTime,
+            IFNULL( IF ( a.last_update_time IS NULL, '0', SUBSTR( a.last_update_time, 1, 4 ) ), '0' ) AS transformTime,
+            IFNULL( a.platform_brand, '0' ) AS brand
         FROM
             sys_org_extend a
                 LEFT JOIN sys_org b ON a.org_id = b.id
-WHERE b.id=#{orgId}
+        WHERE b.id=#{orgId}
     </select>
     <select id="getCamera" resultType="java.util.Map">
         SELECT
-            COUNT( 1 ) AS cameraTotal,
-            SUM(
-                    IF
-                        ( definition = 1, 1, 0 )) AS definitionNumber
+            IFNULL( COUNT( a.id ), 0 ) AS cameraTotal,
+            IFNULL( SUM( IF ( a.definition = 1, 1, 0 )), 0 ) AS definitionNumber
         FROM
-            sys_device
+            sys_device a
+                LEFT JOIN sys_org b ON a.org_id = b.id
         WHERE
-            del_flag=0 AND
-            device_type =2 AND org_path LIKE concat(#{orgPath}, '%')
+            del_flag = 0
+          AND device_type = 2
+          AND b.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getRemote" resultType="java.util.Map">
         SELECT
-            SUM( a.cash_adding_room ) AS cashAddingRoom,
-            SUM( a.remote_count ) AS remoteCount
+            IFNULL( SUM( a.cash_adding_room ), 0 ) AS cashAddingRoom,
+            IFNULL( SUM( a.remote_count ), 0 ) AS remoteCount
         FROM
             sys_org_extend a
                 LEFT JOIN sys_org b ON a.org_id = b.id
-where org_path LIKE concat(#{orgPath}, '%')
+        where  b.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getDuty" resultType="java.util.Map">
         SELECT
-            SUM(
-                    IF
-                        ( duty_mode = 2, 1, 0 )) AS localDutyNetworkNumber,
-            SUM(
-                    IF
-                        ( duty_mode = 1, 1, 0 )) AS remoteDutyNetworkNumber
+            IFNULL( SUM( IF ( duty_mode = 2, 1, 0 )), 0 ) AS localDutyNetworkNumber,
+            IFNULL( SUM( IF ( duty_mode = 1, 1, 0 )), 0 ) AS remoteDutyNetworkNumber
         FROM
             sys_org_extend a
                 LEFT JOIN sys_org b ON a.org_id = b.id
-        where org_path LIKE concat(#{orgPath}, '%')
+        where b.path LIKE concat(#{orgPath}, '%')
+    </select>
+    <select id="getCertificate" resultType="java.util.Map">
+SELECT
+                                                               IFNULL( SUM( a.inner_count ), 0 ) AS internalCertificateNumber,
+                                                               IFNULL( SUM( a.outside_count ), 0 ) AS outsourceCertificateNumber,
+                                                               IFNULL( SUM( a.inner_count )+ SUM( a.outside_count ), 0 ) AS certificateTotal,
+                                                               IFNULL( SUM( IF ( a.askari_certificate IS NULL, 0, 1 )), 0 ) AS certificatePeopleNumber
+                                                           FROM
+                                                               sys_org_extend a
+                                                                   LEFT JOIN sys_org b ON a.org_id = b.id
+                                                           where b.path LIKE concat(#{orgPath}, '%')
+    </select>
+    <select id="getSafe" resultType="java.lang.Integer">
+        SELECT
+            COUNT( a.id )
+        FROM
+            core_safety_task a
+                LEFT JOIN sys_org b ON a.org_id = b.id
+                LEFT JOIN core_safecheck_plan c ON a.plan_id = c.id
+        WHERE
+            a.deleted = 0
+          AND c.check_type =3
+and a.org_path LIKE concat(#{orgPath}, '%')
+ AND a.ymd_date BETWEEN #{startTime} and #{endTime}
+    </select>
+    <select id="getEduNumber" resultType="java.lang.Integer">
+        SELECT
+            COUNT( a.id )
+        FROM
+            core_edu_training_task a
+                LEFT JOIN core_edu_training_plan b ON a.plan_id = b.id
+        WHERE
+            b.exec_org_type = 1
+          AND b.deleted =0
+        and a.org_path    like concat(concat('%',#{orgPath}),'%')
+          AND a.training_start_date_time BETWEEN #{startTime} and #{endTime}
+    </select>
+    <select id="getEduUser" resultType="java.lang.Integer">
+        SELECT
+            COUNT( b.edu_training_task_id )
+        FROM
+            core_edu_training_task a
+                LEFT JOIN core_edu_training_task_to_user b ON a.id = b.edu_training_task_id
+        WHERE
+            b.type = 1  and a.org_path    like concat(concat('%',#{orgPath}),'%')
+    </select>
+    <select id="getQuarterDrillNumber" resultType="java.lang.Integer">
+        SELECT
+            COUNT(a.id)
+        FROM
+            core_drill_task a
+                LEFT JOIN core_drill_plan b ON a.plan_id = b.id
+        WHERE b.exec_org_type=1
+          and a.org_path    like concat(concat('%',#{orgPath}),'%')
+          AND a.drill_start_time BETWEEN #{startTime} and #{endTime}
+    </select>
+    <select id="getQuarterDrillPeopleNumber" resultType="java.lang.Integer">
+        SELECT
+            COUNT( c.drill_task_id )
+        FROM
+            core_drill_task a
+                LEFT JOIN core_drill_plan b ON a.plan_id = b.id
+                LEFT JOIN core_drill_task_to_user c ON c.drill_task_id = a.id
+        WHERE
+            b.exec_org_type = 1
+          and a.org_path    like concat(concat('%',#{orgPath}),'%')
+    </select>
+    <select id="getQuarterAllNetworkDrillNumber" resultType="java.lang.Integer">
+        SELECT
+            COUNT(a.id)
+        FROM
+            core_drill_task a
+                LEFT JOIN core_drill_plan b ON a.plan_id = b.id
+        WHERE b.exec_org_type=4
+          and a.org_path    like concat(concat('%',#{orgPath}),'%')
+          AND a.drill_start_time BETWEEN #{startTime} and #{endTime}
+    </select>
+    <select id="getQuarterAllNetworkDrillPeopleNumber" resultType="java.lang.Integer">
+        SELECT
+            COUNT( c.drill_task_id )
+        FROM
+            core_drill_task a
+                LEFT JOIN core_drill_plan b ON a.plan_id = b.id
+                LEFT JOIN core_drill_task_to_user c ON c.drill_task_id = a.id
+        WHERE
+            b.exec_org_type = 4
+          and a.org_path    like concat(concat('%',#{orgPath}),'%')
     </select>