package com.sxyz.rfid.presenter.service;

import com.sxyz.rfid.presenter.model.ApkModel;
import com.sxyz.rfid.presenter.model.DictModel;
import com.sxyz.rfid.presenter.model.LoginModel;
import com.sxyz.rfid.presenter.model.OperatorBean;
import com.sxyz.rfid.presenter.model.OutBoundDetailModel;
import com.sxyz.rfid.presenter.model.OutboundFlowingWaterModel;
import com.sxyz.rfid.presenter.model.OutboundFridModel;
import com.sxyz.rfid.presenter.model.OutboundModel;
import com.sxyz.rfid.presenter.model.ReviewDetailListModel;
import com.sxyz.rfid.presenter.model.ReviewDetailModel;
import com.sxyz.rfid.presenter.model.ReviewModel;
import com.sxyz.rfid.presenter.model.ReviewResultModel;
import com.sxyz.rfid.presenter.model.ReviewRfidTaskCheckModel;
import com.sxyz.rfid.presenter.model.ReviewTaskCheck;
import com.sxyz.rfid.presenter.model.ReviewTaskDetailList;
import com.sxyz.rfid.presenter.model.UserInfoModel;
import com.sxyz.rfid.ui.login.bean.UserBean;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface ApiService {

    //版本更新
    @GET("law/version/1")
    Observable<ApkModel> getApk();

    //登录
    @POST("login")
    Observable<LoginModel> getLogin(@Body UserBean userBean);

    //登录
    @GET("getInfo")
    Observable<UserInfoModel> getUserInfo();

    //字典列表
    @GET("system/dict/data/list")
    Observable<DictModel> getDict(@Query("pageSize") int pageSize, @Query("pageNum") int pageNum, @Query("dictType") String dictType);
    //------------------------------------------ 出库 start ------------------------------------------

    //出库列表http://192.168.19.22:8851/dev-api/ware/wmsOutboundOrder/cancelItem/1
    @GET("ware/wmsOutboundOrder/list")
    Observable<OutboundModel> getOutboundList(@Query("pageSize") int pageSize, @Query("pageNum") int pageNum, @Query("orderNo") String orderNo);

    //出库单明细
    @GET("ware/wmsOutboundOrderItem/list")
    Observable<OutBoundDetailModel> getOutboundDetailList(@Query("pageSize") int pageSize, @Query("pageNum") int pageNum, @Query("orderId") int orderId);

    //出库流水
    @GET("ware/wmsOutboundItemInventory/list")
    Observable<OutboundFlowingWaterModel> getOutboundFlowList(@Query("pageSize") int pageSize, @Query("pageNum") int pageNum, @Query("itemId") int itemId);

    //出库明细-撤销操作
    @POST("http://192.168.19.22:8851/dev-api/ware/wmsOutboundOrder/cancelItem/{itemId}")
    Observable<Object> getCancelOutboundOrderCancelItem(@Path("itemId") int itemId, @Body OperatorBean operatorId);

    //出库流水-撤销操作
    @POST("ware/wmsOutboundOrder/cancelOutboundRelations/{relationId}")
    Observable<Object> getCancelOutboundRelations(@Path("relationId") int relationId, @Body OperatorBean operatorId);

    //出库流水-撤销操作
    @GET("ware/wmsInventory/list")
    Observable<OutboundFridModel> getOutboundFridList(@Query("rfidTag") String rfidTag);

    //出库
    @POST("ware/wmsOutboundOrder/rfidPicking")
    Observable<Object> doOutBoundFrid(@Body OperatorBean operatorBean);
    //------------------------------------------ 出库 end ------------------------------------------

    //------------------------------------------ 盘点 start ------------------------------------------

    //盘点列表 http://192.168.19.214:8851/dev-api/ware/wmsInventoryTask/list?pageNum=1&pageSize=10&taskNo=PLAN-807049194DA2
    @GET("ware/wmsInventoryTask/list")
    Observable<ReviewModel> getReviewList(@Query("pageSize") int pageSize, @Query("pageNum") int pageNum, @Query("taskNo") String taskNo);

    //删除盘点任务 http://192.168.19.214:8851/dev-api/ware/wmsInventoryTask/3
    @DELETE("ware/wmsInventoryTask/{taskIds}")
    Observable<Object> deleteReviewTask(@Path("taskIds") int taskIds);

    //盘点详情 http://192.168.19.214:8851/dev-api/ware/wmsInventoryTask/2
    @GET("ware/wmsInventoryTask/{taskIds}")
    Observable<ReviewDetailModel> getReviewDetail(@Path("taskIds") int taskIds);

    //盘点详情列表 - 盘点任务明细信息 http://192.168.19.214:8851/dev-api/ware/wmsInventoryTaskDetail/list?pageNum=1&pageSize=1000&taskId=2
    @GET("ware/wmsInventoryTaskDetail/list")
    Observable<ReviewDetailListModel> getReviewDetailList(@Query("pageSize") int pageSize, @Query("pageNum") int pageNum, @Query("taskId") int taskId);

    //盘点结果 http://192.168.19.214:8851/dev-api/ware/wmsInventoryResult/list?taskId=2
    @GET("ware/wmsInventoryResult/list")
    Observable<ReviewResultModel> getReviewResult(@Query("taskId") int taskId);

    //执行盘点 - 二维码执行盘点 http://192.168.19.214:8851/dev-api/ware/inventoryCheck/checkToBatchNo
    //{taskId: 4, checkerId: 1, checkerName: "若依", batchNoList: ["BATCH2026010414284490650026"]}
    @POST("ware/inventoryCheck/checkToBatchNo")
    Observable<ReviewRfidTaskCheckModel> doReviewScanTaskCheck(@Body ReviewTaskCheck reviewTaskCheck);

    //执行盘点 - RFID执行盘点 http://192.168.19.214:8851/dev-api/ware/inventoryCheck/check
    @POST("ware/inventoryCheck/check")
    Observable<ReviewRfidTaskCheckModel> doReviewRfidTaskCheck(@Body ReviewTaskCheck reviewTaskCheck);

    //结束盘点 http://192.168.19.214:8851/dev-api/ware/wmsInventoryTask/stop/2
    @POST("ware/inventoryCheck/complete/{taskId}")
    Observable<Object> doStopReviewTask(@Path("taskId") int taskId);

    //------------------------------------------ 盘点 end------------------------------------------

}
