|
|
@ -207,14 +207,14 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD |
|
|
|
@Transactional |
|
|
|
@Override |
|
|
|
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); |
|
|
|
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); |
|
|
|