package org.wcs.mapper.intf;

import com.baomidou.mybatisplus.extension.service.IService;
import org.wcs.constant.enums.database.StockComposeTaskStatusEnum;
import org.wcs.constant.enums.database.StockComposeTaskStepStatusEnum;
import org.wcs.model.bo.tuple.Tuple2;
import org.wcs.model.dto.serve.stcokComposeTask.QueryStockComposeTaskReq;
import org.wcs.model.po.app.AppStockComposeTask;

import java.util.List;

public interface AppStockComposeTaskService extends IService<AppStockComposeTask> {

    Tuple2<Long, List<AppStockComposeTask>> query(QueryStockComposeTaskReq queryTaskReq, Integer pageSize, Integer pageIndex); // 模糊条件查询
    List<AppStockComposeTask> query(AppStockComposeTask appStockComposeTask); // 条件查询
    List<AppStockComposeTask> query(QueryStockComposeTaskReq queryTaskReq);
    List<AppStockComposeTask> queryWithStatus(Integer... taskStatus); // 根据状态批量查询
    int insert(AppStockComposeTask appStockComposeTask); // 插入一条数据
    List<AppStockComposeTask> queryNotCompleteTask(String vehicleNo);
    AppStockComposeTask queryByTaskId(String taskId); // 根据任务ID查询
    List<AppStockComposeTask> queryByUpperTaskId(String upperTaskId); // 根据上位任务ID查询
    boolean update(AppStockComposeTask appStockComposeTask); // 根据主键更新数据
    boolean updateThrowEx(AppStockComposeTask appStockComposeTask); // 根据主键更新数据并抛出异常
    boolean setTaskStatusAndMsg(String taskId, StockComposeTaskStatusEnum status, StockComposeTaskStepStatusEnum stepStatus, String msg); // 设置任务状态和消息
    int setTaskStatusAndMsgWithOldTaskStatus(String taskId, Integer oldStatus, StockComposeTaskStatusEnum newStatus, String msg); // 设置任务状态和消息
    boolean deleteWithTaskIdThrowEx(String taskId); // 根据任务ID删除数据并抛出异常
}
