package com.pj.api.client.level_one_server;

import com.pj.api.FeignInterceptor;
import com.pj.api.consts.FeignConsts;
import com.pj.api.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;

/**
 * @Author Mechrevo
 * @Date 2023 08 01 10 31
 **/
@FeignClient(
        name = FeignConsts.LEVEL_ONE_SERVER, 				// 服务名称
        configuration = FeignInterceptor.class,		// 请求拦截器
        fallbackFactory = LevelOneServerInterfaceFallback.class	// 服务降级
)
public interface LevelOneServerInterface {

    /** 查 - 根据id查orderDto */
    @RequestMapping("/HtTradeSettlement/rpc/getHtTradeSettlementById")
    public TradeSettlementDto getHtTradeSettlementById(@RequestParam("id") Long id);

    /** 远程调用 进口申报单同步 */
    @PostMapping("/TbImportOrder/rpc/importOrderDto")
    public boolean importOrderDto(@RequestBody HtImportOrderDto importOrderDto);

    /** 远程调用: 添加大订单时同时生成小订单 */
    @RequestMapping("/HtTradeSettlement/rpc/tradeSettlementDto")
    public boolean tradeSettlementDto(@RequestBody TradeSettlementDto tradeSettlementDto);

    /** 远程调用: 对合作社信息进行事务处理 */
    @PostMapping("/TbCooperative/rpc/cooperativeDto")
    public boolean cooperativeDto(@RequestBody HtCooperativeDto cooperativeDto);

    /** 商铺信息处理 */
    @PostMapping("/TbShop/rpc/shopDto")
    public boolean shopDto(@RequestBody HtShopDTO shopDto);

    /** 远程调用  修改订单的叫车状态 */
    @PostMapping("/app/TbOrder/rpc/updateOrderCallCarStatus")
    public boolean updateOrderCallCarStatus(@RequestBody OrderDto orderDto);

    /** 根据ID获取一级市场商户信息 */
    @RequestMapping("/app/TbEnterprise/rpc/getEnterpriseById")
    public EnterpriseDto getEnterpriseById(@RequestParam("id")Long enterpriseId);

    /** 根据商户ID和过审商品表ID查询过审商品 */
    @RequestMapping("/app/TbGoodsTransit/rpc/getGoodsTransitById")
    public GoodsTransitDto getGoodsTransitById(@RequestParam("goodsTransitId") Long goodsTransitId,@RequestParam("enterpriseId") Long enterpriseId);

    /** 查 - 根据id查orderDto */
    @RequestMapping("/app/TbOrder/rpc/getOrderDtoById")
    public OrderDto getOrderDtoById(@RequestParam("orderId") Long orderId);

    /** 根据当前天时间和appUserId查询订单记录 */
    @RequestMapping("/app/TbOrder/rpc/selectOrderList")
    public List<OrderDto> selectOrderList(@RequestParam("appUserId") Long appUserId);

    @RequestMapping("/TbPeople/rpc/getPeopleList")
    public List<PeopleDto> getPeopleList(@RequestParam("groupId")Long groupId);

    /** 查 - 根据id */
    @RequestMapping("/TbGoods/rpc/getByGoodsId")
    public GoodsDto getByGoodsId(@RequestParam("goodsId") Long goodsId);

    /** 根据ID获取边民信息 */
    @RequestMapping("/TbPeople/rpc/getRpcById")
    public PeopleDto getRpcById(@RequestParam("id")Long peopleId);

    /** 根据边民ID获取边民开户信息 */
    @PostMapping("/TbPeopleTaxAccount/rpc/getTaxAccountByPeopleId")
    public PeopleTaxAccountDto getTaxAccountByPeopleId(@RequestParam("peopleId") Long peopleId);

    /** 根据ID获取边民组信息 */
    @RequestMapping("/TbGroup/rpc/getRpcById")
    public GroupDto getRpcById(@RequestParam("id") String id);

    /** 添加商家身份信息 */
    @PostMapping("/TbEnterprise/rpc/enterpriseDto")
    public boolean enterpriseDto(@RequestBody EnterpriseDto enterpriseDto);

    /** 添加组长信息 */
    @PostMapping("/TbGroup/rpc/groupDto")
    public boolean groupDto(@RequestBody HtGroupDto groupDto);

    /** 添加普通边民信息 */
    @PostMapping("/TbPeople/rpc/peopleDto")
    public boolean peopleDto(@RequestBody HtPeopleDto peopleDto);

    @PostMapping("/AppUser/rpc/audit")
    public boolean audit(@RequestBody EnterpriseAuditDto dto);

    @RequestMapping("/app/TbCooperative/rpc/getCooperativeById")
    public CooperativeDto getCooperativeById(@RequestParam("id")Long cooperativeId);

