hfxc226 3 yıl önce
ebeveyn
işleme
28b48882b7

+ 52 - 48
platform-dao/src/main/java/com/platform/dao/vo/export/repair/ExportRepairFeeVO.java

@@ -3,7 +3,10 @@ package com.platform.dao.vo.export.repair;
 import com.platform.office.annotation.Excel;
 import lombok.Data;
 import lombok.experimental.Accessors;
+
+import javax.persistence.Transient;
 import java.io.Serializable;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 
 /**
@@ -17,70 +20,71 @@ import java.time.LocalDateTime;
 public class ExportRepairFeeVO implements Serializable {
 
     /**
-   * 主键
-   */
-  @Excel(name = "主键", orderNum = "1")
-  private String id;
+     * 主键
+     */
+    @Excel(name = "主键", orderNum = "1")
+    private String id;
 
     /**
-   * 维修单id
-   */
-  @Excel(name = "维修单id", orderNum = "2")
-  private String repairId;
+     * 设备编号
+     */
+    @Excel(name = "设备编号", orderNum = "3")
+    private String sbNo;
 
     /**
-   * 费用金额
-   */
-  @Excel(name = "费用金额", orderNum = "3")
-  private Double fee;
+     * 设备名称
+     */
+    @Excel(name = "设备名称", orderNum = "3")
+    private String sbName;
 
     /**
-   * 费用类别
-   */
-  @Excel(name = "费用类别", orderNum = "4")
-  private Integer type;
+     * 委外单号
+     */
+    @Excel(name = "维修单号", orderNum = "4")
+    private String repairNo;
 
     /**
-   * 费用原因
-   */
-  @Excel(name = "费用原因", orderNum = "5")
-  private String reason;
-
+     * 费用金额
+     */
+    @Excel(name = "费用金额", orderNum = "5")
+    private Double fee;
     /**
-   * 费用描述
-   */
-  @Excel(name = "费用描述", orderNum = "6")
-  private String descripition;
-
+     * 费用类别
+     */
+    @Excel(name = "费用类别", orderNum = "6", dicCode = "REPAIR_FEE_TYPE")
+    private Integer type;
     /**
-   * 备注
-   */
-  @Excel(name = "备注", orderNum = "7")
-  private String remark;
-
+     * 货币类型
+     */
+    @Excel(name = "货币类型", orderNum = "7", dicCode = "MONEY_TYPE")
+    private Integer moneyType;
     /**
-   * 创建日期
-   */
-  @Excel(name = "创建日期", orderNum = "8")
-  private LocalDateTime createdTime;
-
+     * 费用日期
+     */
+    @Excel(name = "费用日期", orderNum = "8")
+    private LocalDate feeDate;
     /**
-   * 更新日期
-   */
-  @Excel(name = "更新日期", orderNum = "9")
-  private LocalDateTime updateTime;
+     * 费用原因
+     */
+    @Excel(name = "费用原因", orderNum = "9")
+    private String reason;
 
     /**
-   * 创建人
-   */
-  @Excel(name = "创建人", orderNum = "10")
-  private String createdUserId;
+     * 费用描述
+     */
+    @Excel(name = "费用描述", orderNum = "10")
+    private String descripition;
 
     /**
-   * 更新人
-   */
-  @Excel(name = "更新人", orderNum = "11")
-  private String updateUserId;
+     * 备注
+     */
+    @Excel(name = "备注", orderNum = "11")
+    private String remark;
 
+    /**
+     * 创建日期
+     */
+    @Excel(name = "创建日期", orderNum = "12")
+    private LocalDateTime createdTime;
 
 }

+ 2 - 2
platform-dao/src/main/java/com/platform/dao/vo/report/CheckJobReportVO.java

