Browse Source

修改:-

dev_shibei_match
wangxianzhang 4 years ago
parent
commit
10ab91dd0c
  1. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

@ -3,6 +3,7 @@ package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -252,7 +253,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
private Object importIcResiBaseInfoFromExcel(String excelPathName, int sheetNo, int headRowNumber, String currUserAgencyId, String currUserAgencyPids, String currentUserId,
String tableName) {
DynamicEasyExcelListener readListener = new DynamicEasyExcelListener();
EasyExcelFactory.read(new File(excelPathName)).registerReadListener(readListener).headRowNumber(headRowNumber).sheet(sheetNo).doRead();
//EasyExcelFactory.read(new File(excelPathName)).registerReadListener(readListener).headRowNumber(headRowNumber).sheet(sheetNo).doRead();
EasyExcel.read(new File(excelPathName)).registerReadListener(readListener).headRowNumber(headRowNumber).sheet(sheetNo).doRead();
List<Map<Integer, String>> headList = readListener.getHeadList();
List<Map<Integer, String>> dataList = readListener.getDataList();
@ -592,7 +594,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
}
if (interupt) {
throw new RenException(String.join(",", errorColumnNames) + "的值未填写");
throw new RenException(String.join(",", errorColumnNames) + "的值未填写,或者所填写信息在系统中未找到");
}
}
@ -919,7 +921,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
String fileName = "导入失败条目清单.xls";
response.setHeader("content-Type", "application/vnd.ms-excel");
response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));
LinkedList<ErrorRow> list = new LinkedList<>();
for (Map.Entry<String, List<ErrorRow>> entry : errorRows.get().entrySet()) {

Loading…
Cancel
Save