package com.sw.common.accessory.api.feignCilent;


import com.sw.common.accessory.api.model.WarehouseInputBillBo;
import com.sw.common.accessory.api.model.WarehouseOutputBillBo;
import com.sw.common.accessory.api.fallBackFactory.StoreFeignClientsFallback;
import com.sw.common.accessory.config.FeignConfig;
import com.sw.common.accessory.server.dto.WarehouseMaterialDto;
import com.sw.common.accessory.server.dto.WarehouseModelDto;
import com.sw.common.accessory.server.dto.WarehouseOutputRecordBillDetailDto;
import com.sw.common.core.response.Result;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;

/**
 * @Author: JS111816
 * @Description:
 * @Date: 2022/8/8
 * @Modified By:
 **/
@FeignClient(value = "mes-store-server", configuration = {FeignConfig.class}, fallbackFactory = StoreFeignClientsFallback.class)
public interface StoreFeignClients {

    /**
     * @return 入库单号
     * @Author wupeng
     * @Description 入库申请接口
     * @Date 16:29 2023/12/29
     * @Param
     **/
    @ApiOperation(value = "入库申请")
    @PostMapping(value = "/warehouse/supplier/inputApply", headers = "token=token_admin")
    Result<String> inputApply(@RequestBody @Valid @ApiParam(value = "入库单对象") WarehouseInputBillBo inputBillBo);

    /**
     * @return 出库单号
     * @Author wupeng
     * @Description 出库申请接口
     * @Date 16:29 2023/12/29
     * @Param
     **/
    @ApiOperation(value = "出库申请")
    @PostMapping(value = "/warehouse/supplier/outputApply", headers = "token=token_admin")
    Result<String> outputApply(@RequestBody @Valid @ApiParam(value = "出库单对象") WarehouseOutputBillBo outputBillBo);

    /**
     * 取消入库申请
     **/
    @ApiOperation(value = "取消入库申请")
    @PostMapping(value = "/warehouse/supplier/cancelInputApply", headers = "token=token_admin")
    Result cancelInputApply(@RequestParam("billNo") @ApiParam(value = "入库单号") String billNo);

    /**
     * 取消入库申请接口
     **/
    @ApiOperation(value = "取消出库申请")
    @PostMapping(value = "/warehouse/supplier/cancelOutputApply", headers = "token=token_admin")
    Result cancelOutputApply(@RequestParam("billNo") @ApiParam(value = "出库单号") String billNo);

    @ApiOperation(value = "根据物料Code查询线边仓物料信息")
    @GetMapping("/warehouse/material/getByMaterialCode")
    Result<WarehouseMaterialDto> getByStoreMaterialCode(@ApiParam(value = "物料编码", type = "query") @RequestParam String materialCode);

    @ApiOperation(value = "通过物料编码查询出库记录")
    @GetMapping("/warehouse/outputRecordBillDetail/getOutputBillByMaterialCode")
    public Result<WarehouseOutputRecordBillDetailDto> getOutputBillByMaterialCode(@RequestParam String materialCode);

    @ApiOperation(value = "通过唯一码查询出库记录")
    @GetMapping("/warehouse/outputRecordBillDetail/getOutputBillByUniqueCode")
    public Result<WarehouseOutputRecordBillDetailDto> getOutputBillByUniqueCode(@RequestParam String uniqueCode);
    @ApiOperation(value = "线边仓模型详细信息")
    @GetMapping("/warehouse/model/getCode")
    public Result<WarehouseModelDto> getCode(@RequestParam @ApiParam(value = "线边仓模型code") String code);
}
