public String _GetMsg(String strSFZ_ALL, String strSFZ) { String strRes = ""; if (strSFZ_ALL != "") { //2,8 String[] strAllSFZCMD = strSFZ_ALL.Split(','); for (int i = 0; i < strAllSFZCMD.Length; i++) { strRes = strRes + PB.wc_pub._GetZL(strAllSFZCMD[i]) + ","; } } ArrayList list = new ArrayList(); if (strSFZ != "") { //2,8 String[] strSFZCMD = strSFZ.Split(' '); for (int i = 0; i < strSFZCMD.Length; i++) { string[] strSFZS = strSFZCMD[i].ToString().Split('|'); if (strSFZS.Length == 2) { string[] strData = strSFZS[1].Split('$'); //$88$89$90$91$92$93$95$96$97$ for (int k = 0; k < strData.Length; k++) { String strLXCode = _GetSFZNameAPI(strData[k]); if (strLXCode != "") { String strGSName = _GetLXName_API(strLXCode); PB.wc_pub.STR_SFZ_DATA data = new PB.wc_pub.STR_SFZ_DATA(); data.control_reason = ""; data.control_state = strSFZS[0]; data.roadcode = strLXCode; data.roadname = strGSName; data.sfzdm = strData[k]; data.sfzmc = _GetSFZName(strData[k]); list.Add(data); } } } } } String strZLS = _GetZLMsg(list); strRes = strRes + "<BR/>" + strZLS; return(strRes); }
public String _GetZLMsg(ArrayList sfzlist) { String strRes = ""; ArrayList hw = new ArrayList(); for (int i = 0; i < sfzlist.Count; i++) { PB.wc_pub.STR_SFZ_DATA data = (PB.wc_pub.STR_SFZ_DATA)sfzlist[i]; hw = _GetAddHighwayList(hw, data.roadcode + data.roadname); } for (int n = 0; n < hw.Count; n++) { string strOneHW = hw[n].ToString() + ":"; int k = 0; for (int i = 0; i < sfzlist.Count; i++) { PB.wc_pub.STR_SFZ_DATA data = (PB.wc_pub.STR_SFZ_DATA)sfzlist[i]; if (data.roadcode + data.roadname == hw[n].ToString()) { strOneHW = strOneHW + ""; if (k == 0) { strOneHW = strOneHW + data.sfzmc;//+"("+data.control_reason+")" } else { strOneHW = strOneHW + "," + data.sfzmc;//+"("+data.control_reason+")" } k++; } } if (n == 0) { strRes = "[" + (n + 1).ToString() + "]" + strOneHW; } else { strRes = strRes + "<BR/>" + "[" + (n + 1).ToString() + "]" + strOneHW; } } return(strRes); }
public ArrayList _GetZL(ArrayList sfzlist) { ArrayList zl = new ArrayList(); for (int i = 0; i < sfzlist.Count; i++) { PB.wc_pub.STR_SFZ_DATA data = (PB.wc_pub.STR_SFZ_DATA)sfzlist[i]; if (zl.Count < 1) { PB.wc_pub.STR_ZL_DATA zldata = new PB.wc_pub.STR_ZL_DATA(); zldata.zl_code = data.control_state; zldata.zl_content = ""; zl.Add(zldata); } else { bool yes = false; foreach (PB.wc_pub.STR_ZL_DATA strVa in zl) { if (data.control_state == strVa.zl_code) { yes = true; break; } } if (!yes) { PB.wc_pub.STR_ZL_DATA zldata = new PB.wc_pub.STR_ZL_DATA(); zldata.zl_code = data.control_state; zldata.zl_content = ""; zl.Add(zldata); } } } return(zl); }
public void _CrtMap(string strGID) { // string strSQL = "select * from T_ITZL_INFO where GID='" + strGID + "'"; DataTable tb = WXDBUtility.SqlHelper.GetDataTable(strSQL); if (tb == null) { return; } String strSFZJson = PB.wc_pub.Decrypt_DES(tb.Rows[0]["IT_ZL_SFZ"].ToString()); ArrayList sfzlist = PB.wc_pub._GetSFZ_Array(strSFZJson); String strRoadJson = PB.wc_pub.Decrypt_DES(tb.Rows[0]["IT_ZL_ROAD"].ToString()); ArrayList roadlist = PB.wc_pub._GetROAD_Array(strRoadJson); if (sfzlist.Count == 0 && roadlist.Count == 0) { _SetMapOK(strGID); return; } //获取收费站数据库表 DataTable sfztb = _GetSFZTable(); //要把所有的指令都存储在sfzzldata中 //一个收费站多种管制状态,返回的数据是一条。 //单个管制类型的数值都是在10一下,如果89同时管制,数据返回的就是89。 String strDataSFZ = ""; for (int i = 0; i < sfzlist.Count; i++) { PB.wc_pub.STR_SFZ_DATA data = (PB.wc_pub.STR_SFZ_DATA)sfzlist[i]; String strsfzgid = _GetSFZGIDByCodeOrName(data.sfzdm, data.sfzmc, sfztb); if (strsfzgid == "") { continue; } //重组一下指令 //data.control_state String newCMD = "0"; if (data.control_state.Trim() != "") { newCMD = _GetOneSFZZl(data.control_state); } if (newCMD == "") { newCMD = "1"; } if (i == 0) { strDataSFZ = newCMD + "|" + strsfzgid; } else { strDataSFZ = strDataSFZ + " " + newCMD + "|" + strsfzgid; } } string strMsg = _GetZLMsg(sfzlist); strGID = Guid.NewGuid().ToString(); String strAddSQL = "Insert into T_ZL_INFO_MAN(ZL_SFZ,ZL_ROAD,ZL_MAN,GID,ZL_MSG) Values('" + strDataSFZ + "','','接口','" + strGID + "','" + strMsg + "')"; int res = WXDBUtility.SqlHelper.ExecuteSql(strAddSQL); if (res > 0) { //_CrtMapByGID(strGID); _CrtMapAuto(strGID); } }