Explorar el Código

机构导入bugfix

JiangChongBo hace 2 años
padre
commit
b99e729e03
Se han modificado 1 ficheros con 20 adiciones y 8 borrados
  1. 20 8
      src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

+ 20 - 8
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

@@ -605,8 +605,11 @@ public class AuthServiceImpl implements AuthService {
                 Cell cell = null;
                 // 校验机构名称
                 cell = authPartyRow.getCell(0);
-                cell.setCellType(CellType.STRING);
-                String authParty = cell.getStringCellValue();
+                String authParty = null;
+                if(null != cell){
+                    cell.setCellType(CellType.STRING);
+                    authParty = cell.getStringCellValue();
+                }
                 if (StringUtils.isBlank(authParty)) {
                     return ResponseJson.error("第" + i + 1 + "行机构名称不能为空");
                 }
@@ -696,13 +699,19 @@ public class AuthServiceImpl implements AuthService {
                 }
                 // 认证编号
                 cell = authPartyRow.getCell(5);
-                cell.setCellType(CellType.STRING);
-                String authCode = cell.getStringCellValue();
+                String authCode = null;
+                if(null != cell){
+                    cell.setCellType(CellType.STRING);
+                    authCode = cell.getStringCellValue();
+                }
                 // 认证日期
                 Date authDate = null;
                 cell = authPartyRow.getCell(6);
-                cell.setCellType(CellType.STRING);
-                String authDateStr = cell.getStringCellValue();
+                String authDateStr= null;
+                if(null != cell){
+                    cell.setCellType(CellType.STRING);
+                    authCode = cell.getStringCellValue();
+                }
                 if (StringUtils.isNotBlank(authDateStr)) {
                     SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd");
                     authDate = format.parse(authDateStr);
@@ -722,8 +731,11 @@ public class AuthServiceImpl implements AuthService {
                 }
                 // 校验店铺备注
                 cell = authPartyRow.getCell(8);
-                cell.setCellType(CellType.STRING);
-                String remarks = cell.getStringCellValue();
+                String remarks =null;
+                if(null != cell){
+                    cell.setCellType(CellType.STRING);
+                    remarks = cell.getStringCellValue();
+                }
                 Integer customFlag = 0;
                 if (StringUtils.isNotEmpty(remarks)) {
                     customFlag = 1;