From e2eb6343c3ec0f4e102df23ac0ef50a3fb5f85cd Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 24 Nov 2021 09:41:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=88=86=E9=98=9F=E4=B8=8B?= =?UTF-8?q?=E6=88=90=E5=91=98=E6=89=8B=E6=9C=BA=E5=8F=B7=E5=94=AF=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IcPlacePatrolTeamServiceImpl.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java index b48d8a1bc2..5b59178fa9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java @@ -48,7 +48,9 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -74,6 +76,14 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl map = new HashMap<>(); + formDTO.getMemberList().forEach(m -> { + if(map.containsKey(m.getMobile())){ + throw new RenException(String.format("新增巡查人员管理失败,分队下人员手机号重复,重复手机号->%s", m.getMobile())); + } + map.put(m.getMobile(),m.getName()); + }); //1.分队主表新增数据 IcPlacePatrolTeamEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolTeamEntity.class); CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); @@ -101,6 +111,14 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl map = new HashMap<>(); + formDTO.getMemberList().forEach(m -> { + if(map.containsKey(m.getMobile())){ + throw new RenException(String.format("修改巡查人员管理失败,分队下人员手机号重复,重复手机号->%s", m.getMobile())); + } + map.put(m.getMobile(),m.getName()); + }); //1.修改分队主表信息 IcPlacePatrolTeamEntity entity = baseDao.selectById(formDTO.getTeamId()); if (null == entity) {