    @PostMapping("/app/TbOrder/rpc/updateResaleStatus")
    public boolean updateResaleStatus(@RequestParam("id") Long orderId);

    @PostMapping("/app/TbOrder/rpc/updateBeingOrder")
    public boolean updateBeingOrder(@RequestParam("id") Long levelOneOrderId);

    @RequestMapping("/app/TbGoodsType/rpc/getGoodsIds")
    public List<Long> getGoodsIds(@RequestParam("typeCode") String typeCode);
    /**
     * 远程调用: 根据电话查询外籍商户
     */
    @RequestMapping("/TbEnterprise/rpc/getEnterpriseDtoListByPhone")
    public List<com.pj.api.dto.EnterpriseDto> getEnterpriseDtoListByPhone(@RequestParam("phone") String phone);

    /** 远程调用: 根据电话查询商铺 */
    @RequestMapping("/TbShop/rpc/getShopDtoListByPhone")
    public List<ShopDto> getShopDtoListByPhone(@RequestParam("phone") String phone);

    /** 远程调用: 同步航通海关监管商品信息 */
    @PostMapping("/TbGoods/rpc/goodsDto")
    public boolean goodsDto(@RequestBody HtGoodsDto goodsDto);

    /** 根据航通主键查询appUser */
    @RequestMapping("/TbPeople/rpc/getAppUserByBorderPutrecNo")
    public AppUserDto getAppUserByBorderPutrecNo(@RequestParam("borderPutrecNo") String borderPutrecNo);


    /** 系统接收到航通接口信息：进出口申报单退单 **/
    @PostMapping("/TbOrder/rpc/chargeback")
    public boolean chargeback(@RequestBody HtDeclareChargebackDto htDeclareChargebackDto);

    /** 系统接收到航通接口信息：车辆已出一级市场 ,修改相对应的一级市场订单状态 **/
    @PostMapping("/TbOrder/rpc/orderFinish")
    public boolean orderFinish(@RequestBody HtPassCardDTO htPassCardRecord);


    /** 边民保存银行卡信息 */
    @PostMapping("/app/TbPeople/rpc/saveBankInfo")
    public boolean saveBankByPeople(@RequestParam("id")Long id, @RequestParam("bankName")String bankName, @RequestParam("bankAccount")String bankAccount);

    /** 商户保存银行卡信息 */
    @PostMapping("/app/TbEnterprise/rpc/saveBankInfo")
    public boolean saveBankByEnterprise(@RequestParam("id")Long id, @RequestParam("bankName")String bankName, @RequestParam("bankAccount")String bankAccount);

    /** 合作社保存银行卡信息 */
    @PostMapping("/app/TbCooperative/rpc/saveBankInfo")
    public boolean saveBankByCooperative(@RequestParam("id")Long id, @RequestParam("bankName")String bankName, @RequestParam("bankAccount")String bankAccount);

    /** (一级市场)订单扣款回执 */
    @PostMapping("/app/TbOrder/rpc/confirmOrderFromBank")
    public boolean confirmOrderFromBank(@RequestParam("tradeNo")String tradeNo,@RequestParam("note")String note,@RequestParam("SXB010Status")Integer SXB010Status);

    /** 收到（一级市场-通车批信息）订单打款回执 */
    @PostMapping("/app/TbOrder/rpc/orderFinishFromBank")
    public boolean orderFinishFromBank(@RequestParam("tradeNo")String tradeNo,@RequestParam("SXB023Status")Integer SXB023Status);

    /** 收到银行退款回执 */
    @PostMapping("/app/TbOrder/rpc/chargebackFromBank")
    public boolean chargebackFromBank(@RequestParam("tradeNo")String tradeNo,@RequestParam("SXB023Status")Integer SXB023Status, @RequestParam("note")String note);

    /** 根据边民姓名与身份证号查询边民是否存在 */
    @PostMapping("/app/TbPeople/rpc/getByidCard")
    public boolean getByidCard(@RequestParam("name")String name, @RequestParam("idCard")String idCard);

    /** 边民备案验证查询-银行回复新开户或变更数据 */
    @PostMapping("/app/TbPeople/rpc/updateBySXB005")
    public boolean updateBySXB005(@RequestBody BankInfoDto bankInfoDto);

    /** 根据铺主姓名查询商铺是否存在 */
    @PostMapping("/TbShop/rpc/getByName")
    public boolean getByName(@RequestParam("name")String name);

    /** 商家备案验证查询-银行回复新开户或变更数据 */
    @PostMapping("/TbShop/rpc/updateBySXB009")
    public boolean updateBySXB009(@RequestBody BankInfoDto bankInfoDto);
    @RequestMapping("/TbOrder/rpc/getOrderListByMainIds")
    List<OrderDto> getOrderListByMainIds(@RequestParam("mainIds")String mainIds);
}
