From 03c4c93d77025742cf533be59ac449ae0a6c4f87 Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Tue, 2 Jul 2024 14:20:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=80=BC=E7=8F=AD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/zc/business/enums/UniversalEnum.java | 7 +++++-- .../com/zc/business/service/impl/DcShiftsServiceImpl.java | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java b/zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java index 86e112fe..8f865297 100644 --- a/zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java +++ b/zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java @@ -2503,14 +2503,17 @@ public enum UniversalEnum { // 手机号为空 THE_PHONE_NUMBER_IS_EMPTY(0, "手机号为空"), + // 姓名为空 + Name_Is_Empty_IS_EMPTY(0, "姓名为空"), + // 请检查数据是否重复,或存在空值 CHECK_WHETHER_THE_DATA_IS_DUPLICATED_OR_HAS_NULL_VALUES(0, "请检查数据是否重复,或存在空值"), // 排版信息为空 - THE_LAYOUT_INFORMATION_IS_EMPTY(0, "排版信息为空"), + THE_LAYOUT_INFORMATION_IS_EMPTY(0, "排班信息为空"), // 排版格式不正确 - THE_FORMATTING_IS_INCORRECT(0, "排版格式不正确,请重新输入"), + THE_FORMATTING_IS_INCORRECT(0, "排班格式不正确,请重新输入"), // 事件id为空 THE_EVENT_ID_IS_NULL(0, "事件id为空"), diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java index 4e380bdb..5766dd39 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java @@ -295,6 +295,10 @@ public class DcShiftsServiceImpl implements IDcShiftsService for (int i = UniversalEnum.ZERO.getNumber(); i < equipmentList.size(); i++) { DcShifts dcShifts = equipmentList.get(i);//获取第i条全部的数据,转换给实体类 String name = dcShifts.getName(); + if (name == null || name.equals(UniversalEnum.EMPTY_STRING.getValue())){ + msg = UniversalEnum.Name_Is_Empty_IS_EMPTY.getValue(); + throw new ServiceException(msg); + } String contactNumber = dcShifts.getContactNumber();//手机号 String organizationName = dcShifts.getOrganizationName();//驻点 String scheduling = dcShifts.getScheduling();//排班