|
|
@@ -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;
|