package com.prolog.cs.biz.outbound.resource;

import com.prolog.cs.basic.item.model.BaseMtlItemMst;
import com.prolog.cs.basic.item.model.BaseMtlItemUomConversions;
import com.prolog.cs.basic.item.model.vo.ItemBarCodeVO;
import com.prolog.cs.basic.item.model.vo.ItemMstQueryVO;
import com.prolog.cs.basic.item.model.vo.ItemMstVO2;
import com.prolog.cs.basic.item.model.vo.WaveItemInfoVO;
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;

/**
 * Created by Administrator on 2021-04-21.
 */
@FeignClient(value = "${prolog.service.item}")
public interface ItemClient {
    @PostMapping( "/item/wave/listbyids")
    RestMessage<List<WaveItemInfoVO>> getWaveItemInfo(@RequestBody List<String> ids);

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

    @GetMapping( "/item/outbound/barcode")
    RestMessage<ItemBarCodeVO> getItemByBarCode(@RequestParam("barCode") String barCode,@RequestParam("itemId") String itemId);

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

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

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

}
