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);