合同管理导入功能开发

This commit is contained in:
梁琦涛
2021-09-06 10:21:41 +08:00
parent 3f8843b08e
commit 56478e2eb5
2 changed files with 324 additions and 232 deletions
+318 -230
View File
File diff suppressed because it is too large Load Diff
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.util.DateUtils;
@@ -37,6 +38,7 @@ import org.jeecgframework.poi.excel.def.MapExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecgframework.poi.excel.view.JeecgMapExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.*;
@@ -385,7 +387,7 @@ public class PayIncomeContractController extends JeroController<PayIncomeContrac
mapCount.put("count",listSub.size());
}
listSub.forEach(p1->{
int n = listSub.indexOf(p1);
int n = listSub.indexOf(p1) + 1;
map.put("phaseName" + n,p1.getPhaseName());
map.put("accountsReceivableAmount" + n,p1.getAccountsReceivableAmount());
map.put("accountsReceivableTime" + n, DateUtils.date2Str(p1.getAccountsReceivableTime(),new SimpleDateFormat("yyyy-MM-dd")));
@@ -396,6 +398,8 @@ public class PayIncomeContractController extends JeroController<PayIncomeContrac
list.add(map);
});
}
}else{
throw new JeroBootException("数据为空!");
}
// 设置表头样式
List<ExcelExportEntity> filedsList = new ArrayList<>();
@@ -423,7 +427,7 @@ public class PayIncomeContractController extends JeroController<PayIncomeContrac
}
}
// Step.3 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
ModelAndView mv = new ModelAndView(new JeecgMapExcelView());
mv.addObject(MapExcelConstants.FILE_NAME, "收入合同"); //此处设置的filename无效 ,前端会重更新设置一下
mv.addObject(MapExcelConstants.ENTITY_LIST, filedsList);
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------