Exemple #1
0
        /// <summary>
        /// 根据机车整备id看是否所有环节已整备完毕
        /// </summary>
        /// <param name="zbid"></param>
        /// <returns></returns>
        public static bool boolCheckLcFinish(int zbid)
        {
            string hssql = @"select caseid,nState from VIEW_Jt6JicheProcess where jcid = @zbid order by nOrder desc";

            SqlParameter[] hssqlParams =
            {
                new SqlParameter("zbid", zbid)
            };
            DataTable dtLcCase = SqlHelper.ExecuteDataset(searchmaster.GetSqlConnConfig("57"), CommandType.Text, hssql, hssqlParams).Tables[0];

            if (dtLcCase.Rows[0]["nState"].ToString() == "1")//只有状态为进行中的时候才检查所有步骤是否已完成
            {
                foreach (DataRow dr in dtLcCase.Rows)
                {
                    if (!boolCheckCaseFinish(dr["caseid"].ToString(), zbid))
                    {
                        return(false);
                    }
                }
            }
            else
            {
                return(false);
            }
            if (Lxd.GetCountJt6tpFromJiCheID(zbid) > 0)
            {
                return(false);
            }
            if (LKJDataAnalysis.GetAllTAB_LKJDataAnalysis(zbid) <= 0)
            {
                return(false);
            }
            return(true);
        }
Exemple #2
0
        /// <summary>
        /// 更新机车状态,包括当前环节,以及机车状态
        /// </summary>
        /// <returns></returns>
        public static void UpdateJiCheState(int nJiCheID)
        {
            //1.根据机车ID,获得当前环节ID
            lsDatJT6JiChe JiChe = new lsDatJT6JiChe(nJiCheID);

            //2.如果当前环节ID为空,则跳过,否则,根据环节ID,检查下面所有步骤是否整备完毕,如果整备完毕,则切换到下一个环节ID(如果没有,则不改变环节ID)
            if (JiChe.strHandleCaseID != "")
            {
                UpdateJiCheCase(JiChe);
            }

            //3.检查当前机车状态是否为1,如果为1的话,检查该机车是否全部步骤整备完毕,如果整备完毕,设置nState为2
            if (JiChe.nState == 1)
            {
                List <HandleCase> HandleCaseList = HandleCase.getJieCheCaseList(PageBase.static_ext_int(JiChe.ID));
                Boolean           bIsAllHandle   = true;
                for (int i = 0; i < HandleCaseList.Count; i++)
                {
                    if (CheckJiCheCase(JiChe, HandleCaseList[i]) == false)
                    {
                        bIsAllHandle = false;
                        break;
                    }
                }

                if (Lxd.GetCountJt6tpFromJiCheID(JiChe.ID) > 0)
                {
                    bIsAllHandle = false;
                }
                if (JiChe.LocoType == "HXD2B")
                {
                    if (LKJDataAnalysis.GetAllTAB_LKJDataAnalysis(JiChe.ID) <= 0)
                    {
                        bIsAllHandle = false;
                    }
                }
                if (bIsAllHandle)
                {
                    JiChe.nState = 2;
                    PageBase.log("要更新endtime");
                    JiChe.dtHandleEndTime = DateTime.Now;
                    JiChe.Update();
                }
            }
        }