|
|
@ -36,6 +36,7 @@ import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
@ -147,7 +148,14 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD |
|
|
|
@Override |
|
|
|
public CustomerFootBarResultDTO getFootBarDetail(String id) { |
|
|
|
CustomerFootBarEntity entity = baseDao.selectById(id); |
|
|
|
if (entity == null) { |
|
|
|
return new CustomerFootBarResultDTO(); |
|
|
|
} |
|
|
|
CustomerFootBarResultDTO dto = ConvertUtils.sourceToTarget(entity, CustomerFootBarResultDTO.class); |
|
|
|
CustomerFootBarEntity defaultBar = baseDao.getByAppTypeAndBarKeyOfCustomer("default", entity.getAppType(), entity.getBarKey()); |
|
|
|
dto.setDefaultBarName(defaultBar.getBarName()); |
|
|
|
dto.setDefaultIconPath(defaultBar.getIconPath()); |
|
|
|
dto.setDefaultSelectedIconPath(defaultBar.getSelectedIconPath()); |
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
@ -169,6 +177,27 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD |
|
|
|
baseDao.updateDisplayStatus(id, display); |
|
|
|
} |
|
|
|
|
|
|
|
@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) { |
|
|
|
defaultBar.setCustomerId(customerId); |
|
|
|
defaultBar.setId(null); |
|
|
|
defaultBar.setCreatedTime(null); |
|
|
|
defaultBar.setCreatedBy(null); |
|
|
|
defaultBar.setUpdatedTime(null); |
|
|
|
defaultBar.setUpdatedBy(null); |
|
|
|
baseDao.insert(defaultBar); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 添加footbar之前的校验 |
|
|
|
* @param form |
|
|
|