Commit 3bddceac789688645fc063324543a3c7f9888e4c
1 parent
24867828
查询保有客档案sdk
Showing
6 changed files
with
77 additions
and
8 deletions
fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerMapper.java
@@ -7,7 +7,9 @@ import cn.fw.valhalla.domain.query.CustomCustomerQuery; | @@ -7,7 +7,9 @@ import cn.fw.valhalla.domain.query.CustomCustomerQuery; | ||
7 | import cn.fw.valhalla.domain.query.CustomerQueryVO; | 7 | import cn.fw.valhalla.domain.query.CustomerQueryVO; |
8 | import cn.fw.valhalla.domain.query.StammkundeAnalyseQueryVO; | 8 | import cn.fw.valhalla.domain.query.StammkundeAnalyseQueryVO; |
9 | import cn.fw.valhalla.domain.vo.customer.CustomerListVO; | 9 | import cn.fw.valhalla.domain.vo.customer.CustomerListVO; |
10 | +import cn.fw.valhalla.sdk.param.CusCntReq; | ||
10 | import cn.fw.valhalla.sdk.result.BasicsCustomerDTO; | 11 | import cn.fw.valhalla.sdk.result.BasicsCustomerDTO; |
12 | +import cn.fw.valhalla.sdk.result.CusCntResult; | ||
11 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 13 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
12 | import org.apache.ibatis.annotations.Param; | 14 | import org.apache.ibatis.annotations.Param; |
13 | import org.springframework.stereotype.Repository; | 15 | import org.springframework.stereotype.Repository; |
@@ -64,4 +66,21 @@ public interface CustomerMapper extends BaseMapper<Customer> { | @@ -64,4 +66,21 @@ public interface CustomerMapper extends BaseMapper<Customer> { | ||
64 | * @return | 66 | * @return |
65 | */ | 67 | */ |
66 | List<BasicsCustomerDTO> queryByKeyword(@Param("keyword") String keyword, @Param("groupId") Long groupId); | 68 | List<BasicsCustomerDTO> queryByKeyword(@Param("keyword") String keyword, @Param("groupId") Long groupId); |
69 | + | ||
70 | + /** | ||
71 | + * 查询门店保有客数量 | ||
72 | + * | ||
73 | + * @param cusCntReq 门店保有客数量 | ||
74 | + * @return 门店保有客数据 | ||
75 | + */ | ||
76 | + List<CusCntResult> queryShopCusCnt(@Param("req") CusCntReq cusCntReq); | ||
77 | + | ||
78 | + /** | ||
79 | + * 查询服务顾问保有客数量 | ||
80 | + * | ||
81 | + * @param cusCntReq 服务顾问保有客数量 | ||
82 | + * @return 服务顾问保有客数据 | ||
83 | + */ | ||
84 | + List<CusCntResult> queryAdviserCusCnt(@Param("req") CusCntReq cusCntReq); | ||
85 | + | ||
67 | } | 86 | } |
fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml
@@ -355,4 +355,34 @@ | @@ -355,4 +355,34 @@ | ||
355 | ) | 355 | ) |
356 | and t1.group_id = #{groupId} | 356 | and t1.group_id = #{groupId} |
357 | </select> | 357 | </select> |
358 | + | ||
359 | + <select id="queryShopCusCnt" | ||
360 | + parameterType="cn.fw.valhalla.sdk.param.CusCntReq" | ||
361 | + resultType="cn.fw.valhalla.sdk.result.CusCntResult"> | ||
362 | + select t1.shop_id,COUNT(t1.id) | ||
363 | + from customer t1 | ||
364 | + where t1.yn = 1 | ||
365 | + <if test="req.shopIds !=null and req.shopIds.size() != 0"> | ||
366 | + and t1.shop_id in | ||
367 | + <foreach collection="req.shopIds" item="shopId" index="index" open="(" close=")" separator=","> | ||
368 | + #{shopId} | ||
369 | + </foreach> | ||
370 | + group by t1.shop_id | ||
371 | + </if> | ||
372 | + </select> | ||
373 | + | ||
374 | + <select id="queryAdviserCusCnt" | ||
375 | + parameterType="cn.fw.valhalla.sdk.param.CusCntReq" | ||
376 | + resultType="cn.fw.valhalla.sdk.result.CusCntResult"> | ||
377 | + select t1.adviser_id,COUNT(t1.id) | ||
378 | + from customer t1 | ||
379 | + where t1.yn = 1 | ||
380 | + <if test="req.adviserIds !=null and req.adviserIds.size() != 0"> | ||
381 | + and t1.adviser_id in | ||
382 | + <foreach collection="req.adviserIds" item="adviserId" index="index" open="(" close=")" separator=","> | ||
383 | + #{adviserId} | ||
384 | + </foreach> | ||
385 | + group by t1.adviser_id | ||
386 | + </if> | ||
387 | + </select> | ||
358 | </mapper> | 388 | </mapper> |
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java
@@ -281,6 +281,6 @@ public class CustomerApiServiceImpl implements CustomerApiService { | @@ -281,6 +281,6 @@ public class CustomerApiServiceImpl implements CustomerApiService { | ||
281 | @PostMapping("/query/cus/cnt") | 281 | @PostMapping("/query/cus/cnt") |
282 | @ControllerMethod("查询保有客户数量") | 282 | @ControllerMethod("查询保有客户数量") |
283 | public Message<List<CusCntResult>> queryCusCnt(@RequestBody final CusCntReq req) { | 283 | public Message<List<CusCntResult>> queryCusCnt(@RequestBody final CusCntReq req) { |
284 | - return success(); | 284 | + return success(customerBiz.queryCusCnt(req)); |
285 | } | 285 | } |
286 | } | 286 | } |
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; | @@ -35,13 +35,8 @@ import cn.fw.valhalla.rpc.oop.OopService; | ||
35 | import cn.fw.valhalla.rpc.oop.dto.ShopDTO; | 35 | import cn.fw.valhalla.rpc.oop.dto.ShopDTO; |
36 | import cn.fw.valhalla.rpc.oop.dto.SpecDTO; | 36 | import cn.fw.valhalla.rpc.oop.dto.SpecDTO; |
37 | import cn.fw.valhalla.sdk.enums.CusTypeEnum; | 37 | import cn.fw.valhalla.sdk.enums.CusTypeEnum; |
38 | -import cn.fw.valhalla.sdk.param.ChangeSpecCodeReq; | ||
39 | -import cn.fw.valhalla.sdk.param.CustomerParams; | ||
40 | -import cn.fw.valhalla.sdk.param.CustomerQueryReq; | ||
41 | -import cn.fw.valhalla.sdk.result.BasicsCustomerDTO; | ||
42 | -import cn.fw.valhalla.sdk.result.CustomerInfoDto; | ||
43 | -import cn.fw.valhalla.sdk.result.MemberVehicleDTO; | ||
44 | -import cn.fw.valhalla.sdk.result.ReceptionResultDto; | 38 | +import cn.fw.valhalla.sdk.param.*; |
39 | +import cn.fw.valhalla.sdk.result.*; | ||
45 | import cn.fw.valhalla.service.bus.StammkundeBizService; | 40 | import cn.fw.valhalla.service.bus.StammkundeBizService; |
46 | import cn.fw.valhalla.service.bus.setting.SettingBizService; | 41 | import cn.fw.valhalla.service.bus.setting.SettingBizService; |
47 | import cn.fw.valhalla.service.data.*; | 42 | import cn.fw.valhalla.service.data.*; |
@@ -1119,6 +1114,11 @@ public class CustomerBizService extends AbstractCustomerService { | @@ -1119,6 +1114,11 @@ public class CustomerBizService extends AbstractCustomerService { | ||
1119 | return dto; | 1114 | return dto; |
1120 | } | 1115 | } |
1121 | 1116 | ||
1117 | + public List<CusCntResult> queryCusCnt(CusCntReq req){ | ||
1118 | + return customerService.queryCusCnt(req); | ||
1119 | + } | ||
1120 | + | ||
1121 | + | ||
1122 | 1122 | ||
1123 | private AffiliationRecord createEntity(CustomerDetailDto customer) { | 1123 | private AffiliationRecord createEntity(CustomerDetailDto customer) { |
1124 | AffiliationRecord record = new AffiliationRecord(); | 1124 | AffiliationRecord record = new AffiliationRecord(); |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerService.java
@@ -7,7 +7,9 @@ import cn.fw.valhalla.domain.query.CustomCustomerQuery; | @@ -7,7 +7,9 @@ import cn.fw.valhalla.domain.query.CustomCustomerQuery; | ||
7 | import cn.fw.valhalla.domain.query.CustomerQueryVO; | 7 | import cn.fw.valhalla.domain.query.CustomerQueryVO; |
8 | import cn.fw.valhalla.domain.query.StammkundeAnalyseQueryVO; | 8 | import cn.fw.valhalla.domain.query.StammkundeAnalyseQueryVO; |
9 | import cn.fw.valhalla.domain.vo.customer.CustomerListVO; | 9 | import cn.fw.valhalla.domain.vo.customer.CustomerListVO; |
10 | +import cn.fw.valhalla.sdk.param.CusCntReq; | ||
10 | import cn.fw.valhalla.sdk.result.BasicsCustomerDTO; | 11 | import cn.fw.valhalla.sdk.result.BasicsCustomerDTO; |
12 | +import cn.fw.valhalla.sdk.result.CusCntResult; | ||
11 | import com.baomidou.mybatisplus.extension.service.IService; | 13 | import com.baomidou.mybatisplus.extension.service.IService; |
12 | import org.springframework.lang.NonNull; | 14 | import org.springframework.lang.NonNull; |
13 | import org.springframework.lang.Nullable; | 15 | import org.springframework.lang.Nullable; |
@@ -150,4 +152,12 @@ public interface CustomerService extends IService<Customer> { | @@ -150,4 +152,12 @@ public interface CustomerService extends IService<Customer> { | ||
150 | */ | 152 | */ |
151 | @Transactional(rollbackFor = Exception.class) | 153 | @Transactional(rollbackFor = Exception.class) |
152 | void afterDistributePubClue(List<String> vinList, Long userId, Long shopId, Long groupId); | 154 | void afterDistributePubClue(List<String> vinList, Long userId, Long shopId, Long groupId); |
155 | + | ||
156 | + /** | ||
157 | + * 查询保有客数量 | ||
158 | + * @param req 查询参数 | ||
159 | + * @return 保有客数量 | ||
160 | + */ | ||
161 | + List<CusCntResult> queryCusCnt(CusCntReq req); | ||
162 | + | ||
153 | } | 163 | } |
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; | @@ -8,7 +8,9 @@ import cn.fw.valhalla.domain.query.CustomCustomerQuery; | ||
8 | import cn.fw.valhalla.domain.query.CustomerQueryVO; | 8 | import cn.fw.valhalla.domain.query.CustomerQueryVO; |
9 | import cn.fw.valhalla.domain.query.StammkundeAnalyseQueryVO; | 9 | import cn.fw.valhalla.domain.query.StammkundeAnalyseQueryVO; |
10 | import cn.fw.valhalla.domain.vo.customer.CustomerListVO; | 10 | import cn.fw.valhalla.domain.vo.customer.CustomerListVO; |
11 | +import cn.fw.valhalla.sdk.param.CusCntReq; | ||
11 | import cn.fw.valhalla.sdk.result.BasicsCustomerDTO; | 12 | import cn.fw.valhalla.sdk.result.BasicsCustomerDTO; |
13 | +import cn.fw.valhalla.sdk.result.CusCntResult; | ||
12 | import cn.fw.valhalla.service.data.CustomerService; | 14 | import cn.fw.valhalla.service.data.CustomerService; |
13 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 15 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
14 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 16 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
@@ -151,4 +153,12 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i | @@ -151,4 +153,12 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i | ||
151 | .isNull(Customer::getAdviserId) | 153 | .isNull(Customer::getAdviserId) |
152 | ); | 154 | ); |
153 | } | 155 | } |
156 | + | ||
157 | + @Override | ||
158 | + public List<CusCntResult> queryCusCnt(final CusCntReq req) { | ||
159 | + if(!CollectionUtils.isEmpty(req.getShopIds())){ | ||
160 | + return getBaseMapper().queryShopCusCnt(req); | ||
161 | + } | ||
162 | + return getBaseMapper().queryAdviserCusCnt(req); | ||
163 | + } | ||
154 | } | 164 | } |