Browse Source

修改:同步客户的footbar的时候,修改bar存在性验证逻辑

dev_shibei_match
wxz 5 years ago
parent
commit
94b81f624f
  1. 12
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java

12
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<CustomerFootBarD
@Transactional @Transactional
@Override @Override
public void addDefault4Customer(String customerId, String appType) { public void addDefault4Customer(String customerId, String appType) {
List<CustomerFootBarEntity> 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<CustomerFootBarEntity> defaultBars = baseDao.listByAppTypeAndCustomerId("default", appType); List<CustomerFootBarEntity> defaultBars = baseDao.listByAppTypeAndCustomerId("default", appType);
for (CustomerFootBarEntity defaultBar : defaultBars) { for (CustomerFootBarEntity defaultBar : defaultBars) {
CustomerFootBarEntity bar = baseDao.getByAppTypeAndBarKeyOfCustomer(customerId, appType, defaultBar.getBarKey());
if (bar != null) {
// 该客户已经有该bar了,不再添加
continue;
}
defaultBar.setCustomerId(customerId); defaultBar.setCustomerId(customerId);
defaultBar.setId(null); defaultBar.setId(null);
defaultBar.setCreatedTime(null); defaultBar.setCreatedTime(null);

Loading…
Cancel
Save