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.PurchasingPlanDTO;
import digital.laboratory.platform.reagent.entity.ProcurementContent;
import digital.laboratory.platform.reagent.entity.PurchasingPlan;
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * (采购计划)服务类
 *
 * @author Zhang Xiaolong created at  2023-03-10
 * @describe (采购计划) 服务类
 */
public interface PurchasingPlanService extends IService<PurchasingPlan> {

    IPage<PurchasingPlanVO> getPurchasingPlanVOPage(@Param("page") IPage<PurchasingPlan> page, @Param(Constants.WRAPPER) QueryWrapper<PurchasingPlan> qw);

    List<PurchasingPlanVO> getPurchasingPlanVOList(@Param(Constants.WRAPPER) QueryWrapper<PurchasingPlan> qw);

    PurchasingPlanVO getPurchasingPlanVO (String purchasingPlanId);

    @Transactional
    PurchasingPlanVO addById(List<PurchasingPlanDTO> purchasingPlanDTOList, DLPUser user);

    ProcurementContent addContent(PurchasingPlanDTO purchasingPlanDTO);

    ProcurementContent editById(PurchasingPlanDTO purchasingPlanDTO);

    ProcurementContent editDetails(PurchasingPlanDTO purchasingPlanDTO);

    Boolean delContentById(String procurementContentId);

    ProcurementContent replacementById(PurchasingPlanDTO purchasingPlanDTO);

    PurchasingPlan commitById(String purchasingPlanId);

    PurchasingPlan auditById(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser);

    PurchasingPlan approveById(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser);

    PurchasingPlan releaseById(String purchasingPlanId);
}
