Browse Source

优化评价导入

tags/正式3.2.0
雍文秀 2 years ago
parent
commit
39e941430e
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      sapi/src/main/java/com/xhkjedu/sapi/utils/PoiUtils.java

+ 3
- 2
sapi/src/main/java/com/xhkjedu/sapi/utils/PoiUtils.java View File

219
      **/
219
      **/
220
     public static String getCellValue(Cell cell){
220
     public static String getCellValue(Cell cell){
221
         String value = null;
221
         String value = null;
222
+        if (cell == null) return value;
222
         DecimalFormat df = new DecimalFormat("0");  //格式化number String字符
223
         DecimalFormat df = new DecimalFormat("0");  //格式化number String字符
223
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");  //日期格式化
224
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");  //日期格式化
224
         DecimalFormat df2 = new DecimalFormat("0");  //格式化数字
225
         DecimalFormat df2 = new DecimalFormat("0");  //格式化数字
294
      **/
295
      **/
295
     public static Map<String, Object> readAssess(MultipartFile file, Integer schoolid, AssessUserService assessService) {
296
     public static Map<String, Object> readAssess(MultipartFile file, Integer schoolid, AssessUserService assessService) {
296
         Map<String, Object> resultMap = new HashMap<>();
297
         Map<String, Object> resultMap = new HashMap<>();
298
+        Map<Integer, List<String>> errMsg = new LinkedHashMap<>();
297
         try {
299
         try {
298
             // 数据校验
300
             // 数据校验
299
             isExcelEmpty(file);
301
             isExcelEmpty(file);
312
 
314
 
313
             // 导入用户信息
315
             // 导入用户信息
314
             List<TAssessUser> users = new ArrayList<>();
316
             List<TAssessUser> users = new ArrayList<>();
315
-            Map<Integer, List<String>> errMsg = new LinkedHashMap<>();
316
             Map<String, Integer> grades = listGrade();
317
             Map<String, Integer> grades = listGrade();
317
             TSchool school = assessService.getSchoolById(schoolid);
318
             TSchool school = assessService.getSchoolById(schoolid);
318
             List<SubjectVo> subject = assessService.listSubject(schoolid, school.getSchoollevel());
319
             List<SubjectVo> subject = assessService.listSubject(schoolid, school.getSchoollevel());
412
 
413
 
413
             resultMap.put("code", 0);
414
             resultMap.put("code", 0);
414
             resultMap.put("users", users);
415
             resultMap.put("users", users);
415
-            resultMap.put("errMsg", errMsg);
416
         } catch (Exception e) {
416
         } catch (Exception e) {
417
             resultMap.put("code", 1);
417
             resultMap.put("code", 1);
418
             resultMap.put("msg", e.getMessage());
418
             resultMap.put("msg", e.getMessage());
419
             log.error("读取评价用户出错", e.getMessage());
419
             log.error("读取评价用户出错", e.getMessage());
420
         }
420
         }
421
+        resultMap.put("errMsg", errMsg);
421
         return resultMap;
422
         return resultMap;
422
     }
423
     }
423
 
424
 

Loading…
Cancel
Save