package com.prolog.cs.biz.inbound.remote;

import com.prolog.cs.basic.item.model.BaseMtlItemMst;
import com.prolog.cs.basic.item.model.BaseMtlItemUomConversions;
import com.prolog.cs.basic.item.model.vo.ItemBaseInfoVO;
import com.prolog.cs.basic.item.model.vo.ItemMstQueryVO;
import com.prolog.cs.basic.item.model.vo.ItemMstVO;
import com.prolog.cs.basic.item.model.vo.ItemMstVO2;
import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.core.pojo.Page;
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;
import java.util.Map;
import java.util.Set;

@FeignClient(value = "${prolog.service.item}")
public interface BaseItemRemoteCaller {

	@PostMapping("/item/listbyids")
	public RestMessage<List<BaseMtlItemMst>> getListByIds(@RequestBody Set<String> itmeIds);

	@PostMapping("/item/getUomConversionsByItemIds")
	public RestMessage<Map<String, List<BaseMtlItemUomConversions>>> getUomConversionsByItemIds(@RequestParam(value = "itemIds") String itemIds);

	@PostMapping("/item/page")
	public RestMessage<Page<ItemMstVO>> getPage(@RequestBody ItemMstQueryVO vo);

	@PostMapping("/item/pagebyRelated")
	public RestMessage<Page<ItemMstVO2>> pagebyRelated(@RequestBody ItemMstQueryVO vo);

	/**
	 * 商品证照效期
	 */
//	@ApiOperation(value = "商品证照效期校验(全量)")
	@GetMapping("/item/vaildateCertificate")
	public RestMessage<Object> vaildateCertificate(@RequestParam("itemId") String itemId,
			@RequestParam("enterpriseId") String enterpriseId);

	/**
	 * 商品证照效期All(批量)
	 */
//	@ApiOperation(value = "批量商品证照效期校验(全量)")
//	@ApiImplicitParam(value = "数据示例: {'queryMap':[{'itemId':'商品id','refId':'关联id','flag':true/false,'message':''},{}]};响应也是这个")
	@PostMapping("/item/batchVaildateCertificate")
	public RestMessage<Object> batchVaildateCertificate(@RequestBody Map<String, Object> queryMap);

	/**
	 * 校验商品长宽高(为33也需要校验)
	 */
//	@ApiOperation(value = "商品长宽高校验(所有的包装)")
//	@ApiImplicitParam(value = "数据示例: {'queryMap':[{'itemId':'商品id','refId':'关联id','flag':true/false,'message':''},{}]};响应也是这个")
	@PostMapping("/item/vaildateVolInfo")
	public RestMessage<Object> vaildateVolInfo(@RequestBody Map<String, Object> queryMap);

	/**
	 * 校验商品大类是否维护
	 */
//	@ApiOperation(value = "商品大类校验")
//	@ApiImplicitParam(value = "数据示例: {'queryMap':[{'itemId':'商品id','refId':'关联id','flag':true/false,'message':''},{}]};响应也是这个")
	@PostMapping("/item/vaildateCategory")
	public RestMessage<Object> vaildateCategory(@RequestBody Map<String, Object> queryMap);

	/**
	 * 校验商品是否召回,停售(采购/采退;销售/销退)
	 */
//	@ApiOperation(value = "校验商品采销属性(是否召回,停售(采购/采退;销售/销退))")
//	@ApiImplicitParam(value = "数据示例: {'type':'in/out','queryMap':[{'itemId':'商品id','refId':'关联id','flag':true/false,'message':''},{}]};响应也是这个")
	@PostMapping("/item/vaildatePurchaseAndSales")
	public RestMessage<Object> vaildatePurchaseAndSales(@RequestBody Map<String, Object> queryMap);

	@GetMapping("/item/base/list")
	public RestMessage<List<ItemBaseInfoVO>> getItemBaseList(@RequestParam("itemIds") String[] itemIds);

	@PostMapping("/item/getByItemCodes")
	RestMessage<List<BaseMtlItemMst>> getByItemCodes(@RequestParam("cargoOwnerId") String cargoOwnerId ,@RequestParam("itemCodes") Set<String> itemCode);

	@PostMapping("item/getByItemCodesE")
	public RestMessage<List<BaseMtlItemMst>> getByItemCodesE(@RequestParam("cargoOwnerId") String cargoOwnerId ,@RequestParam("itemCodes") Set<String> itemCode,@RequestParam("enterpriseId") String enterpriseId);
}
