|
|
@ -22,11 +22,15 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
|
import com.epmet.dao.crm.CustomerRelationDao; |
|
|
|
import com.epmet.dto.indexcal.CustomerSubInfoDTO; |
|
|
|
import com.epmet.dto.stats.DimCustomerDTO; |
|
|
|
import com.epmet.entity.crm.CustomerRelationEntity; |
|
|
|
import com.epmet.service.crm.CustomerRelationService; |
|
|
|
import com.epmet.service.stats.DimCustomerService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
@ -42,7 +46,8 @@ import java.util.stream.Collectors; |
|
|
|
@Service |
|
|
|
public class CustomerRelationServiceImpl extends BaseServiceImpl<CustomerRelationDao, CustomerRelationEntity> implements CustomerRelationService { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private DimCustomerService dimCustomerService; |
|
|
|
/** |
|
|
|
* @param customerIds |
|
|
|
* @return java.util.Map<java.lang.String, com.epmet.dto.indexcal.CustomerSubInfoDTO> |
|
|
@ -52,7 +57,17 @@ public class CustomerRelationServiceImpl extends BaseServiceImpl<CustomerRelatio |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public Map<String, CustomerSubInfoDTO> getCustomerInfoMap(List<String> customerIds) { |
|
|
|
List<CustomerSubInfoDTO> list = baseDao.selectCustomerSubInfo(customerIds); |
|
|
|
List<CustomerSubInfoDTO> list=new ArrayList<>(); |
|
|
|
for(String customerId:customerIds){ |
|
|
|
CustomerSubInfoDTO customerSubInfoDTO = baseDao.selectCustomerSubInfo(customerId); |
|
|
|
if(null!=customerSubInfoDTO){ |
|
|
|
DimCustomerDTO dimCustomerDTO=dimCustomerService.get(customerId); |
|
|
|
if(null!=dimCustomerDTO){ |
|
|
|
customerSubInfoDTO.setCustomerName(dimCustomerDTO.getCustomerName()); |
|
|
|
} |
|
|
|
list.add(customerSubInfoDTO); |
|
|
|
} |
|
|
|
} |
|
|
|
if(CollectionUtils.isEmpty(list)){ |
|
|
|
return new HashMap<>(); |
|
|
|
} |
|
|
|