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

import com.prolog.cs.basic.warehouse.model.BaseWmsWarehouseArea;
import com.prolog.cs.basic.warehouse.model.BaseWmsWarehouseMst;
import com.prolog.cs.basic.warehouse.model.dto.WmsWhBldgDTO;
import com.prolog.cs.basic.warehouse.model.vo.WarehouseLocatorBasicInfo;
import com.prolog.framework.common.message.RestMessage;
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.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

@FeignClient(value = "${prolog.service.warehouse}")
public interface WarehouseClient {

    /**
     * 批量查询仓库信息
     *
     * @return 仓库信息
     */
    @GetMapping("/warehouse")
    RestMessage<BaseWmsWarehouseMst> warehouse(@RequestParam("id") String id);

    /**
     * 批量查询仓库信息
     *
     * @return 仓库信息
     */
    @PostMapping("/warehouse/mapbyids")
    RestMessage<Map<String, BaseWmsWarehouseMst>> mapbyids(@RequestBody Set<String> warehouseIds);

    /**
     * 查询建筑物信息
     *
     * @return 建筑物信息
     */
    @GetMapping("/wmsWhBldg/findByPkId")
    RestMessage<WmsWhBldgDTO> findBldgByPkId(@RequestParam("pkId") String pkId);

    /**
     * 批量查询建筑物基础信息
     */
    @GetMapping("/wmsWhBldg/basic/list")
    RestMessage<List<WmsWhBldgDTO>> getBldgBasicInfoList(String[] bldgIds);

    /**
     * 批量查询库位基础信息
     *
     * @param locatorIds 库位编码集合
     * @return 库位基础信息
     */
    @GetMapping("/locator/basic/list")
    RestMessage<List<WarehouseLocatorBasicInfo>> getLocationBasicInfos(@RequestParam("locatorIds") String[] locatorIds);

    /**
     * 批量查询库位详细信息
     *
     * @param locatorIds 库位编码集合
     * @return 库位详细信息
     */
    @GetMapping("/locator/detail/list")
    RestMessage<List<HashMap<String, Object>>> getLocationDetailInfos(@RequestParam("locatorIds") String[] locatorIds);

    @PostMapping("/warehouse/getByWarehouseCode")
    RestMessage<Map<String, BaseWmsWarehouseMst>> getByWarehouseCode(Set<String> warehouseCode);


    @GetMapping("/baseWmsWarehouseArea/basic/list")
    RestMessage<List<BaseWmsWarehouseArea>> getWarehouseAreaBasicInfos(@RequestParam("warehouseAreaIds") String[] warehouseAreaIds);
}
