package cn.fw.valhalla.sdk.api;
import cn.fw.data.base.domain.common.Message;
import cn.fw.valhalla.sdk.param.*;
import cn.fw.valhalla.sdk.result.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* 客户、车相关api
*
* create at 2019-09-05
*
* @author xiatian
*/
@FeignClient(value = "fw-valhalla", path = "/api/valhalla/customer")
public interface CustomerApiService {
/**
* 新增售后保有客档案
*
* @param customerParams
* @return
*/
@PostMapping("/save")
Message addCustomer(@Valid @RequestBody CustomerParams customerParams);
/**
* 更新保有客档案购车时间
*
* @param updateBuyDateParams
*/
@PostMapping("/update/buyDate")
Message updateCustomerBuyDate(@Valid @RequestBody CustomerUpdateBuyDateParams updateBuyDateParams);
/**
* 新增或更新售后保有客档案
*
* @param param 档案参数
* @return 售后保有客档案
*/
@PostMapping("/new/save")
Message saveCustomer(@Valid @RequestBody CustomerSaveReq param);
/**
* 查询保有客档案信息
*
* @param customerId
* @return
*/
@GetMapping("/query/by/id")
Message queryById(@RequestParam("customerId") Long customerId);
/**
* 通过手机号查询档案列表
*
* @param mobile
* @param groupId 集团id
* @return 保有客列表 nonull
*/
@GetMapping("/query/by/mobile")
Message> queryByMobile(@RequestParam("mobile") String mobile, @RequestParam("groupId") Long groupId);
/**
* 通过手机号查询档案列表
*
* @param plateNo
* @param groupId 集团id
* @return 保有客列表 nonull
*/
@GetMapping("/query/by/plateNo")
Message queryByPlateNo(@RequestParam("plateNo") String plateNo, @RequestParam("groupId") Long groupId);
/**
* 通过车架号查询档案
*
* @param frameNo
* @param groupId
* @return
*/
@GetMapping("/query/by/frameNo")
Message queryByFrameNo(@RequestParam("frameNo") String frameNo, @RequestParam("groupId") Long groupId);
/**
* 通过车架号查询车辆信息,包含无档案
*
* @param frameNo 车架号
* @param shopId 门店id
* @return 车辆信息
*/
@GetMapping("/query/vehicle/by/frameNo")
Message queryVehicleByFrameNo(@RequestParam("frameNo") String frameNo, @RequestParam("shopId") Long shopId);
/**
* 批量查询客户档案
*
* @param customerIds 客户档案ids
* @return 客户档案
*/
@GetMapping("/query/batch")
Message> queryBatch(@RequestParam("customerIds") Long[] customerIds);
/**
* 变更保有客专属服务顾问
*
* @param changeAdviserReq 新的专属服务顾问
* @return 是否变更成功
*/
@PostMapping("/change/adviser")
Message changeAdviser(@Valid @RequestBody ChangeAdviserReq changeAdviserReq);
/**
* 会员关联商家(专属商家和进站的商家)
*
* @param groupId 集团ID
* @param memberId 会员ID
* @return 商家列表
*/
@GetMapping("/dealers")
Message> dealers(@RequestParam("groupId") Long groupId, @RequestParam("memberId") Long memberId);
/**
* 查询接车送修人
*
* @param customerId
* @param plateNo
* @param shopId
* @return
*/
@GetMapping("/receptioner")
Message queryReceptioner(@RequestParam("customerId") Long customerId,
@RequestParam("plateNo") String plateNo,
@RequestParam("shopId") Long shopId);
/**
* 查询联系人信息
*
* @param customerId
* @param memberId
* @return
*/
@GetMapping("/contactInfo")
Message queryContactInfo(@RequestParam("customerId") Long customerId, @RequestParam("memberId") Long memberId);
/**
* 修改车型代码
*
* @param customerId
* @param specCode
* @return
* @deprecated {@link #updateSpecCode}
*/
@Deprecated
@GetMapping("/modifySpecCode")
Message modifySpecCode(@RequestParam("customerId") Long customerId, @RequestParam("specCode") String specCode);
/**
* 修改车型代码
*
* @param changeSpecCodeReq
* @return
*/
@PostMapping("/modify/spec_code")
Message updateSpecCode(@Valid @RequestBody ChangeSpecCodeReq changeSpecCodeReq);
/**
* 查询顾问能否接车
*
* @param userId
* @param plateNo
* @return
*/
@GetMapping("/queryReceivable")
Message queryReceivable(@RequestParam("userId") Long userId, @RequestParam("plateNo") String plateNo);
/**
* 查询不能接车的售后接待人员
*
* @param cusId 档案id
* @return 售后接待人员id集合
*/
@GetMapping("/query/illegal/adviser")
Message> queryIllegalAdviser(@RequestParam("cusId") Long cusId);
/**
* 修改车牌号
*
* @param changePlateNoReq
* @return
*/
@PostMapping("/updatePlateNo")
Message updatePlateNo(@Valid @RequestBody ChangePlateNoReq changePlateNoReq);
/**
* 查询对应memberId的所有保有客档案
*
* @param memberId
* @return
*/
@GetMapping("/queryByMemberId")
Message> queryByMemberId(@RequestParam("memberId") Long memberId);
/**
* 查询会员认证车辆
*
* @param memberId 会员id
* @return 认证车辆
*/
@GetMapping("/query/vehicle/by/memberId")
Message> queryVehicleByMemberId(@RequestParam("memberId") Long memberId);
/**
* 通过发动机号查询档案
*
* @param engineNo
* @param groupId
* @return
*/
@GetMapping("/query/by/engineNo")
Message queryByEngineNo(@RequestParam("engineNo") String engineNo, @RequestParam("groupId") Long groupId);
/**
* 通过关键字查询档案列表
*
* @param keyword 关键字 【车主名称、车牌号、车架号后6位】精确查找
* @param groupId 集团id
* @return
*/
@GetMapping("/query/by/keyword")
Message> queryByKeyword(@RequestParam("keyword") String keyword, @RequestParam("groupId") Long groupId);
/**
* 通过车架号查询认证车辆信息
*
* @param vin 车架号
* @return 认证车辆
*/
@GetMapping("/query/vehicle/by/vin")
Message queryVehicle(@RequestParam("vin") String vin);
/**
* 查询保有客数量
*
* @param req 查询参数
* @return 保有客数量
*/
@PostMapping("/query/cus/cnt")
Message> queryCusCnt(@RequestBody CusCntReq req);
}