コード例 #1
0
        /*
         *      /// <summary>
         *      /// 分页获取数据列表
         *      /// </summary>
         *      public DataSet GetList(int PageSize,int PageIndex,string strWhere)
         *      {
         *              SqlParameter[] parameters = {
         *                              new SqlParameter("@tblName", SqlDbType.VarChar, 255),
         *                              new SqlParameter("@fldName", SqlDbType.VarChar, 255),
         *                              new SqlParameter("@PageSize", SqlDbType.Int),
         *                              new SqlParameter("@PageIndex", SqlDbType.Int),
         *                              new SqlParameter("@IsReCount", SqlDbType.Bit),
         *                              new SqlParameter("@OrderType", SqlDbType.Bit),
         *                              new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
         *                              };
         *              parameters[0].Value = "WF_ProcessNode";
         *              parameters[1].Value = "ID";
         *              parameters[2].Value = PageSize;
         *              parameters[3].Value = PageIndex;
         *              parameters[4].Value = 0;
         *              parameters[5].Value = 0;
         *              parameters[6].Value = strWhere;
         *              return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
         *      }*/

        #endregion  BasicMethod
        #region  ExtensionMethod
        public DataSet GetNodesByWFType(enumFlowType flowType)
        {
            string strSql = @"SELECT  * FROM    dbo.WF_ProcessNode a
                                        WHERE   FlowID IN ( SELECT  id
                                                            FROM    dbo.WF_FlowChart
                                                            WHERE   FlowType = {0} )
                                        ORDER BY PN_Sort ASC";

            strSql = string.Format(strSql, (int)flowType);
            return(DbHelperSQL.Query(strSql.ToString()));
        }
コード例 #2
0
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod
        #region  ExtensionMethod
        public List <Parking.Core.Model.WF_ProcessNode> GetNodesByWFType(enumFlowType flowType)
        {
            DataSet ds = dal.GetNodesByWFType(flowType);

            return(DataTableToList(ds.Tables[0]));
        }
コード例 #3
0
        /// <summary>
        /// 执行节点
        /// </summary>
        /// <param name="recordInfo"></param>
        public void Process(ProcessRecord recordInfo)
        {
            try
            {
                WF_ProcessNode tempNode = null;
                var            flow     = EngineContext.Current.Resolve <IWF_ProcessNode>();
                enumFlowType   flowType = enumFlowType.In;
                if (recordInfo.CHANNEL_TYPE == enumChannelType.chn_in)
                {
                    flowType = enumFlowType.In;
                }
                else if (recordInfo.CHANNEL_TYPE == enumChannelType.chn_out)
                {
                    flowType = enumFlowType.Out;
                }
                else
                {
                    flowType = enumFlowType.Center;
                }
                var flowList = flow.GetNodesByWFType(flowType);

                if (flowList.Count > 0)
                {
                    if (!dicChargeInfo.ContainsKey(recordInfo.INOUT_RECODE.VEHICLE_NO))
                    {
                        dicChargeInfo.Add(recordInfo.INOUT_RECODE.VEHICLE_NO, new AutoResetEvent(false));
                        while (true)
                        {
                            tempNode = tempNode ?? flowList.First <WF_ProcessNode>(x => x.PN_Flag);
                            if (!string.IsNullOrEmpty(tempNode.NodeCode) && null != tempNode && tempNode.PN_Flag)
                            {
                                ICheck checkPoint = EngineContext.Current.Resolve <ICheck>(tempNode.NodeCode);
                                checkPoint.Process(recordInfo);
                                checkPoint.SaveCheckPointFlowingWater(tempNode, recordInfo, recordInfo.CheckPointResult);
                                if (recordInfo.CheckPointResult)
                                {
                                    if (!string.IsNullOrEmpty(tempNode.NextNode))
                                    {
                                        //////////////////执行下一节点//////////////////
                                        var nextNode = flowList.Where(x => x.ID == tempNode.NextNode).FirstOrDefault();
                                        if (null != nextNode)
                                        {
                                            if (nextNode.PN_Flag)
                                            {
                                                checkPoint = EngineContext.Current.Resolve <ICheck>(nextNode.NodeCode);
                                            }
                                            tempNode = nextNode;
                                        }
                                        else
                                        {
                                            LogHelper.Log.Error("下一节点为空");
                                        }
                                    }
                                    else
                                    {
                                        break;
                                    }
                                }
                                else
                                {
                                    if (!string.IsNullOrEmpty(tempNode.JumpNode))
                                    {
                                        //////////////////执行跳转节点//////////////////
                                        var jumpNode = flowList.Where(x => x.ID == tempNode.JumpNode).FirstOrDefault();
                                        if (null != jumpNode)
                                        {
                                            if (jumpNode.PN_Flag)
                                            {
                                                checkPoint = EngineContext.Current.Resolve <ICheck>(jumpNode.NodeCode);
                                            }
                                            tempNode = jumpNode;
                                        }
                                        else
                                        {
                                            LogHelper.Log.Error("跳转节点为空");
                                        }
                                    }
                                    else
                                    {
                                        break;
                                    }
                                }
                            }
                            else
                            {
                                var nextNode = flowList.Where(x => x.ID == tempNode.NextNode).FirstOrDefault();
                                if (null != nextNode)
                                {
                                    tempNode = nextNode;
                                }
                                else
                                {
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                if (dicChargeInfo.ContainsKey(recordInfo.INOUT_RECODE.VEHICLE_NO))
                {
                    dicChargeInfo.Remove(recordInfo.INOUT_RECODE.VEHICLE_NO);
                }
                LogHelper.Log.Error(ex.StackTrace);
            }
            finally {
                if (dicChargeInfo.ContainsKey(recordInfo.INOUT_RECODE.VEHICLE_NO))
                {
                    dicChargeInfo.Remove(recordInfo.INOUT_RECODE.VEHICLE_NO);
                }
            }
        }