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.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 {


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

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

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

    /** 远程调用  修改订单的叫车状态 */
    @RequestMapping("/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获取边民组信息 */
    @RequestMapping("/TbGroup/rpc/getRpcById")
    public GroupDto getRpcById(@RequestParam("id") String id);

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

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

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

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

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

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


    /**
     * 远程调用: 根据电话查询外籍商户
     */
    @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);

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

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

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