From e3fd07db2b889e5c35007d1e6646598a3056aef8 Mon Sep 17 00:00:00 2001 From: ma <1062634917@qq.com> Date: Thu, 15 Apr 2021 10:11:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=A5=96=E6=83=A9=E5=B9=B2?= =?UTF-8?q?=E7=B3=BB=E4=BA=BA=E7=9A=84=E6=89=8B=E6=9C=BA=E5=8F=B7=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ccsens/tall/service/ExcelService.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 0c03d1f8..caf87a28 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ExcelService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ExcelService.java @@ -525,17 +525,22 @@ 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 判断手机号格式 String regex ="^[1]([3-9])[0-9]{9}$"; if (!phoneCell.matches(regex)){ - throw new BaseException(CodeEnum.WBS_PHONE_ERROR.addMsg(memberSheet.getSheetName() + (i+1))); + throw new BaseException(CodeEnum.WBS_PHONE_ERROR.addMsg(memberSheet.getSheetName(),(i+1),memberCell)); } //添加奖惩干系人 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)) {