|
|
@ -134,7 +134,7 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD |
|
|
|
CustomerFootBarEntity entity = new CustomerFootBarEntity(); |
|
|
|
entity.setAppType(form.getAppType()); |
|
|
|
entity.setCustomerId("default"); // 只能为默认客户创建
|
|
|
|
entity.setBarKey(form.getBarKey()); |
|
|
|
entity.setBarKey(form.getBarKey().trim()); |
|
|
|
entity.setBarName(form.getBarName()); |
|
|
|
entity.setIconPath(form.getIconPath()); |
|
|
|
entity.setPageTitle(form.getPageTitle()); |
|
|
@ -212,9 +212,9 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD |
|
|
|
|
|
|
|
@Transactional |
|
|
|
@Override |
|
|
|
public void saveOrder(List<CustomerFootBarFormDTO.OrderIndexDTO> orderList) { |
|
|
|
public void saveOrder(String userId,List<CustomerFootBarFormDTO.OrderIndexDTO> orderList) { |
|
|
|
for (CustomerFootBarFormDTO.OrderIndexDTO idx : orderList) { |
|
|
|
baseDao.updateOrder(idx.getId(), idx.getOrderIndex()); |
|
|
|
baseDao.updateOrder(idx.getId(), idx.getOrderIndex(),userId); |
|
|
|
} |
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(orderList)) { |
|
|
@ -237,8 +237,8 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD |
|
|
|
|
|
|
|
@Transactional |
|
|
|
@Override |
|
|
|
public void updateDisplayStatus(String id, Boolean display) { |
|
|
|
baseDao.updateDisplayStatus(id, display); |
|
|
|
public void updateDisplayStatus(String id, Boolean display,String userId) { |
|
|
|
baseDao.updateDisplayStatus(id, display,userId); |
|
|
|
|
|
|
|
CustomerFootBarEntity footBarEntity = baseDao.selectById(id); |
|
|
|
|
|
|
@ -271,11 +271,12 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD |
|
|
|
|
|
|
|
@Transactional |
|
|
|
@Override |
|
|
|
public void deleteFootBar(String id) { |
|
|
|
public void deleteFootBar(String id,String userId) { |
|
|
|
CustomerFootBarEntity defaultFootbar = baseDao.selectById(id); |
|
|
|
// 注释07.28
|
|
|
|
baseDao.physicsDeleteByAppTypeAndBarKey(defaultFootbar.getAppType(), defaultFootbar.getBarKey(),id); |
|
|
|
|
|
|
|
// 注释07.28,暂时不要物理删除
|
|
|
|
// baseDao.physicsDeleteByAppTypeAndBarKey(defaultFootbar.getAppType(), defaultFootbar.getBarKey(),id);
|
|
|
|
defaultFootbar.setDelFlag("1"); |
|
|
|
baseDao.updateFootBarDel(id,userId); |
|
|
|
// 删除缓存中的footbar。若缓存删除失败,则事务回滚,db中的不应该成功
|
|
|
|
redisUtils.delete(RedisKeys.getCustomerFootbarKey(defaultFootbar.getCustomerId(), defaultFootbar.getAppType())); |
|
|
|
} |
|
|
@ -286,7 +287,7 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD |
|
|
|
*/ |
|
|
|
private void validateBeforeCreate(CustomerFootBarFormDTO form) { |
|
|
|
synchronized (this) { |
|
|
|
int uniqueCount1 = baseDao.count4Unique(form.getCustomerId(), form.getAppType(), form.getBarKey(), null); |
|
|
|
int uniqueCount1 = baseDao.count4Unique(form.getCustomerId(), form.getAppType(), form.getBarKey().trim(), null); |
|
|
|
int uniqueCount2 = baseDao.count4Unique(form.getCustomerId(), form.getAppType(), null, form.getBarName()); |
|
|
|
if (uniqueCount1 > 0 || uniqueCount2 > 0) { |
|
|
|
throw new RenException(EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getCode(), |
|
|
@ -352,6 +353,7 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD |
|
|
|
@Override |
|
|
|
public void createFootBarCustomer(SyncFootBar4CustomerFormDTO form) { |
|
|
|
if (!CollectionUtils.isEmpty(form.getSyncBarKeyList())) { |
|
|
|
// 根据key, 查找产品配置中该footbar信息
|
|
|
|
List<CustomerFootBarEntity> syncList = baseDao.selectListByKey(Constant.DEFAULT_CUSTOMER, form.getAppType(), form.getSyncBarKeyList()); |
|
|
|
syncList.forEach(syncEntity -> { |
|
|
|
baseDao.updateCustomerFootBarByKey(form.getCustomerId(), |
|
|
@ -366,6 +368,7 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD |
|
|
|
); |
|
|
|
}); |
|
|
|
} |
|
|
|
// 产品配置有,当前客户未上线的,直接增加
|
|
|
|
if (!CollectionUtils.isEmpty(form.getAddBarKeyList())) { |
|
|
|
List<CustomerFootBarEntity> addList = baseDao.selectListByKey(Constant.DEFAULT_CUSTOMER, form.getAppType(), form.getAddBarKeyList()); |
|
|
|
addList.forEach(addEntity -> { |
|
|
@ -374,6 +377,7 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD |
|
|
|
footBarFormDTO.setAppType(form.getAppType()); |
|
|
|
footBarFormDTO.setBarKey(addEntity.getBarKey()); |
|
|
|
footBarFormDTO.setBarName(addEntity.getBarName()); |
|
|
|
// 校验一下是否存在
|
|
|
|
validateBeforeCreate(footBarFormDTO); |
|
|
|
|
|
|
|
CustomerFootBarEntity entity = ConvertUtils.sourceToTarget(addEntity, CustomerFootBarEntity.class); |
|
|
|