Explorar o código

现场bug处理,离行巡检报表逻辑变更

jingyuanchao hai 1 ano
pai
achega
c735042b65
Modificáronse 16 ficheiros con 267 adicións e 103 borrados
  1. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/mapper/MonitorAccessReportMapper.java
  2. 3 6
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/service/impl/MonitorAccessReportServiceImpl.java
  3. 4 4
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/controller/ResumptionReportController.java
  4. 2 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/mapper/ResumptionReportMapper.java
  5. 3 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/ResumptionReportService.java
  6. 95 70
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/impl/ResumptionReportServiceImpl.java
  7. 41 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/vo/LhSelfBankInspectionReport.java
  8. 52 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/vo/LhSelfBankInspectionReportNameVo.java
  9. 46 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/vo/LhSelfBankInspectionReportNumVo.java
  10. 2 4
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/service/impl/SafetyInspectServiceImpl.java
  11. 1 1
      soc-modules/soc-modules-core/src/main/resources/mapper/board/CockpitMapper.xml
  12. 2 2
      soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/MonitorAccessReportMapper.xml
  13. 1 1
      soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/ResumptionReportMapper.xml
  14. 4 7
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java
  15. 5 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/ConstructionDetailExport.java
  16. 5 1
      soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/mapper/MonitorAccessReportMapper.java

@@ -16,7 +16,7 @@ import org.apache.ibatis.annotations.Param;
 public interface MonitorAccessReportMapper {
     Page<MonitoringAccessVO> report(@Param("page") Page<MonitoringAccessVO> page, @Param("monitoringAccessDTO") MonitoringAccessDTO monitoringAccessDTO);
 
-    Integer selectNetworkNumberByPath(String orgPath);
+    Integer selectOrgNumByPathAndType(@Param("orgPath") String orgPath, @Param("orgType") Integer orgType);
 
     MonitoringAccessVO selectAll(MonitoringAccessDTO monitoringAccessDTO);
 

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

@@ -1,11 +1,10 @@
 package com.xunmei.core.reportForms.monitor.service.impl;
 
-import cn.hutool.core.date.DateTime;
-import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xunmei.common.core.constant.SecurityConstants;
+import com.xunmei.common.core.enums.OrgTypeEnum;
 import com.xunmei.common.core.utils.DateHelper;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.common.security.utils.SecurityUtils;
@@ -14,8 +13,6 @@ import com.xunmei.core.reportForms.monitor.dto.MonitoringAccessDTO;
 import com.xunmei.core.reportForms.monitor.mapper.MonitorAccessReportMapper;
 import com.xunmei.core.reportForms.monitor.service.MonitorAccessReportService;
 import com.xunmei.core.reportForms.monitor.vo.MonitoringAccessVO;
-import com.xunmei.core.reportForms.resumption.dto.ResumptionDTO;
-import com.xunmei.core.reportForms.resumption.service.ResumptionReportService;
 import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.domain.SysOrg;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -69,7 +66,7 @@ public class MonitorAccessReportServiceImpl implements MonitorAccessReportServic
 //        monitoringAccessDTO.setEndTime(new Date());
         Page<MonitoringAccessVO> report = monitorAccessReportMapper.report(page, monitoringAccessDTO);
         report.getRecords().forEach(r -> {
-            Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(r.getPath());
+            Integer integer = monitorAccessReportMapper.selectOrgNumByPathAndType(r.getPath(), OrgTypeEnum.YINGYE_WANGDIAN.getCode());
             r.setNetworkNumber(integer);
         });
         return TableDataInfo.build(report);
@@ -129,7 +126,7 @@ public class MonitorAccessReportServiceImpl implements MonitorAccessReportServic
                 }
             }
             monitoringAccessVO.setCity(sysOrg1.getShortName().indexOf("地区行社") == -1 ? sysOrg1.getShortName().substring(0, 2) : sysOrg1.getShortName().split("地区行社")[0]);
-            Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(s.getPath());
+            Integer integer = monitorAccessReportMapper.selectOrgNumByPathAndType(s.getPath(), OrgTypeEnum.YINGYE_WANGDIAN.getCode());
             monitoringAccessDTO.setOrgPath(s.getPath());
             Long condOrgId=monitoringAccessDTO.getOrgId();
             monitoringAccessDTO.setOrgId(null);

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

