CustomerApiService.java 4.49 KB
package cn.fw.valhalla.sdk.api;

import cn.fw.data.base.domain.common.Message;
import cn.fw.valhalla.sdk.param.ChangeAdviserReq;
import cn.fw.valhalla.sdk.param.ChangePlateNoReq;
import cn.fw.valhalla.sdk.param.CustomerParams;
import cn.fw.valhalla.sdk.result.CustomerContactDto;
import cn.fw.valhalla.sdk.result.CustomerInfoDto;
import cn.fw.valhalla.sdk.result.ReceptionResultDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

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 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 plateNo
     * @param groupId
     * @return
     */
    @GetMapping("/query/by/frameNo")
    Message<CustomerInfoDto> queryByFrameNo(@RequestParam("frameNo") String plateNo, @RequestParam("groupId") Long groupId);

    /**
     * 批量查询客户档案
     *
     * @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
     */
    @GetMapping("/modifySpecCode")
    Message<Boolean> modifySpecCode(@RequestParam("customerId") Long customerId, @RequestParam("specCode") String specCode);

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

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