Commit 62f94d3d authored by lcl's avatar lcl

u

parent e0c88ce3
...@@ -1503,10 +1503,9 @@ public class ExcelUtils<T> { ...@@ -1503,10 +1503,9 @@ public class ExcelUtils<T> {
* *
* @param titleNum 标题占用行数 * @param titleNum 标题占用行数
* @param is 输入流 * @param is 输入流
* @param keyName 主要键名称(NULL则不判断)
* @return 转换后集合 * @return 转换后集合
*/ */
public List<T> importExcelAllSheet(InputStream is, int titleNum, String keyName) throws Exception { public List<T> importExcelAllSheet(InputStream is, int titleNum) throws Exception {
this.type = Excel.Type.IMPORT; this.type = Excel.Type.IMPORT;
this.wb = WorkbookFactory.create(is); this.wb = WorkbookFactory.create(is);
List<T> list = new ArrayList<T>(); List<T> list = new ArrayList<T>();
......
...@@ -56,7 +56,7 @@ public class CbQuantitySummaryController extends BaseController { ...@@ -56,7 +56,7 @@ public class CbQuantitySummaryController extends BaseController {
@PostMapping(value = "/importData") @PostMapping(value = "/importData")
public R<Void> importFile(@RequestPart("file") MultipartFile file) throws Exception { public R<Void> importFile(@RequestPart("file") MultipartFile file) throws Exception {
//识别Excel内容 //识别Excel内容
List<CbQuantitySummary> importList = new ExcelUtils<>(CbQuantitySummary.class).importExcelAllSheet(file.getInputStream(), 1, "cbSubjectName"); List<CbQuantitySummary> importList = new ExcelUtils<>(CbQuantitySummary.class).importExcelAllSheet(file.getInputStream(), 1);
if (importList.isEmpty()) { if (importList.isEmpty()) {
throw new ServiceException("表格中不存在待导入数据!"); throw new ServiceException("表格中不存在待导入数据!");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment