package com.qmth.sop.business.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.sop.business.bean.result.ProjectExchangeResult;
import com.qmth.sop.business.bean.result.TBProjectExchangeViewResult;
import com.qmth.sop.business.entity.TBProjectExchange;
import com.qmth.sop.common.enums.*;

import java.util.Map;

/**
 * <p>
 * 项目变更计划表 服务类
 * </p>
 *
 * @author wangliang
 * @since 2023-08-01
 */
public interface TBProjectExchangeService extends IService<TBProjectExchange> {

    /**
     * 新增项目变更计划申请
     *
     * @param tbProjectExchange
     * @return
     * @throws InterruptedException
     */
    Boolean saveProjectExchange(TBProjectExchange tbProjectExchange) throws InterruptedException;

    /**
     * 项目变更计划申请列表
     *
     * @param iPage
     * @param serviceId
     * @param createUserId
     * @param type
     * @param customType
     * @param flowStatus
     * @param customName
     * @param exchangeNo
     * @param startTime
     * @param endTime
     * @return
     */
    IPage<ProjectExchangeResult> list(IPage<Map> iPage, Long serviceId, Long createUserId, DelayWarnTypeEnum type, ProductTypeEnum customType, ProjectExchangeFlowStatusEnum flowStatus, String customName, String exchangeNo, Long startTime, Long endTime);

    /**
     * 项目计划变更审核接口
     *
     * @param taskId
     * @param flowApprove
     * @param projectExchangeApprove
     * @param remark
     * @param userId
     * @return
     */
    Boolean flowApprove(Long taskId, FlowApprovePassEnum flowApprove, ProjectExchangeApproveEnum projectExchangeApprove, String remark, Long userId) throws InterruptedException;

    /**
     * 项目计划变更详情接口
     *
     * @param id
     * @return
     */
    TBProjectExchangeViewResult view(Long id);
}
