package digital.laboratory.platform.imr.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.imr.dto.OutWarehouseApplyDTO;
import digital.laboratory.platform.imr.dto.VerificationCode;
import digital.laboratory.platform.imr.entity.SampleOutWarehouseApply;
import digital.laboratory.platform.imr.vo.SampleOutWarehouseApplyVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 样本出库申请实体类服务类
 *
 * @author Zhang Xiaolong created at  2023-03-17
 * @describe 样本出库申请实体类 服务类
 */
public interface SampleOutWarehouseApplyService extends IService<SampleOutWarehouseApply> {

    SampleOutWarehouseApplyVO createOutApply(OutWarehouseApplyDTO dto, DLPUser dlpUser);

    /**
     * 根据出库申请id查询单个出库信息
     * 出库信息+出库样本明细
     *
     * @param id
     * @return
     */
    SampleOutWarehouseApplyVO getOutWarehouseDetailedById(String id);

    IPage<SampleOutWarehouseApply> getSampleOutWarehouseApplyVOList(@Param(Constants.WRAPPER) QueryWrapper<SampleOutWarehouseApply> qw);

    IPage<SampleOutWarehouseApplyVO> getSampleOutWarehouseApplyVOPage(@Param("page") Page<SampleOutWarehouseApply> page, @Param(Constants.WRAPPER) QueryWrapper<SampleOutWarehouseApply> qw);

    SampleOutWarehouseApplyVO confirmOutbound(VerificationCode dto, DLPUser dlpUser);

    SampleOutWarehouseApplyVO getInfoByCode(@Param("code") String code);




    /**
     * 出库申请第二版
     *
     * @param dto
     * @param dlpUser
     * @return
     */
    SampleOutWarehouseApplyVO createOutRepositoryApply(OutWarehouseApplyDTO dto, DLPUser dlpUser);

    /**
     * 领用出库确认
     *
     * @param id
     * @return
     */
    SampleOutWarehouseApplyVO reconfirmApply(String id, String userId);

    String buildEventImLabelContent(String code);
}
