diff --git a/tall/src/main/java/com/ccsens/tall/service/ExcelService.java b/tall/src/main/java/com/ccsens/tall/service/ExcelService.java index 247b5015..fc4f6904 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ExcelService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ExcelService.java @@ -525,8 +525,7 @@ public class ExcelService implements IExcelService { continue; } //手机号不能为空 - if ((StrUtil.isNotEmpty(memberCell) && StrUtil.isEmpty(phoneCell)) || - (StrUtil.isNotEmpty(stakeholderCell) && StrUtil.isEmpty(stakeholderPhoneCell))) { + if (StrUtil.isNotEmpty(memberCell) && StrUtil.isEmpty(phoneCell)) { throw new BaseException(CodeEnum.WBS_NOT_PHONE.addMsg(memberSheet.getSheetName(), (i+1),memberCell)); } //TODO 判断手机号格式 @@ -534,11 +533,15 @@ public class ExcelService implements IExcelService { if (StrUtil.isNotEmpty(phoneCell) || !phoneCell.matches(regex)){ throw new BaseException(CodeEnum.WBS_PHONE_ERROR.addMsg(memberSheet.getSheetName(),(i+1),memberCell)); } - if (StrUtil.isNotEmpty(stakeholderPhoneCell) || !stakeholderPhoneCell.matches(regex)){ - throw new BaseException(CodeEnum.WBS_PHONE_ERROR.addMsg(memberSheet.getSheetName(),(i+1),stakeholderCell)); - } + //添加奖惩干系人 if (StrUtil.isNotEmpty(stakeholderCell)) { + if ( StrUtil.isEmpty(stakeholderPhoneCell)){ + throw new BaseException(CodeEnum.WBS_NOT_PHONE.addMsg(memberSheet.getSheetName(), (i+1),stakeholderCell)); + } + if (!stakeholderPhoneCell.matches(regex)){ + throw new BaseException(CodeEnum.WBS_PHONE_ERROR.addMsg(memberSheet.getSheetName(),(i+1),stakeholderCell)); + } if (!stakeholderWithPhone(stakeholderList, stakeholderCell, stakeholderPhoneCell)) { Long userId = userService.selectUserIdByPhone(stakeholderPhoneCell); if (ObjectUtil.isNotNull(userId)) {