From e0d928535cea1e08b4bf94427d2496910e4558e2 Mon Sep 17 00:00:00 2001 From: wanggongfeng <1305282856@qq.com> Date: Wed, 29 Jun 2022 10:11:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=96=AB=E8=8B=97=E6=8E=A5=E7=A7=8D=E7=82=B9?= =?UTF-8?q?=EF=BC=8C=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B=E7=82=B9=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IcPointNucleicMonitoringServiceImpl.java | 7 +++++++ .../impl/IcPointVaccinesInoculationServiceImpl.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointNucleicMonitoringServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointNucleicMonitoringServiceImpl.java index a5dacb5bc6..541dc3d43f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointNucleicMonitoringServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointNucleicMonitoringServiceImpl.java @@ -9,6 +9,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; @@ -124,6 +125,12 @@ public class IcPointNucleicMonitoringServiceImpl extends BaseServiceImpl addressList = baseDao.getAllAddressName(); + // 校验数据库是否存在该地点名称 + if (addressList.contains(dto.getName())){ + throw new RenException("该监测点名称已存在"); + } IcPointNucleicMonitoringEntity entity = ConvertUtils.sourceToTarget(dto, IcPointNucleicMonitoringEntity.class); insert(entity); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointVaccinesInoculationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointVaccinesInoculationServiceImpl.java index 9b89513936..8367d53b36 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointVaccinesInoculationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointVaccinesInoculationServiceImpl.java @@ -8,6 +8,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; @@ -121,6 +122,12 @@ public class IcPointVaccinesInoculationServiceImpl extends BaseServiceImpl addressList = baseDao.getAllAddressName(); + // 校验数据库是否存在该地点名称 + if (addressList.contains(dto.getName())){ + throw new RenException("该接种点名称已存在"); + } IcPointVaccinesInoculationEntity entity = ConvertUtils.sourceToTarget(dto, IcPointVaccinesInoculationEntity.class); insert(entity); }