Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage

This commit is contained in:
liyawei
2022-07-14 11:48:47 +08:00
2 changed files with 14 additions and 13 deletions
@@ -206,8 +206,8 @@ public class LawsTechnologyEvaluationEOController extends JeroController<LawsTec
@AutoLog(value = "条款导入")
@ApiOperation(value = "条款导入")
@PostMapping(value = "/importItemExcel")
public List<Map<String,Object>> importItemExcel(MultipartFile file, @RequestParam(name = "cut") String cut, HttpServletRequest request) throws Exception {
public Result<?> importItemExcel(MultipartFile file, @RequestParam(name = "cut") String cut, HttpServletRequest request) throws Exception {
List<Map<String,Object>> result = this.lawsTechnologyEvaluationEOService.importItemExcel(file,cut,request);
return result;
return Result.OK(result);
}
}
@@ -394,17 +394,18 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechn
int rowNos = sheet.getPhysicalNumberOfRows();// 得到excel的总记录条数
for (int i = 0; i < rowNos ; i++) {
Row row = sheet.getRow(i + 1);
String itemNum = row.getCell(0, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
String itemName = row.getCell(1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
String itemContents = row.getCell(2, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
Map<String,Object> itemInfoMap = new HashMap<>();
String itemId = UUID.randomUUID().toString().replace("-", "");
itemInfoMap.put("itemId",itemId);
itemInfoMap.put("itemNum",itemNum);
itemInfoMap.put("itemName",itemName);
itemInfoMap.put("itemContent",itemContents);
result.add(itemInfoMap);
if(row != null){
String itemNum = row.getCell(0, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
String itemName = row.getCell(1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
String itemContents = row.getCell(2, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
Map<String,Object> itemInfoMap = new HashMap<>();
String itemId = UUID.randomUUID().toString().replace("-", "");
itemInfoMap.put("itemId",itemId);
itemInfoMap.put("itemNum",itemNum);
itemInfoMap.put("itemName",itemName);
itemInfoMap.put("itemContent",itemContents);
result.add(itemInfoMap);
}
}
}
}