package com.sunda.spmswms.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sunda.spmscommon.ResponseResult;
import com.sunda.spmswms.entity.InventoryCheckAction;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 仓库盘盈盘亏 服务类
 * </p>
 *
 * @author Wayne
 * @since 2021-05-10
 */
public interface IInventoryCheckActionService extends IService<InventoryCheckAction> {

    /** 获取库存盘点盘盈盘亏列表
    *{
          "werks":["CN01","CM31"],
          "whsLocationCode":["1011","1061"],
          "inventoryCheckType":"X",  // X-备件货, M-贸易货
          "inventoryCheckCategory":"1", //盘点类别 1-日常盘点 2-月度盘点 3-动态盘点 4-其它盘点
          "createDate":["20210401","20210501"],
          "inventoryCheckId":"CN01-20210511-INV",
          "spmsStatus":"1", //任务状态：1-待盘点；2-盘点中；3-复盘中；4-处理中；5-关闭(完成)
      }
    * */
    ResponseResult getInvCheckAcList(JSONObject InvCheckFilter);

    /** 新建盘盈盘亏单
     * 1. 有uuid 更新
     * 2. 无uuid 新建
     * */
    ResponseResult updateInvCheckAc(JSONObject InvCheckDoc, String userId)throws Exception;

    /*按uuid获取InvCheckAc的详情数据*/
    ResponseResult getInvCheckAcWithDtl(String uuid)throws Exception;

    /** 根据任务uuid，获取盘盈盘亏结果提交SAP */
    ResponseResult getInventoryCheckActionToSap(String uuid, String postingDate, String userId, String remarks, String currentStatus)throws Exception;

    /** 获取盘盈盘亏单据相关日志信息 */
    List<Map<String, Object>> getICALogs(String uuid);

    /**根据盘点单Id获取关联的盘盈亏单*/
    List<InventoryCheckAction> getInvChkAcByInvChkId(String invChkId);
}