@@ -10,6 +10,7 @@ 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.LhSelfBankInspectionReport;
 import com.xunmei.core.reportForms.resumption.vo.ResumptionDayVO;
 import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.domain.SysOrg;
@@ -25,7 +26,6 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.time.LocalDate;
-import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
@@ -172,7 +172,7 @@ public class ResumptionReportController {
     @ApiOperation(value = "离行式自助银行巡检报表导出")
     @RequiresPermissions("core:resumptionReport:export")
     @PostMapping("/serviceBankExport")
-    public void serviceBankExport(ResumptionDTO request, HttpServletResponse response) throws IOException {
+    public void serviceBankExport(ResumptionDTO request, HttpServletResponse response) throws Exception {
         if (null == request.getSearchTime()) {
             LocalDate currentDate = LocalDate.now();
             request.setSearchTime(currentDate.getYear() + "-" + currentDate.getMonthValue());
@@ -183,7 +183,7 @@ public class ResumptionReportController {
     @ApiOperation(value = "离行式自助银行巡检报表")
     @RequiresPermissions("core:resumptionReport:list")
     @GetMapping("/serviceBank")
-    public AjaxResult serviceBank(ResumptionDTO resumptionDTO) {
+    public AjaxResult serviceBank(ResumptionDTO resumptionDTO) throws Exception {
         if (null == resumptionDTO.getSearchTime()) {
             LocalDate currentDate = LocalDate.now();
             String m = String.valueOf(currentDate.getMonthValue());
@@ -193,7 +193,7 @@ public class ResumptionReportController {
             resumptionDTO.setSearchTime(currentDate.getYear() + "-" + m);
         }
         AjaxResult ajaxResult = AjaxResult.success();
-        List<IntrusionTestReportVO> intrusionTestReportVOList = resumptionReportService.serviceBank(resumptionDTO);
+        List<LhSelfBankInspectionReport> intrusionTestReportVOList = resumptionReportService.serviceBank(resumptionDTO);
         ajaxResult.put(AjaxResult.DATA_TAG, intrusionTestReportVOList);
         ajaxResult.put(TITLE, "离行式自助银行巡检情况表(" + resumptionDTO.getSearchTime() + ")");
         SysOrg sysOrg = remoteOrgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);

+ 2 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/mapper/ResumptionReportMapper.java

@@ -1,13 +1,12 @@
 package com.xunmei.core.reportForms.resumption.mapper;
 
-import com.xunmei.core.reportForms.resumption.dto.ResumptionDTO;
 import com.xunmei.core.reportForms.resumption.vo.IntrusionTestReportVO;
+import com.xunmei.core.reportForms.resumption.vo.LhSelfBankInspectionReport;
 import com.xunmei.core.reportForms.resumption.vo.ResumptionDayVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Date;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -31,7 +30,7 @@ public interface ResumptionReportMapper {
 
     Map selectIntrusionTestAbnormalNumber(@Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
 
-    IntrusionTestReportVO selectServiceBankReport(@Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
+    LhSelfBankInspectionReport selectServiceBankReport(@Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
 
     IntrusionTestReportVO selectStandbyPower(@Param("orgId") Long orgId, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("orgPath") String orgPath);
 

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

@@ -1,8 +1,8 @@
 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.LhSelfBankInspectionReport;
 import com.xunmei.core.reportForms.resumption.vo.ResumptionDayVO;
 
 import javax.servlet.http.HttpServletResponse;
@@ -28,7 +28,7 @@ public interface ResumptionReportService {
 
     List<IntrusionTestReportVO> standbyPower(ResumptionDTO resumptionDTO);
 
-    void serviceBankExport(ResumptionDTO resumptionDTO, HttpServletResponse response)throws IOException;
+    void serviceBankExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws Exception;
 
-    List<IntrusionTestReportVO> serviceBank(ResumptionDTO resumptionDTO);
+    List<LhSelfBankInspectionReport> serviceBank(ResumptionDTO resumptionDTO) throws Exception;
 }

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

@@ -3,20 +3,17 @@ 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.domain.edu.domain.CoreEduTrainingPlan;
-import com.xunmei.common.core.domain.panel.vo.PanelListVo;
-import com.xunmei.common.core.enums.edu.EduTrainingPlanStatus;
+import com.xunmei.common.core.enums.OrgTypeEnum;
 import com.xunmei.common.core.thread.ThreadPoolConfig;
+import com.xunmei.common.core.util.BeanHelper;
 import com.xunmei.common.core.utils.DateHelper;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.edu.service.impl.ValueCellWriteHandler;
 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;
-import com.xunmei.core.reportForms.resumption.vo.IntrusionTestReportVO;
-import com.xunmei.core.reportForms.resumption.vo.ResumptionDayVO;
+import com.xunmei.core.reportForms.resumption.vo.*;
 import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.domain.SysOrg;
 import org.springframework.beans.BeanUtils;
@@ -34,10 +31,6 @@ import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.bouncycastle.asn1.x500.style.RFC4519Style.o;
 
 /**
  * @author :LuoWei
@@ -64,7 +57,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         //判断机构类型,如果机构类型大于行社,都展示行社数据
         SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
         List<SysOrg> sysOrgs;
-        if (null==sysOrg.getType()){
+        if (null == sysOrg.getType()) {
             return Collections.emptyList();
         }
         if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
@@ -149,10 +142,10 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
 //            resumptionDayVOS.add(resumptionDayVO);
 //        });
 
-        List<CompletableFuture<ResumptionDayVO>> completableFutureList=new ArrayList<>();
+        List<CompletableFuture<ResumptionDayVO>> completableFutureList = new ArrayList<>();
         sysOrgs.forEach(o -> {
             CompletableFuture<ResumptionDayVO> getOneOrgResumptionDayVO = CompletableFuture.supplyAsync(() ->
-                    getOneOrgResumptionDayVO(o,resumptionDTO),threadPoolTaskExecutor
+                    getOneOrgResumptionDayVO(o, resumptionDTO), threadPoolTaskExecutor
             );
             completableFutureList.add(getOneOrgResumptionDayVO);
         });
@@ -161,23 +154,22 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
 
         allQueries.get(10L, TimeUnit.SECONDS);
 
-        completableFutureList.forEach(x->{
+        completableFutureList.forEach(x -> {
             resumptionDayVOS.add(x.join());
         });
         return resumptionDayVOS;
     }
 
-    private ResumptionDayVO getOneOrgResumptionDayVO(SysOrg org,ResumptionDTO resumptionDTO)
-    {
+    private ResumptionDayVO getOneOrgResumptionDayVO(SysOrg org, ResumptionDTO resumptionDTO) {
         ResumptionDayVO resumptionDayVO = new ResumptionDayVO();
         resumptionDayVO.setCity(org.getAffiliatedArea());
         resumptionDayVO.setOrgName(org.getShortName());
-        Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(org.getPath());
-        ResumptionDayVO resumptionDayVO1 =null;
-        ResumptionDayVO resumptionDayVO2 =null;
-        ResumptionDayVO resumptionDayVO3 =null;
+        Integer integer = monitorAccessReportMapper.selectOrgNumByPathAndType(org.getPath(), OrgTypeEnum.YINGYE_WANGDIAN.getCode());
+        ResumptionDayVO resumptionDayVO1 = null;
+        ResumptionDayVO resumptionDayVO2 = null;
+        ResumptionDayVO resumptionDayVO3 = null;
 
-        if(org.getType()!=4) {
+        if (org.getType() != 4) {
             //营业前
             resumptionDayVO1 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 1, null, resumptionDTO.getSearchTime(), org.getPath());
             //营业中
@@ -251,8 +243,8 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             ResumptionDayVO resumptionDayVO = report.get(i);
             resumptionDayVO.setOrderNum(i + 1);
         }
-        String baseHeaderName="营业网点安全保卫履职情况表";
-        String header=baseHeaderName+"(" + resumptionDTO.getSearchTime() + ")";
+        String baseHeaderName = "营业网点安全保卫履职情况表";
+        String header = baseHeaderName + "(" + resumptionDTO.getSearchTime() + ")";
 
         response.setContentType("application/vnd.ms-excel");
         response.setCharacterEncoding("utf-8");
@@ -282,11 +274,11 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             IntrusionTestReportVO intrusionTestReportVO = report.get(i);
             intrusionTestReportVO.setOrderNum(i + 1);
         }
-        String baseHeaderName="报警测试情况表";
-        String header=baseHeaderName+"(" + resumptionDTO.getSearchTime() + ")";
+        String baseHeaderName = "报警测试情况表";
+        String header = baseHeaderName + "(" + resumptionDTO.getSearchTime() + ")";
         response.setContentType("application/vnd.ms-excel");
         response.setCharacterEncoding("utf-8");
-        String fileName = URLEncoder.encode("【" + orgName + "】-"+baseHeaderName + DateHelper.getDateString(new Date()), "UTF-8");
+        String fileName = URLEncoder.encode("【" + orgName + "】-" + baseHeaderName + DateHelper.getDateString(new Date()), "UTF-8");
         response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
         // 调用EasyExcel的导出方法
         EasyExcel.write(response.getOutputStream(), IntrusionTestReportVO.class)
@@ -302,7 +294,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         //判断机构类型,如果机构类型大于行社,都展示行社数据
         SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
         List<SysOrg> sysOrgs;
-        if (null==sysOrg.getType()){
+        if (null == sysOrg.getType()) {
             return Collections.emptyList();
         }
         if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
@@ -325,7 +317,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
                 }
             }
             IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectIntrusionTestReport(null, resumptionDTO.getSearchTime(), o.getPath());
-            Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
+            Integer integer = monitorAccessReportMapper.selectOrgNumByPathAndType(o.getPath(), OrgTypeEnum.YINGYE_WANGDIAN.getCode());
             //隐患
             Map map = resumptionReportMapper.selectIntrusionTestAbnormalNumber(null, resumptionDTO.getSearchTime(), o.getPath());
             if (o.getType() == 4) {
@@ -366,11 +358,11 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             IntrusionTestReportVO intrusionTestReportVO = report.get(i);
             intrusionTestReportVO.setOrderNum(i + 1);
         }
-        String baseHeaderName="备用电源维护情况表";
-        String header=baseHeaderName+"(" + resumptionDTO.getExportDateTitle() + ")";
+        String baseHeaderName = "备用电源维护情况表";
+        String header = baseHeaderName + "(" + resumptionDTO.getExportDateTitle() + ")";
         response.setContentType("application/vnd.ms-excel");
         response.setCharacterEncoding("utf-8");
-        String fileName = URLEncoder.encode("【" + orgName + "】-"+baseHeaderName + DateHelper.getDateString(new Date()), "UTF-8");
+        String fileName = URLEncoder.encode("【" + orgName + "】-" + baseHeaderName + DateHelper.getDateString(new Date()), "UTF-8");
         response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
         // 调用EasyExcel的导出方法
         EasyExcel.write(response.getOutputStream(), IntrusionTestReportVO.class)
@@ -380,44 +372,51 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
 
 
     @Override
-    public List<IntrusionTestReportVO> serviceBank(ResumptionDTO resumptionDTO) {
+    public List<LhSelfBankInspectionReport> serviceBank(ResumptionDTO resumptionDTO) throws Exception {
         if (null == resumptionDTO.getOrgId()) {
             resumptionDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
         }
         //判断机构类型,如果机构类型大于行社,都展示行社数据
         SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
-        List<SysOrg> sysOrgs;
-        if (null==sysOrg.getType()){
-            return Collections.emptyList();
-        }
-        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 {
+        List<SysOrg> sysOrgs = orgService.selectSysOrgByPathAndType(sysOrg.getPath(), 3, SecurityConstants.INNER);
+        if (null == sysOrg.getType()) {
             return Collections.emptyList();
         }
-        List<IntrusionTestReportVO> intrusionTestReportVOList = new ArrayList<>(16);
-        sysOrgs.forEach(o -> {
-            IntrusionTestReportVO intrusionTestReportVO = new IntrusionTestReportVO();
-            SysOrg sysOrg1;
-            if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
-                sysOrg1 = orgService.selectOrgById(o.getParentId(), SecurityConstants.INNER);
-            } else {
-                sysOrg1 = orgService.selectOrgById(orgService.selectOrgById(o.getParentId(), SecurityConstants.INNER).getParentId(), SecurityConstants.INNER);
+        //如果查看省联社/地区 数据,那么就展示离行机构数量
+        //如果查看行社数据,那么列表上展示离行机构名称
+        boolean showOrgName = sysOrg.getType() == 3;
+        List<LhSelfBankInspectionReport> intrusionTestReportVOList = new ArrayList<>();
+        if (!showOrgName) {
+            for (SysOrg hsOrg : sysOrgs) {
+                CompletableFuture<LhSelfBankInspectionReport> future = CompletableFuture.supplyAsync(() -> {
+                    LhSelfBankInspectionReport intrusionTestReportVO = resumptionReportMapper.selectServiceBankReport(null, resumptionDTO.getSearchTime(), hsOrg.getPath());
+                    Integer orgNums = monitorAccessReportMapper.selectOrgNumByPathAndType(hsOrg.getPath(), OrgTypeEnum.LIHANG_ZIZHU_YINGHANG.getCode());
+                    intrusionTestReportVO.setCity(hsOrg.getAffiliatedArea());
+                    intrusionTestReportVO.setOrgName(hsOrg.getShortName());
+                    intrusionTestReportVO.setNetworkNumber(orgNums);
+                    return intrusionTestReportVO;
+                }, threadPoolTaskExecutor);
+                intrusionTestReportVOList.add(future.get(5, TimeUnit.SECONDS));
             }
-            IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectServiceBankReport(null, resumptionDTO.getSearchTime(), o.getPath());
-            Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
-            if (o.getType() == 4) {
-                integer = 1;
-                intrusionTestReportVO1 = resumptionReportMapper.selectServiceBankReport(o.getId(), resumptionDTO.getSearchTime(), null);
+        } else {
+            for (SysOrg hsOrg : sysOrgs) {
+                List<SysOrg> lhOrgList = orgService.selectSysOrgByPathAndType(sysOrg.getPath(), OrgTypeEnum.LIHANG_ZIZHU_YINGHANG.getCode(), SecurityConstants.INNER);
+                for (SysOrg lhOrg : lhOrgList) {
+                    CompletableFuture<LhSelfBankInspectionReport> future = CompletableFuture.supplyAsync(() -> {
+                        LhSelfBankInspectionReport intrusionTestReportVO = resumptionReportMapper.selectServiceBankReport(null, resumptionDTO.getSearchTime(), lhOrg.getPath());
+                        intrusionTestReportVO.setCity(lhOrg.getAffiliatedArea());
+                        intrusionTestReportVO.setOrgName(hsOrg.getShortName());
+                        intrusionTestReportVO.setLhOrgName(lhOrg.getShortName());
+                        return intrusionTestReportVO;
+                    }, threadPoolTaskExecutor);
+                    intrusionTestReportVOList.add(future.get(5, TimeUnit.SECONDS));
+                }
             }
-            BeanUtils.copyProperties(intrusionTestReportVO1, intrusionTestReportVO);
-            intrusionTestReportVO.setCity(sysOrg1.getShortName().indexOf("地区行社") == -1 ? sysOrg1.getShortName().substring(0, 2) : sysOrg1.getShortName().split("地区行社")[0]);
-            intrusionTestReportVO.setOrgName(o.getShortName());
-            intrusionTestReportVO.setNetworkNumber(integer);
-            intrusionTestReportVOList.add(intrusionTestReportVO);
-        });
+        }
+        //如果不展示离行机构名称,说明要展示离行机构数量,不展示离行机构数量为0的数据
+        if (!showOrgName) {
+            intrusionTestReportVOList.removeIf(r -> ObjectUtil.equal(0, r.getNetworkNumber()));
+        }
         return intrusionTestReportVOList;
     }
 
@@ -467,7 +466,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectStandbyPower(null, resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
             //隐患
             Map map = resumptionReportMapper.selectStandbyPowerAbnormalNumber(null, resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
-            Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
+            Integer integer = monitorAccessReportMapper.selectOrgNumByPathAndType(o.getPath(), OrgTypeEnum.YINGYE_WANGDIAN.getCode());
             if (o.getType() == 4) {
                 integer = 1;
                 map = resumptionReportMapper.selectStandbyPowerAbnormalNumber(o.getId(), resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), null);
@@ -491,13 +490,18 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
     }
 
     @Override
-    public void serviceBankExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException {
+    public void serviceBankExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws Exception {
         String orgName = null;
+        boolean showOrgName = false;
         if (null != resumptionDTO.getOrgId()) {
             SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
             orgName = sysOrg.getName();
+            if (sysOrg.getType() == 3) {
+                showOrgName = true;
+            }
         }
-        List<IntrusionTestReportVO> report = this.serviceBank(resumptionDTO);
+
+        List<LhSelfBankInspectionReport> report = this.serviceBank(resumptionDTO);
         if (ObjectUtil.isEmpty(report)) {
             throw new RuntimeException("导出数据为空!");
         }
@@ -505,19 +509,40 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             throw new RuntimeException("导出数据量过大(单次导出限量10000条数据),请填写条件分批导出");
         }
         for (int i = 0; i < report.size(); i++) {
-            IntrusionTestReportVO intrusionTestReportVO = report.get(i);
+            LhSelfBankInspectionReport intrusionTestReportVO = report.get(i);
             intrusionTestReportVO.setOrderNum(i + 1);
         }
-        String baseHeaderName="离行式自助银行巡检情况表";
-        String header=baseHeaderName+"(" + resumptionDTO.getSearchTime() + ")";
+
+        String baseHeaderName = "离行式自助银行巡检情况表";
+        String header = baseHeaderName + "(" + resumptionDTO.getSearchTime() + ")";
         response.setContentType("application/vnd.ms-excel");
         response.setCharacterEncoding("utf-8");
         String fileName = URLEncoder.encode("【" + orgName + "】-" + baseHeaderName + DateHelper.getDateString(new Date()), "UTF-8");
         response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
-        // 调用EasyExcel的导出方法
-        EasyExcel.write(response.getOutputStream(), IntrusionTestReportVO.class)
-                .registerWriteHandler(new ValueCellWriteHandler(header))
-                .sheet(baseHeaderName).doWrite(report);
+        Class clazz;
+        if (showOrgName){
+            List<LhSelfBankInspectionReportNameVo> list = BeanHelper.copyProperties(report, LhSelfBankInspectionReportNameVo.class);
+            clazz = LhSelfBankInspectionReportNameVo.class;
+            // 调用EasyExcel的导出方法
+            EasyExcel.write(response.getOutputStream(), clazz)
+                    .registerWriteHandler(new ValueCellWriteHandler(header))
+                    .sheet(baseHeaderName).doWrite(list);
+        }else {
+            List<LhSelfBankInspectionReportNumVo> list = BeanHelper.copyProperties(report, LhSelfBankInspectionReportNumVo.class);
+            clazz = LhSelfBankInspectionReportNumVo.class;
+            // 调用EasyExcel的导出方法
+            EasyExcel.write(response.getOutputStream(), clazz)
+                    .registerWriteHandler(new ValueCellWriteHandler(header))
+                    .sheet(baseHeaderName).doWrite(list);
+        }
+
+
+
+
+
+
+
+
     }
 
 

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

@@ -0,0 +1,41 @@
+package com.xunmei.core.reportForms.resumption.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+@Data
+public class LhSelfBankInspectionReport {
+    @ApiModelProperty(value = "序号")
+    private Integer orderNum;
+
+    @ApiModelProperty(value = "地区机构名称")
+    private String city;
+
+    @ApiModelProperty(value = "行社机构名称")
+    private String orgName;
+
+    @ApiModelProperty(value = "离行机构名称")
+    private String lhOrgName;
+
+    @ApiModelProperty(value = "离行机构数量")
+    private Integer networkNumber;
+
+    @ApiModelProperty(value = "应履职次数")
+    private Integer planNumber;
+
+    @ApiModelProperty(value = "已履职次数")
+    private Integer realityNumber;
+
+    @ApiModelProperty(value = "履职完成率")
+    private String realityRate;
+
+    @ApiModelProperty(value = "隐患数量")
+    private Integer abnormalNumber;
+
+    @ApiModelProperty(value = "已整改数量")
+    private Integer realityRectificationNumber;
+
+    @ApiModelProperty(value = "整改完成率")
+    private String realityRectificationRate;
+}

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

@@ -0,0 +1,52 @@
+package com.xunmei.core.reportForms.resumption.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+@Data
+@ColumnWidth(25) //列宽,最大值为255
+@HeadRowHeight(16) //表头行高
+@ContentRowHeight(16) //数据行高
+public class LhSelfBankInspectionReportNameVo {
+    @ExcelProperty(value = "序号")
+    private Integer orderNum;
+
+    @ExcelProperty(value = "地区")
+    private String city;
+
+    @ExcelProperty(value = "单位名称")
+    private String orgName;
+
+    @ExcelProperty(value = "离行式机构名称")
+    @ApiModelProperty(value = "离行式机构名称")
+    private String lhOrgName;
+
+    @ExcelProperty(value = "应履职次数")
+    @ApiModelProperty(value = "应履职次数")
+    private Integer planNumber;
+
+    @ExcelProperty(value = "已履职次数")
+    @ApiModelProperty(value = "已履职次数")
+    private Integer realityNumber;
+
+    @ExcelProperty(value = "履职完成率")
+    @ApiModelProperty(value = "履职完成率")
+    private String realityRate;
+
+    @ExcelProperty(value = "隐患数量")
+    @ApiModelProperty(value = "隐患数量")
+    private Integer abnormalNumber;
+
+    @ExcelProperty(value = "已整改数量")
+    @ApiModelProperty(value = "已整改数量")
+    private Integer realityRectificationNumber;
+
+    @ExcelProperty(value = "整改完成率")
+    @ApiModelProperty(value = "整改完成率")
+    private String realityRectificationRate;
+}

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

@@ -0,0 +1,46 @@
+package com.xunmei.core.reportForms.resumption.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+@Data
+public class LhSelfBankInspectionReportNumVo {
+    @ExcelProperty(value = "序号")
+    private Integer orderNum;
+
+    @ExcelProperty(value = "地区")
+    private String city;
+
+    @ExcelProperty(value = "单位名称")
+    private String orgName;
+
+    @ExcelProperty(value = "离行式机构数量")
+    @ApiModelProperty(value = "离行式机构数量")
+    private Integer networkNumber;
+
+    @ExcelProperty(value = "应履职次数")
+    @ApiModelProperty(value = "应履职次数")
+    private Integer planNumber;
+
+    @ExcelProperty(value = "已履职次数")
+    @ApiModelProperty(value = "已履职次数")
+    private Integer realityNumber;
+
+    @ExcelProperty(value = "履职完成率")
+    @ApiModelProperty(value = "履职完成率")
+    private String realityRate;
+
+    @ExcelProperty(value = "隐患数量")
+    @ApiModelProperty(value = "隐患数量")
+    private Integer abnormalNumber;
+
+    @ExcelProperty(value = "已整改数量")
+    @ApiModelProperty(value = "已整改数量")
+    private Integer realityRectificationNumber;
+
+    @ExcelProperty(value = "整改完成率")
+    @ApiModelProperty(value = "整改完成率")
+    private String realityRectificationRate;
+}

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

@@ -2,11 +2,9 @@ package com.xunmei.core.reportForms.safetyInspect.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.excel.EasyExcel;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xunmei.common.core.constant.SecurityConstants;
-import com.xunmei.common.core.exception.ServiceException;
+import com.xunmei.common.core.enums.OrgTypeEnum;
 import com.xunmei.common.core.utils.DateHelper;
-import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.edu.service.impl.ValueCellWriteHandler;
 import com.xunmei.core.reportForms.monitor.mapper.MonitorAccessReportMapper;
@@ -133,7 +131,7 @@ public class SafetyInspectServiceImpl implements SafetyInspectService {
                     sysOrg1 = orgService.selectOrgById(orgService.selectOrgById(orgService.selectOrgById(s.getParentId(), SecurityConstants.INNER).getParentId(), SecurityConstants.INNER).getParentId(), SecurityConstants.INNER);
                 }
             }
-            Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(s.getPath());
+            Integer integer = monitorAccessReportMapper.selectOrgNumByPathAndType(s.getPath(), OrgTypeEnum.YINGYE_WANGDIAN.getCode());
             //次数
             SafetyInspectVO safetyInspectVOS = safetyInspectMapper.selectSelfByPath(null,safetyInspectDTO.getCycle(),s.getPath(),safetyInspectDTO.getYear(),safetyInspectDTO.getOrgType());
             Map map1 = safetyInspectMapper.pitfallDimension(null,s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(),3);

+ 1 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/board/CockpitMapper.xml

@@ -170,7 +170,7 @@
         select sum(if(o.type = 3, 1, 0))                                     as hangsheCount,
                sum(if(o.type = 4, 1, 0))                                     as bankingCount,
                sum(if(o.type = 5, 1, 0))                                     as offlineCount,
-               sum(if(o.type = 4 and oe.business_library is not null, 1, 0)) as bankingStoreCount
+               sum(if(o.type = 4 and oe.business_library =1, 1, 0)) as bankingStoreCount
         from sys_org o
                  LEFT JOIN sys_org_extend oe on o.id = oe.org_id
         WHERE o.deleted = 0

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

@@ -30,8 +30,8 @@
         GROUP BY
         b.id
     </select>
-    <select id="selectNetworkNumberByPath" resultType="java.lang.Integer">
-        SELECT COUNT(1) FROM sys_org WHERE path LIKE  concat( #{orgPath}, '%') AND type=4 AND deleted=0 AND is_lock=0 AND deleted=0
+    <select id="selectOrgNumByPathAndType" resultType="java.lang.Integer">
+        SELECT COUNT(1) FROM sys_org WHERE path LIKE  concat( #{orgPath}, '%') AND type=#{orgType} AND deleted=0 AND is_lock=0
     </select>
     <select id="selectAll" resultType="com.xunmei.core.reportForms.monitor.vo.MonitoringAccessVO">
         SELECT

+ 1 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/ResumptionReportMapper.xml

@@ -165,7 +165,7 @@
         </if>
     </select>
     <select id="selectServiceBankReport"
-            resultType="com.xunmei.core.reportForms.resumption.vo.IntrusionTestReportVO">
+            resultType="com.xunmei.core.reportForms.resumption.vo.LhSelfBankInspectionReport">
         SELECT
         IFNULL( a.exception_count, 0 ) AS abnormalNumber,
         COUNT( a.id ) AS planNumber,

+ 4 - 7
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java

@@ -13,12 +13,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.common.core.constant.CacheConstants;
 import com.xunmei.common.core.constant.Constants;
 import com.xunmei.common.core.constant.ErrorMsgConstants;
-import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.domain.OrgTreeReq;
 import com.xunmei.common.core.domain.OrgTreeResp;
 import com.xunmei.common.core.enums.OrgTypeEnum;
 import com.xunmei.common.core.exception.ServiceException;
-import com.xunmei.common.core.util.BeanHelper;
 import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.common.redis.utils.RedisUtils;
@@ -37,7 +35,6 @@ import com.xunmei.system.util.OrgPhysicalDefenseConstructionExport;
 import com.xunmei.system.util.SecurityWorkExport;
 import io.netty.util.internal.StringUtil;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
@@ -459,12 +456,12 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
     public List<ConstructionDetailExport> selectConstructionDetail(SysOrg dept) {
         String path = dept.getPath();
         if (StringUtils.isEmpty(path)) {
-            dept.setPath(baseMapper.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId()).getPath());
+            SysOrg org = getById(SecurityUtils.getLoginUser().getOrgId());
+            dept.setPath(org.getPath());
         }
 
         List<ConstructionDetailExport> constructionDetailExports = baseMapper.selectConstructionDetail(dept.getPath());
-
-        //hang
+       /* //hang
         constructionDetailExports.forEach(c -> {
             SysOrg sysOrg = baseMapper.selectSysOrgById(c.getOrgId());
             c.setAddress(sysOrg.getAddress());
@@ -474,7 +471,7 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
             SysOrg sysOrg2;
             sysOrg2 = baseMapper.selectSysOrgById(sysOrg1.getParentId());
             c.setCity(sysOrg2.getShortName().indexOf("地区行社") == -1 ? sysOrg2.getShortName().substring(0, 2) : sysOrg2.getShortName().split("地区行社")[0]);
-        });
+        });*/
         return constructionDetailExports;
     }
 

+ 5 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/ConstructionDetailExport.java

@@ -20,16 +20,21 @@ import lombok.Data;
 public class ConstructionDetailExport {
     @ExcelIgnore
     private Long orgId;
+
     @ExcelProperty(value = "序号", index = 0)
     @TableField(exist = false)
     private String xh;
+
     @ExcelProperty(value = "地区", index = 1)
     private String city;
+
     @ExcelProperty(value = "行社", index = 2)
     private String orgName;
+
     @ExcelProperty(value = "网点名称", index = 3)
     @ApiModelProperty(value = "网点名称")
     private String networkName;
+
     @ExcelProperty(value = "地址", index = 4)
     @ApiModelProperty(value = "地址")
     private String address;

+ 5 - 1
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -831,7 +831,11 @@ and
                             NULL,
                             a.reason
                 ) AS reason,
-            a.date_of_complete AS completeDate
+            a.date_of_complete AS completeDate,
+            c.address as address,
+            c.affiliated_area as city,
+            c.affiliated_bank as orgName,
+            c.short_name as networkName
         FROM
             sys_org_physical_defense_construction a
                 INNER JOIN sys_org c ON c.id=a.org_id