|
@@ -301,7 +301,7 @@ public class RepairReportController {
|
|
|
result.put("fields", yearList);
|
|
|
result.put("dataTable", repairSbInfoReports);
|
|
|
}
|
|
|
- log.info(result.toJSONString());
|
|
|
+ // log.info(result.toJSONString());
|
|
|
return new R(result);
|
|
|
}
|
|
|
|
|
@@ -320,7 +320,7 @@ public class RepairReportController {
|
|
|
fileName = year + "-设备维修统计明细导出";
|
|
|
if (CollectionUtil.isNotEmpty(list)) {
|
|
|
for (RepairSbInfoReport vo : list) {
|
|
|
- if (vo.getYear().equals(year) ) {
|
|
|
+ if (vo.getYear().equals(year)) {
|
|
|
List<RepairApplicationFormVO> detailList = vo.getDetailList();
|
|
|
if (CollectionUtil.isNotEmpty(detailList)) {
|
|
|
ExcelUtil.exportResponseDict(response, ExportRepairApplicationFormVO.class, BeanConverterUtil.copyListProperties(detailList, ExportRepairApplicationFormVO.class), fileName);
|
|
@@ -335,6 +335,7 @@ public class RepairReportController {
|
|
|
Integer ss = 2021;
|
|
|
System.out.println(year == ss);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 费用月统计报表
|
|
|
* 统计规则:
|
|
@@ -347,7 +348,29 @@ public class RepairReportController {
|
|
|
@GetMapping("/sbInfo/fee")
|
|
|
@SysLog("设备费用统计报表")
|
|
|
public R getSbInfoReportFee(RepairFeeDTO dto, @RequestParam(required = false) Integer year) {
|
|
|
- return new R(repairFeeService.getSbInfoReport(dto, year));
|
|
|
+ List<RepairSbInfoReportFee> repairSbInfoReports = repairFeeService.getSbInfoReport(dto, year);
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
+ // 转化列表为叠装柱状图需要的数据形式
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
+ if (CollectionUtil.isNotEmpty(repairSbInfoReports)) {
|
|
|
+ JSONObject plan = new JSONObject();
|
|
|
+ plan.put("name", "计划性");
|
|
|
+ JSONObject planNot = new JSONObject();
|
|
|
+ planNot.put("name", "非计划性");
|
|
|
+ List<Integer> yearList = new ArrayList<>();
|
|
|
+ for (RepairSbInfoReportFee repairSbInfoReport : repairSbInfoReports) {
|
|
|
+ plan.put(repairSbInfoReport.getYear() + "", repairSbInfoReport.getNum());
|
|
|
+ planNot.put(repairSbInfoReport.getYear() + "", repairSbInfoReport.getNum());
|
|
|
+ yearList.add(repairSbInfoReport.getYear());
|
|
|
+ }
|
|
|
+ jsonArray.add(plan);
|
|
|
+ jsonArray.add(planNot);
|
|
|
+ result.put("data", jsonArray);
|
|
|
+ result.put("fields", yearList);
|
|
|
+ result.put("dataTable", repairSbInfoReports);
|
|
|
+ }
|
|
|
+ //log.info(result.toJSONString());
|
|
|
+ return new R(result);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -363,7 +386,7 @@ public class RepairReportController {
|
|
|
@SysLog("设备费用统计报表导出")
|
|
|
public void exportSbInfoFee(HttpServletResponse response, RepairFeeDTO dto, @RequestParam(required = false) Integer year) {
|
|
|
List<RepairSbInfoReportFee> list = repairFeeService.getSbInfoReport(dto, year);
|
|
|
- String fileName = year + "-费用月统计报表";
|
|
|
+ String fileName = "设备费用统计报表";
|
|
|
ExcelUtil.exportResponseDict(response, RepairSbInfoReportFee.class, list, fileName);
|
|
|
}
|
|
|
|