diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanPbsController.java b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanPbsController.java index 1277d20cb..68576302d 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanPbsController.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanPbsController.java @@ -131,6 +131,7 @@ public class PlanPbsController { }) @GetMapping(value = "/tree/page") public Result> queryTreePage(@ApiIgnore @RequestParam HashMap param) { + param.put("seeI", null); return Result.success(planPbsService.queryTreePage(param)); } } diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanRecordController.java b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanRecordController.java index f6cf581d8..95c8597cd 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanRecordController.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanRecordController.java @@ -1,4 +1,5 @@ package com.zhgd.xmgl.modules.baotou.plan.controller; +import java.math.RoundingMode; import java.util.Date; import cn.afterturn.easypoi.excel.ExcelExportUtil; @@ -790,17 +791,22 @@ public class PlanRecordController { } //将项目清单集合添加到map中 map.put("listMap", listMap); + Map> root = new HashMap<>(3); + root.put(0, map); + root.put(1, new HashMap<>()); + Map userMap = new HashMap<>(); + List> userListMap = new ArrayList<>(); + userMap.put("userList", userListMap); + root.put(2, userMap); File out = Fileutils.getExportTemplateFile("excel/plan/计划编制模板导出.xlsx"); - TemplateExportParams params = new TemplateExportParams(out.getAbsolutePath(), 0); - Workbook workbook = ExcelExportUtil.exportExcel(params, map); + TemplateExportParams params = new TemplateExportParams(out.getAbsolutePath(), root.keySet().toArray(new Integer[]{})); + Workbook workbook = ExcelExportUtil.exportExcel(root, params); //下拉 - XSSFSheet sheet7 = (XSSFSheet) workbook.getSheet("责任人"); if (users.size() > 0) { for (int i = 0; i < users.size(); i++) { - XSSFRow row1 = sheet7.createRow(i); - XSSFCell cell1 = row1.createCell(0); - cell1.setCellType(CellType.STRING); - cell1.setCellValue(users.get(i).getRealName()); + HashMap hashMap = new HashMap<>(); + hashMap.put("userName", users.get(i).getRealName()); + userListMap.add(hashMap); } } ExcelUtils.downLoadExcel("计划编制模板导出.xlsx", response, workbook); @@ -828,7 +834,7 @@ public class PlanRecordController { mp.put("plannedFinish", DateUtil.formatDateTime(planRecord.getPlannedFinish())); mp.put("actualStart", DateUtil.formatDateTime(planRecord.getActualStart())); mp.put("actualFinish", DateUtil.formatDateTime(planRecord.getActualFinish())); - mp.put("weightRate", planRecord.getWeightRate()); + mp.put("weightRate", Optional.ofNullable(planRecord.getWeightRate()).map(m -> m.multiply(new BigDecimal("0.01")).setScale(2, RoundingMode.HALF_UP)).orElse(null)); mp.put("chargerName", Optional.ofNullable(userIdMap.get(planRecord.getChargerId())).map(SystemUser::getRealName).orElse("")); mp.put("plannedDuration", planRecord.getPlannedDuration()); Optional.ofNullable(ridToMilestoneListMap.get(planRecord.getId())).ifPresent(planMilestones -> { diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/impl/PlanRecordServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/impl/PlanRecordServiceImpl.java index 0ef59227b..a6b8dc7ca 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/impl/PlanRecordServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/impl/PlanRecordServiceImpl.java @@ -893,7 +893,7 @@ public class PlanRecordServiceImpl extends ServiceImpl