Exemplo n.º 1
0
        public static string GetBjInfo(lsDatJT6JiChe jiche)
        {
            string    rtnstr      = "";
            DataTable dtCheckType = lsDicJianCeTianShu.GetlsDicJianCeTianShu(jiche.LocoType, jiche.UnitId);

            if (dtCheckType.Rows.Count > 0)
            {
                foreach (DataRow dr in dtCheckType.Rows)
                {
                    switch (dr["FenLei"].ToString())
                    {
                    case "滤网":
                        lsDatLvWang lsdatlw = lsDatLvWang.getLastLvWangJianCeRiQi(jiche.LocoType, jiche.LocoNum, 0);
                        string      lvbj    = MakeBjContent(lsdatlw.genghuanriqi, PageBase.static_ext_int(dr["TianShu"]), PageBase.static_ext_int(dr["BaoJing"]), "滤网");
                        rtnstr += lvbj;
                        rtnstr += lvbj == "" ? "" : ",";
                        break;

                    case "列车管":
                        lsDatLieCheGuan lsdatlcg = lsDatLieCheGuan.getLastLcgJianCeRiQi(jiche.LocoType, jiche.LocoNum, 0);
                        string          lcgbj    = MakeBjContent(lsdatlcg.JianChaDate, PageBase.static_ext_int(dr["TianShu"]), PageBase.static_ext_int(dr["BaoJing"]), "列车管");
                        rtnstr += lcgbj;
                        rtnstr += lcgbj == "" ? "" : ",";
                        break;
                    }
                }
            }
            rtnstr = PageBase.CutComma(rtnstr);
            return(rtnstr);
        }
Exemplo n.º 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();
                }
            }
        }
Exemplo n.º 3
0
        private static void CheckNextCase(lsDatJT6JiChe JiChe, HandleCase Case)
        {
            if (CheckJiCheCase(JiChe, Case))
            {
                //更新环节记录
                UpdateCaseRecord(JiChe.ID, JiChe.strHandleCaseID);

                //获得下一个环节信息
                HandleCase NextCase = Case.getNextCase(Case.nOrder, Case.strID);
                if (NextCase != null)
                {
                    PageBase.log("下一个环节" + NextCase.strID);
                    JiChe.strHandleCaseID = NextCase.strID;
                    JiChe.UpdateCaseID();
                    addCaseRecord(JiChe.ID, NextCase.strID);
                    CheckNextCase(JiChe, NextCase);
                }
            }
        }
Exemplo n.º 4
0
 public static lsDatJT6JiChe SetValue(lsDatJT6JiChe JiChe, DataRow dr)
 {
     if (dr != null)
     {
         JiChe.ID                 = PageBase.static_ext_int(dr["ID"]);
         JiChe.LocoType           = dr["LocoType"].ToString();
         JiChe.LocoCode           = dr["LocoCode"].ToString();
         JiChe.LocoNum            = dr["LocoNum"].ToString();
         JiChe.RuDuanDate         = PageBase.static_ext_date(dr["RuDuanDate"].ToString());
         JiChe.RuDuanID           = dr["RuDuanID"].ToString();
         JiChe.RuDuanName         = dr["RuDuanName"].ToString();
         JiChe.JiaoCheDate        = PageBase.static_ext_date(dr["JiaoCheDate"].ToString());
         JiChe.JiaoCheID          = dr["JiaoCheID"].ToString();
         JiChe.JiaoCheName        = dr["JiaoCheName"].ToString();
         JiChe.ChuDuanDate        = PageBase.static_ext_date(dr["ChuDuanDate"].ToString());
         JiChe.ChuDuanID          = dr["ChuDuanID"].ToString();
         JiChe.ChuDuanName        = dr["ChuDuanName"].ToString();
         JiChe.Mark               = PageBase.static_ext_int(dr["Mark"].ToString());
         JiChe.GovernUnitId       = PageBase.static_ext_int(dr["GovernUnitId"].ToString());
         JiChe.UnitId             = PageBase.static_ext_int(dr["UnitId"].ToString());
         JiChe.DepartmentId       = PageBase.static_ext_int(dr["DepartmentId"].ToString());
         JiChe.ApanageId          = PageBase.static_ext_int(dr["ApanageId"].ToString());
         JiChe.TrackId            = PageBase.static_ext_int(dr["TrackId"].ToString());
         JiChe.ZBSJ               = dr["ZBSJ"].ToString();
         JiChe.CreateDate         = PageBase.static_ext_date(dr["CreateDate"].ToString());
         JiChe.dtHandleBeginTime  = PageBase.static_ext_date(dr["dtHandleBeginTime"].ToString());
         JiChe.strHandleCaseID    = dr["strHandleCaseID"].ToString();
         JiChe.nState             = PageBase.static_ext_int(dr["nState"].ToString());
         JiChe.dtHandleEndTime    = PageBase.static_ext_date(dr["dtHandleEndTime"].ToString());
         JiChe.nBeginHandleUserID = PageBase.static_ext_string(dr["nBeginHandleUserID"]);
         JiChe.nDirection         = PageBase.static_ext_int(dr["nDirection"]);
         JiChe.nMapX              = PageBase.static_ext_double(dr["nMapX"]);
         JiChe.nMapY              = PageBase.static_ext_double(dr["nMapY"]);
         JiChe.nDetailedState     = PageBase.static_ext_int(dr["nDetailedState"]);
         JiChe.nTieXieState       = PageBase.static_ext_int(dr["nTieXieState"]);
         JiChe.nRuDuanType        = PageBase.static_ext_int(dr["nRuDuanType"]);
         JiChe.nLocationLock      = PageBase.static_ext_int(dr["nLocationLock"]);
         JiChe.nGL                = PageBase.static_ext_int(dr["nGL"]);
     }
     return(JiChe);
 }
