|
@ -26,6 +26,7 @@ import com.epmet.dto.stats.DimCustomerDTO; |
|
|
import com.epmet.entity.crm.CustomerRelationEntity; |
|
|
import com.epmet.entity.crm.CustomerRelationEntity; |
|
|
import com.epmet.service.crm.CustomerRelationService; |
|
|
import com.epmet.service.crm.CustomerRelationService; |
|
|
import com.epmet.service.stats.DimCustomerService; |
|
|
import com.epmet.service.stats.DimCustomerService; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.util.CollectionUtils; |
|
|
import org.springframework.util.CollectionUtils; |
|
@ -42,6 +43,7 @@ import java.util.stream.Collectors; |
|
|
* @author generator generator@elink-cn.com |
|
|
* @author generator generator@elink-cn.com |
|
|
* @since v1.0.0 2021-01-14 |
|
|
* @since v1.0.0 2021-01-14 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@Slf4j |
|
|
@DataSource(DataSourceConstant.OPER_CRM) |
|
|
@DataSource(DataSourceConstant.OPER_CRM) |
|
|
@Service |
|
|
@Service |
|
|
public class CustomerRelationServiceImpl extends BaseServiceImpl<CustomerRelationDao, CustomerRelationEntity> implements CustomerRelationService { |
|
|
public class CustomerRelationServiceImpl extends BaseServiceImpl<CustomerRelationDao, CustomerRelationEntity> implements CustomerRelationService { |
|
@ -60,13 +62,13 @@ public class CustomerRelationServiceImpl extends BaseServiceImpl<CustomerRelatio |
|
|
List<CustomerSubInfoDTO> list=new ArrayList<>(); |
|
|
List<CustomerSubInfoDTO> list=new ArrayList<>(); |
|
|
for(String customerId:customerIds){ |
|
|
for(String customerId:customerIds){ |
|
|
CustomerSubInfoDTO customerSubInfoDTO = baseDao.selectCustomerSubInfo(customerId); |
|
|
CustomerSubInfoDTO customerSubInfoDTO = baseDao.selectCustomerSubInfo(customerId); |
|
|
if(null!=customerSubInfoDTO){ |
|
|
if(null==customerSubInfoDTO){ |
|
|
DimCustomerDTO dimCustomerDTO=dimCustomerService.get(customerId); |
|
|
log.info(String.format("当前客户customerId: %s, 没有下一级客户 ",customerId)); |
|
|
if(null!=dimCustomerDTO){ |
|
|
continue; |
|
|
customerSubInfoDTO.setCustomerName(dimCustomerDTO.getCustomerName()); |
|
|
|
|
|
} |
|
|
|
|
|
list.add(customerSubInfoDTO); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
DimCustomerDTO dimCustomerDTO=dimCustomerService.get(customerId); |
|
|
|
|
|
customerSubInfoDTO.setCustomerName(dimCustomerDTO.getCustomerName()); |
|
|
|
|
|
list.add(customerSubInfoDTO); |
|
|
} |
|
|
} |
|
|
if(CollectionUtils.isEmpty(list)){ |
|
|
if(CollectionUtils.isEmpty(list)){ |
|
|
return new HashMap<>(); |
|
|
return new HashMap<>(); |
|
|