CustomerRemote.java 18.1 KB
package cn.com.glsx.entmicro.remote;

import cn.com.glsx.entmicro.dto.CustomerOneIdDto;
import cn.com.glsx.entmicro.dto.CustomerPropertyInfoDTO;
import cn.com.glsx.entmicro.dto.CustomerResponseDTO;
import cn.com.glsx.entmicro.dto.SearchCustomerOneIdDto;
import cn.com.glsx.entmicro.model.request.*;
import cn.com.glsx.entmicro.model.request.portraitp.CustomerPortraitRpcRequest;
import cn.com.glsx.entmicro.model.request.sop.SopCusSendRequest;
import cn.com.glsx.entmicro.model.response.*;
import cn.com.glsx.entmicro.model.response.portraitp.CustomerPortraitRpcResponse;
import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;

import java.util.List;
import java.util.Map;

/**
 * @author fengzhi
 * @Description:
 * @date 2021/9/18 11:30
 */
@ApiService(value = "客户服务", version = "1.0.0", protocol = ApiService.ProtocolEnum.dubbo, type = ApiService.ApiTypeEnum.DUBBO, alias = "CustomerRemote", owner = "fengzhi")
public interface CustomerRemote {
    @ApiMethod("客户列表查询")
    @ApiParams({@ApiParam(name = "request", notes = "客户搜索条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户列表")
    RpcResponse<RpcPagination<CustomerListResponse>> customerPageQuery(RpcPagination<CustomerSearchRequest> request);

    @ApiMethod("客户详情查询")
    @ApiParams({@ApiParam(name = "id", notes = "客户id", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户详情信息")
    RpcResponse<CustomerDetailResponse> getCustomerDetail(OneIdIdRequest id);

    @ApiMethod("客户管理概览——柱状图统计查询")
    @ApiParams({@ApiParam(name = "dayNum", notes = "查询天数", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户概览柱状图数据")
    RpcResponse<CustomerChartResponse> getCustomerChart(CustDayRequest dayNum);

    @ApiMethod("客户管理概览——数据概览查询")
    @ApiParams({@ApiParam(name = "merchantId", notes = "商户号", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户概览数据")
    RpcResponse<CustomerDataViewResponse> getCustomerDataView(CustBaseRequest request);

    @ApiMethod("scrm首页概览——汇总数据查询(商户登录)")
    @ApiParams({@ApiParam(name = "request", notes = "DateRequest", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("商户客户概览汇总数据")
    RpcResponse<ShopCollectViewResponse> getShopCollectView(DateRequest request);

    @ApiMethod("scrm首页概览——汇总数据查询(门店登录)")
    @ApiParams({@ApiParam(name = "request", notes = "DateRequest", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("门店客户概览汇总数据")
    RpcResponse<StoreCollectViewResponse> getStoreCollectView(DateRequest request);

    @ApiMethod("scrm首页概览——商户登录1-2——折线图")
    @ApiParams({@ApiParam(name = "dayRequest", notes = "DefaultRequest", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户概览折线图")
    RpcResponse<ShopLineChartResponse> getShopLineChart(CustDayRequest dayRequest);

    @ApiMethod("scrm首页概览——商户登录1-3——门店企微客户排行")
    @ApiParams({@ApiParam(name = "request", notes = "DefaultRequest", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户概览门店企微客户排行")
    RpcResponse<ShopCustSortResponse> getShopCustSort(CustSortRequest request);

    @ApiMethod("oneid变更")
    @ApiParams({@ApiParam(name = "request", notes = "ChangeOneIDRopRequest", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    RpcResponse<Boolean> changeOneID(ChangeOneIDRopRequest request);

    @ApiMethod("企微魔方客户添加")
    @ApiParams({@ApiParam(name = "request", notes = "addCustomerMagic", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    RpcResponse<List<CustomerMagicResponse>> addCustomerMagic(MagicDynamicRequest magicDynamicRequest);

    @ApiMethod("「主要提供给企微C端调用」客户信息获取接口")
    @ApiParams({@ApiParam(name = "externalUserId", notes = "企微外部联系人Id", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("返回企微客户基本信息")
    RpcResponse<CustomerInfoResponse> getCustomerInfoByExternalUserId(String externalUserId);

    @ApiMethod("跟进条件查询员工下的客户")
    @ApiParams({@ApiParam(name = "findCustomerByCondition", notes = "条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("跟进条件查询员工下的客户")
    RpcResponse<List<CustomerInfoResponse>> findCustomerByCondition(QyWechatStaffDefaultRequest qyWechatStaffDefaultRequest);

    @ApiMethod("客户编辑")
    @ApiParams({@ApiParam(name = "editCustomer", notes = "条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户编辑")
    RpcResponse<Boolean> editCustomer(CustomerMagicRequest customerMagicRequest);

    @ApiMethod("客户数据编辑")
    @ApiParams({@ApiParam(name = "editCustomer", notes = "条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户数据编辑")
    RpcResponse<Boolean> editCustomerData(CustomerMagicRequest customerMagicRequest);

    @ApiMethod("客户列表导出")
    @ApiParams({@ApiParam(name = "customerListExport", notes = "条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户列表导出")
    RpcResponse<String> customerListExport(CustomerSearchRequest customerSearchRequest);

    @ApiMethod("首页概览客户导出")
    @ApiParams({@ApiParam(name = "customerViewExport", notes = "条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("首页概览客户导出")
    RpcResponse<String> customerViewExport(CustomerSearchRequest customerSearchRequest);

    @ApiMethod("渠道活码客户列表查询")
    @ApiParams({@ApiParam(name = "request", notes = "客户搜索条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("渠道活码客户列表查询")
    RpcResponse<RpcPagination<CustomerListResponse>> getCodeCustomerByPage(RpcPagination<CodeCustomerSearchRpcRequest> request);

    @ApiMethod("客户分群列表查询")
    @ApiParams({@ApiParam(name = "request", notes = "客户搜索条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户分群列表")
    RpcResponse<RpcPagination<CustomerClusterListResponse>> getCustomerClusterListByPage(RpcPagination<CustomerSearchRequest> pagination);

    @ApiMethod("自定义分群客户列表查询")
    @ApiParams({@ApiParam(name = "request", notes = "客户搜索条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("分群客户列表")
    RpcResponse<RpcPagination<CustomerClusterListResponse>> getCrowdManagementCustomerList(RpcPagination<CustomerSearchRequest> request);

    @ApiMethod("客户分群列表导出")
    @ApiParams({@ApiParam(name = "qyWechatStaffDefaultRequest", notes = "条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户分群列表Excel")
    RpcResponse<String> customerClusterListExport(CustomerSearchRequest convertRequest);

    @ApiMethod("根据标签查询客户列表")
    @ApiParams({@ApiParam(name = "request", notes = "客户搜索条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("根据标签查询客户列表")
    RpcResponse<RpcPagination<CustomerListResponse>> getCustomerPageByTag(RpcPagination<CustomerSearchRequest> pagination);

    @ApiMethod("根据标签查询客户列表导出")
    @ApiParams({@ApiParam(name = "request", notes = "客户搜索条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("根据标签查询客户列表导出")
    RpcResponse<String> customerPageByTagExport(CustomerSearchRequest convertRequest);

    @ApiMethod("查询手机号是否是企微客户")
    @ApiParams({@ApiParam(name = "phone", notes = "手机号", dataType = ApiParam.DataTypeEnum.OBJECT, required = true), @ApiParam(name = "merchantId", notes = "商户号", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("查询手机号是否是企微客户")
    RpcResponse<Boolean> isEntmicroCustomer(String phone, Integer merchantId);

    @ApiMethod("客户备注手机号导入")
    @ApiParams({@ApiParam(name = "request", notes = "客户搜索条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户备注手机号导入")
    RpcResponse<Boolean> CustomerRemarkDataExport(CustomerRemarkRequest customerRemarkRequest);

    @ApiMethod("根据条件删选客户")
    @ApiParams({@ApiParam(name = "searchRequest", notes = "客户删选条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("根据条件删选客户")
    RpcResponse<List<CustomerInfoResponse>> findCustomerByCondition(CustListSearchRequest searchRequest);

    @ApiMethod("根据客户合并id删选客户")
    @ApiParams({@ApiParam(name = "mergeIds", notes = "客户id集合", dataType = ApiParam.DataTypeEnum.OBJECT, required = true),
            @ApiParam(name = "customerName", notes = "客户名称", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户列表")
    RpcResponse<List<CustomerInfoResponse>> findCustomerBymergeIds(List<Integer> mergeIds, String customerName, Integer merchantId);

    @ApiMethod("根据客户id查询跟进员工列表")
    @ApiParams({@ApiParam(name = "mergeId", notes = "客户id", dataType = ApiParam.DataTypeEnum.OBJECT, required = true),
            @ApiParam(name = "merchantId", notes = "授权的商户id", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)}
    )
    @ApiResponse("员工列表")
    RpcResponse<List<EntmicroStaffResponse>> findStaffIdByCustomerIds(Integer mergeId, Integer merchantId);

    @ApiMethod("根据客户id查询跟进员工列表")
    @ApiParams({@ApiParam(name = "mergeId", notes = "客户id", dataType = ApiParam.DataTypeEnum.OBJECT, required = true),
            @ApiParam(name = "merchantId", notes = "授权的商户id", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)}
    )
    @ApiResponse("员工列表")
    RpcResponse<Map<Integer, List<EntmicroStaffResponse>>> findStaffIdByCustomerIdList(List<Integer> mergeIds, Integer merchantId);

    @ApiMethod("查询手机号查询客户信息")
    @ApiParams({@ApiParam(name = "phone", notes = "手机号", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("查询手机号查询客户信息")
    RpcResponse<CustomerInfoResponse> findCustomerByPhone(String phone, Integer merchantId);

    @ApiMethod("根据外部联系人id列表查询客户详情列表")
    @ApiResponse("客户详情")
    @ApiParams({@ApiParam(name = "var1", notes = "外部联系人id列表", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    RpcResponse<List<CustomerResponseDTO>> findCustomersByExternalUserid(List<String> var1);

    @ApiMethod("脚本 - 批量添加客户数据性能测试用")
    @ApiResponse("执行结果")
    @ApiParams({@ApiParam(name = "var1", notes = "商户id列表", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    RpcResponse<Boolean> addBatchMagicCustomerScript(List<Integer> var1);

    @ApiMethod("查询客户信息")
    @ApiResponse("查询客户信息")
    @ApiParams({@ApiParam(name = "json", notes = "查询客户信息", dataType = ApiParam.DataTypeEnum.STRING, required = true)})
    RpcResponse<String> findModel(String json);

    @ApiMethod("新增客户信息")
    @ApiResponse("新增客户信息")
    @ApiParams({@ApiParam(name = "json", notes = "新增客户信息", dataType = ApiParam.DataTypeEnum.STRING, required = true)})
    RpcResponse<Boolean> addModel(String json);

    @ApiMethod("更新客户信息")
    @ApiResponse("更新客户信息")
    @ApiParams({@ApiParam(name = "json", notes = "更新客户信息", dataType = ApiParam.DataTypeEnum.STRING, required = true)})
    RpcResponse<Boolean> updateModel(String json);

    @ApiMethod("根据userId完善客户手机号")
    @ApiResponse("执行结果")
    @ApiParams({@ApiParam(name = "customerSearchRequest", notes = "客户信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    RpcResponse<String> perfectCustomerPhone(List<String> userIdList, String phone, Integer merchantId);

    @ApiMethod("客户合并表和备份表数据比对")
    @ApiResponse("执行结果")
    @ApiParams({@ApiParam(name = "tableName", notes = "备份表表名", dataType = ApiParam.DataTypeEnum.STRING, required = true)})
    RpcResponse<Boolean> customerMergeDataCompare(String tableName);


    @ApiMethod("根据条件查询客户列表")
    @ApiParams({@ApiParam(name = "customerOpenRequest", notes = "客户条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("根据条件查询客户列表")
    RpcResponse<List<CustomerListResponse>> findCustomerByOpenCondition(CustomerOpenRequest customerOpenRequest);


    @ApiMethod("跟进合并客户查询客户详情")
    @ApiParams({@ApiParam(name = "mergeIds", notes = "客户条件", dataType = ApiParam.DataTypeEnum.INTEGER, required = true)})
    @ApiResponse("跟进合并客户查询客户详情")
    RpcResponse<Map<Integer, List<CustomerInfoResponse>>> findCusetomerListByMergeIds(List<Integer> mergeIds, Integer merchantId, Integer staffId);

    @ApiMethod("跟进oneId查询客户id")
    @ApiParams({@ApiParam(name = "oneIds", notes = "客户条件", dataType = ApiParam.DataTypeEnum.INTEGER, required = true)})
    @ApiResponse("跟进oneId查询客户id")
    RpcResponse<Map<String, CustomerInfoResponse>> findCusetomerListByOneIds(List<String> oneIds, Integer merchantId);

    @ApiMethod("通过分群Id查询人群列表详情请求")
    @ApiResponse("人群列表")
    @ApiParams({@ApiParam(name = "groupId", notes = "分群Id", dataType = ApiParam.DataTypeEnum.STRING, required = true)})
    RpcResponse<CrowdGroupDetailRopResponse> queryCrowdListByCrowdGroupId(Integer groupId);

    @ApiMethod("根据员工id列表查询部门名称")
    @ApiResponse("部门名称")
    @ApiParams({@ApiParam(name = "staffIds", notes = "员工Id", dataType = ApiParam.DataTypeEnum.STRING, required = true),
            @ApiParam(name = "merchantId", notes = "授权的商户id", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    RpcResponse<Map<Integer, EntmicroStaffResponse>> getMassDepartmentName(List<Integer> staffIds, Integer merchantId);

    @ApiMethod("通过客户手机号查询oneId")
    @ApiResponse("客户oneId")
    @ApiParams({@ApiParam(name = "dto", notes = "客户手机号", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    RpcResponse<CustomerOneIdDto> queryOneIdByPhoneNumber(SearchCustomerOneIdDto dto);

    @ApiMethod("记录用户是否登录小程序")
    @ApiResponse("记录结果")
    @ApiParams({@ApiParam(name = "unionId", notes = "用户unionId", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    RpcResponse<Boolean> recordIsLoginApplet(Integer merchantId, String unionId);

    @ApiMethod("手机号查询门店已经加微客户")
    @ApiResponse("结果")
    @ApiParams({@ApiParam(name = "merchantId", notes = "商户号", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    RpcResponse<List<CustomerInfoResponse>> findAddEntmicroCustomerByPhones(Integer merchantId, List<String> phoneList);

    @ApiMethod("上报客户意向或者下单")
    @ApiResponse("结果")
    @ApiParams({@ApiParam(name = "reportCustomerRequest", notes = "入参", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    RpcResponse<Boolean> reportCustomerList(ReportCustomerRequest reportCustomerRequest);

    @ApiMethod("根据企微客户userid查询客户信息")
    @ApiResponse("结果")
    RpcResponse<CustomerInfoResponse> findCustomerByUserId(String userId, Integer merchantId);

    @ApiMethod("根据id查询意向和下单客户(客户群)")
    @ApiResponse("查询结果 1.意向客户 2.下单客户 list是客户id集合 ")
    RpcResponse<Map<Integer, List<Integer>>> getCustomerByLabel(List<Integer> customerIds, Integer merchantId);

    @ApiMethod("根据id查询意向和下单客户(客户)")
    @ApiResponse("查询结果 1.意向客户 2.下单客户 list是客户id集合 ")
    RpcResponse<Map<Integer, List<Integer>>> getCustomerByMegerIdLabel(List<Integer> customerIds, Integer merchantId);

    @ApiMethod("客户跟进记录查询")
    @ApiParams({@ApiParam(name = "request", notes = "客户搜索条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户跟进记录列表")
    RpcResponse<List<CustomerRecordResponse>> getCustomerRecords(CustRecordRequest request);

    @ApiMethod("获取用户物业信息")
    @ApiParams({@ApiParam(name = "request", notes = "oneId", dataType = ApiParam.DataTypeEnum.STRING, required = true)})
    @ApiResponse("用户物业信息")
    RpcResponse<CustomerPropertyInfoDTO> getUserPropertyMessageByOneId(String oneId);

    @ApiMethod("更新用户物业信息")
    @ApiParams({@ApiParam(name = "request", notes = "物业信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("更新结果")
    RpcResponse<Boolean> updateUserPropertyMessageByOneId(CustomerPropertyInfoDTO request);

    @ApiMethod("客户画像展示")
    @ApiParams({@ApiParam(name = "request", notes = "请求参数", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("客户画像")
    RpcResponse<CustomerPortraitRpcResponse> viewCustomerPortrait(CustomerPortraitRpcRequest request);

    @ApiMethod("获取客户员工跟进关系")
    @ApiParams({@ApiParam(name = "request", notes = "请求参数", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
    @ApiResponse("是否有跟进关系")
    RpcResponse<Boolean> getStaffFollowCustomer(GetStaffFollowCustomerRequest request);

    @ApiMethod("推送企微客户到sop")
    @ApiResponse("结果")
    RpcResponse<Boolean> sendCustomerToSop(SopCusSendRequest sopCusSendRequest);
}