package org.nl.acs.ext.wms.service;

import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.nl.acs.ext.wms.data.*;

public interface AcsToWmsService {

    /**
     * ACS向WMS申请任务
     */
    String applyTaskToWms(JSONObject jo);

    /**
     * 向WMS反馈任务状态
     *
     * @return Map<String, Object>
     */
    public HttpResponse feedbackTaskStatusToWms(JSONArray arr);


    public String requestTaskAgain(String address, String task_id, String vehicle_code);

    /**
     * 反馈AGV设备状态
     *
     * @param device_code
     * @param error
     * @param error_message
     * @return
     */
    HttpResponse feedbackAgvStatus(String device_code, String error, String error_message);

    /**
     * 反馈AGV设备状态
     *
     * @param device_code
     * @return
     */
    HttpResponse feedbackDeviceStatus(String device_code, String state);

    /**
     * 反馈AGV设备信息
     *
     * @param from
     * @return
     */
    HttpResponse feedbackAgv(JSONArray from);

    /**
     * 请求开门或关门
     *
     * @param device_code
     * @param status
     * @return
     */
    HttpResponse applyOpenOrCloseDoor(String device_code, String status);

    /**
     * 查询自动门状态
     *
     * @param
     * @returna
     */
    HttpResponse queryDoorsStatus();


    /**
     * 反馈工单状态
     *
     * @param param
     * @return
     */
    HttpResponse feedbackOrderStatus(JSONObject param);

    /**
     * ACS申请缓存线入库任务
     *
     * @param param
     * @return
     */
    HttpResponse applyInCacheLineTask(JSONObject param);

    /**
     * ACS系统申请出库任务
     *
     * @param param
     * @return
     */
    HttpResponse applyOutCacheLineTask(JSONObject param);

    /**
     * 申请捆扎、贴标
     *
     * @param param
     * @return
     */
    ApplyLabelingAndBindingResponse applyLabelingAndBindingRequest(ApplyLabelingAndBindingRequest param);

    LiKuApplyTakResponse liKuApplyTaskRequest(LiKuApplyTaskRequest liKuApplyTaskRequest);

    UpdateLKTaskResponse updateLKTaskRequest(UpdateLKTaskRequest updateLKTaskRequest);

    // 向lms反馈AGV信息
    HttpResponse shipDeviceUpdate(JSONObject param);



    // 向lms反馈AGV信息
    HttpResponse shipAgvUpdate(JSONArray param);

    /**
     * 反馈所有小车AGV信息
     *
     * @param from
     * @return
     */
    HttpResponse feedAgvTaskStatus(JSONArray from);


    /**
     * ACS向WMS反馈任务状态
     */
    String feedTaskStatus(BaseRequest request);



    /**
     * 反馈AGV取放货信息
     *
     * @param from
     * @return
     */
    JSONObject feedAgvTaskAction(JSONArray from);


    /**
     * 反馈AGV故障信息
     *
     * @param from
     * @return
     */
    HttpResponse feedAgvErrorStatus(JSONArray from);


    /**
     * ACS向WMS申请任务
     */
    String applyTask(BaseRequest request);


    /**
     * ACS向WMS反馈点位状态
     */
    String notify(BaseRequest request);

    /**
     * 任务阶段反馈最新点位
     */
    String feedbackState(BaseRequest request);

}
