luowei 1 rok temu
rodzic
commit
914df544ba

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

@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
+
 import java.time.LocalDate;
 import java.util.Date;
 import java.util.List;
@@ -35,12 +36,20 @@ public class ResumptionReportController {
     public AjaxResult list(ResumptionDTO resumptionDTO) {
         if (null == resumptionDTO.getSearchTime()) {
             LocalDate currentDate = LocalDate.now();
-            resumptionDTO.setSearchTime(currentDate.toString());
+            if (null == resumptionDTO.getCycle() || resumptionDTO.getCycle() == 1) {
+                resumptionDTO.setSearchTime(currentDate.toString());
+            } else {
+                resumptionDTO.setSearchTime(currentDate.getYear() + "-" + currentDate.getMonthValue());
+            }
         }
         AjaxResult ajaxResult = AjaxResult.success();
         List<ResumptionDayVO> report = resumptionReportService.report(resumptionDTO);
         ajaxResult.put(AjaxResult.DATA_TAG, report);
-        ajaxResult.put("title", "日报表-营业网点每日安全保卫履职(" + resumptionDTO.getSearchTime() + ")");
+        if (null == resumptionDTO.getCycle() || resumptionDTO.getCycle() == 1) {
+            ajaxResult.put("title", "日报表-营业网点每日安全保卫履职(" + resumptionDTO.getSearchTime() + ")");
+        } else {
+            ajaxResult.put("title", "月报表-营业网点每日安全保卫履职(" + resumptionDTO.getSearchTime() + ")");
+        }
         return ajaxResult;
     }
 
@@ -50,7 +59,7 @@ public class ResumptionReportController {
     public AjaxResult intrusionTest(ResumptionDTO resumptionDTO) {
         if (null == resumptionDTO.getSearchTime()) {
             LocalDate currentDate = LocalDate.now();
-            resumptionDTO.setSearchTime(currentDate.getYear()+"-"+currentDate.getMonthValue());
+            resumptionDTO.setSearchTime(currentDate.getYear() + "-" + currentDate.getMonthValue());
         }
         AjaxResult ajaxResult = AjaxResult.success();
         List<IntrusionTestReportVO> intrusionTestReportVOList = resumptionReportService.intrusionTest(resumptionDTO);
@@ -58,11 +67,12 @@ public class ResumptionReportController {
         ajaxResult.put("title", "报警测试报表(" + resumptionDTO.getSearchTime() + ")");
         return ajaxResult;
     }
+
     @ApiOperation(value = "备用电源维护报表")
     @RequiresPermissions("core:resumptionReport:list")
     @GetMapping("/standbyPower")
     public AjaxResult standbyPower(ResumptionDTO resumptionDTO) {
-     String time;
+        String time;
         if (null == resumptionDTO.getSearchTime()) {
             DateTime beginOfQuarter = DateUtil.beginOfQuarter(new java.util.Date());
             DateTime endOfQuarter = DateUtil.endOfQuarter(new Date());
@@ -71,10 +81,10 @@ public class ResumptionReportController {
             LocalDate currentDate = LocalDate.now();
             int month = currentDate.getMonthValue();
             int quarter = (month - 1) / 3 + 1;
-            time=currentDate.getYear()+"年第"+quarter+"季度";
-        }else {
+            time = currentDate.getYear() + "年第" + quarter + "季度";
+        } else {
             String[] split = resumptionDTO.getSearchTime().split("-");
-            time=    split[0]+"年第"+split[1]+"季度";
+            time = split[0] + "年第" + split[1] + "季度";
         }
         AjaxResult ajaxResult = AjaxResult.success();
         List<IntrusionTestReportVO> intrusionTestReportVOList = resumptionReportService.standbyPower(resumptionDTO);
@@ -82,13 +92,14 @@ public class ResumptionReportController {
         ajaxResult.put("title", "备用电源维护报表(" + time + ")");
         return ajaxResult;
     }
+
     @ApiOperation(value = "离行式自助银行巡检报表")
     @RequiresPermissions("core:resumptionReport:list")
     @GetMapping("/serviceBank")
     public AjaxResult serviceBank(ResumptionDTO resumptionDTO) {
         if (null == resumptionDTO.getSearchTime()) {
             LocalDate currentDate = LocalDate.now();
-            resumptionDTO.setSearchTime(currentDate.getYear()+"-"+currentDate.getMonthValue());
+            resumptionDTO.setSearchTime(currentDate.getYear() + "-" + currentDate.getMonthValue());
         }
         AjaxResult ajaxResult = AjaxResult.success();
         List<IntrusionTestReportVO> intrusionTestReportVOList = resumptionReportService.serviceBank(resumptionDTO);

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

@@ -17,4 +17,5 @@ public class ResumptionDTO {
     private Integer planType;
     private Date startTime;
     private Date endTime;
+    private Integer cycle;
 }

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

@@ -16,7 +16,7 @@ import java.util.List;
 @Mapper
 public interface ResumptionReportMapper {
 
-    ResumptionDayVO selectReport(@Param("planType") Integer planType, @Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
+    ResumptionDayVO selectReport(@Param("cycle") Integer cycle,@Param("planType") Integer planType, @Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
 
     /**
      * 已整改数量

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

@@ -64,19 +64,19 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
             resumptionDayVO.setNetworkNumber(integer);
             //营业前
-            ResumptionDayVO resumptionDayVO1 = resumptionReportMapper.selectReport(1, null, resumptionDTO.getSearchTime(), o.getPath());
+            ResumptionDayVO resumptionDayVO1 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(),1, null, resumptionDTO.getSearchTime(), o.getPath());
             resumptionDayVO.setFrontRate(resumptionDayVO1.getFrontRate());
             resumptionDayVO.setFrontAbnormalNumber(resumptionDayVO1.getFrontAbnormalNumber());
             resumptionDayVO.setFrontPlanNumber(resumptionDayVO1.getFrontPlanNumber());
             resumptionDayVO.setFrontRealityNumber(resumptionDayVO1.getFrontRealityNumber());
             //营业中
-            ResumptionDayVO resumptionDayVO2 = resumptionReportMapper.selectReport(2, null, resumptionDTO.getSearchTime(), o.getPath());
+            ResumptionDayVO resumptionDayVO2 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(),2, null, resumptionDTO.getSearchTime(), o.getPath());
             resumptionDayVO.setCentreRate(resumptionDayVO2.getFrontRate());
             resumptionDayVO.setCentreAbnormalNumber(resumptionDayVO2.getFrontAbnormalNumber());
             resumptionDayVO.setCentrePlanNumber(resumptionDayVO2.getFrontPlanNumber());
             resumptionDayVO.setCentreRealityNumber(resumptionDayVO2.getFrontRealityNumber());
             //后
-            ResumptionDayVO resumptionDayVO3 = resumptionReportMapper.selectReport(3, null, resumptionDTO.getSearchTime(), o.getPath());
+            ResumptionDayVO resumptionDayVO3 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(),3, null, resumptionDTO.getSearchTime(), o.getPath());
             resumptionDayVO.setAfterRate(resumptionDayVO3.getFrontRate());
             resumptionDayVO.setAfterAbnormalNumber(resumptionDayVO3.getFrontAbnormalNumber());
             resumptionDayVO.setAfterPlanNumber(resumptionDayVO3.getFrontPlanNumber());

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

@@ -33,7 +33,10 @@
           <if test="orgId !=null">
               AND a.org_id = #{orgId}
           </if>
-          <if test="date !=null">
+          <if test=" cycle ==2">
+              AND a.ymd_date like concat(#{date},'%')
+          </if>
+          <if test="cycle ==1 || cycle ==null">
               AND a.ymd_date = #{date}
           </if>
         <if test="orgPath !=null">