Browse Source

班级学生导入提示信息、考号为空报错完善

tags/正式版本
雍文秀 2 years ago
parent
commit
a00fb750e8
1 changed files with 14 additions and 5 deletions
  1. 14
    5
      suser/src/main/java/com/xhkjedu/suser/utils/PoiUtils.java

+ 14
- 5
suser/src/main/java/com/xhkjedu/suser/utils/PoiUtils.java View File

151
                             }
151
                             }
152
                         }
152
                         }
153
                     } else if (y == 5) {//准考证号
153
                     } else if (y == 5) {//准考证号
154
-                        user.setExamno(getCellValue(cell));
154
+                        String examno = getCellValue(cell);
155
+                        if (N_Utils.isNotEmpty(examno)) user.setExamno(examno);
155
                     }
156
                     }
156
                 }
157
                 }
157
 
158
 
168
             resultMap.put("users", users);
169
             resultMap.put("users", users);
169
         } catch (Exception e) {
170
         } catch (Exception e) {
170
             resultMap.put("code", 1);
171
             resultMap.put("code", 1);
171
-            resultMap.put("msg", e.getMessage());
172
-            throw new Exception(e.getMessage());
172
+            String msg=e.getMessage();
173
+            resultMap.put("msg", msg);
174
+            if (msg.contains("Invalid ")) {
175
+                msg = "格式不正确";
176
+            }
177
+            throw new Exception(msg);
173
         }
178
         }
174
         return resultMap;
179
         return resultMap;
175
     }
180
     }
305
             resultMap.put("users", users);
310
             resultMap.put("users", users);
306
         } catch (Exception e) {
311
         } catch (Exception e) {
307
             resultMap.put("code", 1);
312
             resultMap.put("code", 1);
308
-            resultMap.put("msg", e.getMessage());
309
-            throw new Exception(e.getMessage());
313
+            String msg=e.getMessage();
314
+            resultMap.put("msg", msg);
315
+            if (msg.contains("Invalid ")) {
316
+                msg = "格式不正确";
317
+            }
318
+            throw new Exception(msg);
310
         }
319
         }
311
 
320
 
312
         return resultMap;
321
         return resultMap;

Loading…
Cancel
Save