luowei vor 1 Jahr
Ursprung
Commit
7e86d0d54b
12 geänderte Dateien mit 238 neuen und 9 gelöschten Zeilen
  1. 8 1
      project_data/sql/0.0.3/soc/soc.sql
  2. 13 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/controller/MonitorAccessReportController.java
  3. 1 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/service/impl/MonitorAccessReportServiceImpl.java
  4. 42 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/controller/ResumptionReportController.java
  5. 11 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/ResumptionReportService.java
  6. 112 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/impl/ResumptionReportServiceImpl.java
  7. 3 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/vo/IntrusionTestReportVO.java
  8. 3 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/vo/ResumptionDayVO.java
  9. 10 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/controller/SafetyInspectReportController.java
  10. 4 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/service/SafetyInspectService.java
  11. 30 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/service/impl/SafetyInspectServiceImpl.java
  12. 1 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/vo/SafetyInspectVO.java

+ 8 - 1
project_data/sql/0.0.3/soc/soc.sql

@@ -913,7 +913,14 @@ INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 01719892877586239
 INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 01719892877586239490);
 INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (121, 01719892877586239490);
 INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (122, 01719892877586239490);
-
+delete from sys_menu where id =1730138955887800321;
+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 (1730138955887800321, '导出', 1719288533101928450, 1, '', null, NULL, 1, 0, 'F', '0', '0', 'core:safetyInspectReport:export', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+delete from sys_role_menu where menu_id =1730138955887800321;
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 1730138955887800321);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 1730138955887800321);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (121, 1730138955887800321);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (122, 1730138955887800321);
 -- 登记簿批量导出菜单权限赋予
 delete from sys_role_menu where menu_id =1722135552494403586;
 insert into sys_role_menu select id,1722135552494403586 from sys_role where org_type in (1,2,3,4) and del_flag=0 and status=0;

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

@@ -1,5 +1,6 @@
 package com.xunmei.core.reportForms.monitor.controller;
 
+import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.web.domain.AjaxResult;
 
 import com.xunmei.common.log.annotation.Log;