@@ -24,12 +24,12 @@ public class CheckJobReportVO implements Serializable {
      * 月份
      */
     @Excel(name = "年", orderNum = "1")
-    private String year;
+    private Integer year;
     /**
      * 月份
      */
     @Excel(name = "月份", orderNum = "2")
-    private String month;
+    private Integer month;
     /**
      * 每月总数
      */

+ 2 - 2
platform-dao/src/main/java/com/platform/dao/vo/report/CheckJobReportWeekHoursVO.java

@@ -20,12 +20,12 @@ public class CheckJobReportWeekHoursVO implements Serializable {
      * 周
      */
     @Excel(name = "年", orderNum = "1")
-    private String year;
+    private Integer year;
     /**
      * 周
      */
     @Excel(name = "周", orderNum = "2")
-    private String week;
+    private Integer week;
     /**
      * 保养标准工时(小时)
      */

+ 8 - 3
platform-dao/src/main/java/com/platform/dao/vo/report/RepairReport24VO.java

@@ -16,16 +16,21 @@ import java.util.List;
 @Accessors(chain = true)
 public class RepairReport24VO implements Serializable {
     private static final long serialVersionUID = 1L;
+    /**
+     * 周
+     */
+    @Excel(name = "年", orderNum = "1")
+    private Integer year;
     /**
      * 月份
      */
-    @Excel(name = "月份", orderNum = "1")
-    private String month;
+    @Excel(name = "月份", orderNum = "2")
+    private Integer month;
 
     /**
      * 次数
      */
-    @Excel(name = "次数", orderNum = "2")
+    @Excel(name = "次数", orderNum = "3")
     private Integer num;
 
     /**

+ 10 - 5
platform-dao/src/main/java/com/platform/dao/vo/report/RepairReportFee.java

@@ -19,26 +19,31 @@ import java.util.List;
 @Accessors(chain = true)
 public class RepairReportFee implements Serializable {
     private static final long serialVersionUID = 1L;
+    /**
+     * 年
+     */
+    @Excel(name = "年", orderNum = "1")
+    private Integer year;
     /**
      * 月份
      */
-    @Excel(name = "月份", orderNum = "1")
-    private String month;
+    @Excel(name = "月份", orderNum = "2")
+    private Integer month;
 
     /**
      * 次数
      */
-    @Excel(name = "费用次数", orderNum = "2")
+    @Excel(name = "费用次数", orderNum = "3")
     private Integer num;
     /**
      * 次数
      */
-    @Excel(name = "费用总额", orderNum = "3")
+    @Excel(name = "费用总额", orderNum = "4")
     private Double totalFee;
     /**
      * 平均修复时间(Mean time to repair,MTTR)
      */
-    @Excel(name = "平均费用", orderNum = "4")
+    @Excel(name = "平均费用", orderNum = "5")
     private Double meanFee;
 
     /**

+ 10 - 5
platform-dao/src/main/java/com/platform/dao/vo/report/RepairReportMttr.java

@@ -21,23 +21,28 @@ public class RepairReportMttr implements Serializable {
     /**
      * 月份
      */
-    @Excel(name = "月份", orderNum = "1")
-    private String month;
+    @Excel(name = "年", orderNum = "1")
+    private Integer year;
+    /**
+     * 月份
+     */
+    @Excel(name = "月份", orderNum = "2")
+    private Integer month;
 
     /**
      * 次数
      */
-    @Excel(name = "故障次数", orderNum = "2")
+    @Excel(name = "故障次数", orderNum = "3")
     private Integer num;
     /**
      * 次数
      */
-    @Excel(name = "总修复时间(小时)", orderNum = "3")
+    @Excel(name = "总修复时间(小时)", orderNum = "4")
     private Double totalHours;
     /**
      * 平均修复时间(Mean time to repair,MTTR)
      */
-    @Excel(name = "平均修复时间(小时)", orderNum = "4")
+    @Excel(name = "平均修复时间(小时)", orderNum = "5")
     private Double mttr;
 
     /**

+ 124 - 122
platform-rest/src/main/java/com/platform/rest/controller/check/CheckJobController.java

@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
 import lombok.AllArgsConstructor;
 import com.platform.common.bean.AbstractPageResultBean;
 import com.platform.rest.log.annotation.SysLog;
+
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
@@ -32,59 +33,59 @@ import javax.servlet.http.HttpServletResponse;
 @RequestMapping("/check/jobs")
 public class CheckJobController {
 
-  private final  CheckJobService checkJobService;
-
-  /**
-   * 通过id查询单条任务
-   *
-   * @param id 主键
-   * @return R
-   */
-  @GetMapping("/{id}")
-  public R<CheckJobVO> getById(@PathVariable("id") String id){
-      return new R<>(checkJobService.getDetail(id));
-  }
-
-  /**
-   * 新增任务
-   *
-   * @param checkJobDTO 点检任务DTO
-   * @return R
-   */
-  @SysLog("新增点检任务")
-  @PostMapping
-  @PreAuthorize("@pms.hasPermission('check-polling-jobs-add')")
-  public R save(@Validated({AddGroup.class}) @RequestBody CheckJobDTO checkJobDTO) {
-      return new R<>(checkJobService.saveModelByDTO(checkJobDTO));
-  }
-
-  /**
-   * 修改任务
-   *
-   * @param checkJobDTO 点检任务DTO
-   * @return R
-   */
-  @SysLog("修改点检任务")
-  @PutMapping("/{id}")
-  @PreAuthorize("@pms.hasPermission('check-polling-jobs-edit')")
-  public R update(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody CheckJobDTO checkJobDTO) {
-      checkJobService.modModelByDTO(checkJobDTO);
-      return new R<>();
-  }
-
-  /**
-   * 通过id删除一条任务
-   *
-   * @param id 主键
-   * @return R
-   */
-  @SysLog("删除点检任务")
-  @DeleteMapping("/{id}")
-  @PreAuthorize("@pms.hasPermission('check-polling-jobs-del')")
-  public R removeById(@PathVariable String id){
-    checkJobService.deleteByPrimaryKey(id);
-    return new R<>();
-  }
+    private final CheckJobService checkJobService;
+
+    /**
+     * 通过id查询单条任务
+     *
+     * @param id 主键
+     * @return R
+     */
+    @GetMapping("/{id}")
+    public R<CheckJobVO> getById(@PathVariable("id") String id) {
+        return new R<>(checkJobService.getDetail(id));
+    }
+
+    /**
+     * 新增任务
+     *
+     * @param checkJobDTO 点检任务DTO
+     * @return R
+     */
+    @SysLog("新增点检任务")
+    @PostMapping
+    @PreAuthorize("@pms.hasPermission('check-polling-jobs-add')")
+    public R save(@Validated({AddGroup.class}) @RequestBody CheckJobDTO checkJobDTO) {
+        return new R<>(checkJobService.saveModelByDTO(checkJobDTO));
+    }
+
+    /**
+     * 修改任务
+     *
+     * @param checkJobDTO 点检任务DTO
+     * @return R
+     */
+    @SysLog("修改点检任务")
+    @PutMapping("/{id}")
+    @PreAuthorize("@pms.hasPermission('check-polling-jobs-edit')")
+    public R update(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody CheckJobDTO checkJobDTO) {
+        checkJobService.modModelByDTO(checkJobDTO);
+        return new R<>();
+    }
+
+    /**
+     * 通过id删除一条任务
+     *
+     * @param id 主键
+     * @return R
+     */
+    @SysLog("删除点检任务")
+    @DeleteMapping("/{id}")
+    @PreAuthorize("@pms.hasPermission('check-polling-jobs-del')")
+    public R removeById(@PathVariable String id) {
+        checkJobService.deleteByPrimaryKey(id);
+        return new R<>();
+    }
 
     /**
      * 批量任务
@@ -95,36 +96,36 @@ public class CheckJobController {
     @SysLog("批量删除点检任务")
     @DeleteMapping("")
     @PreAuthorize("@pms.hasPermission('check-polling-jobs-del')")
-    public R removeIds(@RequestBody List<String> ids){
+    public R removeIds(@RequestBody List<String> ids) {
         checkJobService.batchDelete(ids);
         return new R<>();
     }
 
-  /**
-   * 获取分页
-   *
-   * @param pageNum 当前页码
-   * @param pageSize 每页条数
-   * @param checkJobDTO 点检任务DTO
-   * @return R
-   */
-  @GetMapping("/page")
-  public R<AbstractPageResultBean<CheckJobVO>> query(CheckJobDTO checkJobDTO, @RequestParam(required = false) List<Integer> statusList, @RequestParam(defaultValue = "1") int pageNum, @RequestParam(defaultValue = "20") int pageSize) {
-      if(CollectionUtil.isNotEmpty(statusList)){
-        checkJobDTO.setStatusList(statusList);
-      }
-      return new R<>(checkJobService.selectPageList(checkJobDTO, pageNum, pageSize));
-  }
+    /**
+     * 获取分页
+     *
+     * @param pageNum     当前页码
+     * @param pageSize    每页条数
+     * @param checkJobDTO 点检任务DTO
+     * @return R
+     */
+    @GetMapping("/page")
+    public R<AbstractPageResultBean<CheckJobVO>> query(CheckJobDTO checkJobDTO, @RequestParam(required = false) List<Integer> statusList, @RequestParam(defaultValue = "1") int pageNum, @RequestParam(defaultValue = "20") int pageSize) {
+        if (CollectionUtil.isNotEmpty(statusList)) {
+            checkJobDTO.setStatusList(statusList);
+        }
+        return new R<>(checkJobService.selectPageList(checkJobDTO, pageNum, pageSize));
+    }
 
     /**
      * 获取月日历任务列表,均是当月
      * 1:获取某个设备所有当月任务,我设备里面调用,根据角色来判断:维修员或者现场人员返回自己的任务,管理员返回全部的
      * 2:如果传递设备,则查询某一个设备的保养任务。
-     *
+     * <p>
      * 使用场景
-     *  1:我的任务,看到自己所有的任务
-     *  2:我的设备,看到自己负责的所有设备:这个设备调用接口根据角色返回设备台账,点击详情,点击日历图,看到这个设备的任务,根据角色返回
-     *  3:设备台账同2 一样
+     * 1:我的任务,看到自己所有的任务
+     * 2:我的设备,看到自己负责的所有设备:这个设备调用接口根据角色返回设备台账,点击详情,点击日历图,看到这个设备的任务,根据角色返回
+     * 3:设备台账同2 一样
      *
      * @param checkJobDTO 点检任务DTO
      * @return R
@@ -134,19 +135,19 @@ public class CheckJobController {
         return new R<>(checkJobService.getTuiCalendar(checkJobDTO));
     }
 
-  /**
-   * 获取列表
-   *
-   * @param checkJobDTO 点检任务DTO
-   * @return R
-   */
-  @GetMapping("")
-  public R query(CheckJobDTO checkJobDTO, @RequestParam(required = false) List<Integer> statusList) {
-      if(CollectionUtil.isNotEmpty(statusList)){
-          checkJobDTO.setStatusList(statusList);
-      }
-      return new R<>(checkJobService.getModelListByDTO(checkJobDTO));
-  }
+    /**
+     * 获取列表
+     *
+     * @param checkJobDTO 点检任务DTO
+     * @return R
+     */
+    @GetMapping("")
+    public R query(CheckJobDTO checkJobDTO, @RequestParam(required = false) List<Integer> statusList) {
+        if (CollectionUtil.isNotEmpty(statusList)) {
+            checkJobDTO.setStatusList(statusList);
+        }
+        return new R<>(checkJobService.getModelListByDTO(checkJobDTO));
+    }
 
     /**
      * 任务数量
@@ -169,47 +170,48 @@ public class CheckJobController {
     public R getScreenVO(CheckJobDTO checkJobDTO) {
         return new R<>(checkJobService.getScreenCountByTime(checkJobDTO));
     }
-  /**
+
+    /**
      * 任务导出
      *
      * @param checkJobDTO 点检任务DTO
      * @return R
      */
-  @GetMapping("/export")
-  @SysLog("任务导出")
-  @PreAuthorize("@pms.hasPermission('check-polling-jobs-export')")
-  public void export(HttpServletResponse response, CheckJobDTO checkJobDTO) {
-    List<CheckJobVO> list = checkJobService.getVOListByDTO(checkJobDTO);
-    ExcelUtil.exportResponseDict(response, ExportCheckJobVO.class, BeanConverterUtil.copyListProperties(list, ExportCheckJobVO.class), "保养任务");
-  }
-
-  /**
-   * 接收点检任务
-   *
-   * @param checkJobDTO 点检任务DTO
-   * @return R
-   */
-  @SysLog("接收点检任务")
-  @PutMapping("/execute")
-  @PreAuthorize("@pms.hasPermission('check-polling-jobs-edit')")
-  public R executeJob(@Validated({UpdateGroup.class}) @RequestBody CheckJobDTO checkJobDTO) {
-    checkJobService.executeJob(checkJobDTO.getId());
-    return new R<>();
-  }
-
-  /**
-   * 完成任务
-   *
-   * @param checkJobDTO 点检任务DTO
-   * @return R
-   */
-  @SysLog("完成点检任务")
-  @PutMapping("/finish")
-  @PreAuthorize("@pms.hasPermission('check-polling-jobs-edit')")
-  public R finishJob(@Validated({UpdateGroup.class}) @RequestBody CheckJobDTO checkJobDTO) {
-    checkJobService.finishJob(checkJobDTO);
-    return new R<>();
-  }
+    @GetMapping("/export")
+    @SysLog("任务导出")
+    @PreAuthorize("@pms.hasPermission('check-polling-jobs-export')")
+    public void export(HttpServletResponse response, CheckJobDTO checkJobDTO) {
+        List<CheckJobVO> list = checkJobService.getVOListByDTO(checkJobDTO);
+        ExcelUtil.exportResponseDict(response, ExportCheckJobVO.class, BeanConverterUtil.copyListProperties(list, ExportCheckJobVO.class), "保养任务");
+    }
+
+    /**
+     * 接收点检任务
+     *
+     * @param checkJobDTO 点检任务DTO
+     * @return R
+     */
+    @SysLog("接收点检任务")
+    @PutMapping("/execute")
+    @PreAuthorize("@pms.hasPermission('check-polling-jobs-edit')")
+    public R executeJob(@Validated({UpdateGroup.class}) @RequestBody CheckJobDTO checkJobDTO) {
+        checkJobService.executeJob(checkJobDTO.getId());
+        return new R<>();
+    }
+
+    /**
+     * 完成任务
+     *
+     * @param checkJobDTO 点检任务DTO
+     * @return R
+     */
+    @SysLog("完成点检任务")
+    @PutMapping("/finish")
+    @PreAuthorize("@pms.hasPermission('check-polling-jobs-edit')")
+    public R finishJob(@Validated({UpdateGroup.class}) @RequestBody CheckJobDTO checkJobDTO) {
+        checkJobService.finishJob(checkJobDTO);
+        return new R<>();
+    }
 
 
     /**

+ 54 - 0
platform-rest/src/main/java/com/platform/rest/controller/report/CheckJobReportController.java

@@ -1,5 +1,6 @@
 package com.platform.rest.controller.report;
 
+import cn.hutool.core.collection.CollectionUtil;
 import com.platform.common.bean.AbstractPageResultBean;
 import com.platform.common.util.BeanConverterUtil;
 import com.platform.common.util.DateUtils;
@@ -71,6 +72,33 @@ public class CheckJobReportController {
         ExcelUtil.exportResponseDict(response, CheckJobReportVO.class, list, fileName);
     }
 
+    /**
+     * 保养任务每月统计报表导出
+     *
+     * @param dto  查询条件
+     * @param year 查询年份
+     * @return R
+     */
+    @GetMapping("/export/month")
+    @SysLog("保养任务每月明细导出")
+    public void export(HttpServletResponse response, CheckJobDTO dto, @RequestParam(required = false) Integer year,
+                       @RequestParam(required = false) LocalDate startMonth, @RequestParam(required = false) LocalDate endMonth,
+                       @RequestParam(required = false) Integer month) {
+        List<CheckJobReportVO> list = checkJobService.getMonthReport(dto, year, startMonth, endMonth);
+        String fileName = "";
+        fileName = year + "-" + month + "-保养任务统计明细";
+        if (CollectionUtil.isNotEmpty(list)) {
+            for (CheckJobReportVO vo : list) {
+                if (vo.getMonth() == month) {
+                    List<CheckJobVO> detailList = vo.getDetailList();
+                    if (CollectionUtil.isNotEmpty(detailList)) {
+                        ExcelUtil.exportResponseDict(response, ExportCheckJobVO.class, BeanConverterUtil.copyListProperties(detailList, ExportCheckJobVO.class), fileName);
+                    }
+                }
+            }
+        }
+    }
+
     /**
      * 新增保养任务负荷数据
      *
@@ -117,4 +145,30 @@ public class CheckJobReportController {
         }
         ExcelUtil.exportResponseDict(response, CheckJobReportWeekHoursVO.class, list, fileName);
     }
+
+    /**
+     * 保养任务每月统计报表导出
+     *
+     * @param dto  查询条件
+     * @param year 查询年份
+     * @return R
+     */
+    @GetMapping("/week/export/week")
+    @SysLog("保养任务周工作负荷统计报表")
+    public void exportWeekReportByYear(HttpServletResponse response, CheckJobDTO dto,
+                                       @RequestParam(required = false) Integer year,
+                                       @RequestParam(required = false) LocalDate startMonth, @RequestParam(required = false) LocalDate endMonth,
+                                       @RequestParam(required = false) Integer week) {
+        List<CheckJobReportWeekHoursVO> list = checkJobService.getWeekReport(dto, year, startMonth, endMonth);
+        String fileName = "";
+        fileName = year + "-" + week + "-保养任务每周工作负荷统计报表";
+        if (CollectionUtil.isNotEmpty(list)) {
+            for (CheckJobReportWeekHoursVO vo : list) {
+                if (vo.getWeek() == week) {
+                    List<CheckJobVO> detailList = vo.getDetailList();
+                    ExcelUtil.exportResponseDict(response, ExportCheckJobVO.class, BeanConverterUtil.copyListProperties(detailList, ExportCheckJobVO.class), fileName);
+                }
+            }
+        }
+    }
 }

+ 97 - 0
platform-rest/src/main/java/com/platform/rest/controller/report/RepairReportController.java

@@ -1,5 +1,6 @@
 package com.platform.rest.controller.report;
 
+import cn.hutool.core.collection.CollectionUtil;
 import com.platform.common.util.BeanConverterUtil;
 import com.platform.common.util.DateUtils;
 import com.platform.common.util.R;
@@ -7,8 +8,13 @@ import com.platform.dao.dto.check.CheckJobDTO;
 import com.platform.dao.dto.repair.RepairApplicationFormDTO;
 import com.platform.dao.dto.repair.RepairFeeDTO;
 import com.platform.dao.entity.repair.RepairApplicationForm;
+import com.platform.dao.entity.repair.RepairFee;
 import com.platform.dao.util.ExcelUtil;
+import com.platform.dao.vo.export.check.ExportCheckJobVO;
 import com.platform.dao.vo.export.repair.ExportRepairApplicationFormVO;
+import com.platform.dao.vo.export.repair.ExportRepairFeeVO;
+import com.platform.dao.vo.query.check.CheckJobVO;
+import com.platform.dao.vo.repair.RepairApplicationFormVO;
 import com.platform.dao.vo.report.CheckJobReportVO;
 import com.platform.dao.vo.report.RepairReport24VO;
 import com.platform.dao.vo.report.RepairReportFee;
@@ -89,6 +95,39 @@ public class RepairReportController {
         ExcelUtil.exportResponseDict(response, RepairReport24VO.class, list, fileName);
     }
 
+    /**
+     * 1: >24小时停机次数按月统计
+     * 统计规则:
+     * 1:非计划性维修
+     * 2:报修和维修结束的时间大于24小时,即设备停机修复时间
+     * <p>
+     * 2:设备故障次数按月统计
+     * 统计规则:
+     * 1: 非计划性维修
+     * 2: 时间不限制
+     *
+     * @param dto  查询条件
+     * @param year 查询年份
+     * @return R
+     */
+    @GetMapping("/export/month")
+    @SysLog("24小时停机次数每月明细导出")
+    public void export(HttpServletResponse response, RepairApplicationFormDTO dto, @RequestParam(required = false) Integer year, @RequestParam(required = false) LocalDate startMonth, @RequestParam(required = false) LocalDate endMonth, @RequestParam(defaultValue = "1") Integer searchType, @RequestParam(required = false) Integer month) {
+        List<RepairReport24VO> list = repairApplicationFormService.getMonthReportBig24(dto, year, startMonth, endMonth, searchType);
+        String fileName = "";
+        fileName = year + "-" + month + (searchType == 1 ? "-24小时停机次数按月统计表" : "-设备故障次数按月统计");
+        if (CollectionUtil.isNotEmpty(list)) {
+            for (RepairReport24VO vo : list) {
+                if (vo.getMonth() == month) {
+                    List<RepairApplicationFormVO> detailList = vo.getDetailList();
+                    if (CollectionUtil.isNotEmpty(detailList)) {
+                        ExcelUtil.exportResponseDict(response, ExportRepairApplicationFormVO.class, BeanConverterUtil.copyListProperties(detailList, ExportRepairApplicationFormVO.class), fileName);
+                    }
+                }
+            }
+        }
+    }
+
     /**
      * MTTR月统计报表
      * 统计规则:
@@ -129,6 +168,36 @@ public class RepairReportController {
         ExcelUtil.exportResponseDict(response, RepairReportMttr.class, list, fileName);
     }
 
+    /**
+     * 1: >24小时停机次数按月统计
+     * 2: 设备故障次数按月统计
+     * 统计规则:
+     * 1:非计划性维修,且dealMinutes小于24小时的
+     * 2:报修和维修结束的时间大于24小时,即设备停机修复时间
+     *
+     * @param dto  查询条件
+     * @param year 查询年份
+     * @return R
+     */
+    @GetMapping("/mttr/export/month")
+    @SysLog("MTTR月统计明细导出")
+    public void exportMttr(HttpServletResponse response, RepairApplicationFormDTO dto,
+                           @RequestParam(required = false) Integer year, @RequestParam(required = false) LocalDate startMonth, @RequestParam(required = false) LocalDate endMonth,
+                           @RequestParam(required = false) Integer month) {
+        List<RepairReportMttr> list = repairApplicationFormService.getMonthReportMtrr(dto, year, startMonth, endMonth);
+        String fileName = year + "-" + month + "-MTTR月统计明细";
+        if (CollectionUtil.isNotEmpty(list)) {
+            for (RepairReportMttr vo : list) {
+                if (vo.getMonth() == month) {
+                    List<RepairApplicationFormVO> detailList = vo.getDetailList();
+                    if (CollectionUtil.isNotEmpty(detailList)) {
+                        ExcelUtil.exportResponseDict(response, ExportRepairApplicationFormVO.class, BeanConverterUtil.copyListProperties(detailList, ExportRepairApplicationFormVO.class), fileName);
+                    }
+                }
+            }
+        }
+    }
+
     /**
      * 费用月统计报表
      * 统计规则:
@@ -165,4 +234,32 @@ public class RepairReportController {
         }
         ExcelUtil.exportResponseDict(response, RepairReportFee.class, list, fileName);
     }
+
+    /**
+     * 费用月统计报表
+     * 统计规则:
+     * 1:所有费用
+     *
+     * @param dto  查询条件
+     * @param year 查询年份
+     * @return R
+     */
+    @GetMapping("/fee/export/month")
+    @SysLog("费用月明细导出")
+    public void exportFee(HttpServletResponse response, RepairFeeDTO dto, @RequestParam(required = false) Integer year,
+                          @RequestParam(required = false) LocalDate startMonth, @RequestParam(required = false) LocalDate endMonth,
+                          @RequestParam(required = false) Integer month) {
+        List<RepairReportFee> list = repairFeeService.getMonthReport(dto, year, startMonth, endMonth);
+        String fileName = year + "-" + month + "-费用月明细";
+        if (CollectionUtil.isNotEmpty(list)) {
+            for (RepairReportFee vo : list) {
+                if (vo.getMonth() == month) {
+                    List<RepairFee> detailList = vo.getDetailList();
+                    if (CollectionUtil.isNotEmpty(detailList)) {
+                        ExcelUtil.exportResponseDict(response, ExportRepairFeeVO.class, BeanConverterUtil.copyListProperties(detailList, ExportRepairFeeVO.class), fileName);
+                    }
+                }
+            }
+        }
+    }
 }

+ 10 - 9
platform-service/src/main/java/com/platform/service/check/impl/CheckJobServiceImpl.java

@@ -1257,7 +1257,8 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
         for(Map<String, LocalDateTime> map: monthStartAndEndList){
             CheckJobReportVO vo = new CheckJobReportVO();
             List<CheckJobVO> detailList = new ArrayList<CheckJobVO>();
-            vo.setMonth(map.get("searchStartTimeMonth").getYear() + "-" + map.get("searchStartTimeMonth").getMonthValue() + "月");
+            vo.setYear(map.get("searchStartTimeMonth").getYear());
+            vo.setMonth(map.get("searchStartTimeMonth").getMonthValue());
             int totalNum = 0;
             int totalFinishNum = 0;
             int totalWaitNum = 0;
@@ -1318,8 +1319,8 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
         for(Map<String, LocalDateTime> map: monthStartAndEndList){
             CheckJobReportWeekHoursVO vo = new CheckJobReportWeekHoursVO();
             List<CheckJobVO> detailList = new ArrayList<CheckJobVO>();
-            vo.setYear(searchYear+"");
-            vo.setWeek((i++) + "");
+            vo.setYear(searchYear);
+            vo.setWeek((i++));
             double totalHours = 0;
             for(CheckJobVO checkJob: list){
                 if(checkJob.getStartTime().isAfter(map.get("searchStartTimeWeek").toLocalDate()) && checkJob.getStartTime().isBefore(map.get("searchEndTimeWeek").toLocalDate())){
@@ -1383,22 +1384,22 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
     public static void main(String[] args) throws IOException {
         List<CheckJobReportWeekHoursVO> list = new ArrayList<CheckJobReportWeekHoursVO>();
         CheckJobReportWeekHoursVO vo = new CheckJobReportWeekHoursVO();
-        vo.setYear("2021");
-        vo.setWeek("12");
+        vo.setYear(2021);
+        vo.setWeek(12);
         vo.setUseHours(3.0);
         vo.setUsePeople(3.5);
         list.add(vo);
 
         CheckJobReportWeekHoursVO vo2 = new CheckJobReportWeekHoursVO();
-        vo2.setYear("2020");
-        vo2.setWeek("1");
+        vo2.setYear(2020);
+        vo2.setWeek(1);
         vo2.setUseHours(5.0);
         vo2.setUsePeople(4.5);
         list.add(vo2);
 
         CheckJobReportWeekHoursVO vo3 = new CheckJobReportWeekHoursVO();
-        vo3.setYear("2020");
-        vo3.setWeek("3");
+        vo3.setYear(2020);
+        vo3.setWeek(3);
         vo3.setUseHours(3.0);
         vo3.setUsePeople(4.3);
         list.add(vo3);

+ 4 - 2
platform-service/src/main/java/com/platform/service/repair/impl/RepairApplicationFormServiceImpl.java

@@ -769,7 +769,8 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
         for (Map<String, LocalDateTime> map : monthStartAndEndList) {
             RepairReport24VO vo = new RepairReport24VO();
             List<RepairApplicationFormVO> detailList = new ArrayList<RepairApplicationFormVO>();
-            vo.setMonth(map.get("searchStartTimeMonth").getYear() + "-" + map.get("searchStartTimeMonth").getMonthValue() + "月");
+            vo.setYear(map.get("searchStartTimeMonth").getYear());
+            vo.setMonth(map.get("searchStartTimeMonth").getMonthValue());
             int i = 0;
             for (RepairApplicationFormVO repairApplicationForm : list) {
                 if (repairApplicationForm.getDealMinutes() == null) {
@@ -836,7 +837,8 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
         for (Map<String, LocalDateTime> map : monthStartAndEndList) {
             RepairReportMttr vo = new RepairReportMttr();
             List<RepairApplicationFormVO> detailList = new ArrayList<RepairApplicationFormVO>();
-            vo.setMonth(map.get("searchStartTimeMonth").getYear() + "-" + map.get("searchStartTimeMonth").getMonthValue() + "月");
+            vo.setYear(map.get("searchStartTimeMonth").getYear());
+            vo.setMonth(map.get("searchStartTimeMonth").getMonthValue());
             double totalMinuties = 0.0;
             double meanMinuties = 0.0;
             int i = 0;

+ 2 - 1
platform-service/src/main/java/com/platform/service/repair/impl/RepairFeeServiceImpl.java

@@ -172,7 +172,8 @@ public class RepairFeeServiceImpl extends BaseServiceImpl<RepairFeeMapper, Repai
         for (Map<String, LocalDateTime> map : monthStartAndEndList) {
             RepairReportFee vo = new RepairReportFee();
             List<RepairFee> detailList = new ArrayList<RepairFee>();
-            vo.setMonth(map.get("searchStartTimeMonth").getYear() + "-" + map.get("searchStartTimeMonth").getMonthValue() + "月");
+            vo.setYear(map.get("searchStartTimeMonth").getYear());
+            vo.setMonth(map.get("searchStartTimeMonth").getMonthValue());
             double totalFee = 0.0;
             double meanFee = 0.0;
             int i = 0;