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

import com.prolog.cs.basic.warehouse.model.BaseWmsWarehouseLocator;
import com.prolog.cs.biz.control.model.RelationWorkgroup;
import com.prolog.cs.biz.control.model.vo.LocatorQueryVO;
import com.prolog.cs.biz.outbound.model.vo.WorkgroupVO;
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;

@FeignClient(value = "${prolog.service.control}")
public interface ControlResource {

    /**
     * 获取员工作业库区编码集合
     * @param workercode
     * @param warehouseId
     * @param businesstype
     * @param worktype
     * @return
     */
    @GetMapping("/workgroup/areacodes")
	RestMessage<List<String>> getWorkareaList(@RequestParam(value = "workercode")String workercode,@RequestParam(value = "warehouseId")String warehouseId,@RequestParam(value = "businesstype")String businesstype,@RequestParam(value = "worktype") String worktype,@RequestParam(value = "workpassword") String workpassword);

    @PostMapping("/checkWorkGroup/verify-permission")
    RestMessage<Boolean> checkerAuthorityCheck(@RequestBody WorkgroupVO workgroupVO);

    @GetMapping("/workgroup/worktype")
    RestMessage<String> getWorkType(@RequestParam(value = "workercode")String workercode, @RequestParam(value = "warehouseId")String warehouseId, @RequestParam(value = "businesstype")String businesstype);

    /**
     * 获取员工编码集合
     * @param workarea
     * @param businesstype
     * @param type
     * @param enterpriseId
     * @param warehouseId
     * @return
     */
    @GetMapping("/workgroup/operators")
    RestMessage<List<String>> getOperatorList(@RequestParam(value = "workarea")String workarea,@RequestParam(value = "businesstype")String businesstype,@RequestParam(value = "type") String type,@RequestParam(value = "enterpriseId") String enterpriseId,@RequestParam(value = "warehouseId")String warehouseId);

    @GetMapping("/checkWorkGroup/page")
    RestMessage<Page<RelationWorkgroup>> getPage(@RequestParam(value = "warehouseId")String warehouseId, @RequestParam(value = "workarea")String workarea, @RequestParam(value = "params")String params, @RequestParam(value = "businesstype")String businesstype, @RequestParam(value = "pageSize")Integer pageSize, @RequestParam(value = "pageNum")Integer pageNum);

    @GetMapping("/item-locator/v1/getRecommendLocatoror")
    public RestMessage<Map<String, BaseWmsWarehouseLocator>> getRecommendLocatoror(
            @RequestBody List<Map<String,Object>> queryVO);

    /**
     * 根据条件查询货位限定列表
     *
     * @param warehouseId 仓库id
     * @return 货位限定列表
     */
    @GetMapping("/item-locator/v1/locator-all-limit")
    RestMessage<Map<String, String>> getItemArrayStLocatorList(@RequestParam("itemIds") String[] itemIds,
                                                               @RequestParam("cargoOwnerId") String cargoOwnerId,
                                                               @RequestParam("warehouseId") String warehouseId,
                                                               @RequestParam("warehouseAreaCategory") String warehouseAreaCategory,
                                                               @RequestParam("areaIds") String[] areaIds,
                                                               @RequestParam("locatorTypes") String[] locatorTypes,
                                                               @RequestParam("enterpriseId") String enterpriseId);
}
