package com.prolog.eis.feign;

import com.prolog.cs.basic.warehouse.model.vo.BaseEisWarehouseLocatorVo;
import com.prolog.eis.core.model.base.area.WhArea;
import com.prolog.eis.core.model.base.area.WhAreaDirection;
import com.prolog.eis.core.model.base.locator.WhLocator;
import com.prolog.framework.common.message.RestMessage;
import org.springframework.cloud.openfeign.FeignClient;
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;

/**
 * @author ：cb
 * @date ：Created in 2022/4/19 13:59
 */
@FeignClient(value = "${prolog.service.warehouse}")
public interface WarehouseFeign {

    // 获取区域表中查询area_no字段
    @PostMapping("/eisStoreAreaDirectionService/storearea")
    RestMessage<List<WhArea>> getStoreArea(@RequestParam("areaNo") String areaNo);

    // 根据区域查询货位
    @PostMapping("/eisLocator/getLocatorByArea")
    RestMessage<List<WhLocator>> getLocatorByArea(@RequestParam("areaNo") String areaNo);

    @PostMapping("/eisLocator/findLocatorByLocationList")
    RestMessage<List<BaseEisWarehouseLocatorVo>> findLocatorByLocationList(@RequestBody List<String> locationList);

    @PostMapping("/eisWhArea/getAreaByAreaNo")
    RestMessage<WhArea> getAreaByAreaNo(@RequestParam(value = "areaNo") String areaNo);

    /**
     * 批量查询区域方向
     * @param areaNos
     * @return
     */
    @PostMapping("/eisStoreAreaDirectionService/area/findStartAreaOrEndArea")
    RestMessage<List<WhAreaDirection>> findStartAreaOrEndArea(@RequestBody List<String> areaNos);

    /**
     * 
     * Description: 获取区域总货位数<br/>
     *
     * @param area
     * @return
     */
    @PostMapping("/eisLocator/findTotalCountByAreaNo")
    RestMessage<Map<String, Integer>> findTotalCountByAreaNo(@RequestParam("area") String area);

    @PostMapping("/eisLocator/getLocatorByLocation")
    RestMessage<List<WhLocator>> getLocatorByLocation(List<String> list);

}
