|
@@ -36,35 +36,37 @@ import java.util.List;
|
|
|
@RequestMapping("/report/check/jobs")
|
|
|
public class CheckJobReportController {
|
|
|
|
|
|
- private final CheckJobService checkJobService;
|
|
|
+ private final CheckJobService checkJobService;
|
|
|
|
|
|
- /**
|
|
|
- * 保养任务每月统计报表导出
|
|
|
- * @param dto 查询条件
|
|
|
- * @param year 查询年份
|
|
|
- * @return R
|
|
|
- */
|
|
|
- @SysLog("保养任务每月统计报表")
|
|
|
- @GetMapping("")
|
|
|
- public R getMonthReportByYear(CheckJobDTO dto, @RequestParam(required = false) Integer year, @RequestParam(required = false) LocalDate startMonth, @RequestParam(required = false) LocalDate endMonth){
|
|
|
- return new R(checkJobService.getMonthReport(dto, year, startMonth, endMonth));
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 保养任务每月统计报表导出
|
|
|
+ *
|
|
|
+ * @param dto 查询条件
|
|
|
+ * @param year 查询年份
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @SysLog("保养任务每月统计报表")
|
|
|
+ @GetMapping("")
|
|
|
+ public R getMonthReportByYear(CheckJobDTO dto, @RequestParam(required = false) Integer year, @RequestParam(required = false) LocalDate startMonth, @RequestParam(required = false) LocalDate endMonth) {
|
|
|
+ return new R(checkJobService.getMonthReport(dto, year, startMonth, endMonth));
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 保养任务每月统计报表导出
|
|
|
- * @param dto 查询条件
|
|
|
+ *
|
|
|
+ * @param dto 查询条件
|
|
|
* @param year 查询年份
|
|
|
* @return R
|
|
|
*/
|
|
|
@GetMapping("/export")
|
|
|
@SysLog("保养任务每月统计报表导出")
|
|
|
- public void export(HttpServletResponse response, CheckJobDTO dto, @RequestParam(required = false) Integer year,@RequestParam(required = false) LocalDate startMonth, @RequestParam(required = false) LocalDate endMonth) {
|
|
|
+ public void export(HttpServletResponse response, CheckJobDTO dto, @RequestParam(required = false) Integer year, @RequestParam(required = false) LocalDate startMonth, @RequestParam(required = false) LocalDate endMonth) {
|
|
|
List<CheckJobReportVO> list = checkJobService.getMonthReport(dto, year, startMonth, endMonth);
|
|
|
String fileName = "";
|
|
|
- if(year == null){
|
|
|
- fileName = DateUtils.dateToString(startMonth, DateUtils.PATTERN_YMD) + "-" + DateUtils.dateToString(endMonth, DateUtils.PATTERN_YMD) + "-保养任务统计报表";
|
|
|
- }else{
|
|
|
- fileName = year + "年-保养任务统计报表";
|
|
|
+ if (year == null) {
|
|
|
+ fileName = DateUtils.dateToString(startMonth, DateUtils.PATTERN_YMD) + "-" + DateUtils.dateToString(endMonth, DateUtils.PATTERN_YMD) + "-保养任务统计报表";
|
|
|
+ } else {
|
|
|
+ fileName = year + "年-保养任务统计报表";
|
|
|
}
|
|
|
ExcelUtil.exportResponseDict(response, CheckJobReportVO.class, list, fileName);
|
|
|
}
|
|
@@ -85,19 +87,21 @@ public class CheckJobReportController {
|
|
|
|
|
|
/**
|
|
|
* 保养任务每月统计报表导出
|
|
|
- * @param dto 查询条件
|
|
|
+ *
|
|
|
+ * @param dto 查询条件
|
|
|
* @param year 查询年份
|
|
|
* @return R
|
|
|
*/
|
|
|
@SysLog("保养任务周工作负荷统计报表")
|
|
|
@GetMapping("week")
|
|
|
- public R getWeekReportByYear(CheckJobDTO dto, @RequestParam(required = false) Integer year,@RequestParam(required = false) LocalDate startMonth, @RequestParam(required = false) LocalDate endMonth){
|
|
|
+ public R getWeekReportByYear(CheckJobDTO dto, @RequestParam(required = false) Integer year, @RequestParam(required = false) LocalDate startMonth, @RequestParam(required = false) LocalDate endMonth) {
|
|
|
return new R(checkJobService.getWeekReport(dto, year, startMonth, endMonth));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保养任务每月统计报表导出
|
|
|
- * @param dto 查询条件
|
|
|
+ *
|
|
|
+ * @param dto 查询条件
|
|
|
* @param year 查询年份
|
|
|
* @return R
|
|
|
*/
|
|
@@ -106,10 +110,10 @@ public class CheckJobReportController {
|
|
|
public void exportWeekReportByYear(HttpServletResponse response, CheckJobDTO dto, @RequestParam(required = false) Integer year, @RequestParam(required = false) LocalDate startMonth, @RequestParam(required = false) LocalDate endMonth) {
|
|
|
List<CheckJobReportWeekHoursVO> list = checkJobService.getWeekReport(dto, year, startMonth, endMonth);
|
|
|
String fileName = "";
|
|
|
- if(year == null){
|
|
|
- fileName = DateUtils.dateToString(startMonth, DateUtils.PATTERN_YMD) + "-" + DateUtils.dateToString(endMonth, DateUtils.PATTERN_YMD) + "-保养任务每周工作负荷统计报表";
|
|
|
- }else{
|
|
|
- fileName = year + "年-保养任务每周工作负荷统计报表";
|
|
|
+ if (year == null) {
|
|
|
+ fileName = DateUtils.dateToString(startMonth, DateUtils.PATTERN_YMD) + "-" + DateUtils.dateToString(endMonth, DateUtils.PATTERN_YMD) + "-保养任务每周工作负荷统计报表";
|
|
|
+ } else {
|
|
|
+ fileName = year + "年-保养任务每周工作负荷统计报表";
|
|
|
}
|
|
|
ExcelUtil.exportResponseDict(response, CheckJobReportWeekHoursVO.class, list, fileName);
|
|
|
}
|