Commit 7ad0be67056b90095a2a00ca95b83a4c02bbb892

Authored by 夏天
1 parent 668f48ef

新增sdk接口

fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/api/CustomerApiService.java
1 1 package cn.fw.valhalla.sdk.api;
2 2  
3 3 import cn.fw.data.base.domain.common.Message;
4   -import cn.fw.valhalla.sdk.param.ChangeAdviserReq;
5   -import cn.fw.valhalla.sdk.param.ChangePlateNoReq;
6   -import cn.fw.valhalla.sdk.param.ChangeSpecCodeReq;
7   -import cn.fw.valhalla.sdk.param.CustomerParams;
  4 +import cn.fw.valhalla.sdk.param.*;
8 5 import cn.fw.valhalla.sdk.result.*;
9 6 import org.springframework.cloud.openfeign.FeignClient;
10   -import org.springframework.web.bind.annotation.GetMapping;
11   -import org.springframework.web.bind.annotation.PostMapping;
12   -import org.springframework.web.bind.annotation.RequestBody;
13   -import org.springframework.web.bind.annotation.RequestParam;
  7 +import org.springframework.web.bind.annotation.*;
14 8  
15 9 import javax.validation.Valid;
  10 +
16 11 import java.util.List;
17 12  
18 13 /**
... ... @@ -155,6 +150,16 @@ public interface CustomerApiService {
155 150 Message<ReceptionResultDto> queryReceivable(@RequestParam("userId") Long userId, @RequestParam("plateNo") String plateNo);
156 151  
157 152 /**
  153 + * 查询不能接车的售后接待人员
  154 + *
  155 + * @param cusId 档案id
  156 + * @return 售后接待人员id集合
  157 + */
  158 + @GetMapping("/query/illegal/adviser")
  159 + Message<List<Long>> queryIllegalAdviser(@RequestParam("cusId") Long cusId);
  160 +
  161 +
  162 + /**
158 163 * 修改车牌号
159 164 *
160 165 * @param changePlateNoReq
... ...
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java
... ... @@ -187,6 +187,13 @@ public class CustomerApiServiceImpl implements CustomerApiService {
187 187 }
188 188  
189 189 @Override
  190 + @GetMapping("/query/illegal/adviser")
  191 + @ControllerMethod("查询不能接车的售后接待人员")
  192 + public Message<List<Long>> queryIllegalAdviser(final Long cusId) {
  193 + return success(customerBiz.queryIllegalAdviser(cusId));
  194 + }
  195 +
  196 + @Override
190 197 @PostMapping("/updatePlateNo")
191 198 @ControllerMethod("通过vin修改车牌号")
192 199 public Message<Boolean> updatePlateNo(@Valid @RequestBody ChangePlateNoReq changePlateNoReq) {
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java
... ... @@ -351,6 +351,17 @@ public class CustomerBizService extends AbstractCustomerService {
351 351 return new ReceptionResultDto(true, "");
352 352 }
353 353  
  354 + public List<Long> queryIllegalAdviser(Long cusId){
  355 + List<AffiliationRecord> list = affiliationRecordService.list(Wrappers.<AffiliationRecord>lambdaQuery()
  356 + .eq(AffiliationRecord::getType, CustomerChangeTypeEnum.DEFEAT)
  357 + .eq(AffiliationRecord::getCustomerId, cusId)
  358 + .ge(AffiliationRecord::getDefeatTime, DateUtil.getNowExpiredMonth(-12)));
  359 + if(CollectionUtils.isEmpty(list)){
  360 + return Collections.emptyList();
  361 + }
  362 + return list.stream().map(AffiliationRecord::getOriginUserId).distinct().collect(Collectors.toList());
  363 + }
  364 +
354 365 /**
355 366 * 根据档案id查询详情
356 367 *
... ...