package com.prolog.cs.base.gsp.resource;

import com.prolog.framework.bz.core.collection.ValidList;
import com.prolog.framework.common.message.RestMessage;
import com.prolog.upcloud.base.inventory.model.WmsInvStockLot;
import com.prolog.upcloud.base.inventory.vo.*;
import com.prolog.upcloud.base.strategy.dto.stock.StockLocatorDTO;
import io.swagger.annotations.ApiOperation;
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 java.util.List;

@FeignClient(value = "${prolog.service.inventory}")
public interface InventoryClient {

	/**
	 * 报废
	 *
	 * @param invStock 报废信息
	 * @return 执行结果
	 */
	@PostMapping("/stock/v1/scarp")
	RestMessage scrapStock(@RequestBody List<InvStockScarp> invStock);
	
	//报废取消
	@PostMapping("/stock/v1/scarp/cancel")
    RestMessage scrapCancel(@RequestBody InvStockCancel stockCancel);

	/**
	 * 报废确认
	 *
	 * @param check 报废单编码
	 * @return 执行结果
	 */
	@PostMapping("/stock/v1/scarp/check")
	@ApiOperation(value = "报废确认")
    RestMessage scrapStockCheck(@RequestBody InvStockCheck check);
	/**
	 * 养护
	 *
	 * @param invStock 养护信息
	 * @return 执行结果
	 */
	@PostMapping("/stock/v1/maintain")
	@ApiOperation(value = "养护")
	public RestMessage maintainStock( @RequestBody ValidList<InvStockMaintain> invStock);

	@PostMapping("/stock/v1/maintain/cancel")
	@ApiOperation(value = "养护取消")
	public RestMessage maintainCancel(@RequestBody InvStockCancel stockCancel);

	//查询商品库存批次基础信息列表
	@GetMapping("/batch-number/v1/basic/list")
	public RestMessage<List<BatchNumberListVO>> getBatchNumberBasicInfo(@RequestParam("batchIds") String[] batchIds);
	
	//获取多个商品批次库存
	@PostMapping("/stock/v1/qty/avl-list")
	public RestMessage<List<WmsInvStockQtyVO>> getAvailableQuantityList(@RequestBody List<WmsInvStockQtyQueryVO> qtyQueries);

	@GetMapping("/stock-lot/v1/locators")
	public RestMessage<List<StockLocatorDTO>> getItemLocators(@RequestParam("warehouseId") String warehouseId,
															  @RequestParam("cargoOwnerId") String cargoOwnerId,
															  @RequestParam("itemId") String itemId,
															  @RequestParam(value = "status", required = false, defaultValue = "1") String status,
															  @RequestParam(value = "subStatus", required = false, defaultValue = "1") String subStatus);

	@PostMapping("/integration/v1/ask")
	public RestMessage<?> askIntegration(@RequestBody AskIntegrationVo vo);

	@PostMapping("stock/v1/updateLotStatus")
	public RestMessage updateLotStatus(@RequestBody WmsInvStockLot wmsInvStockLot);
}