Exemplo n.º 5
0
        /// <summary>
        /// 获取所有在段整备中机车
        /// </summary>
        /// <returns></returns>
        public static List <lsDatJT6JiChe> GetAllJiCheZBZ(int apanageid)
        {
            string sqloption = "";

            sqloption += apanageid == 0 ? "" : "and ApanageID=@ApanageID";
            string strSql = "select * from lsDatJT6JiChe where Mark <> 0 and Mark <> 4 and LocoType in (select strTrainType from TAB_HandleProcessTrainType) and TrackId in(select TrackID from TAB_ZbcAreaConfig where 1=1 " + sqloption + " )  and nState=1 " + sqloption + " order by RuDuanDate desc";
            List <lsDatJT6JiChe> JiCheList = new List <lsDatJT6JiChe>();

            SqlParameter[] sqlParams =
            {
                new SqlParameter("apanageid", apanageid)
            };
            DataTable jcdt = SqlHelper.ExecuteDataset(searchmaster.GetSqlConnConfig("57"), CommandType.Text, strSql, sqlParams).Tables[0];

            if (jcdt.Rows.Count > 0)
            {
                for (int i = 0; i < jcdt.Rows.Count; i++)
                {
                    lsDatJT6JiChe jc = new lsDatJT6JiChe();
                    JiCheList.Add(SetValue(jc, jcdt.Rows[i]));
                }
            }
            return(JiCheList);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 获取所有在段机车
        /// </summary>
        /// <returns></returns>
        public static List <lsDatJT6JiChe> GetAlllsDatJT6JiCheZD(int apanageid)
        {
            string strSql = "select * from View_lsDatJT6JiChe where (Mark <> 0) and (Mark <> 4) and ApanageId=@apanageid  and ((trackid <> '' and ndirection>0) or (nmapx<>0 and nmapy<>0)) order by RuDuanDate asc";
            List <lsDatJT6JiChe> JiCheList = new List <lsDatJT6JiChe>();

            SqlParameter[] sqlParams =
            {
                new SqlParameter("apanageid", apanageid)
            };
            DataTable jcdt = SqlHelper.ExecuteDataset(searchmaster.GetSqlConnConfig("57"), CommandType.Text, strSql, sqlParams).Tables[0];

            if (jcdt.Rows.Count > 0)
            {
                for (int i = 0; i < jcdt.Rows.Count; i++)
                {
                    lsDatJT6JiChe jc = new lsDatJT6JiChe();
                    jc.UserName           = jcdt.Rows[i]["UserName"].ToString();
                    jc.UserNum            = jcdt.Rows[i]["UserNum"].ToString();
                    jc.strPictureFileName = jcdt.Rows[i]["strPictureFileName"].ToString();
                    JiCheList.Add(SetValue(jc, jcdt.Rows[i]));
                }
            }
            return(JiCheList);
        }
Exemplo n.º 7
0
 //功能:检查机车某一个环节是否整备完毕
 private static bool CheckJiCheCase(lsDatJT6JiChe JiChe, HandleCase Case)
 {
     return(HandleCase.boolCheckCaseFinish(Case.strID, JiChe.ID));
 }
Exemplo n.º 8
0
        //功能:更新机车环节
        private static void UpdateJiCheCase(lsDatJT6JiChe JiChe)
        {
            HandleCase Case = new HandleCase(JiChe.strHandleCaseID);

            CheckNextCase(JiChe, Case);
        }