using APT.BaseData.Domain.Entities;
using APT.Infrastructure.Core;
using APT.Infrastructure.Api;
using APT.BaseData.Domain.ApiModel.PF;
using System;
using System.Linq.Expressions;
using System.Collections.Generic;
using APT.BaseData.Domain.Entities.FM;

namespace APT.BaseData.Domain.IServices.FM
{

    public interface IFMFlowPermitService : ICommonService
    {

        /// <summary>
        /// 审核后执行动作
        /// </summary>
        /// <param name="id">送审单ID</param>
        /// <param name="flowPermitStatus">当前审批执行的动作</param>
        void AfterPermit(string id, int flowPermitStatus);

        /// <summary>
        /// 審批流數據保存
        /// </summary>
        /// <param name="model">審批流程</param>
        bool UpdateApprove(T_PF_APPROVE model, Action action, Guid? APPROVE_ID = null);
        /// <summary>
        /// 審批流驳回申请人
        /// </summary>
        /// <param name="model">審批流程</param>
        bool RejectApprove(Guid id, bool is_send_message, Action action);
        /// <summary>
        /// 发布审批流 wyw 添加自定义条件
        /// </summary>
        /// <param name="id">表单id</param>
        bool SendApprove(Guid id, Action action, Expression<Func<T_PF_APPROVE, bool>> expression = null, bool isShowCode = true, string approveTaskName = "");
        /// <summary>
        /// 发布审批流
        /// </summary>
        /// <param name="serialCode">审批流编号</param>
        /// <param name="fromCode">审批流模板配置中的编号（例：PF001）</param>
        /// <param name="param">审批流模板配置中的自定义参数</param>
        /// <param name="id">审批流对应主表ID（DATA_ID）</param>
        /// <param name="approveCode">审批流对应 APPROVE_CODE（例：FO017_SHOWPRINT）审批流页面对应名称</param>
        /// <param name="finishNoticeId">待办ID（传入需要结束的待办ID）</param>
        /// <param name="sendMessage">是否需要发送通知</param>
        /// <param name="action"></param>
        /// <param name="approveId">审批流ID（主表如果有存传值进来 ）</param>
        /// <param name="approveUserId">审批用户（主表如果有存传值进来 ）</param>
        /// <param name="dicApproveUser">自定义审批流程人员信息</param>
        /// <param name="dicApproveDepartMentID">自定义审批流程人员部门信息</param>
        /// <param name="approveTaskName">审批流名称</param>
        /// <returns></returns>
        void InsertApprove(string serialCode, string fromCode, string param, Guid id, string approveCode, Guid? finishNoticeId, bool sendMessage, Action action, Guid? approveId = null, Guid? approveUserId = null, Dictionary<int, T_FM_USER> dicApproveUser = null, Dictionary<int, Guid> dicApproveDepartMentID = null, string NoticeCode = "", string taskSourceFormCode = "", Guid? operaterID = null, string approveTaskName = "", Enums.FMTASKTYPE? TASK_TYPE = null, int? FREQUENCYE = null, DateTime? DateTimeLastest = null, int? BSOperateEnum = null);

        /// <summary>
        /// 发布审批流
        /// </summary>
        /// <param name="listSerialCode">审批流编号</param>
        /// <param name="fromCode">审批流模板配置中的编号（例：PF001）</param>
        /// <param name="listID">审批流对应主表ID（DATA_ID）</param>
        /// <param name="approveCode">审批流对应 APPROVE_CODE（例：FO017_SHOWPRINT）点击时页面跳转配置项</param>
        /// <param name="finishNoticeId">待办ID（传入需要结束的待办ID）</param>
        /// <param name="isSendMessage">是否需要发送通知</param>
        /// <param name="action"></param>
        /// <param name="listParam">审批流模板配置中的自定义参数</param>
        /// <param name="listApproveId">审批流ID（主表如果有存传值进来 ）</param>
        /// <param name="approveUserId">审批用户（主表如果有存传值进来 ）</param>
        /// <exception cref="Exception"></exception>
        void InsertApprove(List<string> listSerialCode, string fromCode, List<Guid> listID, string approveCode, Guid? finishNoticeId, bool isSendMessage, Action action, List<string> listParam = null, List<Guid> listApproveId = null, Guid? approveUserId = null, string taskSourceFormCode = "", Guid? operaterID = null);

        /// <summary>
        /// 发布审批流 隐患上报
        /// </summary>
        /// <param name="listSerialCode">审批流编号</param>
        /// <param name="fromCode">审批流模板配置中的编号（例：PF001）</param>
        /// <param name="listID">审批流对应主表ID（DATA_ID）</param>
        /// <param name="approveCode">审批流对应 APPROVE_CODE（例：FO017_SHOWPRINT）点击时页面跳转配置项</param>
        /// <param name="finishNoticeId">待办ID（传入需要结束的待办ID）</param>
        /// <param name="isSendMessage">是否需要发送通知</param>
        /// <param name="action"></param>
        /// <param name="listParam">审批流模板配置中的自定义参数</param>
        /// <param name="listApproveId">审批流ID（主表如果有存传值进来 ）</param>
        /// <param name="approveUserId">审批用户（主表如果有存传值进来 ）</param>
        /// <exception cref="Exception"></exception>
        void InsertApproveRisk(List<string> listSerialCode, string fromCode, List<Guid> listID, string approveCode, Guid? finishNoticeId, bool isSendMessage, Action action, List<string> listParam = null, List<Guid> listApproveId = null, Guid? approveUserId = null, string taskSourceFormCode = "", Guid? operaterID = null, List<Guid> ListDepIDNone = null, Enums.FMTASKTYPE? TASK_TYPE = null, int? FREQUENCYE = null, DateTime? DateTimeLastest = null);
        /// <summary>
        /// 获取流水码
        /// </summary>
        /// <param name="id">表单id</param>
        //string[] CreateGenSerial(int codeType, int count);



        //#region   审批流回调接口

        //#region     BS

        ///// <summary>
        ///// 隐患上报 审核通过 给每个通知负责人发送通知
        ///// </summary>
        ///// <param name="id"></param>
        ///// <returns></returns>
        //bool Notice(string id);

        //#endregion

        //#endregion
    }
}
