包头bug修复

This commit is contained in:
guoshengxiong 2025-05-16 22:54:23 +08:00
parent 31576f7b57
commit e1b6b2dba0
4 changed files with 16 additions and 9 deletions

View File

@ -131,6 +131,7 @@ public class PlanPbsController {
})
@GetMapping(value = "/tree/page")
public Result<IPage<PlanPbs>> queryTreePage(@ApiIgnore @RequestParam HashMap<String, Object> param) {
param.put("seeI", null);
return Result.success(planPbsService.queryTreePage(param));
}
}

View File

@ -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<Integer, Map<String, Object>> root = new HashMap<>(3);
root.put(0, map);
root.put(1, new HashMap<>());
Map<String, Object> userMap = new HashMap<>();
List<Map<String, Object>> 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<String, Object> 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 -> {

View File

@ -893,7 +893,7 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
}
levelIds.set(parentLevelIndex + 1, excelRecord.getId());
levelAncestors.set(parentLevelIndex + 1, excelRecord.getAncestors());
levelAncestors.set(parentLevelIndex + 1, excelRecord.getAncestors() + "," + excelRecord.getId());
}
if (CollUtil.isNotEmpty(addPlanMilestones)) {
planMilestoneService.saveBatch(addPlanMilestones);