luowei 1 سال پیش
والد
کامیت
f377abbfb0
14فایلهای تغییر یافته به همراه332 افزوده شده و 88 حذف شده
  1. 11 3
      project_data/sql/0.0.3/soc/soc.sql
  2. 112 1
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/retrieval/vo/AppCoreMonitoringRetrievalTaskVO.java
  3. 22 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/controller/MonitorAccessReportController.java
  4. 4 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/dto/MonitoringAccessDTO.java
  5. 36 30
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/service/impl/MonitorAccessReportServiceImpl.java
  6. 8 5
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/vo/MonitoringAccessVO.java
  7. 4 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/controller/ResumptionReportController.java
  8. 27 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/controller/SafetyInspectReportController.java
  9. 1 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/dto/SafetyInspectDTO.java
  10. 3 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/mapper/SafetyInspectMapper.java
  11. 6 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/service/SafetyInspectService.java
  12. 51 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/service/impl/SafetyInspectServiceImpl.java
  13. 3 28
      soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/MonitorAccessReportMapper.xml
  14. 44 10
      soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/SafetyInspectMapper.xml

+ 11 - 3
project_data/sql/0.0.3/soc/soc.sql

@@ -835,13 +835,13 @@ DELETE FROM sys_menu WHERE id IN(01724607752400044034,01723993298998222849,01719
 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 (01719287834364436482, '统计报表', 0, 1, 'reportForms', NULL, NULL, 1, 0, 'M', '0', '0', null, '1', 'chart', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (01719288533101928450, '安全检查统计报表', 1719287834364436482, 1, 'core/reportForms', 'core/reportForms/safetyInspectReport', NULL, 1, 1, 'C', '0', '0', 'core:safetyInspectReport:list', '1', 'chart', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+VALUES (01719288533101928450, '行社全面检查统计报表', 1719287834364436482, 1, 'core/reportForms', 'core/reportForms/safetyInspectReport', NULL, 1, 1, 'C', '0', '0', 'core:safetyInspectReport:list', '1', 'chart', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (01719892877586239490, '外包履职评价统计表', 1719287834364436482, 2, 'evaluateTable', 'evaluateTable/index', NULL, 1, 1, 'C', '0', '0', 'core:safetyInspectReport:list', '1', 'chart', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (01720000571298115585, '监控调阅统计报表', 1719287834364436482, 3, 'core', 'core/reportForms/monitorAccessReport', NULL, 1, 1, 'C', '0', '0', 'core:monitorAccessReport:list', '1', 'chart', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (01722523915868221442, '每日营业前中后的履职报表', 1719287834364436482, 5, '/core/resumptionReport', 'core/reportForms/resumptionReport', NULL, 1, 1, 'C', '0', '0', 'core:resumptionReport:list', '1', 'chart', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+VALUES (01722523915868221442, '履职报表', 1719287834364436482, 5, '/core/resumptionReport', 'core/reportForms/resumptionReport', NULL, 1, 1, 'C', '0', '0', 'core:resumptionReport:list', '1', 'chart', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (01723993298998222849, '报警测试报表', 1719287834364436482, 6, '/resumptionReport/intrusionTest', 'core/reportForms/intrusionTestReport', NULL, 1, 1, 'C', '0', '0', 'core:resumptionReport:list', '1', 'chart', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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`)
@@ -849,11 +849,19 @@ VALUES (01724607752400044034, '备用电源维护报表', 1719287834364436482, 7
 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 (01724355771043504129, '离行式自助银行巡检报表', 1719287834364436482, 7, '/resumptionReport/serviceBank', 'core/reportForms/serviceBankReport', NULL, 1, 1, 'C', '0', '0', 'core:resumptionReport:list', '1', 'chart', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 
+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 (01726904309791121409, '网点负责人自查报表', 1719287834364436482, 9, '/core/safetyInspectReport/selfInspectList', 'core/reportForms/selfInspectReport', NULL, 1, 1, 'C', '0', '0', 'core:safetyInspectReport:list', '1', 'chart', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 
 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 (1722135552494403586, '登记簿批量导出', 1719287834364436482, 10, 'code/registerbook', 'registerBook/index', null, 1, 0, 'C', '0', '0', 'core:registerBook:list', '1', 'education', null, null, now(), null, now(), null);
 
-delete from sys_role_menu where menu_id IN(01724355771043504129,01723993298998222849,01722523915868221442,01719287834364436482,01719288533101928450,01719892877586239490,01720000571298115585);
+delete from sys_role_menu where menu_id IN(01726904309791121409,01724355771043504129,01723993298998222849,01722523915868221442,01719287834364436482,01719288533101928450,01719892877586239490,01720000571298115585);
+
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 01726904309791121409);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 01726904309791121409);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (121, 01726904309791121409);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (122, 01726904309791121409);
+
 INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 01724355771043504129);
 INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 01724355771043504129);
 INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (121, 01724355771043504129);

+ 112 - 1
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/retrieval/vo/AppCoreMonitoringRetrievalTaskVO.java

@@ -1,13 +1,124 @@
 package com.xunmei.common.core.domain.retrieval.vo;
 
+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.domain.retrieval.domain.CoreMonitoringRetrievalTask;
+import com.xunmei.common.core.web.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
 
 /**
  * @author :LuoWei
  * @date : 2023/10/23
  */
 @Data
-public class AppCoreMonitoringRetrievalTaskVO extends CoreMonitoringRetrievalTask {
+public class AppCoreMonitoringRetrievalTaskVO  {
+        /** 主键 */
+        @JsonSerialize(using = ToStringSerializer.class)
+        private Long id;
+
+        /** 计划id */
+        @JsonSerialize(using = ToStringSerializer.class)
+        private Long planId;
+
+        /** 任务名称 */
+        @ApiModelProperty(value = "任务名称")
+        private String taskName;
+
+        /** 调阅机构 */
+        @JsonSerialize(using = ToStringSerializer.class)
+        private Long orgId;
+
+        /** 调阅机构 */
+        private String orgPath;
+
+        /** 调阅机构 */
+        @ApiModelProperty(value = "调阅机构")
+        private String orgName;
+
+        /** 年月日 */
+        private Date ymdDate;
+
+        /** 年 */
+        private Integer ymdYear;
+
+        /** 半年 */
+        private Integer ymdHalfyear;
+
+        /** 季度 */
+        private Integer ymdQuarter;
+
+        /** 月 */
+        private Integer ymdMonth;
+
+        /** 周 */
+        private Integer ymdWeek;
+
+        /** 日 */
+        private Integer ymdDay;
+
+        /** 周期无周期、每日、每周、每月、每季度、每半年、每年(0-6) */
+        private String cycle;
+
+        /** 开始时间 */
+        @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+        @ApiModelProperty(value = "开始时间")
+        private Date planStartTime;
+
+        /** 结束时间 */
+        @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+        @ApiModelProperty(value = "结束时间")
+        private Date planEndTime;
+
+        /** 调阅开始时间 */
+        @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+        @ApiModelProperty(value = "调阅开始时间")
+        private Date startTime;
+
+        /** 调阅结束时间 */
+        @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+        @ApiModelProperty(value = "调阅结束时间")
+        private Date endTime;
+
+        /** 状态 */
+        @ApiModelProperty(value = "状态")
+        private String status;
+
+        /** 角色id */
+        @JsonSerialize(using = ToStringSerializer.class)
+        private Long roleId;
+
+        /** 调阅人 */
+        @JsonSerialize(using = ToStringSerializer.class)
+        private Long retrievalUser;
+
+        /** 第几次调阅(根据计划的频次计算的来) */
+        @JsonSerialize(using = ToStringSerializer.class)
+        private Integer orderNum;
+
+        /** 批次号(同一计划多频次为一个批次号) */
+        @JsonSerialize(using = ToStringSerializer.class)
+        private Long batchNum;
+
+        /** 提交时间 */
+        private Date submitTime;
+
+        /** 异常数 */
+        @ApiModelProperty(value = "异常数")
+        private Integer exceptionCount;
+        @ApiModelProperty(value = "0正常,1删除")
+        private Integer isDeleted;
+
+
+
+
+
     private Integer isExist;
 }

+ 22 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/controller/MonitorAccessReportController.java

@@ -8,6 +8,7 @@ import com.xunmei.common.security.annotation.RequiresPermissions;
 
 import com.xunmei.core.reportForms.monitor.dto.MonitoringAccessDTO;
 import com.xunmei.core.reportForms.monitor.service.MonitorAccessReportService;
+import com.xunmei.core.reportForms.monitor.service.impl.MonitorAccessReportServiceImpl;
 import com.xunmei.core.reportForms.monitor.vo.MonitoringAccessVO;
 
 import io.swagger.annotations.Api;
@@ -19,6 +20,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -31,12 +35,14 @@ import java.util.List;
 public class MonitorAccessReportController {
     @Autowired
     private MonitorAccessReportService monitorAccessReportService;
+
     @ApiOperation(value = "监控调阅报表")
     @RequiresPermissions("core:monitorAccessReport:list")
     @GetMapping("/list")
     public AjaxResult list(MonitoringAccessDTO monitoringAccessDTO) {
-        if (null==monitoringAccessDTO.getCycle()){
-            monitoringAccessDTO.setCycle("2");
+        if (null==monitoringAccessDTO.getStartDate()||null==monitoringAccessDTO.getEndDate()){
+            monitoringAccessDTO.setStartDate(getWeekStart());
+            monitoringAccessDTO.setEndDate(getWeekEnd());
         }
         AjaxResult ajax = AjaxResult.success();
         List<MonitoringAccessVO> report = monitorAccessReportService.selectAll(monitoringAccessDTO);
@@ -55,4 +61,18 @@ public class MonitorAccessReportController {
     public void export(MonitoringAccessDTO request, HttpServletResponse response) throws IOException {
         monitorAccessReportService.export(request, response);
     }
+    public static String getWeekStart(){
+        Calendar cal=Calendar.getInstance();
+        cal.add(Calendar.WEEK_OF_MONTH,0);
+        cal.set(Calendar.DAY_OF_WEEK,2);
+        Date time=cal.getTime();
+        return new SimpleDateFormat("yyyy-MM-dd").format(time);
+    }
+    public static String getWeekEnd(){
+        Calendar cal=Calendar.getInstance();
+        cal.set(Calendar.DAY_OF_WEEK,cal.getActualMaximum(Calendar.DAY_OF_WEEK));
+        cal.add(Calendar.DAY_OF_WEEK,1);
+        Date time=cal.getTime();
+        return new SimpleDateFormat("yyyy-MM-dd").format(time);
+    }
 }

+ 4 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/dto/MonitoringAccessDTO.java

@@ -1,5 +1,6 @@
 package com.xunmei.core.reportForms.monitor.dto;
 
+import cn.hutool.core.date.Week;
 import com.xunmei.common.core.web.domain.BaseEntity;
 import lombok.Data;
 
@@ -13,7 +14,8 @@ import java.util.Date;
 public class MonitoringAccessDTO extends BaseEntity {
     private Long orgId;
     private String orgPath;
-    private Date startTime;
-    private Date endTime;
+    private String startDate;
+    private String endDate;
     private String cycle;
+    private Week searchTime;
 }

+ 36 - 30
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/service/impl/MonitorAccessReportServiceImpl.java

@@ -24,10 +24,7 @@ import java.io.IOException;
 import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * @author :LuoWei
@@ -65,8 +62,8 @@ public class MonitorAccessReportServiceImpl implements MonitorAccessReportServic
         cal.setTime(new Date());
         cal.add(Calendar.DATE, -amount);
         Date time = cal.getTime();
-        monitoringAccessDTO.setStartTime(time);
-        monitoringAccessDTO.setEndTime(new Date());
+//        monitoringAccessDTO.setStartTime(time);
+//        monitoringAccessDTO.setEndTime(new Date());
         Page<MonitoringAccessVO> report = monitorAccessReportMapper.report(page, monitoringAccessDTO);
         report.getRecords().forEach(r -> {
             Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(r.getPath());
@@ -74,17 +71,46 @@ public class MonitorAccessReportServiceImpl implements MonitorAccessReportServic
         });
         return TableDataInfo.build(report);
     }
-
+public static String getWeekStart(){
+        Calendar cal=Calendar.getInstance();
+        cal.add(Calendar.WEEK_OF_MONTH,0);
+        cal.set(Calendar.DAY_OF_WEEK,2);
+        Date time=cal.getTime();
+        return new SimpleDateFormat("yyyy-MM-dd").format(time);
+}
+    public static String getWeekEnd(){
+        Calendar cal=Calendar.getInstance();
+        cal.set(Calendar.DAY_OF_WEEK,cal.getActualMaximum(Calendar.DAY_OF_WEEK));
+        cal.add(Calendar.DAY_OF_WEEK,1);
+        Date time=cal.getTime();
+        return new SimpleDateFormat("yyyy-MM-dd").format(time);
+    }
     @Override
     public List<MonitoringAccessVO> selectAll(MonitoringAccessDTO monitoringAccessDTO) {
-        resumptionReportService.report(new ResumptionDTO());
+
         if (null == monitoringAccessDTO.getOrgId()) {
             monitoringAccessDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
         }
-        List<SysOrg> sysOrgs = remoteOrgService.selectSysOrgByParentId(monitoringAccessDTO.getOrgId(), SecurityConstants.INNER);
+        //判断机构类型,如果机构类型大于行社,都展示行社数据
+        SysOrg sysOrg = remoteOrgService.selectSysOrgById(monitoringAccessDTO.getOrgId(), SecurityConstants.INNER);
+        List<SysOrg> sysOrgs;
+        if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
+            sysOrgs = remoteOrgService.selectSysOrgByPathAndType(sysOrg.getPath(), 3, SecurityConstants.INNER);
+        } else if (sysOrg.getType() == 3) {
+            sysOrgs = remoteOrgService.selectSysOrgByPathAndType(sysOrg.getPath(), 4, SecurityConstants.INNER);
+        } else {
+            return Collections.emptyList();
+        }
         List<MonitoringAccessVO> monitoringAccessVOList = new ArrayList<>();
         sysOrgs.forEach(s -> {
             MonitoringAccessVO monitoringAccessVO = new MonitoringAccessVO();
+            SysOrg sysOrg1;
+            if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
+                sysOrg1 = remoteOrgService.selectOrgById(s.getParentId(), SecurityConstants.INNER);
+            } else {
+                sysOrg1 = remoteOrgService.selectOrgById(remoteOrgService.selectOrgById(s.getParentId(), SecurityConstants.INNER).getParentId(), SecurityConstants.INNER);
+            }
+            monitoringAccessVO.setCity(sysOrg1.getShortName().split("地区行社")[0]);
             Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(s.getPath());
             monitoringAccessDTO.setOrgPath(s.getPath());
             MonitoringAccessVO monitoringAccessVO1 = monitorAccessReportMapper.selectAll(monitoringAccessDTO);
@@ -131,27 +157,7 @@ public class MonitorAccessReportServiceImpl implements MonitorAccessReportServic
             monitoringAccessDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
         }
         SysOrg sysOrg = remoteOrgService.selectSysOrgById(monitoringAccessDTO.getOrgId(), SecurityConstants.INNER);
-        String timeUnit = "年";
-        int amount = 0;
-        switch (monitoringAccessDTO.getCycle()) {
-            case "2":
-                amount = 7;
-                timeUnit = "周";
-                break;
-            case "3":
-                amount = 30;
-                timeUnit = "月";
-                break;
-            default:
-                amount = 365;
-                break;
-        }
-        Calendar cal = Calendar.getInstance();
-        cal.setTime(new Date());
-        cal.add(Calendar.DATE, -amount);
-        Date time = cal.getTime();
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-        String title = sysOrg.getShortName() + "监控调阅" + timeUnit + "报(" + sdf.format(time) + "~" + sdf.format(new Date()) + ")";
+        String title = sysOrg.getShortName() + "监控调阅情况表" + "(" + monitoringAccessDTO.getStartDate() + "~" + monitoringAccessDTO.getEndDate() + ")";
         return title;
     }
 

+ 8 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/vo/MonitoringAccessVO.java

@@ -18,8 +18,9 @@ public class MonitoringAccessVO {
      */
     @ExcelProperty("序号")
     private Integer orderNum;
+private String city;
 
-    @ExcelProperty("机构名称")
+    @ExcelProperty("单位名称")
     @ApiModelProperty(value = "机构名称")
     private String orgName;
 
@@ -31,12 +32,14 @@ public class MonitoringAccessVO {
     @ApiModelProperty(value = "应调阅次数")
     private Integer planAccessNumber;
 
-    @ExcelProperty("实际调阅次数")
+    @ExcelProperty("调阅次数")
     @ApiModelProperty(value = "实际调阅次数")
     private Integer realityAccessNumber;
-
-    @ExcelProperty("调阅率")
-    @ApiModelProperty(value = "调阅率")
+    @ExcelProperty("平均调阅时长")
+    @ApiModelProperty(value = "平均调阅时长(小时)")
+private String duration;
+    @ExcelProperty("完成率")
+    @ApiModelProperty(value = "完成率")
     private String accessRate;
     @ExcelIgnore
     @ExcelProperty("机构路径")

+ 4 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/controller/ResumptionReportController.java

@@ -46,9 +46,9 @@ private static  final String TITLE="title";
         List<ResumptionDayVO> report = resumptionReportService.report(resumptionDTO);
         ajaxResult.put(AjaxResult.DATA_TAG, report);
         if (null == resumptionDTO.getCycle() || resumptionDTO.getCycle() == 1) {
-            ajaxResult.put(TITLE, "日报表-营业网点每日安全保卫履职(" + resumptionDTO.getSearchTime() + ")");
+            ajaxResult.put(TITLE, "营业网点安全保卫履职情况表(" + resumptionDTO.getSearchTime() + ")");
         } else {
-            ajaxResult.put(TITLE, "月报表-营业网点每日安全保卫履职(" + resumptionDTO.getSearchTime() + ")");
+            ajaxResult.put(TITLE, "营业网点安全保卫履职情况表(" + resumptionDTO.getSearchTime() + ")");
         }
         return ajaxResult;
     }
@@ -84,7 +84,8 @@ private static  final String TITLE="title";
             time = currentDate.getYear() + "年第" + quarter + "季度";
         } else {
             String[] split = resumptionDTO.getSearchTime().split("-");
-            time = split[0] + "年第" + split[1] + "季度";
+            Integer month =(Integer.valueOf(split[1])-1)/3+1 ;
+            time = split[0] + "年第" + month + "季度";
         }
         AjaxResult ajaxResult = AjaxResult.success();
         List<IntrusionTestReportVO> intrusionTestReportVOList = resumptionReportService.standbyPower(resumptionDTO);

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

@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.time.LocalDate;
 import java.util.List;
 
 /**
@@ -34,10 +35,14 @@ public class SafetyInspectReportController {
     @Resource
     private RemoteOrgService remoteOrgService;
 
-    @ApiOperation(value = "安全检查报表")
+    @ApiOperation(value = "行社全面检查报表")
     @RequiresPermissions("core:safetyInspectReport:list")
     @GetMapping("/list")
     public AjaxResult list(SafetyInspectDTO safetyInspectDTO) {
+        if (null==safetyInspectDTO.getYear()){
+            LocalDate localDate= LocalDate.now();
+            safetyInspectDTO.setYear(String.valueOf(localDate.getYear()));
+        }
         AjaxResult ajax = AjaxResult.success();
         List<SafetyInspectVO> report = safetyInspectService.report(safetyInspectDTO);
         ajax.put(AjaxResult.DATA_TAG, report);
@@ -46,9 +51,29 @@ public class SafetyInspectReportController {
         }
         SysOrg sysOrg = remoteOrgService.selectSysOrgById(safetyInspectDTO.getOrgId(), SecurityConstants.INNER);
         ajax.put("orgName", sysOrg.getShortName());
+        ajax.put("title","行社全面检查统计报表("+safetyInspectDTO.getYear()+")");
+        return ajax;
+    }
+    @ApiOperation(value = "网点负责人自查报表")
+    @RequiresPermissions("core:safetyInspectReport:list")
+    @GetMapping("/selfInspectList")
+    public AjaxResult selfInspectList(SafetyInspectDTO safetyInspectDTO) {
+        AjaxResult ajax = AjaxResult.success();
+     if (null== safetyInspectDTO.getYear()){
+         safetyInspectDTO.setCycle(1);
+         LocalDate localDate= LocalDate.now();
+         safetyInspectDTO.setYear(localDate.getYear()+"-"+  localDate.getMonthValue());
+     }
+        List<SafetyInspectVO> report = safetyInspectService.selfInspectReport(safetyInspectDTO);
+        ajax.put(AjaxResult.DATA_TAG, report);
+        if (null == safetyInspectDTO.getOrgId()) {
+            safetyInspectDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
+        }
+        SysOrg sysOrg = remoteOrgService.selectSysOrgById(safetyInspectDTO.getOrgId(), SecurityConstants.INNER);
+        ajax.put("orgName", sysOrg.getShortName());
+        ajax.put("title","网点负责人自查报表("+safetyInspectDTO.getYear()+")");
         return ajax;
     }
-
     @GetMapping("/selectAllOrg")
     public AjaxResult selectAllOrg() {
         return AjaxResult.success(safetyInspectService.selectAllOrg());

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/dto/SafetyInspectDTO.java

@@ -13,6 +13,7 @@ import java.util.Date;
  */
 @Data
 public class SafetyInspectDTO extends BaseEntity {
+    private Integer cycle;
     private Long orgId;
     private String year;
     private String orgPath;

+ 3 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/mapper/SafetyInspectMapper.java

@@ -18,7 +18,9 @@ import java.util.Map;
  */
 @Mapper
 public interface SafetyInspectMapper {
-   SafetyInspectVO selectAllByPath(String orgPath);
+   SafetyInspectVO selectAllByPath(@Param("orgPath")String orgPath,@Param("year") String year,@Param("orgType") Integer orgType);
+
+  SafetyInspectVO selectSelfByPath(@Param("cycle") Integer cycle,@Param("orgPath")String orgPath,@Param("year") String year,@Param("orgType") Integer orgType);
 
     Page<SafetyInspectVO> report(@Param("page") Page<SafetyInspectVO> page, @Param("safetyInspectDTO") SafetyInspectDTO safetyInspectDTO);
 

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

@@ -18,6 +18,12 @@ import java.util.List;
 public interface SafetyInspectService {
     List<SafetyInspectVO> report(SafetyInspectDTO safetyInspectDTO);
 
+    /**
+     * 自查
+     * @param safetyInspectDTO
+     * @return
+     */
+    List<SafetyInspectVO> selfInspectReport(SafetyInspectDTO safetyInspectDTO);
     void export(SafetyInspectDTO safetyInspectDTO, HttpServletResponse response) throws IOException;
 
     List<SysOrg> selectAllOrg();

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

@@ -65,7 +65,7 @@ public class SafetyInspectServiceImpl implements SafetyInspectService {
             safetyInspectVO.setCity(sysOrg1.getShortName().split("地区行社")[0]);
             safetyInspectVO.setOrgName(s.getShortName());
             //次数
-            SafetyInspectVO safetyInspectVOS = safetyInspectMapper.selectAllByPath(s.getPath());
+            SafetyInspectVO safetyInspectVOS = safetyInspectMapper.selectAllByPath(s.getPath(),safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType());
             //机构维度
             Map map = safetyInspectMapper.orgDimension(s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType());
             safetyInspectVO.setPlanInspectOrg(Integer.valueOf(map.get("planInspectOrg").toString()));
@@ -87,6 +87,56 @@ public class SafetyInspectServiceImpl implements SafetyInspectService {
     }
 
     @Override
+    public List<SafetyInspectVO> selfInspectReport(SafetyInspectDTO safetyInspectDTO) {
+        if (null == safetyInspectDTO.getOrgId()) {
+            safetyInspectDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
+        }
+        //判断机构类型,如果机构类型大于行社,都展示行社数据
+        SysOrg sysOrg = orgService.selectSysOrgById(safetyInspectDTO.getOrgId(), SecurityConstants.INNER);
+        List<SysOrg> sysOrgs;
+        if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
+            sysOrgs = orgService.selectSysOrgByPathAndType(sysOrg.getPath(), 3, SecurityConstants.INNER);
+        } else if (sysOrg.getType() == 3) {
+            sysOrgs = orgService.selectSysOrgByPathAndType(sysOrg.getPath(), 4, SecurityConstants.INNER);
+        } else {
+            return Collections.emptyList();
+        }
+        List<SafetyInspectVO>safetyInspectVOList=new ArrayList<>();
+        sysOrgs.forEach(s->{
+            SafetyInspectVO safetyInspectVO=new SafetyInspectVO();
+            SysOrg sysOrg1;
+            if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
+                sysOrg1 = orgService.selectOrgById(s.getParentId(), SecurityConstants.INNER);
+            } else {
+                sysOrg1 = orgService.selectOrgById(orgService.selectOrgById(s.getParentId(), SecurityConstants.INNER).getParentId(), SecurityConstants.INNER);
+            }
+            Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(s.getPath());
+            safetyInspectVO.setPlanInspectOrg(integer);
+            safetyInspectVO.setCity(sysOrg1.getShortName().split("地区行社")[0]);
+            safetyInspectVO.setOrgName(s.getShortName());
+            //次数
+            SafetyInspectVO safetyInspectVOS = safetyInspectMapper.selectSelfByPath(safetyInspectDTO.getCycle(),s.getPath(),safetyInspectDTO.getYear(),safetyInspectDTO.getOrgType());
+            //机构维度
+            Map map = safetyInspectMapper.orgDimension(s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType());
+            safetyInspectVO.setPlanInspectOrg(Integer.valueOf(map.get("planInspectOrg").toString()));
+            safetyInspectVO.setRealityInspectOrg(Integer.valueOf(map.get("realityInspectOrg").toString()));
+            safetyInspectVO.setInspectCoverRate(map.get("inspectCoverRate").toString());
+            safetyInspectVO.setOrgName(s.getShortName());
+            Map map1 = safetyInspectMapper.pitfallDimension(s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType());
+            safetyInspectVO.setPitfallNumber(Integer.valueOf(map1.get("pitfallNumber").toString()));
+            safetyInspectVO.setRectificationNumber(Integer.valueOf(map1.get("rectificationNumber").toString()));
+            safetyInspectVO.setRectificationRate(map1.get("rectificationRate").toString());
+
+            safetyInspectVO.setPlanInspectNumber(safetyInspectVOS.getPlanInspectNumber());
+            safetyInspectVO.setRealityInspectNumber(safetyInspectVOS.getRealityInspectNumber());
+            safetyInspectVO.setInspectRate(safetyInspectVOS.getInspectRate());
+            //  safetyInspectVO.setPitfallNumber(safetyInspectVOS.getPitfallNumber());
+            safetyInspectVOList.add(safetyInspectVO);
+        });
+        return safetyInspectVOList;
+    }
+
+    @Override
     public void export(SafetyInspectDTO safetyInspectDTO, HttpServletResponse response) throws IOException {
         String orgName = null;
         SysOrg sysOrg;

+ 3 - 28
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/MonitorAccessReportMapper.xml

@@ -34,32 +34,7 @@
         SELECT COUNT(1) FROM sys_org WHERE path LIKE  concat( #{orgPath}, '%') AND type=4 AND deleted=0
     </select>
     <select id="selectAll" resultType="com.xunmei.core.reportForms.monitor.vo.MonitoringAccessVO">
-    <!--    SELECT
-        b.short_name AS orgName,
-        b.path,
-        COUNT( a.id ) AS planAccessNumber,
-        SUM(
-        IF
-        ( a.`status` = 2, 1, 0 )) AS realityAccessNumber,
-        SUM(
-        IF
-        ( a.`status` = 2, 1, 0 ))/ COUNT( a.id ) AS accessRate
-        FROM
-        core_monitoring_retrieval_task a
-        LEFT JOIN sys_org b ON a.org_id = b.id
-        WHERE
-        a.is_deleted=0
-        <if test="orgPath != null  and orgPath != ''">
-            and     b.path like concat( #{orgPath}, '%')
-        </if>
-        <if test="cycle != null  and cycle != ''">
-            AND a.cycle = #{cycle}
-        </if>
-        <if test="startTime != null  and endTime != null">
-            AND a.start_time >= #{startTime} ANDa.end_time &lt;= #{endTime}
-        </if>
-        GROUP BY
-        b.id-->
+
         SELECT
 
         COUNT( a.id ) AS planAccessNumber,
@@ -80,8 +55,8 @@
         <if test="cycle != null  and cycle != ''">
             AND a.cycle = #{cycle}
         </if>
-        <if test="startTime != null  and endTime != null">
-            AND a.start_time >= #{startTime} AND a.end_time &lt;= #{endTime}
+        <if test="startDate != null  and endDate != null">
+            AND a.start_time >= #{startDate} AND a.end_time &lt;= #{endDate}
         </if>
 
     </select>

+ 44 - 10
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/SafetyInspectMapper.xml

@@ -71,18 +71,20 @@
                     IF
                         ( a.`status` = 3, 1, 0 )),0) AS realityInspectNumber,
             IFNULL( SUM( a.exception_count ), 0 ) AS pitfallNumber,
-
-            CONCAT(
-                    ROUND(
-                                    IFNULL( SUM( IF ( a.`status` = 1, 1, 0 )), 0 ) / IFNULL( COUNT( a.id ), 0 )* 100,
-                                    2
-                        ),
-                    '%'
-                ) AS inspectRate
+        CONCAT(
+        ROUND(
+        IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 ) / IFNULL( COUNT( a.id ), 0 )* 100,
+        2
+        ),
+        '%'
+        ) AS inspectRate
         FROM
-            core_safety_task a LEFT JOIN sys_org b ON a.org_id=b.id
+        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
+        a.deleted = 0
+        AND c.check_type =4
         <if test="orgPath !=null and orgPath !=''">
             and a.org_path like concat(#{orgPath},'%')
         </if>
@@ -155,4 +157,36 @@
             AND b.type = #{orgType}
         </if>
     </select>
+    <select id="selectSelfByPath" resultType="com.xunmei.core.reportForms.safetyInspect.vo.SafetyInspectVO">
+        SELECT
+        IFNULL( COUNT( a.id ), 0 ) AS planInspectNumber,
+        IFNULL(       SUM(
+        IF
+        ( a.`status` = 3, 1, 0 )),0) AS realityInspectNumber,
+        IFNULL( SUM( a.exception_count ), 0 ) AS pitfallNumber,
+        CONCAT(
+        ROUND(
+        IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 ) / IFNULL( COUNT( a.id ), 0 )* 100,
+        2
+        ),
+        '%'
+        ) AS inspectRate
+        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
+        <if test="orgPath !=null and orgPath !=''">
+            and a.org_path like concat(#{orgPath},'%')
+        </if>
+
+        <if test="year !=null and year !=''">
+            AND a.ymd_date like concat(#{year},'%')
+        </if>
+        <if test="orgType !=null">
+            AND b.type = #{orgType}
+        </if>
+    </select>
 </mapper>