|
@@ -324,31 +324,69 @@ public class RepairApplicationFormController {
|
|
|
@SysLog("历史故障导出")
|
|
|
@PreAuthorize("@pms.hasPermission('repair-application-forms-export')")
|
|
|
public void export2(HttpServletResponse response, RepairApplicationFormDTO record) {
|
|
|
- if (record.getSearchType() != null) {
|
|
|
- // 获取报修人
|
|
|
- if (record.getSearchType() == 1) {
|
|
|
- if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
|
|
|
- UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
- record.setUserId(userInfo.getUserId());
|
|
|
- }
|
|
|
+// if (record.getSearchType() != null) {
|
|
|
+// // 获取报修人
|
|
|
+// if (record.getSearchType() == 1) {
|
|
|
+// if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
|
|
|
+// UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
+// record.setUserId(userInfo.getUserId());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// // 获取维修人,包括第二维修人
|
|
|
+// if (record.getSearchType() == 2) {
|
|
|
+// if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
|
|
|
+// UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
+// record.setRepairUserId(userInfo.getUserId());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// // 获取验收人
|
|
|
+// if (record.getSearchType() == 3) {
|
|
|
+// if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
|
|
|
+// UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
+// record.setCheckUserId(userInfo.getUserId());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// List<RepairApplicationFormVO> excelList = repairApplicationFormMapper.selectPageList(record);
|
|
|
+// ExcelUtil.exportResponseDict(response, ExporHistoryFaultsVO.class, BeanConverterUtil.copyListProperties(excelList, ExporHistoryFaultsVO.class), "历史故障统计");
|
|
|
+ List<RepairApplicationFormVO> list = repairApplicationFormService.getVOListByDTO(record);
|
|
|
+ List<ExportRepairApplicationFormVO> excelList = new ArrayList<>();
|
|
|
+ for (RepairApplicationFormVO vo : list) {
|
|
|
+ ExportRepairApplicationFormVO excel = BeanConverterUtil.copyObjectProperties(vo, ExportRepairApplicationFormVO.class);
|
|
|
+ excelList.add(excel);
|
|
|
+ boolean find = false;
|
|
|
+ if (vo.getChangeRepairPlan() != null && vo.getChangeRepairPlan()) {
|
|
|
+ find = true;
|
|
|
+ excel.setChangeRepairPlan("更新维修计划");
|
|
|
+ excel.setChangeRepairPlanContent(vo.getChangeRepairPlanContent());
|
|
|
+ }
|
|
|
+ if (vo.getChangeSparePlan() != null && vo.getChangeSparePlan()) {
|
|
|
+ find = true;
|
|
|
+ excel.setChangeRepairPlan("更新备件计划");
|
|
|
+ excel.setChangeRepairPlanContent(vo.getChangeSparePlanContent());
|
|
|
+ }
|
|
|
+ if (vo.getUserTeach() != null && vo.getUserTeach()) {
|
|
|
+ find = true;
|
|
|
+ excel.setChangeRepairPlan("人员培训");
|
|
|
+ excel.setChangeRepairPlanContent(vo.getUserTeachContent());
|
|
|
+
|
|
|
+ }
|
|
|
+ if (vo.getSbChange() != null && vo.getSbChange()) {
|
|
|
+ find = true;
|
|
|
+ excel.setChangeRepairPlan("设备改造升级");
|
|
|
+ excel.setChangeRepairPlanContent(vo.getSbChangeContent());
|
|
|
}
|
|
|
- // 获取维修人,包括第二维修人
|
|
|
- if (record.getSearchType() == 2) {
|
|
|
- if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
|
|
|
- UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
- record.setRepairUserId(userInfo.getUserId());
|
|
|
- }
|
|
|
+ if (vo.getOtherChange() != null && vo.getOtherChange()) {
|
|
|
+ find = true;
|
|
|
+ excel.setChangeRepairPlan("其他");
|
|
|
+ excel.setChangeRepairPlanContent(vo.getOtherChangeContent());
|
|
|
}
|
|
|
- // 获取验收人
|
|
|
- if (record.getSearchType() == 3) {
|
|
|
- if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
|
|
|
- UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
- record.setCheckUserId(userInfo.getUserId());
|
|
|
- }
|
|
|
+ if (!find) {
|
|
|
+ excel.setChangeRepairPlan("无");
|
|
|
+ excel.setChangeRepairPlanContent("无");
|
|
|
}
|
|
|
}
|
|
|
- List<RepairApplicationFormVO> excelList = repairApplicationFormMapper.selectPageList(record);
|
|
|
- ExcelUtil.exportResponseDict(response, ExporHistoryFaultsVO.class, BeanConverterUtil.copyListProperties(excelList, ExporHistoryFaultsVO.class), "历史故障统计");
|
|
|
+ ExcelUtil.exportResponseDict(response, ExportRepairApplicationFormVO.class, excelList, "历史故障");
|
|
|
}
|
|
|
|
|
|
}
|