From 94b81f624fdbb397c6e6a62a34b25a2da2b3ab4b Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 2 Sep 2020 12:37:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=9A=84footbar=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9bar=E5=AD=98=E5=9C=A8=E6=80=A7?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CustomerFootBarServiceImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java index b72edf0ed4..1b732343e4 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java @@ -207,14 +207,14 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl footBarsOfCustomer = baseDao.listByAppTypeAndCustomerId(customerId, appType); - if (!CollectionUtils.isEmpty(footBarsOfCustomer)) { - throw new RenException(EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getCode(), - EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getMsg()); - } - List defaultBars = baseDao.listByAppTypeAndCustomerId("default", appType); for (CustomerFootBarEntity defaultBar : defaultBars) { + CustomerFootBarEntity bar = baseDao.getByAppTypeAndBarKeyOfCustomer(customerId, appType, defaultBar.getBarKey()); + if (bar != null) { + // 该客户已经有该bar了,不再添加 + continue; + } + defaultBar.setCustomerId(customerId); defaultBar.setId(null); defaultBar.setCreatedTime(null);