소스 검색

机构导入bugfix

JiangChongBo 2 년 전
부모
커밋
cb426f0f52
1개의 변경된 파일21개의 추가작업 그리고 9개의 파일을 삭제
  1. 21 9
      src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

+ 21 - 9
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

@@ -551,7 +551,7 @@ public class AuthServiceImpl implements AuthService {
         String extName = originalFilename.substring(index);
         String filePath = "/mnt/newdatadrive/data/runtime/jar-instance/zplma/tempFile/";
         if ("dev".equals(active)) {
-            filePath = "D:\\WorkSpace\\file\\tempImport\\";
+          filePath = "D:\\WorkSpace\\file\\tempImport\\";
         }
         filePath += randomStr + extName;
         try {
@@ -606,8 +606,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 + "行机构名称不能为空");
                 }
@@ -697,13 +700,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);
@@ -723,8 +732,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;