CustomerApiService.java 7.06 KB
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
 * <p>
 * create at 2019-09-05
 *
 * @author xiatian
 */
@FeignClient(value = "fw-valhalla", path = "/api/valhalla/customer")
public interface CustomerApiService {
    /**
     * 新增售后保有客档案
     *
     * @param customerParams
     * @return
     */
    @PostMapping("/save")
    Message<Boolean> addCustomer(@Valid @RequestBody CustomerParams customerParams);


    /**
     * 更新保有客档案购车时间
     *
     * @param updateBuyDateParams
     */
    @PostMapping("/update/buyDate")
    Message<Void> updateCustomerBuyDate(@Valid @RequestBody CustomerUpdateBuyDateParams updateBuyDateParams);

    /**
     * 新增或更新售后保有客档案
     *
     * @param param 档案参数
     * @return 售后保有客档案
     */
    @PostMapping("/new/save")
    Message<Long> saveCustomer(@Valid @RequestBody CustomerSaveReq param);

    /**
     * 查询保有客档案信息
     *
     * @param customerId
     * @return
     */
    @GetMapping("/query/by/id")
    Message<CustomerInfoDto> queryById(@RequestParam("customerId") Long customerId);

    /**
     * 通过手机号查询档案列表
     *
     * @param mobile
     * @param groupId 集团id
     * @return 保有客列表 nonull
     */
    @GetMapping("/query/by/mobile")
    Message<List<CustomerInfoDto>> queryByMobile(@RequestParam("mobile") String mobile, @RequestParam("groupId") Long groupId);

    /**
     * 通过手机号查询档案列表
     *
     * @param plateNo
     * @param groupId 集团id
     * @return 保有客列表 nonull
     */
    @GetMapping("/query/by/plateNo")
    Message<CustomerInfoDto> queryByPlateNo(@RequestParam("plateNo") String plateNo, @RequestParam("groupId") Long groupId);

    /**
     * 通过车架号查询档案
     *
     * @param frameNo
     * @param groupId
     * @return
     */
    @GetMapping("/query/by/frameNo")
    Message<CustomerInfoDto> queryByFrameNo(@RequestParam("frameNo") String frameNo, @RequestParam("groupId") Long groupId);

    /**
     * 通过车架号查询车辆信息,包含无档案
     *
     * @param frameNo 车架号
     * @param shopId  门店id
     * @return 车辆信息
     */
    @GetMapping("/query/vehicle/by/frameNo")
    Message<CustomerInfoDto> queryVehicleByFrameNo(@RequestParam("frameNo") String frameNo, @RequestParam("shopId") Long shopId);

    /**
     * 批量查询客户档案
     *
     * @param customerIds 客户档案ids
     * @return 客户档案
     */
    @GetMapping("/query/batch")
    Message<List<CustomerInfoDto>> queryBatch(@RequestParam("customerIds") Long[] customerIds);

    /**
     * 变更保有客专属服务顾问
     *
     * @param changeAdviserReq 新的专属服务顾问
     * @return 是否变更成功
     */
    @PostMapping("/change/adviser")
    Message<Boolean> changeAdviser(@Valid @RequestBody ChangeAdviserReq changeAdviserReq);

    /**
     * 会员关联商家(专属商家和进站的商家)
     *
     * @param groupId  集团ID
     * @param memberId 会员ID
     * @return 商家列表
     */
    @GetMapping("/dealers")
    Message<List<Long>> dealers(@RequestParam("groupId") Long groupId, @RequestParam("memberId") Long memberId);

    /**
     * 查询接车送修人
     *
     * @param customerId
     * @param plateNo
     * @param shopId
     * @return
     */
    @GetMapping("/receptioner")
    Message<CustomerContactDto> queryReceptioner(@RequestParam("customerId") Long customerId,
                                                 @RequestParam("plateNo") String plateNo,
                                                 @RequestParam("shopId") Long shopId);

    /**
     * 查询联系人信息
     *
     * @param customerId
     * @param memberId
     * @return
     */
    @GetMapping("/contactInfo")
    Message<CustomerContactDto> queryContactInfo(@RequestParam("customerId") Long customerId, @RequestParam("memberId") Long memberId);

    /**
     * 修改车型代码
     *
     * @param customerId
     * @param specCode
     * @return
     * @deprecated {@link #updateSpecCode}
     */
    @Deprecated
    @GetMapping("/modifySpecCode")
    Message<Boolean> modifySpecCode(@RequestParam("customerId") Long customerId, @RequestParam("specCode") String specCode);

    /**
     * 修改车型代码
     *
     * @param changeSpecCodeReq
     * @return
     */
    @PostMapping("/modify/spec_code")
    Message<Boolean> updateSpecCode(@Valid @RequestBody ChangeSpecCodeReq changeSpecCodeReq);

    /**
     * 查询顾问能否接车
     *
     * @param userId
     * @param plateNo
     * @return
     */
    @GetMapping("/queryReceivable")
    Message<ReceptionResultDto> queryReceivable(@RequestParam("userId") Long userId, @RequestParam("plateNo") String plateNo);

    /**
     * 查询不能接车的售后接待人员
     *
     * @param cusId 档案id
     * @return 售后接待人员id集合
     */
    @GetMapping("/query/illegal/adviser")
    Message<List<Long>> queryIllegalAdviser(@RequestParam("cusId") Long cusId);


    /**
     * 修改车牌号
     *
     * @param changePlateNoReq
     * @return
     */
    @PostMapping("/updatePlateNo")
    Message<Boolean> updatePlateNo(@Valid @RequestBody ChangePlateNoReq changePlateNoReq);

    /**
     * 查询对应memberId的所有保有客档案
     *
     * @param memberId
     * @return
     */
    @GetMapping("/queryByMemberId")
    Message<List<CarArchiveDTO>> queryByMemberId(@RequestParam("memberId") Long memberId);

    /**
     * 查询会员认证车辆
     *
     * @param memberId 会员id
     * @return 认证车辆
     */
    @GetMapping("/query/vehicle/by/memberId")
    Message<List<MemberVehicleDTO>> queryVehicleByMemberId(@RequestParam("memberId") Long memberId);

    /**
     * 通过发动机号查询档案
     *
     * @param engineNo
     * @param groupId
     * @return
     */
    @GetMapping("/query/by/engineNo")
    Message<CustomerInfoDto> queryByEngineNo(@RequestParam("engineNo") String engineNo, @RequestParam("groupId") Long groupId);

    /**
     * 通过关键字查询档案列表
     *
     * @param keyword 关键字 【车主名称、车牌号、车架号后6位】精确查找
     * @param groupId 集团id
     * @return
     */
    @GetMapping("/query/by/keyword")
    Message<List<BasicsCustomerDTO>> queryByKeyword(@RequestParam("keyword") String keyword, @RequestParam("groupId") Long groupId);

    /**
     * 通过车架号查询认证车辆信息
     *
     * @param vin 车架号
     * @return 认证车辆
     */
    @GetMapping("/query/vehicle/by/vin")
    Message<MemberVehicleDTO> queryVehicle(@RequestParam("vin") String vin);

    /**
     * 查询保有客数量
     *
     * @param req 查询参数
     * @return 保有客数量
     */
    @PostMapping("/query/cus/cnt")
    Message<List<CusCntResult>> queryCusCnt(@RequestBody CusCntReq req);




}