using Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Cache.Entity { public static class EnumFunctionType { private static Dictionary Fundict = new Dictionary() { { "QGC_SSQ","GetFCSSQList"},{ "QGC_FC3D","GetFC3DList"},{ "QGC_DLT","GetTCDLTList"},{ "QGC_PL3","GetTCP3List"}, { " QGC_QXC","GetTCQXCList"},{"QGC_QLC","GetFCQLCList" },{ "DFC_HC1","GetGDHC1List"},{ "DFC_DF6J1","GetFCDF6J1List"}, { "DFC_ZJTC6J1","GetTCZJ6J1List"},{ "DFC_HD15X5","GetFCHD11X5List"},{ "DFC_JSTC7WS","GetTCJS7WSList"},{ "DFC_HB30X5","GetFCHB30X5List"}, { "DFC_HN22X5","GetFCHN22X5List"},{ "DFC_XJ35X7","GetFCXJ35X7List"},{ "DFC_FJ36X7","GetTCFJ36X7List"},{ "DFC_NYFC36X7","GetFCNY36X7List"}, { "DFC_FJ31X7","GetTCFJ31X7List"} }; private static Dictionary Classdict = new Dictionary() { { "QGC_SSQ","CB.Entity.FCSSQInfo"},{ "QGC_FC3D","CB.Entity.FC3DInfo"},{ "QGC_DLT","CB.Entity.TCDLTInfo"},{ "QGC_PL3","CB.Entity.TCP3Info"}, { " QGC_QXC","CB.Entity.TCQXCInfo"},{"QGC_QLC","CB.Entity.FCQLCInfo" },{ "DFC_HC1","CB.Entity.HC1Info"},{ "DFC_DF6J1","CB.Entity.FCDF6J1Info"}, { "DFC_ZJTC6J1","CB.Entity.TCZJ6J1Info"},{ "DFC_HD15X5","CB.Entity.FCHD11X5Info"},{ "DFC_JSTC7WS","CB.Entity.TCJS7WSInfo"},{ "DFC_HB30X5","CB.Entity.FCHB30X5Info"},{ "DFC_HN22X5","CB.Entity.FCHN22X5Info"},{ "DFC_XJ35X7","CB.Entity.FCXJ35X7Info"},{ "DFC_FJ36X7","CB.Entity.TCFJ36X7Info"},{ "DFC_NYFC36X7","CB.Entity.FCNY36X7Info"},{ "DFC_FJ31X7","CB.Entity.TCFJ31X7Info"} }; /// /// 第一位,总数,第二位 红球,第三位蓝球,不在这的是全红或者其他格式 /// private static Dictionary LotteryBallTypeDict = new Dictionary() { { "QGC_SSQ",new int[3] {7,6,1 }},{ "QGC_FC3D",new int[3] {3,3,0}},{ "QGC_DLT",new int[3]{7,5,2 }},{ "QGC_PL3",new int[3]{ 3,3,0}}, { "QGC_PL5",new int[3]{ 5,5,0} },{ "QGC_QXC",new int[3]{ 7,7,0}},{"QGC_QLC",new int[3]{8,7,1 } },{ "DFC_HC1",new int[3]{1,1,0 } }, { "DFC_DF6J1",new int[3]{ 7,6,1}},{ "DFC_ZJTC6J1",new int[3]{7,6,1 }},{ "DFC_HD15X5",new int[3]{5,5,0 } },{ "DFC_JSTC7WS",new int[3]{7,7,0 }},{ "DFC_HB30X5",new int[3]{ 5,5,0} }, { "DFC_HN22X5",new int[3]{ 5,5,0} },{ "DFC_XJ35X7",new int[3]{8,7,1 } },{ "DFC_FJ36X7",new int[3]{8,7,1 } },{ "DFC_NYFC36X7",new int[3]{7,6,1 } },{ "DFC_FJ31X7",new int[3]{ 8,7,1} },{"GPC_BJKL8",new int[]{21,20,1 } } }; /// /// 要三区比的彩种 /// public static string[] Sanqu = new string[] { "QGC_SSQ" }; /// /// 要大小比的彩种 /// public static string[] DaxiaoType = new string[] { "QGC_FC3D","QGC_DLT","QGC_PL3","QGC_PL5"," QGC_QXC","QGC_QLC","DFC_DF6J1","DFC_ZJTC6J1","DFC_HD15X5","DFC_JSTC7WS","DFC_HB30X5","DFC_HN22X5","DFC_FJ36X7","DFC_NYFC36X7","DFC_FJ31X7" }; /// /// 彩票大小比的中间值 /// public static Dictionary DaXiaoZJZ = new Dictionary() { { "QGC_FC3D",5 },{"QGC_DLT",18 },{ "QGC_PL3",4},{ "QGC_PL5",4},{ " QGC_QXC",5},{ "QGC_QLC",16},{ "QGC_SSQ",17},{ "DFC_DF6J1",6},{"DFC_HD15X5",6 }, { "DFC_JSTC7WS",6},{ "DFC_HB30X5",6},{ "DFC_HN22X5",6},{ "DFC_FJ36X7",6},{ "DFC_NYFC36X7",6},{ "DFC_FJ31X7",6} }; /// /// 中间值计算个数 /// private static Dictionary DaxiaoCount = new Dictionary() { {"QGC_FC3D",0},{ "QGC_DLT",5},{ "QGC_PL3",0},{ "QGC_PL5",0},{ " QGC_QXC",0},{ "QGC_QLC",0},{ "DFC_DF6J1",7},{ "DFC_ZJTC6J1",7},{"DFC_HD15X5",5 }, { "DFC_JSTC7WS",7},{ "DFC_HB30X5",5},{ "DFC_HN22X5",5},{ "DFC_FJ36X7",8},{ "DFC_NYFC36X7",7},{"DFC_FJ31X7",8 } }; /// /// opencode需要take的数量 /// private static Dictionary DaxiaoTake = new Dictionary() { {"QGC_PL3",3},{ "QGC_QLC",7} }; /// /// 彩票名字和简写对应 /// private static Dictionary TypeOfNameDict = new Dictionary() { {"QGC_SSQ","双色球" },{ "QGC_FC3D","福彩3D"},{ "QGC_DLT","大乐透"},{ "QGC_PL3","排列三"},{ "QGC_PL5","排列五"}, { "QGC_QXC","七星彩"},{ "QGC_QLC","七乐彩"},{ "DFC_HC1","好彩1"},{ "DFC_DF6J1","东方6+1"},{ "DFC_ZJTC6J1","浙江6+1"}, { "DFC_HD15X5","华东15选5"},{ "DFC_JSTC7WS","江苏7位数"},{ "DFC_HB30X5","湖北30选5"},{ "DFC_HN22X5","河南22选5"},{"DFC_XJ35X7","新疆35选7" }, { "DFC_FJ36X7","福建36选7"},{ "DFC_NYFC36X7","南粤36选7"},{ "DFC_FJ31X7","福建31选7"},{ "GPC_HLJ11X5","黑龙江11选5"},{ "GPC_JS11X5","江苏11选5"} ,{ "GPC_HEB11X5","河北11选5"},{ "GPC_GD11X5","广东11选5"},{ "GPC_ZJ11X5","浙江11选5"},{ "GPC_YN11X5","云南11选5"},{ "GPC_JL11X5","吉林11选5"},{ "GPC_JX11X5","江西11选5"},{ "GPC_LN11X5","辽宁11选5"},{ "GPC_SD11X5","山东11选5"},{"GPC_HUB11X5","湖北11选5"},{"GPC_NMG11X5","内蒙古11选5" },{ "GPC_GS11X5","甘肃11选5"},{ "GPC_FJ11X5","福建11选5"},{ "GPC_XJ11X5","新疆11选5"},{ "GPC_SHANX11X5","陕西11选5"},{ "GPC_SX11X5","山西11选5"}, { "GPC_JSK3","江苏快3"},{ "GPC_HBK3","河北快3"},{ "GPC_AHK3","安徽快3"},{ "GPC_NMGK3","内蒙古快3"},{ "GPC_JLK3","吉林快3"}, { "GPC_HUBK3","湖北快3"},{ "GPC_SCKL12","四川快乐12"}, { "GPC_LNKL12","辽宁快乐12"},{ "GPC_ZJKLC","浙江快乐彩"},{ "GPC_SDQYH","山东群英会"}, { "GPC_GDKLSF","广东快乐十分"},{ "GPC_GXKLSF","广西快乐十分"}, {"GPC_SXKLSF","山西快乐十分" },{ "GPC_TJKLSF","天津快乐十分"},{ "GPC_CQKLSF","重庆快乐十分(幸运农场)"}, { "GPC_HNKLSF","湖南快乐十分(动物总动员)"}, { "GPC_BJKL8","北京快乐8"},{ "GPC_BJSCPK10","北京赛车pk10"},{ "GPC_SHSSL","上海时时乐"},{ "GPC_SDKLPK3","快乐扑克3"}, { "GPC_HNXYSC","幸运赛车"},{ "GPC_HNYTDJ","泳坛夺金" } }; /// /// 如果类型在其中就采用不同规则解析详情 /// public static string[] ContainDetailType = new string[] { "QGC_FC3D","QGC_PL3","QGC_PL5" }; public class LotteryBallType { public int Count { get; set; } public int RedCount { get; set; } public int BlueCount { get; set; } } /// /// 根据彩票类型取得彩票名字 /// /// /// public static string GetLotteryName(string key) { if (TypeOfNameDict.Keys.Contains(key)) { return TypeOfNameDict[key]; } else { return null; } } /// /// 拆解detail字段返回开奖结果 /// /// /// public static List GetLotteryResults(string detail, int takenum) { try { List resultsList = new List(); string[] results = detail.Split(new char[] { '^', '|', ',' });//前面两个是投注总额和奖池奖金 string[] ary = results.Skip(takenum).ToArray(); for (int i = 0; i < ary.Length / 3; i++) { LotteryResults tmplr = new LotteryResults() { LevelName = ary[i * 3], Count = int.Parse(ary[i * 3 + 1]), Money = ary[i * 3 + 2] }; resultsList.Add(tmplr); } return resultsList; } catch (Exception ee) { return new List(); } } /// /// 获取p3开奖详情 /// /// /// /// public static List GetLotteryResultsP3(string detail) { List resultsList = new List(); try { string[] results = detail.Split(new char[] { '^', '|', ',' });//前面1个是投注总额 string[] ary = results.Skip(1).ToArray(); string[] ary2 = ary.Take(ary.Length - 3).ToArray(); for (int i = 0; i < ary2.Length / 3; i++) { LotteryResults tmplr = new LotteryResults() { LevelName = ary2[i * 3], Count = int.Parse(ary2[i * 3 + 1]), Money = ary2[i * 3 + 2] }; resultsList.Add(tmplr); } } catch (Exception ee) { return null; } return resultsList; } /// /// 获取p5开奖详情 /// /// /// /// public static List GetLotteryResultsP5(string detail) { List resultsList = new List(); try { string[] results = detail.Split(new char[] { '^', '|', ',' });//前面1个是投注总额 string[] ary = results.Skip(results.Length - 3).ToArray(); //string[] ary2 = ary.Take(ary.Length - 3).ToArray(); for (int i = 0; i < ary.Length / 3; i++) { LotteryResults tmplr = new LotteryResults() { LevelName = ary[i * 3], Count = int.Parse(ary[i * 3 + 1]), Money = ary[i * 3 + 2] }; resultsList.Add(tmplr); } } catch (Exception ee) { throw; } return resultsList; } /// /// 根据类名获取take个数 /// /// /// public static int GetDaXiaoTake(string key) { if (DaxiaoTake.Keys.Contains(key)) { return DaxiaoTake[key]; } else { return 0; } } /// /// 跟据类名获取要计算大小的中间值 /// /// /// public static int GetDaXiaoZJZ(string key) { if (DaXiaoZJZ.Keys.Contains(key)) { return DaXiaoZJZ[key]; } else { return 0; } } /// /// 根据类型名获取用来计算大小比的个数 /// /// /// public static int GetDaxiaoCount(string key) { if (DaxiaoCount.Keys.Contains(key)) { return DaxiaoCount[key]; } else { return 0; } } /// /// 跟据类型名获取球类型 /// /// /// public static LotteryBallType GetBallType(string key) { try { if (LotteryBallTypeDict.Keys.Contains(key)) { int[] value = LotteryBallTypeDict[key]; LotteryBallType rttype = new LotteryBallType() { Count = value[0], RedCount = value[1], BlueCount = value[2] }; return rttype; } return null; } catch (Exception) { throw; } } /// /// 根据彩票种类获取需要调用的方法名 /// /// /// public static string GetFunctionValue(string key) { try { string value = Fundict[key]; return value; } catch (Exception ee) { throw; } } public static string GetClassValue(string key) { try { string value = Classdict[key]; return value; } catch (Exception) { throw; } } } }