Browse Source

年度执行计划导入修改

master
CMM 1 year ago
parent
commit
298efc38c3
3 changed files with 7 additions and 2 deletions
  1. +7
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java
  2. BIN
      template/丽水市2023年数字化项目年度计划编辑表(空).xls
  3. BIN
      template/丽水市2023年数字化项目年度计划编辑表.xls

+ 7
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java View File

@@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.poi.excel.ExcelUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
@@ -13,6 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
@@ -414,9 +416,9 @@ public class AnnualPlanLibManage {
temp.setSheetName(new String[] {"实施类(新建)", "实施类(续建)"});
Map<String, Object> map = new HashMap<>(4);
map.put("mapList", list);
map.put("mapList1", null);
map.put("mapList1", Lists.newArrayList());
Workbook workbook = ExcelExportUtil.exportExcel(temp, map);
if (workbook == null) {
if (CollUtil.isEmpty(list)) {
// 输出空模板
// 获取本地目录的年度计划编辑表空Excel模板
String emptyTemplate = "丽水市" + year + "年数字化项目年度计划编辑表(空)";
@@ -443,6 +445,9 @@ public class AnnualPlanLibManage {
}
return;
}
if (workbook == null){
throw new BizException("读取编辑表模板失败!");
}
// 重置响应对象
response.reset();
try {


BIN
template/丽水市2023年数字化项目年度计划编辑表(空).xls View File


BIN
template/丽水市2023年数字化项目年度计划编辑表.xls View File


Loading…
Cancel
Save