|
@@ -161,21 +161,21 @@ public class BaseSupplierController extends BaseController {
|
|
|
@GetMapping("/downloaExcel")
|
|
|
public void downloadZip(HttpServletResponse response) {
|
|
|
List<BaseSupplierVo> list = new ArrayList<BaseSupplierVo>();
|
|
|
- //list.add(new BaseSupplierVo("张先生", "法务专家", "男",
|
|
|
- // "2023-07-06", "15152223667", "安全工程03",
|
|
|
- // "科室一", "高级职称", "天津市/河东区", "050050101"
|
|
|
- //));
|
|
|
- //list.add(new BaseSupplierVo("李先生", "经济专家", "女",
|
|
|
- // "2023-07-06", "14448485656", "测试工程07",
|
|
|
- // "科室二", "中级职称", "山西省/阳泉市/平定县", "41133535035"
|
|
|
- //));
|
|
|
+ list.add(new BaseSupplierVo("河南移动", "张先生", "河南-张家口"
|
|
|
+ , "101019", "张老二", "1512626****",
|
|
|
+ "张**", "中国建设银行", "2525********", "是"
|
|
|
+ ));
|
|
|
+ list.add(new BaseSupplierVo("河北不动", "刘先生", "河北-林泉县",
|
|
|
+ "144030", "李老三", "1775959****",
|
|
|
+ "刘**", "中原银行", "3366*********", "否"
|
|
|
+ ));
|
|
|
InputStream resourceAsStream = this.getClass().getResourceAsStream("/template/base_supplier.xlsx");
|
|
|
OutputStream outputStream = null;
|
|
|
try {
|
|
|
response.setContentType("application/vnd.ms-excel");
|
|
|
response.setCharacterEncoding("utf-8");
|
|
|
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
|
|
|
- String fileName = URLEncoder.encode("专家信息(模板)", "UTF-8").replaceAll("\\+", "%20");
|
|
|
+ String fileName = URLEncoder.encode("供应商信息(模板)", "UTF-8").replaceAll("\\+", "%20");
|
|
|
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
|
|
outputStream = response.getOutputStream();
|
|
|
ExcelWriter excelWriter = EasyExcel.write(outputStream)
|