Пример #1
0
        /// <summary>
        /// 入口函数
        /// </summary>
        /// <param name="vouchtype"></param>
        /// <param name="dsHead"></param>
        /// <param name="dsBody"></param>
        public void Run(string vouchtype, DataSet dsHead, DataSet dsBody)
        {
            Model.Synergismlog log = new Synergismlog();
            log.OP       = (APIOp)ClassFactory.GetBaseOp(vouchtype, tasktype);
            log.TaskType = tasktype;

            DealResult dr = new DealResult();

            dr.ResultNum = Constant.ResultNum_NoError;

            BLL.TaskLog.ITaskLogDetail logdtbll = ClassFactory.GetITaskLogDetailBLL(log.TaskType);
            BLL.TaskLog.ITaskLogMain   logbll   = ClassFactory.GetITaskLogMainBLL(log.TaskType);

            Model.Synergismlogdt fdt = logdtbll.GetFrist(log, log.OP);

            //把记录设为处理中
            log.Cstatus = Constant.SynerginsLog_Cstatus_Dealing;
            log.Endtime = DateTime.Now;
            logbll.Update(log, log.OP);

            //预置为完成
            log.Cstatus = Constant.SynerginsLog_Cstatus_Complete;

            //获取下一节点(节点数可能大于1)
            List <Model.Synergismlogdt> listnext = logdtbll.GetNext(fdt, log.OP);

            //协同操作
            dr = MakeLogDT(vouchtype, dsHead, dsBody, log, dr, logdtbll, logbll, fdt, listnext);
        }
Пример #2
0
        /// <summary>
        /// XTLibrary 入口函数
        /// 通过任务主表获取需要执行的任务并执行任务
        /// </summary>
        /// <param name="log"></param>
        /// <returns></returns>
        public void Run(Model.Synergismlog log)
        {
            System.Diagnostics.Trace.WriteLine("begin Run(Model.Synergismlog log)   ");

            System.Diagnostics.Trace.WriteLine("before log.OPClass   ");
            log.OPClass = log.OPClass;
            log.OP      = ClassFactory.GetBaseOp(log);
            DealResult dr = new DealResult();

            dr.ResultNum = Constant.ResultNum_NoError;
            System.Diagnostics.Trace.WriteLine("after log.OPClass   ");


            System.Diagnostics.Trace.WriteLine("before ITaskLogDetail  ");
            BLL.TaskLog.ITaskLogDetail logdtbll = ClassFactory.GetITaskLogDetailBLL(log.TaskType);
            System.Diagnostics.Trace.WriteLine("after ITaskLogDetail  ");

            System.Diagnostics.Trace.WriteLine("before ITaskLogMain  ");
            BLL.TaskLog.ITaskLogMain logbll = ClassFactory.GetITaskLogMainBLL(log.TaskType);
            System.Diagnostics.Trace.WriteLine("after ITaskLogMain  ");


            System.Diagnostics.Trace.WriteLine("before logdtbll.GetFrist  ");
            Model.Synergismlogdt fdt = logdtbll.GetFrist(log, log.OP);
            System.Diagnostics.Trace.WriteLine("after logdtbll.GetFrist  ");

            //挂起主表(置于等待中)
            if (fdt.Cstatus == Constant.SynergisnLogDT_Cstatus_NoAudit)
            {
                log.Cstatus = Constant.SynerginsLog_Cstatus_Wait;
                log.Endtime = DateTime.Now;
                logbll.Update(log, log.OP);
                //return dr;
            }

            //把记录设为处理中
            log.Cstatus = Constant.SynerginsLog_Cstatus_Dealing;
            log.Endtime = DateTime.Now;
            logbll.Update(log, log.OP);

            //预置为完成
            log.Cstatus = Constant.SynerginsLog_Cstatus_Complete;

            //获取下一节点(节点数可能大于1)
            List <Model.Synergismlogdt> listnext = logdtbll.GetNext(fdt, log.OP);

            //协同操作

            System.Diagnostics.Trace.WriteLine("before MakeLogDT  ");
            dr = MakeLogDT(log, dr, logdtbll, logbll, fdt, listnext);
            System.Diagnostics.Trace.WriteLine("after MakeLogDT  ");

            //发送消息


            //更新最终状态
            log.Endtime = DateTime.Now;
            logbll.Update(log, log.OP);

            // return dr;
        }