Quellcode durchsuchen

统计报表-教育培训、报警测试情况、离行式自助银行、网点负责人自查查询条件改为月份范围选择

xujie vor 1 Jahr
Ursprung
Commit
e0ec9b284b
13 geänderte Dateien mit 149 neuen und 105 gelöschten Zeilen
  1. 4 2
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/edu/dto/CoreEduTrainingTaskReportDto.java
  2. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/controller/CoreEduTrainingTaskController.java
  3. 5 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingTaskServiceImpl.java
  4. 20 33
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/controller/ResumptionReportController.java
  5. 8 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/dto/ResumptionDTO.java
  6. 4 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/mapper/ResumptionReportMapper.java
  7. 13 8
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/impl/ResumptionReportServiceImpl.java
  8. 18 27
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/controller/SafetyInspectReportController.java
  9. 8 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/dto/SafetyInspectDTO.java
  10. 3 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/mapper/SafetyInspectMapper.java
  11. 17 9
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/service/impl/SafetyInspectServiceImpl.java
  12. 21 9
      soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/ResumptionReportMapper.xml
  13. 27 6
      soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/SafetyInspectMapper.xml

+ 4 - 2
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/edu/dto/CoreEduTrainingTaskReportDto.java

@@ -3,8 +3,10 @@ package com.xunmei.common.core.domain.edu.dto;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.util.Date;
+import java.util.List;
 
 @Data
 public class CoreEduTrainingTaskReportDto {
@@ -23,9 +25,9 @@ public class CoreEduTrainingTaskReportDto {
 
     private String orgPath;
 
-    @NotNull(message = "请选择具体月份进行查看!")
+    @NotEmpty(message = "请选择月份范围!")
     @ApiModelProperty(value = "统计月份")
-    private Date date;
+    private List<Date> date;
 
     @ApiModelProperty(value = "统计月份开始日期")
     private Date startTime;

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/controller/CoreEduTrainingTaskController.java

@@ -93,7 +93,7 @@ public class CoreEduTrainingTaskController extends BaseController {
     @ApiOperation(value = "导出教育培训统计情况表")
     @RequiresPermissions("core:eduTask:list")
     @PostMapping("exportReport")
-    public void exportReport(CoreEduTrainingTaskReportDto request,HttpServletResponse response) {
+    public void exportReport(@Validated CoreEduTrainingTaskReportDto request,HttpServletResponse response) {
          coreEduTrainingTaskService.exportReport(request,response);
     }
 

+ 5 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingTaskServiceImpl.java

@@ -661,7 +661,9 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
             response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(baseHeaderName, "utf-8"));
             response.setContentType("application/octet-stream;charset=UTF-8");
             response.setCharacterEncoding("utf-8");
-            String header=baseHeaderName+"("+DateUtil.format( request.getDate(),"yyyy-MM")+")";
+            request.setStartTime(DateUtil.beginOfMonth(request.getDate().get(0)));
+            request.setEndTime(DateUtil.endOfMonth(request.getDate().get(1)));
+            String header=baseHeaderName+"("+DateUtil.format( request.getStartTime(),"yyyy-MM")+"至"+ DateUtil.format( request.getEndTime(),"yyyy-MM") +")";
             // 数据导出
             EasyExcel.write(response.getOutputStream(), CoreEduTrainingTaskReportVo.class)
                     .registerWriteHandler(new ValueCellWriteHandler(header)).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).sheet(baseHeaderName).doWrite(list);
@@ -689,8 +691,8 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         if (ObjectUtil.isAllEmpty(planId, planIdList)) {
             return new ArrayList<>();
         }
-        request.setStartTime(DateUtil.beginOfMonth(request.getDate()));
-        request.setEndTime(DateUtil.endOfMonth(request.getDate()));
+        request.setStartTime(DateUtil.beginOfMonth(request.getDate().get(0)));
+        request.setEndTime(DateUtil.endOfMonth(request.getDate().get(1)));
 
         Long orgId = request.getOrgId();
         SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectOrgById(orgId, SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);

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

@@ -3,6 +3,7 @@ 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.utils.DateUtils;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.log.annotation.Log;
 import com.xunmei.common.log.enums.BusinessType;
@@ -17,10 +18,8 @@ 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 org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
@@ -93,30 +92,24 @@ public class ResumptionReportController {
     @ApiOperation(value = "报警测试报表导出")
     @RequiresPermissions("core:resumptionReport:export")
     @PostMapping("/intrusionTestExport")
-    public void intrusionTestExport(ResumptionDTO request, HttpServletResponse response) throws IOException,ExecutionException, InterruptedException, TimeoutException {
-        if (null == request.getSearchTime()) {
-            LocalDate currentDate = LocalDate.now();
-            request.setSearchTime(currentDate.getYear() + "-" + currentDate.getMonthValue());
-        }
+    public void intrusionTestExport(@Validated ResumptionDTO request, HttpServletResponse response) throws IOException,ExecutionException, InterruptedException, TimeoutException {
+        request.setStartTime(DateUtil.beginOfMonth(DateUtils.parseDate(request.getDate().get(0))));
+        request.setEndTime(DateUtil.endOfMonth(DateUtils.parseDate(request.getDate().get(1))));
         resumptionReportService.intrusionTestExport(request, response);
     }
 
     @ApiOperation(value = "报警测试报表")
     @RequiresPermissions("core:resumptionReport:list")
-    @GetMapping("/intrusionTest")
-    public AjaxResult intrusionTest(ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException {
-        if (null == resumptionDTO.getSearchTime()) {
-            LocalDate currentDate = LocalDate.now();
-            String m = String.valueOf(currentDate.getMonthValue());
-            if (m.length() == 1) {
-                m = "0" + currentDate.getMonthValue();
-            }
-            resumptionDTO.setSearchTime(currentDate.getYear() + "-" + m);
-        }
+    @PostMapping("/intrusionTest")
+    public AjaxResult intrusionTest(@RequestBody @Validated ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException {
+        resumptionDTO.setStartTime(DateUtil.beginOfMonth(DateUtils.parseDate(resumptionDTO.getDate().get(0))));
+        resumptionDTO.setEndTime(DateUtil.endOfMonth(DateUtils.parseDate(resumptionDTO.getDate().get(1))));
         AjaxResult ajaxResult = AjaxResult.success();
         List<IntrusionTestReportVO> intrusionTestReportVOList = resumptionReportService.intrusionTest(resumptionDTO);
         ajaxResult.put(AjaxResult.DATA_TAG, intrusionTestReportVOList);
-        ajaxResult.put(TITLE, "报警测试情况表(" + resumptionDTO.getSearchTime() + ")");
+        String startStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getStartTime());
+        String endStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getEndTime());
+        ajaxResult.put(TITLE, "报警测试情况表(" + startStr + "至"+endStr+")");
         SysOrg sysOrg = remoteOrgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
         ajaxResult.put("orgName", sysOrg.getShortName());
         return ajaxResult;
@@ -173,10 +166,8 @@ public class ResumptionReportController {
     @RequiresPermissions("core:resumptionReport:export")
     @PostMapping("/serviceBankExport")
     public void serviceBankExport(ResumptionDTO request, HttpServletResponse response) throws Exception {
-        if (null == request.getSearchTime()) {
-            LocalDate currentDate = LocalDate.now();
-            request.setSearchTime(currentDate.getYear() + "-" + currentDate.getMonthValue());
-        }
+        request.setStartTime(DateUtil.beginOfMonth(DateUtils.parseDate(request.getDate().get(0))));
+        request.setEndTime(DateUtil.endOfMonth(DateUtils.parseDate(request.getDate().get(1))));
         resumptionReportService.serviceBankExport(request, response);
     }
 
@@ -184,18 +175,14 @@ public class ResumptionReportController {
     @RequiresPermissions("core:resumptionReport:list")
     @GetMapping("/serviceBank")
     public AjaxResult serviceBank(ResumptionDTO resumptionDTO) throws Exception {
-        if (null == resumptionDTO.getSearchTime()) {
-            LocalDate currentDate = LocalDate.now();
-            String m = String.valueOf(currentDate.getMonthValue());
-            if (m.length() == 1) {
-                m = "0" + currentDate.getMonthValue();
-            }
-            resumptionDTO.setSearchTime(currentDate.getYear() + "-" + m);
-        }
+        resumptionDTO.setStartTime(DateUtil.beginOfMonth(DateUtils.parseDate(resumptionDTO.getDate().get(0))));
+        resumptionDTO.setEndTime(DateUtil.endOfMonth(DateUtils.parseDate(resumptionDTO.getDate().get(1))));
         AjaxResult ajaxResult = AjaxResult.success();
         List<LhSelfBankInspectionReport> intrusionTestReportVOList = resumptionReportService.serviceBank(resumptionDTO);
         ajaxResult.put(AjaxResult.DATA_TAG, intrusionTestReportVOList);
-        ajaxResult.put(TITLE, "离行式自助银行巡检情况表(" + resumptionDTO.getSearchTime() + ")");
+        String startStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getStartTime());
+        String endStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getEndTime());
+        ajaxResult.put(TITLE, "离行式自助银行巡检情况表(" + startStr + "至"+endStr+")");
         SysOrg sysOrg = remoteOrgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
         ajaxResult.put("orgName", sysOrg.getShortName());
         return ajaxResult;

+ 8 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/dto/ResumptionDTO.java

@@ -3,8 +3,9 @@ package com.xunmei.core.reportForms.resumption.dto;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-
+import javax.validation.constraints.NotEmpty;
 import java.util.Date;
+import java.util.List;
 
 /**
  * @author :LuoWei
@@ -13,11 +14,17 @@ import java.util.Date;
 @Data
 public class ResumptionDTO {
     private Long orgId;
+
     private String searchTime;
+
     private Integer planType;
     private Date startTime;
     private Date endTime;
     private Integer cycle;
 
     private String exportDateTitle;
+
+    @NotEmpty(message = "请选择月份范围!")
+    @ApiModelProperty(value = "统计月份")
+    private List<String> date;
 }

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

@@ -1,5 +1,6 @@
 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;
@@ -26,11 +27,11 @@ public interface ResumptionReportMapper {
      */
     Integer planRectification(@Param("taskId") Long taskId);
 
-    IntrusionTestReportVO selectIntrusionTestReport(@Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
+    IntrusionTestReportVO selectIntrusionTestReport(@Param("orgId") Long orgId, @Param("dto") ResumptionDTO resumptionDTO, @Param("orgPath") String orgPath);
 
-    Map selectIntrusionTestAbnormalNumber(@Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
+    Map selectIntrusionTestAbnormalNumber(@Param("orgId") Long orgId, @Param("dto") ResumptionDTO resumptionDTO, @Param("orgPath") String orgPath);
 
-    LhSelfBankInspectionReport selectServiceBankReport(@Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
+    LhSelfBankInspectionReport selectServiceBankReport(@Param("orgId") Long orgId, @Param("dto") ResumptionDTO resumptionDTO, @Param("orgPath") String orgPath);
 
     IntrusionTestReportVO selectStandbyPower(@Param("orgId") Long orgId, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("orgPath") String orgPath);
 

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

@@ -7,6 +7,7 @@ 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.core.utils.DateUtils;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.edu.service.impl.ValueCellWriteHandler;
 import com.xunmei.core.reportForms.monitor.mapper.MonitorAccessReportMapper;
@@ -275,7 +276,9 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             intrusionTestReportVO.setOrderNum(i + 1);
         }
         String baseHeaderName = "报警测试情况表";
-        String header = baseHeaderName + "(" + resumptionDTO.getSearchTime() + ")";
+        String startStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getStartTime());
+        String endStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getEndTime());
+        String header = baseHeaderName + "(" + startStr + "至"+endStr+")";
         response.setContentType("application/vnd.ms-excel");
         response.setCharacterEncoding("utf-8");
         String fileName = URLEncoder.encode("【" + orgName + "】-" + baseHeaderName + DateHelper.getDateString(new Date()), "UTF-8");
@@ -367,14 +370,14 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         if(o.getType()==4)
         {
             networkNumber =1;
-            tempIntrusionTestReportVO1 = resumptionReportMapper.selectIntrusionTestReport(o.getId(), resumptionDTO.getSearchTime(), null);
-            map = resumptionReportMapper.selectIntrusionTestAbnormalNumber(o.getId(), resumptionDTO.getSearchTime(), null);
+            tempIntrusionTestReportVO1 = resumptionReportMapper.selectIntrusionTestReport(o.getId(), resumptionDTO, null);
+            map = resumptionReportMapper.selectIntrusionTestAbnormalNumber(o.getId(), resumptionDTO, null);
         }
         else{
             networkNumber = monitorAccessReportMapper.selectOrgNumByPathAndType(o.getPath(), OrgTypeEnum.YINGYE_WANGDIAN.getCode());
-            tempIntrusionTestReportVO1 = resumptionReportMapper.selectIntrusionTestReport(null, resumptionDTO.getSearchTime(), o.getPath());
+            tempIntrusionTestReportVO1 = resumptionReportMapper.selectIntrusionTestReport(null, resumptionDTO, o.getPath());
             //隐患
-            map = resumptionReportMapper.selectIntrusionTestAbnormalNumber(null, resumptionDTO.getSearchTime(), o.getPath());
+            map = resumptionReportMapper.selectIntrusionTestAbnormalNumber(null, resumptionDTO, o.getPath());
 
         }
         BeanUtils.copyProperties(tempIntrusionTestReportVO1, resultVo);
@@ -442,7 +445,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
 
             for (SysOrg hsOrg : sysOrgs) {
                 CompletableFuture<LhSelfBankInspectionReport> future = CompletableFuture.supplyAsync(() -> {
-                    LhSelfBankInspectionReport intrusionTestReportVO = resumptionReportMapper.selectServiceBankReport(null, resumptionDTO.getSearchTime(), hsOrg.getPath());
+                    LhSelfBankInspectionReport intrusionTestReportVO = resumptionReportMapper.selectServiceBankReport(null, resumptionDTO, hsOrg.getPath());
                     Integer orgNums = monitorAccessReportMapper.selectOrgNumByPathAndType(hsOrg.getPath(), OrgTypeEnum.LIHANG_ZIZHU_YINGHANG.getCode());
                     intrusionTestReportVO.setCity(hsOrg.getAffiliatedArea());
                     intrusionTestReportVO.setOrgName(hsOrg.getShortName());
@@ -462,7 +465,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
                 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());
+                        LhSelfBankInspectionReport intrusionTestReportVO = resumptionReportMapper.selectServiceBankReport(null, resumptionDTO, lhOrg.getPath());
                         intrusionTestReportVO.setCity(lhOrg.getAffiliatedArea());
                         intrusionTestReportVO.setOrgName(hsOrg.getShortName());
                         intrusionTestReportVO.setLhOrgName(lhOrg.getShortName());
@@ -629,7 +632,9 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         }
 
         String baseHeaderName = "离行式自助银行巡检情况表";
-        String header = baseHeaderName + "(" + resumptionDTO.getSearchTime() + ")";
+        String startStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getStartTime());
+        String endStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getEndTime());
+        String header = baseHeaderName + "(" + startStr + "至"+endStr+")";
         response.setContentType("application/vnd.ms-excel");
         response.setCharacterEncoding("utf-8");
         String fileName = URLEncoder.encode("【" + orgName + "】-" + baseHeaderName + DateHelper.getDateString(new Date()), "UTF-8");

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

@@ -1,6 +1,8 @@
 package com.xunmei.core.reportForms.safetyInspect.controller;
 
+import cn.hutool.core.date.DateUtil;
 import com.xunmei.common.core.constant.SecurityConstants;
+import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.log.annotation.Log;
 import com.xunmei.common.log.enums.BusinessType;
@@ -61,19 +63,17 @@ public class SafetyInspectReportController {
     @GetMapping("/selfInspectList")
     public AjaxResult selfInspectList(SafetyInspectDTO safetyInspectDTO) {
         AjaxResult ajax = AjaxResult.success();
-        if (null == safetyInspectDTO.getYear()) {
-            if (safetyInspectDTO == null || safetyInspectDTO.getCycle() == 1) {
-                safetyInspectDTO.setCycle(1);
-                LocalDate localDate = LocalDate.now();
-                String m = String.valueOf(localDate.getMonthValue());
-                if (m.length() == 1) {
-                    m = "0" + localDate.getMonthValue();
-                }
-                safetyInspectDTO.setYear(localDate.getYear() + "-" + m);
-            } else {
-                LocalDate localDate = LocalDate.now();
-                safetyInspectDTO.setYear(localDate.getYear() + "");
-            }
+        String title;
+        if (safetyInspectDTO.getCycle() == 1){
+            safetyInspectDTO.setStartTime(DateUtil.beginOfMonth(DateUtils.parseDate(safetyInspectDTO.getDate().get(0))));
+            safetyInspectDTO.setEndTime(DateUtil.endOfMonth(DateUtils.parseDate(safetyInspectDTO.getDate().get(1))));
+            String startStr = DateUtils.parseDateToStr("yyyy-MM",safetyInspectDTO.getStartTime());
+            String endStr = DateUtils.parseDateToStr("yyyy-MM",safetyInspectDTO.getEndTime());
+            title = "网点负责人自查情况表(" + startStr + "至"+endStr+")";
+            safetyInspectDTO.setYear(null);
+        }else {
+            title = "网点负责人自查情况表(" + safetyInspectDTO.getYear() + ")";
+
         }
         List<SelfInspectVO> report = safetyInspectService.selfInspectReport(safetyInspectDTO);
         ajax.put(AjaxResult.DATA_TAG, report);
@@ -82,7 +82,7 @@ public class SafetyInspectReportController {
         }
         SysOrg sysOrg = remoteOrgService.selectSysOrgById(safetyInspectDTO.getOrgId(), SecurityConstants.INNER);
         ajax.put("orgName", sysOrg.getShortName());
-        ajax.put("title", "网点负责人自查情况表(" + safetyInspectDTO.getYear() + ")");
+        ajax.put("title", title);
         return ajax;
     }
 
@@ -116,19 +116,10 @@ public class SafetyInspectReportController {
 //            LocalDate localDate = LocalDate.now();
 //            request.setYear(localDate.getYear() + "-" + localDate.getMonthValue());
 //        }
-        if (null == request.getYear()) {
-            if (request == null || request.getCycle() == 1) {
-                request.setCycle(1);
-                LocalDate localDate = LocalDate.now();
-                String m = String.valueOf(localDate.getMonthValue());
-                if (m.length() == 1) {
-                    m = "0" + localDate.getMonthValue();
-                }
-                request.setYear(localDate.getYear() + "-" + m);
-            } else {
-                LocalDate localDate = LocalDate.now();
-                request.setYear(localDate.getYear() + "");
-            }
+        if (request.getCycle() == 1){
+            request.setStartTime(DateUtil.beginOfMonth(DateUtils.parseDate(request.getDate().get(0))));
+            request.setEndTime(DateUtil.endOfMonth(DateUtils.parseDate(request.getDate().get(1))));
+            request.setYear(null);
         }
         safetyInspectService.selfInspectExport(request, response);
     }

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

@@ -6,6 +6,7 @@ import lombok.Data;
 
 import java.time.Year;
 import java.util.Date;
+import java.util.List;
 
 /**
  * @author :LuoWei
@@ -18,4 +19,11 @@ public class SafetyInspectDTO extends BaseEntity {
     private String year;
     private String orgPath;
     private Integer orgType;
+
+    //查询月份范围
+    private List<String> date;
+
+    private Date startTime;
+
+    private Date endTime;
 }

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

@@ -20,7 +20,7 @@ import java.util.Map;
 public interface SafetyInspectMapper {
     SafetyInspectVO selectAllByPath(@Param("orgId")Long orgId,@Param("orgPath") String orgPath, @Param("year") String year, @Param("orgType") Integer orgType);
 
-    SafetyInspectVO selectSelfByPath(@Param("orgId")Long orgId,@Param("cycle") Integer cycle, @Param("orgPath") String orgPath, @Param("year") String year, @Param("orgType") Integer orgType);
+    SafetyInspectVO selectSelfByPath(@Param("orgId")Long orgId,@Param("cycle") Integer cycle, @Param("orgPath") String orgPath, @Param("dto") SafetyInspectDTO safetyInspectDTO, @Param("orgType") Integer orgType);
 
     Page<SafetyInspectVO> report(@Param("page") Page<SafetyInspectVO> page, @Param("safetyInspectDTO") SafetyInspectDTO safetyInspectDTO);
 
@@ -31,7 +31,7 @@ public interface SafetyInspectMapper {
      *
      * @return
      */
-    Map orgDimension(@Param("orgId")Long orgId,@Param("orgPath") String orgPath, @Param("year") String year, @Param("orgType") Integer orgType, @Param("type") Integer type);
+    Map orgDimension(@Param("orgId")Long orgId,@Param("orgPath") String orgPath, @Param("dto") SafetyInspectDTO safetyInspectDTO, @Param("orgType") Integer orgType, @Param("type") Integer type);
 
     Integer orgDimensionPlanInspectOrg(@Param("orgId")Long orgId,@Param("orgPath") String orgPath, @Param("year") String year, @Param("orgType") Integer orgType, @Param("type") Integer type);
 
@@ -45,5 +45,5 @@ public interface SafetyInspectMapper {
      * @param orgType
      * @return
      */
-    Map pitfallDimension(@Param("orgId")Long orgId,@Param("orgPath") String orgPath, @Param("year") String year, @Param("orgType") Integer orgType, @Param("type") Integer type);
+    Map pitfallDimension(@Param("orgId")Long orgId,@Param("orgPath") String orgPath, @Param("dto") SafetyInspectDTO safetyInspectDTO, @Param("orgType") Integer orgType, @Param("type") Integer type);
 }

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

@@ -5,6 +5,7 @@ import com.alibaba.excel.EasyExcel;
 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.utils.DateUtils;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.edu.service.impl.ValueCellWriteHandler;
 import com.xunmei.core.reportForms.monitor.mapper.MonitorAccessReportMapper;
@@ -75,12 +76,12 @@ public class SafetyInspectServiceImpl implements SafetyInspectService {
             //机构维度
             Integer planInspectOrg = safetyInspectMapper.orgDimensionPlanInspectOrg(null,s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(), 4);
             Integer realityInspectOrg = safetyInspectMapper.orgDimensionRealityInspectOrg(null,s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(), 4);
-            Map map1 = safetyInspectMapper.pitfallDimension(null,s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(),4);
+            Map map1 = safetyInspectMapper.pitfallDimension(null,s.getPath(), safetyInspectDTO, safetyInspectDTO.getOrgType(),4);
             if (s.getType() == 4) {
                 safetyInspectVOS=safetyInspectMapper.selectAllByPath(s.getId(),null,safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType());
                 planInspectOrg=safetyInspectMapper.orgDimensionPlanInspectOrg(s.getId(),s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(), 4);
                  realityInspectOrg = safetyInspectMapper.orgDimensionRealityInspectOrg(s.getId(),s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(), 4);
-                map1 = safetyInspectMapper.pitfallDimension(s.getId(),null, safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(),4);
+                map1 = safetyInspectMapper.pitfallDimension(s.getId(),null, safetyInspectDTO, safetyInspectDTO.getOrgType(),4);
             }
             Double i = 0d;
             if (planInspectOrg != 0 && realityInspectOrg != 0) {
@@ -133,15 +134,15 @@ public class SafetyInspectServiceImpl implements SafetyInspectService {
             }
             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);
+            SafetyInspectVO safetyInspectVOS = safetyInspectMapper.selectSelfByPath(null,safetyInspectDTO.getCycle(),s.getPath(),safetyInspectDTO,safetyInspectDTO.getOrgType());
+            Map map1 = safetyInspectMapper.pitfallDimension(null,s.getPath(), safetyInspectDTO, safetyInspectDTO.getOrgType(),3);
             //机构维度
-            Map map = safetyInspectMapper.orgDimension(null,s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(),3);
+            Map map = safetyInspectMapper.orgDimension(null,s.getPath(), safetyInspectDTO, safetyInspectDTO.getOrgType(),3);
             if (s.getType()==4){
                 integer=1;
-                safetyInspectVOS=safetyInspectMapper.selectSelfByPath(s.getId(),safetyInspectDTO.getCycle(),null,safetyInspectDTO.getYear(),safetyInspectDTO.getOrgType());
-                map1= safetyInspectMapper.pitfallDimension(s.getId(),null, safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(),3);
-                map=safetyInspectMapper.orgDimension(s.getId(),null, safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(),3);
+                safetyInspectVOS=safetyInspectMapper.selectSelfByPath(s.getId(),safetyInspectDTO.getCycle(),null,safetyInspectDTO,safetyInspectDTO.getOrgType());
+                map1= safetyInspectMapper.pitfallDimension(s.getId(),null, safetyInspectDTO, safetyInspectDTO.getOrgType(),3);
+                map=safetyInspectMapper.orgDimension(s.getId(),null, safetyInspectDTO, safetyInspectDTO.getOrgType(),3);
             }
             safetyInspectVO.setPlanInspectOrg(integer);
             safetyInspectVO.setCity(sysOrg1.getShortName().indexOf("地区行社")==-1?sysOrg1.getShortName().substring(0,2):sysOrg1.getShortName().split("地区行社")[0]);
@@ -219,7 +220,14 @@ public class SafetyInspectServiceImpl implements SafetyInspectService {
             throw new RuntimeException("导出数据量过大(单次导出限量10000条数据),请填写条件分批导出");
         }
         String baseHeaderName="网点负责人自查情况表";
-        String header=baseHeaderName+"(" + safetyInspectDTO.getYear() + ")";
+        String header;
+        if (safetyInspectDTO.getCycle() == 1){
+            String startStr = DateUtils.parseDateToStr("yyyy-MM",safetyInspectDTO.getStartTime());
+            String endStr = DateUtils.parseDateToStr("yyyy-MM",safetyInspectDTO.getEndTime());
+            header=baseHeaderName+"(" + startStr + "至"+endStr+")";
+        }else {
+            header=baseHeaderName+"(" + safetyInspectDTO.getYear() + ")";
+        }
 
         response.setContentType("application/vnd.ms-excel");
         response.setCharacterEncoding("utf-8");

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

@@ -99,8 +99,12 @@
           <if test="orgId !=null">
               and a.org_id=#{orgId}
           </if>
-        <if test="date !=null">
-            AND a.ymd_date like concat(#{date},'%')
+        <if test="dto !=null and dto.startTime != null and dto.endTime != null">
+            AND
+            (
+            #{dto.startTime}   <![CDATA[<=]]> a.ymd_date
+            and #{dto.endTime}     <![CDATA[>=]]> a.ymd_date
+            )
         </if>
         <if test="orgPath !=null">
             and a.org_path  like concat(#{orgPath},'%')
@@ -202,12 +206,16 @@
         ) a
         WHERE
         a.plan_type =6
-        <if test="date !=null">
-            AND a.ymd_date like concat(#{date},'%')
+        <if test="dto !=null and dto.startTime != null and dto.endTime != null">
+            AND
+            (
+            #{dto.startTime}   <![CDATA[<=]]> a.ymd_date
+            and #{dto.endTime}     <![CDATA[>=]]> a.ymd_date
+            )
+        </if>
+        <if test="orgId !=null">
+          and a.org_id=#{orgId}
         </if>
-          <if test="orgId !=null">
-              and a.org_id=#{orgId}
-          </if>
         <if test="orgPath !=null">
             and a.org_path  like concat(#{orgPath},'%')
         </if>
@@ -279,8 +287,12 @@
         WHERE
         c.src_type = 1
         AND b.plan_type = 4
-        <if test="date !=null">
-            AND a.ymd_date like concat(#{date},'%')
+        <if test="dto !=null and dto.startTime != null and dto.endTime != null">
+            AND
+            (
+            #{dto.startTime}   <![CDATA[<=]]> a.ymd_date
+            and #{dto.endTime}     <![CDATA[>=]]> a.ymd_date
+            )
         </if>
         <if test="orgId !=null">
             and a.org_id=#{orgId}

+ 27 - 6
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/SafetyInspectMapper.xml

@@ -131,8 +131,15 @@
         <if test="orgPath !=null and orgPath !=''">
             and a.org_path like concat(#{orgPath},'%')
         </if>
-        <if test="year !=null and year !=''">
-            AND a.ymd_year = #{year}
+        <if test="dto != null and dto.year !=null and dto.year !=''">
+            AND a.ymd_year = #{dto.year}
+        </if>
+        <if test="dto !=null and dto.startTime != null and dto.endTime != null">
+            AND
+            (
+            #{dto.startTime}   <![CDATA[<=]]> a.ymd_date
+            and #{dto.endTime}     <![CDATA[>=]]> a.ymd_date
+            )
         </if>
         <if test="orgType !=null">
             AND c.type = #{orgType}
@@ -171,8 +178,15 @@
         <if test="orgPath !=null and orgPath !=''">
             and a.org_path like concat(#{orgPath},'%')
         </if>
-        <if test="year !=null and year !=''">
-            AND c.ymd_year = #{year}
+        <if test="dto !=null and dto.year !=null and dto.year !=''">
+            AND c.ymd_year = #{dto.year}
+        </if>
+        <if test="dto !=null and dto.startTime != null and dto.endTime != null">
+            AND
+            (
+            #{dto.startTime}   <![CDATA[<=]]> c.ymd_date
+            and #{dto.endTime}     <![CDATA[>=]]> c.ymd_date
+            )
         </if>
         <if test="orgType !=null">
             AND b.type = #{orgType}
@@ -209,8 +223,15 @@
             and a.org_path like concat(#{orgPath},'%')
         </if>
 
-        <if test="year !=null and year !=''">
-            AND a.ymd_date like concat(#{year},'%')
+        <if test="dto != null and dto.year !=null and dto.year !=''">
+            AND a.ymd_date like concat(#{dto.year},'%')
+        </if>
+        <if test="dto !=null and dto.startTime != null and dto.endTime != null">
+            AND
+            (
+            #{dto.startTime}   <![CDATA[<=]]> a.ymd_date
+            and #{dto.endTime}     <![CDATA[>=]]> a.ymd_date
+            )
         </if>
         <if test="orgType !=null">
             AND b.type = #{orgType}