@@ -11,6 +12,8 @@ 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 com.xunmei.system.api.RemoteOrgService;
+import com.xunmei.system.api.domain.SysOrg;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,6 +21,8 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.text.SimpleDateFormat;
@@ -35,7 +40,8 @@ import java.util.List;
 public class MonitorAccessReportController {
     @Autowired
     private MonitorAccessReportService monitorAccessReportService;
-
+    @Resource
+    private RemoteOrgService remoteOrgService;
     @ApiOperation(value = "监控调阅报表")
     @RequiresPermissions("core:monitorAccessReport:list")
     @GetMapping("/list")
@@ -49,6 +55,8 @@ public class MonitorAccessReportController {
         ajax.put(AjaxResult.DATA_TAG,report);
         String title = monitorAccessReportService.getTitle(monitoringAccessDTO);
         ajax.put("title",title);
+        SysOrg sysOrg = remoteOrgService.selectSysOrgById(monitoringAccessDTO.getOrgId(), SecurityConstants.INNER);
+        ajax.put("orgName", sysOrg.getShortName());
         return ajax;
     }
     /**
@@ -59,6 +67,10 @@ public class MonitorAccessReportController {
     @Log(title = "监控调阅报表", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(MonitoringAccessDTO request, HttpServletResponse response) throws IOException {
+        if (null==request.getStartDate()||null==request.getEndDate()){
+            request.setStartDate(getWeekStart());
+            request.setEndDate(getWeekEnd());
+        }
         monitorAccessReportService.export(request, response);
     }
     public static String getWeekStart(){

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

@@ -38,8 +38,7 @@ public class MonitorAccessReportServiceImpl implements MonitorAccessReportServic
     private MonitorAccessReportMapper monitorAccessReportMapper;
     @Resource
     private RemoteOrgService remoteOrgService;
-    @Autowired
-    private ResumptionReportService resumptionReportService;
+
 
     @Override
     public TableDataInfo<MonitoringAccessVO> report(MonitoringAccessDTO monitoringAccessDTO) {

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

@@ -2,19 +2,28 @@ package com.xunmei.core.reportForms.resumption.controller;
 
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
+import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.web.domain.AjaxResult;
+import com.xunmei.common.log.annotation.Log;
+import com.xunmei.common.log.enums.BusinessType;
 import com.xunmei.common.security.annotation.RequiresPermissions;
 import com.xunmei.core.reportForms.resumption.dto.ResumptionDTO;
 import com.xunmei.core.reportForms.resumption.service.ResumptionReportService;
 import com.xunmei.core.reportForms.resumption.vo.IntrusionTestReportVO;
 import com.xunmei.core.reportForms.resumption.vo.ResumptionDayVO;
+import com.xunmei.system.api.RemoteOrgService;
+import com.xunmei.system.api.domain.SysOrg;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.time.LocalDate;
 import java.util.Date;
 import java.util.List;
@@ -27,10 +36,19 @@ import java.util.List;
 @RestController
 @RequestMapping("/resumptionReport")
 public class ResumptionReportController {
+    @Resource
+    private RemoteOrgService remoteOrgService;
     @Autowired
     private ResumptionReportService resumptionReportService;
     private static final String TITLE = "title";
 
+    @ApiOperation(value = "履职报表导出")
+    @RequiresPermissions("core:resumptionReport:export")
+    @Log(title = "履职报表导出", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(ResumptionDTO request, HttpServletResponse response) throws IOException {
+        resumptionReportService.export(request, response);
+    }
     @ApiOperation(value = "每日安全保卫履职-日报表")
     @RequiresPermissions("core:resumptionReport:list")
     @GetMapping("/list")
@@ -51,9 +69,16 @@ public class ResumptionReportController {
         } else {
             ajaxResult.put(TITLE, "营业网点安全保卫履职情况表(" + resumptionDTO.getSearchTime() + ")");
         }
+        SysOrg sysOrg = remoteOrgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
+        ajaxResult.put("orgName", sysOrg.getShortName());
         return ajaxResult;
     }
-
+    @ApiOperation(value = "报警测试报表导出")
+    @RequiresPermissions("core:resumptionReport:export")
+    @PostMapping("/intrusionTestExport")
+    public void intrusionTestExport(ResumptionDTO request, HttpServletResponse response) throws IOException {
+        resumptionReportService.intrusionTestExport(request, response);
+    }
     @ApiOperation(value = "报警测试报表")
     @RequiresPermissions("core:resumptionReport:list")
     @GetMapping("/intrusionTest")
@@ -68,7 +93,12 @@ public class ResumptionReportController {
         ajaxResult.put(TITLE, "报警测试报表(" + resumptionDTO.getSearchTime() + ")");
         return ajaxResult;
     }
-
+    @ApiOperation(value = "备用电源报表导出")
+    @RequiresPermissions("core:resumptionReport:export")
+    @PostMapping("/standbyPowerExport")
+    public void standbyPowerExport(ResumptionDTO request, HttpServletResponse response) throws IOException {
+        resumptionReportService.standbyPowerExport(request, response);
+    }
     @ApiOperation(value = "备用电源维护报表")
     @RequiresPermissions("core:resumptionReport:list")
     @GetMapping("/standbyPower")
@@ -92,9 +122,16 @@ public class ResumptionReportController {
         List<IntrusionTestReportVO> intrusionTestReportVOList = resumptionReportService.standbyPower(resumptionDTO);
         ajaxResult.put(AjaxResult.DATA_TAG, intrusionTestReportVOList);
         ajaxResult.put(TITLE, "备用电源维护报表(" + time + ")");
+        SysOrg sysOrg = remoteOrgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
+        ajaxResult.put("orgName", sysOrg.getShortName());
         return ajaxResult;
     }
-
+    @ApiOperation(value = "离行式自助银行巡检报表导出")
+    @RequiresPermissions("core:resumptionReport:export")
+    @PostMapping("/serviceBankExport")
+    public void serviceBankExport(ResumptionDTO request, HttpServletResponse response) throws IOException {
+        resumptionReportService.serviceBankExport(request, response);
+    }
     @ApiOperation(value = "离行式自助银行巡检报表")
     @RequiresPermissions("core:resumptionReport:list")
     @GetMapping("/serviceBank")
@@ -107,6 +144,8 @@ public class ResumptionReportController {
         List<IntrusionTestReportVO> intrusionTestReportVOList = resumptionReportService.serviceBank(resumptionDTO);
         ajaxResult.put(AjaxResult.DATA_TAG, intrusionTestReportVOList);
         ajaxResult.put(TITLE, "离行式自助银行巡检报表(" + resumptionDTO.getSearchTime() + ")");
+        SysOrg sysOrg = remoteOrgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
+        ajaxResult.put("orgName", sysOrg.getShortName());
         return ajaxResult;
     }
 

+ 11 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/ResumptionReportService.java

@@ -1,9 +1,12 @@
 package com.xunmei.core.reportForms.resumption.service;
 
+import com.xunmei.core.reportForms.monitor.dto.MonitoringAccessDTO;
 import com.xunmei.core.reportForms.resumption.dto.ResumptionDTO;
 import com.xunmei.core.reportForms.resumption.vo.IntrusionTestReportVO;
 import com.xunmei.core.reportForms.resumption.vo.ResumptionDayVO;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -13,9 +16,17 @@ import java.util.List;
 public interface ResumptionReportService {
     List<ResumptionDayVO> report(ResumptionDTO resumptionDTO);
 
+    void export(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException;
+
+    void intrusionTestExport(ResumptionDTO resumptionDTO, HttpServletResponse response)throws IOException;
+
     List<IntrusionTestReportVO> intrusionTest(ResumptionDTO resumptionDTO);
 
+    void standbyPowerExport(ResumptionDTO resumptionDTO, HttpServletResponse response)throws IOException;
+
     List<IntrusionTestReportVO> standbyPower(ResumptionDTO resumptionDTO);
 
+    void serviceBankExport(ResumptionDTO resumptionDTO, HttpServletResponse response)throws IOException;
+
     List<IntrusionTestReportVO> serviceBank(ResumptionDTO resumptionDTO);
 }

+ 112 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/impl/ResumptionReportServiceImpl.java

@@ -1,8 +1,12 @@
 package com.xunmei.core.reportForms.resumption.service.impl;
 
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.excel.EasyExcel;
 import com.xunmei.common.core.constant.SecurityConstants;
+import com.xunmei.common.core.utils.DateHelper;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.reportForms.monitor.mapper.MonitorAccessReportMapper;
+import com.xunmei.core.reportForms.monitor.vo.MonitoringAccessVO;
 import com.xunmei.core.reportForms.resumption.dto.ResumptionDTO;
 import com.xunmei.core.reportForms.resumption.mapper.ResumptionReportMapper;
 import com.xunmei.core.reportForms.resumption.service.ResumptionReportService;
@@ -14,6 +18,9 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Calendar;
@@ -110,6 +117,58 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
     }
 
     @Override
+    public void export(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException {
+        String orgName = null;
+        if (null != resumptionDTO.getOrgId()) {
+            SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
+            orgName = sysOrg.getName();
+        }
+        List<ResumptionDayVO> report = this.report(resumptionDTO);
+        if (ObjectUtil.isEmpty(report)) {
+            throw new RuntimeException("导出数据为空!");
+        }
+        if (report.size() > 10000) {
+            throw new RuntimeException("导出数据量过大(单次导出限量10000条数据),请填写条件分批导出");
+        }
+        for (int i = 0; i < report.size(); i++) {
+            ResumptionDayVO resumptionDayVO = report.get(i);
+            resumptionDayVO.setOrderNum(i + 1);
+        }
+        response.setContentType("application/vnd.ms-excel");
+        response.setCharacterEncoding("utf-8");
+        String fileName = URLEncoder.encode("【" + orgName + "】-履职报表" + DateHelper.getDateString(new Date()), "UTF-8");
+        response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
+        // 调用EasyExcel的导出方法
+        EasyExcel.write(response.getOutputStream(), ResumptionDayVO.class).sheet("Sheet1").doWrite(report);
+    }
+
+    @Override
+    public void intrusionTestExport(ResumptionDTO resumptionDTO, HttpServletResponse response)throws IOException {
+        String orgName = null;
+        if (null != resumptionDTO.getOrgId()) {
+            SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
+            orgName = sysOrg.getName();
+        }
+        List<IntrusionTestReportVO> report = this.intrusionTest(resumptionDTO);
+        if (ObjectUtil.isEmpty(report)) {
+            throw new RuntimeException("导出数据为空!");
+        }
+        if (report.size() > 10000) {
+            throw new RuntimeException("导出数据量过大(单次导出限量10000条数据),请填写条件分批导出");
+        }
+        for (int i = 0; i < report.size(); i++) {
+            IntrusionTestReportVO intrusionTestReportVO = report.get(i);
+            intrusionTestReportVO.setOrderNum(i + 1);
+        }
+        response.setContentType("application/vnd.ms-excel");
+        response.setCharacterEncoding("utf-8");
+        String fileName = URLEncoder.encode("【" + orgName + "】-报警测试报表" + DateHelper.getDateString(new Date()), "UTF-8");
+        response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
+        // 调用EasyExcel的导出方法
+        EasyExcel.write(response.getOutputStream(), ResumptionDayVO.class).sheet("Sheet1").doWrite(report);
+    }
+
+    @Override
     public List<IntrusionTestReportVO> intrusionTest(ResumptionDTO resumptionDTO) {
         if (null == resumptionDTO.getOrgId()) {
             resumptionDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
@@ -148,6 +207,33 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
     }
 
     @Override
+    public void standbyPowerExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException {
+        String orgName = null;
+        if (null != resumptionDTO.getOrgId()) {
+            SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
+            orgName = sysOrg.getName();
+        }
+        List<IntrusionTestReportVO> report = this.standbyPower(resumptionDTO);
+        if (ObjectUtil.isEmpty(report)) {
+            throw new RuntimeException("导出数据为空!");
+        }
+        if (report.size() > 10000) {
+            throw new RuntimeException("导出数据量过大(单次导出限量10000条数据),请填写条件分批导出");
+        }
+        for (int i = 0; i < report.size(); i++) {
+            IntrusionTestReportVO intrusionTestReportVO = report.get(i);
+            intrusionTestReportVO.setOrderNum(i + 1);
+        }
+        response.setContentType("application/vnd.ms-excel");
+        response.setCharacterEncoding("utf-8");
+        String fileName = URLEncoder.encode("【" + orgName + "】-备用电源维护报表" + DateHelper.getDateString(new Date()), "UTF-8");
+        response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
+        // 调用EasyExcel的导出方法
+        EasyExcel.write(response.getOutputStream(), ResumptionDayVO.class).sheet("Sheet1").doWrite(report);
+    }
+
+
+    @Override
     public List<IntrusionTestReportVO> serviceBank(ResumptionDTO resumptionDTO) {
         if (null == resumptionDTO.getOrgId()) {
             resumptionDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
@@ -233,6 +319,32 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         return intrusionTestReportVOList;
     }
 
+    @Override
+    public void serviceBankExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException {
+        String orgName = null;
+        if (null != resumptionDTO.getOrgId()) {
+            SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
+            orgName = sysOrg.getName();
+        }
+        List<IntrusionTestReportVO> report = this.serviceBank(resumptionDTO);
+        if (ObjectUtil.isEmpty(report)) {
+            throw new RuntimeException("导出数据为空!");
+        }
+        if (report.size() > 10000) {
+            throw new RuntimeException("导出数据量过大(单次导出限量10000条数据),请填写条件分批导出");
+        }
+        for (int i = 0; i < report.size(); i++) {
+            IntrusionTestReportVO intrusionTestReportVO = report.get(i);
+            intrusionTestReportVO.setOrderNum(i + 1);
+        }
+        response.setContentType("application/vnd.ms-excel");
+        response.setCharacterEncoding("utf-8");
+        String fileName = URLEncoder.encode("【" + orgName + "】-离行式自助银行巡检报表" + DateHelper.getDateString(new Date()), "UTF-8");
+        response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
+        // 调用EasyExcel的导出方法
+        EasyExcel.write(response.getOutputStream(), ResumptionDayVO.class).sheet("Sheet1").doWrite(report);
+    }
+
 
     public String getLastDay(String datadate) throws Exception {
 

+ 3 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/vo/IntrusionTestReportVO.java

@@ -1,5 +1,6 @@
 package com.xunmei.core.reportForms.resumption.vo;
 
+import com.alibaba.excel.annotation.ExcelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -11,6 +12,8 @@ import lombok.Data;
  */
 @Data
 public class IntrusionTestReportVO {
+    @ExcelProperty("序号")
+    private Integer orderNum;
     private String city;
     private String orgName;
     @ApiModelProperty(value = "网点数量")

+ 3 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/vo/ResumptionDayVO.java

@@ -1,5 +1,6 @@
 package com.xunmei.core.reportForms.resumption.vo;
 
+import com.alibaba.excel.annotation.ExcelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -9,6 +10,8 @@ import lombok.Data;
  */
 @Data
 public class ResumptionDayVO {
+    @ExcelProperty("序号")
+    private Integer orderNum;
     private String city;
     private String orgName;
     @ApiModelProperty(value = "网点数量")

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

@@ -54,6 +54,7 @@ public class SafetyInspectReportController {
         ajax.put("title","行社全面检查统计报表("+safetyInspectDTO.getYear()+")");
         return ajax;
     }
+
     @ApiOperation(value = "网点负责人自查报表")
     @RequiresPermissions("core:safetyInspectReport:list")
     @GetMapping("/selfInspectList")
@@ -82,11 +83,18 @@ public class SafetyInspectReportController {
     /**
      * 导出excel
      */
-    @ApiOperation(value = "安全检查报表导出")
+    @ApiOperation(value = "行社全面检查报表导出")
     @RequiresPermissions("core:safetyInspectReport:export")
-    @Log(title = "安全检查报表", businessType = BusinessType.EXPORT)
+    @Log(title = "行社全面检查报表", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(SafetyInspectDTO request, HttpServletResponse response) throws IOException {
         safetyInspectService.export(request, response);
     }
+    @ApiOperation(value = "网点负责人自查报表导出")
+    @RequiresPermissions("core:safetyInspectReport:export")
+    @Log(title = "网点负责人自查报表导出", businessType = BusinessType.EXPORT)
+    @PostMapping("/selfInspectExport")
+    public void selfInspectExport(SafetyInspectDTO request, HttpServletResponse response) throws IOException {
+        safetyInspectService.selfInspectExport(request, response);
+    }
 }

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

@@ -20,11 +20,15 @@ public interface SafetyInspectService {
 
     /**
      * 自查
+     *
      * @param safetyInspectDTO
      * @return
      */
     List<SafetyInspectVO> selfInspectReport(SafetyInspectDTO safetyInspectDTO);
+
     void export(SafetyInspectDTO safetyInspectDTO, HttpServletResponse response) throws IOException;
 
+    void selfInspectExport(SafetyInspectDTO safetyInspectDTO, HttpServletResponse response) throws IOException;
+
     List<SysOrg> selectAllOrg();
 }

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

@@ -174,6 +174,36 @@ public class SafetyInspectServiceImpl implements SafetyInspectService {
     }
 
     @Override
+    public void selfInspectExport(SafetyInspectDTO safetyInspectDTO, HttpServletResponse response) throws IOException {
+        String orgName = null;
+        SysOrg sysOrg;
+        if (null == safetyInspectDTO.getOrgId()) {
+            sysOrg = remoteOrgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER);
+            safetyInspectDTO.setOrgPath(sysOrg.getPath());
+        } else {
+            sysOrg = remoteOrgService.selectSysOrgById(safetyInspectDTO.getOrgId(), SecurityConstants.INNER);
+        }
+        orgName = sysOrg.getName();
+        List<SafetyInspectVO> safetyInspectVOS =  this.selfInspectReport(safetyInspectDTO);
+        if (ObjectUtil.isEmpty(safetyInspectVOS)) {
+            throw new RuntimeException("导出数据为空!");
+        }
+        for (int i = 0; i < safetyInspectVOS.size(); i++) {
+            SafetyInspectVO safetyInspectVO = safetyInspectVOS.get(i);
+            safetyInspectVO.setOrderNum(i + 1);
+        }
+        if (safetyInspectVOS.size() > 10000) {
+            throw new RuntimeException("导出数据量过大(单次导出限量10000条数据),请填写条件分批导出");
+        }
+        response.setContentType("application/vnd.ms-excel");
+        response.setCharacterEncoding("utf-8");
+        String fileName = URLEncoder.encode("【" + orgName + "】-网点负责人自查报表" + DateHelper.getDateString(new Date()), "UTF-8");
+        response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
+        // 调用EasyExcel的导出方法
+        EasyExcel.write(response.getOutputStream(), SafetyInspectVO.class).sheet("Sheet1").doWrite(safetyInspectVOS);
+    }
+
+    @Override
     public List<SysOrg> selectAllOrg() {
         return safetyInspectMapper.selectAllOrg();
     }

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

@@ -13,6 +13,7 @@ import lombok.Data;
 public class SafetyInspectVO {
     @ExcelProperty("序号")
     private Integer orderNum;
+    @ExcelProperty("地区")
     private String city;
     @ExcelProperty("单位名称")
     @ApiModelProperty(value = "单位名称")