/// <summary> /// 拆票后,保存竞彩、北单订单到Redis库中 /// </summary> public static void AddToRunningOrder_JC(string gameCode, string orderId, string[] matchIdArray, List <RedisTicketInfo> ticketList) { if (ticketList.Count <= 0) { return; } //把订单号和订单的比赛编号存入List var db = RedisHelperEx.DB_Running_Order_JC; //竞彩足球、竞彩篮球格式:比赛编号1,比赛编号2_订单号 //北京单场格式:期号|比赛编号,期号|比赛编号_订单号 var orderValue = string.Format("{0}_{1}", string.Join(",", matchIdArray), orderId); var fullKey = string.Format("{0}_{1}", gameCode, RedisKeys.Key_Running_Order_List); fullKey = GetUsableList(fullKey); db.RPush(fullKey, orderValue); var orderInfo = new RedisOrderInfo { SchemeId = orderId, TicketList = ticketList, }; //var json = JsonHelper.Serialize<RedisOrderInfo>(orderInfo); var json = orderInfo.ToJsonDataFormat(true); //以订单号为key 订单内容为value保存 db.Set(orderId, json); }
/// <summary> /// 拆票后,北单订单到Redis库中 /// </summary> public static void AddToRunningOrder_BJDC(string orderId, string[] matchIdArray, List <RedisTicketInfo> ticketList) { if (ticketList.Count <= 0) { return; } var db = RedisHelperEx.DB_Running_Order_BJDC; string issuseNumber = ticketList[0].IssuseNumber; var fullKey = string.Format("{0}_{1}_{2}", "BJDC", RedisKeys.Key_Running_Order_List, issuseNumber); //fullKey = GetUsableList(fullKey); var orderValue = string.Format("{0}_{1}", string.Join(",", matchIdArray), orderId); db.RPush(fullKey, orderValue); var orderInfo = new RedisOrderInfo { SchemeId = orderId, TicketList = ticketList, }; //var json = JsonHelper.Serialize<RedisOrderInfo>(orderInfo); var json = orderInfo.ToJsonDataFormat(true); //以订单号为key 订单内容为value保存 db.Set(orderId, json); }
/// <summary> /// 拆票后,保存数字彩订单到Redis库中 /// </summary> public static void AddToRunningOrder_SZC(SchemeType schemeType, string gameCode, string gameType, string orderId, string keyLine, bool stopAfterBonus, string issuseNumber, List <RedisTicketInfo> ticketList) { if (ticketList.Count <= 0) { return; } //把彩种、玩法、期号为Key,订单json存入List CSRedis.CSRedisClient db = null;// RedisHelperEx.DB_Running_Order; if (gameCode == "CTZQ") { db = RedisHelperEx.DB_Running_Order_CTZQ; } if (new string[] { "SSQ", "DLT", "FC3D", "PL3", "OZB" }.Contains(gameCode)) { db = RedisHelperEx.DB_Running_Order_SCZ_DP; } if (new string[] { "CQSSC", "JX11X5", "SD11X5", "GD11X5", "GDKLSF", "JSKS", "SDKLPK3" }.Contains(gameCode)) { db = RedisHelperEx.DB_Running_Order_SCZ_GP; } if (db == null) { throw new Exception(string.Format("找不到{0}对应的库", gameCode)); } var fullKey = (gameCode.ToUpper() == "CTZQ" || gameCode.ToUpper() == "OZB") ? string.Format("{0}_{1}_{2}_{3}", gameCode, gameType, RedisKeys.Key_Running_Order_List, issuseNumber) : string.Format("{0}_{1}_{2}", gameCode, RedisKeys.Key_Running_Order_List, issuseNumber); //fullKey = GetUsableList(fullKey); var orderInfo = new RedisOrderInfo { SchemeId = orderId, KeyLine = keyLine, StopAfterBonus = stopAfterBonus, TicketList = ticketList, SchemeType = schemeType, }; //var json = JsonHelper.Serialize<RedisOrderInfo>(orderInfo); var json = orderInfo.ToJsonDataFormat(true); db.RPush(fullKey, json); }