diff --git a/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerMapper.java b/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerMapper.java index 9909118..cfe0ff2 100644 --- a/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerMapper.java +++ b/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerMapper.java @@ -7,7 +7,9 @@ import cn.fw.valhalla.domain.query.CustomCustomerQuery; import cn.fw.valhalla.domain.query.CustomerQueryVO; import cn.fw.valhalla.domain.query.StammkundeAnalyseQueryVO; import cn.fw.valhalla.domain.vo.customer.CustomerListVO; +import cn.fw.valhalla.sdk.param.CusCntReq; import cn.fw.valhalla.sdk.result.BasicsCustomerDTO; +import cn.fw.valhalla.sdk.result.CusCntResult; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @@ -64,4 +66,21 @@ public interface CustomerMapper extends BaseMapper { * @return */ List queryByKeyword(@Param("keyword") String keyword, @Param("groupId") Long groupId); + + /** + * 查询门店保有客数量 + * + * @param cusCntReq 门店保有客数量 + * @return 门店保有客数据 + */ + List queryShopCusCnt(@Param("req") CusCntReq cusCntReq); + + /** + * 查询服务顾问保有客数量 + * + * @param cusCntReq 服务顾问保有客数量 + * @return 服务顾问保有客数据 + */ + List queryAdviserCusCnt(@Param("req") CusCntReq cusCntReq); + } diff --git a/fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml b/fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml index 443cc05..2b7d2c6 100644 --- a/fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml +++ b/fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml @@ -355,4 +355,34 @@ ) and t1.group_id = #{groupId} + + + + diff --git a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java index eea602e..95a760a 100644 --- a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java +++ b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java @@ -281,6 +281,6 @@ public class CustomerApiServiceImpl implements CustomerApiService { @PostMapping("/query/cus/cnt") @ControllerMethod("查询保有客户数量") public Message> queryCusCnt(@RequestBody final CusCntReq req) { - return success(); + return success(customerBiz.queryCusCnt(req)); } } diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java index 84ad339..1437ffd 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java @@ -35,13 +35,8 @@ import cn.fw.valhalla.rpc.oop.OopService; import cn.fw.valhalla.rpc.oop.dto.ShopDTO; import cn.fw.valhalla.rpc.oop.dto.SpecDTO; import cn.fw.valhalla.sdk.enums.CusTypeEnum; -import cn.fw.valhalla.sdk.param.ChangeSpecCodeReq; -import cn.fw.valhalla.sdk.param.CustomerParams; -import cn.fw.valhalla.sdk.param.CustomerQueryReq; -import cn.fw.valhalla.sdk.result.BasicsCustomerDTO; -import cn.fw.valhalla.sdk.result.CustomerInfoDto; -import cn.fw.valhalla.sdk.result.MemberVehicleDTO; -import cn.fw.valhalla.sdk.result.ReceptionResultDto; +import cn.fw.valhalla.sdk.param.*; +import cn.fw.valhalla.sdk.result.*; import cn.fw.valhalla.service.bus.StammkundeBizService; import cn.fw.valhalla.service.bus.setting.SettingBizService; import cn.fw.valhalla.service.data.*; @@ -1119,6 +1114,11 @@ public class CustomerBizService extends AbstractCustomerService { return dto; } + public List queryCusCnt(CusCntReq req){ + return customerService.queryCusCnt(req); + } + + private AffiliationRecord createEntity(CustomerDetailDto customer) { AffiliationRecord record = new AffiliationRecord(); diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerService.java index 337c954..4fe96a5 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerService.java @@ -7,7 +7,9 @@ import cn.fw.valhalla.domain.query.CustomCustomerQuery; import cn.fw.valhalla.domain.query.CustomerQueryVO; import cn.fw.valhalla.domain.query.StammkundeAnalyseQueryVO; import cn.fw.valhalla.domain.vo.customer.CustomerListVO; +import cn.fw.valhalla.sdk.param.CusCntReq; import cn.fw.valhalla.sdk.result.BasicsCustomerDTO; +import cn.fw.valhalla.sdk.result.CusCntResult; import com.baomidou.mybatisplus.extension.service.IService; import org.springframework.lang.NonNull; import org.springframework.lang.Nullable; @@ -150,4 +152,12 @@ public interface CustomerService extends IService { */ @Transactional(rollbackFor = Exception.class) void afterDistributePubClue(List vinList, Long userId, Long shopId, Long groupId); + + /** + * 查询保有客数量 + * @param req 查询参数 + * @return 保有客数量 + */ + List queryCusCnt(CusCntReq req); + } diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerServiceImpl.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerServiceImpl.java index ea813c6..a9360e3 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerServiceImpl.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerServiceImpl.java @@ -8,7 +8,9 @@ import cn.fw.valhalla.domain.query.CustomCustomerQuery; import cn.fw.valhalla.domain.query.CustomerQueryVO; import cn.fw.valhalla.domain.query.StammkundeAnalyseQueryVO; import cn.fw.valhalla.domain.vo.customer.CustomerListVO; +import cn.fw.valhalla.sdk.param.CusCntReq; import cn.fw.valhalla.sdk.result.BasicsCustomerDTO; +import cn.fw.valhalla.sdk.result.CusCntResult; import cn.fw.valhalla.service.data.CustomerService; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -151,4 +153,12 @@ public class CustomerServiceImpl extends ServiceImpl i .isNull(Customer::getAdviserId) ); } + + @Override + public List queryCusCnt(final CusCntReq req) { + if(!CollectionUtils.isEmpty(req.getShopIds())){ + return getBaseMapper().queryShopCusCnt(req); + } + return getBaseMapper().queryAdviserCusCnt(req); + } }