From 703054cc9e08b6283a2bf626f387056be4e0b02e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 4 Mar 2021 21:02:59 +0800 Subject: [PATCH] test --- .../epmet/controller/IndexCalculateController.java | 2 +- .../crm/impl/CustomerRelationServiceImpl.java | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index 30922b4d6c..415f4cbdea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -357,7 +357,7 @@ public class IndexCalculateController { } @PostMapping("getCustomerInfoMap") - public Result getCustomerInfoMap(List customerIds) { + public Result getCustomerInfoMap(@RequestBody List customerIds) { if(CollectionUtils.isNotEmpty(customerIds)){ return new Result().ok(indexCalculateService.getCustomerInfoMap(customerIds)); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java index ac09dc001a..0af903eb6c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java +++ b/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.service.crm.CustomerRelationService; import com.epmet.service.stats.DimCustomerService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -42,6 +43,7 @@ import java.util.stream.Collectors; * @author generator generator@elink-cn.com * @since v1.0.0 2021-01-14 */ +@Slf4j @DataSource(DataSourceConstant.OPER_CRM) @Service public class CustomerRelationServiceImpl extends BaseServiceImpl implements CustomerRelationService { @@ -60,13 +62,13 @@ public class CustomerRelationServiceImpl extends BaseServiceImpl 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(null==customerSubInfoDTO){ + log.info(String.format("当前客户customerId: %s, 没有下一级客户 ",customerId)); + continue; } + DimCustomerDTO dimCustomerDTO=dimCustomerService.get(customerId); + customerSubInfoDTO.setCustomerName(dimCustomerDTO.getCustomerName()); + list.add(customerSubInfoDTO); } if(CollectionUtils.isEmpty(list)){ return new HashMap<>();