Browse Source

统计报表-预案演练、备用电源查询条件改为季度范围查询,监控调阅改为周范围选择

xujie 1 năm trước cách đây
mục cha
commit
ccc59008e5

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillTaskServiceImpl.java

@@ -644,7 +644,8 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
             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.getStartTime(), "yyyy-MM") + "~" + DateUtil.format(request.getEndTime(), "yyyy-MM") + ")";
+            String header = baseHeaderName + "(" + DateUtil.year(request.getStartTime()) + "Q" + DateUtil.quarter(request.getStartTime())
+                    + "~" + DateUtil.year(request.getEndTime()) + "Q" + DateUtil.quarter(request.getEndTime()) + ")";
             // 数据导出
             EasyExcel.write(response.getOutputStream(), CoreDrillTaskReportVo.class)
                     .registerWriteHandler(new ValueCellWriteHandler(header)).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).sheet(baseHeaderName).doWrite(list);

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

@@ -125,6 +125,8 @@ public class ResumptionReportController {
 //            request.setStartTime(beginOfQuarter);
 //            request.setEndTime(endOfQuarter);
 //        }
+        request.setStartTime(DateUtil.beginOfMonth(DateUtils.parseDate(request.getDate().get(0))));
+        request.setEndTime(DateUtil.endOfMonth(DateUtils.parseDate(request.getDate().get(1))));
         String dateTitle=getStandbyPowerExportTitle(request);
         request.setExportDateTitle(dateTitle);
         resumptionReportService.standbyPowerExport(request, response);
@@ -134,6 +136,8 @@ public class ResumptionReportController {
     @RequiresPermissions("core:resumptionReport:list")
     @GetMapping("/standbyPower")
     public AjaxResult standbyPower(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))));
         String time=getStandbyPowerExportTitle(resumptionDTO);
         AjaxResult ajaxResult = AjaxResult.success();
         List<IntrusionTestReportVO> intrusionTestReportVOList = resumptionReportService.standbyPower(resumptionDTO);
@@ -146,20 +150,23 @@ public class ResumptionReportController {
 
     private String getStandbyPowerExportTitle(ResumptionDTO resumptionDTO)
     {
-        if (null == resumptionDTO.getSearchTime()) {
-            DateTime beginOfQuarter = DateUtil.beginOfQuarter(new java.util.Date());
-            DateTime endOfQuarter = DateUtil.endOfQuarter(new Date());
-            resumptionDTO.setStartTime(beginOfQuarter);
-            resumptionDTO.setEndTime(endOfQuarter);
-            LocalDate currentDate = LocalDate.now();
-            int month = currentDate.getMonthValue();
-            int quarter = (month - 1) / 3 + 1;
-            return currentDate.getYear() + "年第" + quarter + "季度";
-        } else {
-            String[] split = resumptionDTO.getSearchTime().split("-");
-            Integer month = (Integer.valueOf(split[1]) - 1) / 3 + 1;
-            return  split[0] + "年第" + month + "季度";
-        }
+//        if (null == resumptionDTO.getSearchTime()) {
+//            DateTime beginOfQuarter = DateUtil.beginOfQuarter(new java.util.Date());
+//            DateTime endOfQuarter = DateUtil.endOfQuarter(new Date());
+//            resumptionDTO.setStartTime(beginOfQuarter);
+//            resumptionDTO.setEndTime(endOfQuarter);
+//            LocalDate currentDate = LocalDate.now();
+//            int month = currentDate.getMonthValue();
+//            int quarter = (month - 1) / 3 + 1;
+//            return currentDate.getYear() + "年第" + quarter + "季度";
+//        } else {
+//            String[] split = resumptionDTO.getSearchTime().split("-");
+//            Integer month = (Integer.valueOf(split[1]) - 1) / 3 + 1;
+//            return  split[0] + "年第" + month + "季度";
+//        }
+        String title = DateUtil.year(resumptionDTO.getStartTime()) + "Q" + DateUtil.quarter(resumptionDTO.getStartTime())
+                + "~" + DateUtil.year(resumptionDTO.getEndTime()) + "Q" + DateUtil.quarter(resumptionDTO.getEndTime()) + ")";
+        return title;
     }
 
     @ApiOperation(value = "离行式自助银行巡检报表导出")

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

@@ -493,7 +493,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
 
     @Override
     public List<IntrusionTestReportVO> standbyPower(ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException{
-        if (null != resumptionDTO.getSearchTime()) {
+/*        if (null != resumptionDTO.getSearchTime()) {
             String[] split = resumptionDTO.getSearchTime().split("-");
             Integer s = Integer.valueOf(split[1]);
             String end = split[0] + "-" + (s + 2) + "-01";
@@ -508,7 +508,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             }
             resumptionDTO.setStartTime(startTime);
             resumptionDTO.setEndTime(endTime);
-        }
+        }*/
         if (null == resumptionDTO.getOrgId()) {
             resumptionDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
         }