Browse Source

test

dev_shibei_match
yinzuomei 5 years ago
parent
commit
703054cc9e
  1. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
  2. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java

@ -357,7 +357,7 @@ public class IndexCalculateController {
} }
@PostMapping("getCustomerInfoMap") @PostMapping("getCustomerInfoMap")
public Result getCustomerInfoMap(List<String> customerIds) { public Result getCustomerInfoMap(@RequestBody List<String> customerIds) {
if(CollectionUtils.isNotEmpty(customerIds)){ if(CollectionUtils.isNotEmpty(customerIds)){
return new Result().ok(indexCalculateService.getCustomerInfoMap(customerIds)); return new Result().ok(indexCalculateService.getCustomerInfoMap(customerIds));
} }

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java

@ -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<>();

Loading…
Cancel
Save