package digital.laboratory.platform.reagent.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.service.IService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.AuditDecentralizedRequestDTO;
import digital.laboratory.platform.reagent.dto.DecentralizedRequestDTO;
import digital.laboratory.platform.reagent.entity.DecentralizeDetails;
import digital.laboratory.platform.reagent.entity.DecentralizedRequest;
import digital.laboratory.platform.reagent.vo.DecentralizedRequestVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * (分散采购申请)服务类
 *
 * @author Zhang Xiaolong created at  2023-03-10
 * @describe (分散采购申请) 服务类
 */
public interface DecentralizedRequestService extends IService<DecentralizedRequest> {

    IPage<DecentralizedRequestVO> getDecentralizedRequestVOPage
            (@Param("page") IPage<DecentralizedRequest> page, @Param(Constants.WRAPPER) QueryWrapper<DecentralizedRequest> qw);

    List<DecentralizedRequestVO> getDecentralizedRequestVOList(@Param(Constants.WRAPPER) QueryWrapper<DecentralizedRequest> qw);

    DecentralizedRequestVO getRequestById(String decentralizedRequestId);

    DecentralizedRequest addRequest(List<DecentralizedRequestDTO> decentralizedRequestDTOList, DLPUser dlpUser);

    DecentralizeDetails addDetails(DecentralizedRequestDTO decentralizedRequestDTO);

    //修改分散采购申请明细
    DecentralizeDetails editRequest(DecentralizedRequestDTO decentralizedRequestDTO);

    Boolean delRequestById(String decentralizedRequestId);

    //提交分散采购申请
    DecentralizedRequest commitRequest(List<DecentralizedRequestDTO> decentralizedRequestDTOList,DLPUser dlpUser);

    DecentralizedRequest primaryAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto);
    DecentralizedRequest secondaryAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto);
    DecentralizedRequest threeLevelAuditRequest(DLPUser dlpUser, AuditDecentralizedRequestDTO auditDecentralizedRequestDTO);

    DecentralizedRequest approveRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto);
}
