package com.steerinfo.dil.feign;

import com.steerinfo.framework.controller.RESTfulResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.*;

@FeignClient(value = "DAL-OTMS-API-DEV", url = "${openfeign.OTMSFeign.url}")
public interface OtmsFeign {
    //在途订单列表
    @PostMapping("/api/v1/otms/pathDisplay/getInTransitTransportation")
    public RESTfulResult getInTransitTransportation(@RequestBody Map<String,Object> mapValue,
                                                    @RequestParam(required = true,defaultValue = "468",name = "apiId")Integer apiId,
                                                    @RequestParam(required = false,name = "pageNum")Integer pageNum,
                                                    @RequestParam(required = false,name = "pageSize")Integer pageSize);

    //在途订单列表
    @PostMapping("/api/v1/otms/pathDisplay/transportationPerformance")
    public RESTfulResult transportationPerformance(@RequestBody Map<String,Object> mapValue,
                                                    @RequestParam(required = true,defaultValue = "468",name = "apiId")Integer apiId,
                                                    @RequestParam(required = false,name = "pageNum")Integer pageNum,
                                                    @RequestParam(required = false,name = "pageSize")Integer pageSize);
    //已完成订单列表
    @PostMapping("/api/v1/otms/pathDisplay/getFinishTruckOrderInfo")
    public RESTfulResult getFinishTruckOrderInfo(@RequestBody Map<String,Object> mapValue,
                                                 @RequestParam(required = true,defaultValue = "468",name = "apiId")Integer apiId,
                                                 @RequestParam(required = false,defaultValue = "1",name = "pageNum")Integer pageNum,
                                                 @RequestParam(required = false,defaultValue = "20",name = "pageSize")Integer pageSize
    );
    //有异常订单列表
    @PostMapping("/api/v1/otms/pathDisplay/getHaveAbnormalTruckOrderInfo")
    public RESTfulResult getHaveAbnormalTruckOrderInfo(@RequestBody Map<String,Object> mapValue,
                                                       @RequestParam(required = true,defaultValue = "468",name = "apiId")Integer apiId,
                                                       @RequestParam(required = false,name = "pageNum")Integer pageNum,
                                                       @RequestParam(required = false,name = "pageSize")Integer pageSize);
    //车牌号和时间查询路径
    @PostMapping("/api/v1/otms/pathDisplay/fullPathVisualizationByCarNumber")
    public Object fullPathVisualizationByCarNumber(@RequestBody HashMap mapValue);

    //改变当前报警类型
    @PostMapping(value = "/api/v1/otms/pathDisplay/inTransitWarn")
    public RESTfulResult inTransitWarn(@RequestParam String warnSwitch,@RequestParam String radio);


    //查询当前报警类型
    @PostMapping(value = "/api/v1/otms/pathDisplay/selectWarnSwitch")
    public RESTfulResult selectWarnSwitch();

    //通过运输订单号查询全路径
    @PostMapping("/api/v1/otms/pathDisplay/fullPath")
    public Object fullPath(@RequestParam("orderNumber") String orderNumber) throws Exception;

    //获得抵达列表
//    @PostMapping("/api/v1/otms/tmstruckarrivalresults/getArrivalResultInfo")
//    Map<String, Object> getArrivalResultInfo(@RequestBody(required = false) Map<String, Object> mapValue,
//                                         @RequestParam Integer apiId,
//                                         @RequestParam Integer pageNum,
//                                         @RequestParam Integer pageSize,
//                                         @RequestParam String con,
//                                         @RequestParam String startTime,
//                                         @RequestParam String endTime
//    );

    //通过运输订单号获得抵达图片
    @PostMapping("/api/v1/otms/tmstruckreceiptresults/getArrivalPhoto")
    String getReceiptPhoto(@RequestParam String orderNumber);

    //获取收货作业照片
    @PostMapping("/api/v1/otms/tmstruckreceiptresults/getReceivingPhotoByUrl")
    public String getReceivingPhotoByUrl(@RequestParam String orderNumber);

    //获得抵达实集
    @PostMapping(value = "/api/v1/otms/tmstruckarrivalresults/addtmstruckArrivalResult")
    public RESTfulResult addtmstruckArrivalResult(@RequestParam("orderNumber")String orderNumber, @RequestParam("resultArrivalAddress")String resultArrivalAddress,@RequestParam("file") String file);

