|
|
@@ -64,30 +64,35 @@ public class ResumptionReportController {
|
|
|
// @RequiresPermissions("core:resumptionReport:list")
|
|
|
@PostMapping("/list")
|
|
|
public AjaxResult list(@RequestBody ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException {
|
|
|
- if (null == resumptionDTO.getSearchTime()) {
|
|
|
- LocalDate currentDate = LocalDate.now();
|
|
|
+ try {
|
|
|
+ if (null == resumptionDTO.getSearchTime()) {
|
|
|
+ LocalDate currentDate = LocalDate.now();
|
|
|
+ if (null == resumptionDTO.getCycle() || resumptionDTO.getCycle() == 1) {
|
|
|
+ resumptionDTO.setSearchTime(currentDate.toString());
|
|
|
+ } else {
|
|
|
+ String m = String.valueOf(currentDate.getMonthValue());
|
|
|
+ if (m.length() == 1) {
|
|
|
+ m = "0" + currentDate.getMonthValue();
|
|
|
+ }
|
|
|
+ resumptionDTO.setSearchTime(currentDate.getYear() + "-" + m);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ AjaxResult ajaxResult = AjaxResult.success();
|
|
|
+ List<ResumptionDayVO> report = resumptionReportService.report(resumptionDTO);
|
|
|
+ ajaxResult.put(AjaxResult.DATA_TAG, report);
|
|
|
+ DateTime time = DateUtil.parse(resumptionDTO.getSearchTime());
|
|
|
if (null == resumptionDTO.getCycle() || resumptionDTO.getCycle() == 1) {
|
|
|
- resumptionDTO.setSearchTime(currentDate.toString());
|
|
|
+ ajaxResult.put(TITLE, "营业网点安全保卫履职情况表(" + DateUtil.format(time,Constants.DAILY_FORMAT) + ")");
|
|
|
} else {
|
|
|
- String m = String.valueOf(currentDate.getMonthValue());
|
|
|
- if (m.length() == 1) {
|
|
|
- m = "0" + currentDate.getMonthValue();
|
|
|
- }
|
|
|
- resumptionDTO.setSearchTime(currentDate.getYear() + "-" + m);
|
|
|
+ ajaxResult.put(TITLE, "营业网点安全保卫履职情况表(" + DateUtil.format(time,Constants.MONTH_FORMAT) + ")");
|
|
|
}
|
|
|
+ SysOrg sysOrg = remoteOrgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
|
|
|
+ ajaxResult.put("orgName", sysOrg.getShortName());
|
|
|
+ return ajaxResult;
|
|
|
+ } catch (Exception e) {
|
|
|
+ // 生产上查询时间段过大,会查询报错,这里做一下错误提示处理
|
|
|
+ return AjaxResult.error("查询数据量过大,请缩短查询时间范围。");
|
|
|
}
|
|
|
- AjaxResult ajaxResult = AjaxResult.success();
|
|
|
- List<ResumptionDayVO> report = resumptionReportService.report(resumptionDTO);
|
|
|
- ajaxResult.put(AjaxResult.DATA_TAG, report);
|
|
|
- DateTime time = DateUtil.parse(resumptionDTO.getSearchTime());
|
|
|
- if (null == resumptionDTO.getCycle() || resumptionDTO.getCycle() == 1) {
|
|
|
- ajaxResult.put(TITLE, "营业网点安全保卫履职情况表(" + DateUtil.format(time,Constants.DAILY_FORMAT) + ")");
|
|
|
- } else {
|
|
|
- ajaxResult.put(TITLE, "营业网点安全保卫履职情况表(" + DateUtil.format(time,Constants.MONTH_FORMAT) + ")");
|
|
|
- }
|
|
|
- SysOrg sysOrg = remoteOrgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
|
|
|
- ajaxResult.put("orgName", sysOrg.getShortName());
|
|
|
- return ajaxResult;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "报警测试报表导出")
|