    //添加签收图片
    @PostMapping(value = "/api/v1/otms/pathDisplay/addTmstruckReceiptResult")
    public  RESTfulResult addTmstruckReceiptResult(@RequestBody Map<String,Object>  mapValaue  , @RequestParam("num") Integer num, @RequestParam("orderNumber")  String orderNumber, @RequestParam("resultArrivalAddress")String resultArrivalAddress, @RequestParam("imgcount3") Integer imgcount3, @RequestParam("imgcount4")Integer imgcount4);

    //获得异常信息
    @PostMapping("/api/v1/otms/pathDisplay/getTransportAbnormalInfo")
    public RESTfulResult getTransportAbnormalInfo(@RequestBody(required=false) Map<String,Object> mapValue,
                                                  @RequestParam(name = "apiId",defaultValue = "472") Integer apiId,
                                                  @RequestParam(name = "pageNum") Integer pageNum,
                                                  @RequestParam(name = "pageSize") Integer pageSize);

    //抵达信息列表
    @PostMapping("/api/v1/otms/tmstruckreceiptresults/getArrivalResult")
    Map<String, Object> getArrivalResult(@RequestBody(required = false) Map<String, Object> mapValue,
                                         @RequestParam Integer apiId,
                                         @RequestParam Integer pageNum,
                                         @RequestParam Integer pageSize,
                                         @RequestParam String con,
                                         @RequestParam String startTime,
                                         @RequestParam String endTime);

    //获得抵达图片
    @PostMapping("/api/v1/otms/tmstruckreceiptresults/getArrivalPhoto")
    String getArrivalPhoto(@RequestParam String orderNumber);

    //获得签收实绩
    @PostMapping("/api/v1/otms/pathDisplay/getReceiptResult")
    Map<String, Object> getReceiptResult(@RequestBody(required = false) Map<String, Object> mapValue,
                                         @RequestParam Integer apiId,
                                         @RequestParam Integer pageNum,
                                         @RequestParam Integer pageSize,
                                         @RequestParam String con,
                                         @RequestParam String startTime,
                                         @RequestParam String endTime
    );
    @GetMapping("/api/v1/otms/pathDisplay/getCurrentLocation")
    public RESTfulResult getCurrentLocation(@RequestParam("capcityNumber") String capcityNumber) throws Exception;

    //获取地图顶点
    @GetMapping(value = "/api/v1/otms/mapvertexs/findAllAvailableVertex")
    public RESTfulResult findAllAvailableVertex();

    //获取最佳路径
    @GetMapping(value = "/api/v1/otms/mapvertexs/getObtainTheOptimalPath")
    public RESTfulResult getObtainTheOptimalPath(@RequestParam("startPoint") String startPoint,@RequestParam("endPoint")  String endPoint) throws Exception;

    //获取当前订单导航路径
    @GetMapping(value = "/api/v1/otms/mapvertexs/getPathByOrderID")
    public RESTfulResult getPathByOrderID(@RequestParam("orderId") String orderId,@RequestParam("startStep")  String startStep,@RequestParam("endStep")  String endStep) throws Exception;

    //获取导航可选地点
    @GetMapping(value = "/api/v1/otms/mapvertexs/findSelections")
    public RESTfulResult findSelections();

    @PostMapping("/api/v1/otms/pathDisplay/offLineWarn")
    public String offLineWarn(@RequestParam(value = "data") String data) throws Exception;

    @PostMapping("/api/v1/otms/pathDisplay/parkWarn")
    public String parkWarn(@RequestParam(value = "data",required = false) String data) throws Exception;

    @PostMapping("/api/v1/otms/pathDisplay/abnormalLineWarn")
    public String abnormalLineWarn(@RequestParam(value = "data") String data) throws Exception;

    //查询地址经纬度
    @GetMapping("/api/v1/otms/pathDisplay/getLocationForAddress")
    public RESTfulResult getLocationForAddress(@RequestParam("address") String address);

    /**
     * @author:zyf
     * @version:1.0
     * @Date:2022-10-19
     * @Description:逆地址解析
     */
    @PostMapping("/api/v1/otms/Test/getAddress")
    public RESTfulResult getAddress(@RequestBody Map<String,Object> map);

}