123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- 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<string, string> Fundict = new Dictionary<string, string>() {
- { "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<string, string> Classdict = new Dictionary<string, string>() {
- { "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"}
- };
- /// <summary>
- /// 第一位,总数,第二位 红球,第三位蓝球,不在这的是全红或者其他格式
- /// </summary>
- private static Dictionary<string, int[]> LotteryBallTypeDict = new Dictionary<string, int[]>() {
- { "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 } }
- };
- /// <summary>
- /// 要三区比的彩种
- /// </summary>
- public static string[] Sanqu = new string[] {
- "QGC_SSQ"
- };
- /// <summary>
- /// 要大小比的彩种
- /// </summary>
- 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"
- };
- /// <summary>
- /// 彩票大小比的中间值
- /// </summary>
- public static Dictionary<string, int> DaXiaoZJZ = new Dictionary<string, int>() {
- { "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}
- };
- /// <summary>
- /// 中间值计算个数
- /// </summary>
- private static Dictionary<string, int> DaxiaoCount = new Dictionary<string, int>() {
- {"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 }
- };
- /// <summary>
- /// opencode需要take的数量
- /// </summary>
- private static Dictionary<string, int> DaxiaoTake = new Dictionary<string, int>() {
- {"QGC_PL3",3},{ "QGC_QLC",7}
- };
- /// <summary>
- /// 彩票名字和简写对应
- /// </summary>
- private static Dictionary<string, string> TypeOfNameDict = new Dictionary<string, string>() {
- {"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","泳坛夺金" }
- };
- /// <summary>
- /// 如果类型在其中就采用不同规则解析详情
- /// </summary>
- 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; }
- }
- /// <summary>
- /// 根据彩票类型取得彩票名字
- /// </summary>
- /// <param name="key"></param>
- /// <returns></returns>
- public static string GetLotteryName(string key)
- {
- if (TypeOfNameDict.Keys.Contains(key))
- {
- return TypeOfNameDict[key];
- }
- else
- {
- return null;
- }
- }
- /// <summary>
- /// 拆解detail字段返回开奖结果
- /// </summary>
- /// <param name="detail"></param>
- /// <returns></returns>
- public static List<LotteryResults> GetLotteryResults(string detail, int takenum)
- {
- try
- {
- List<LotteryResults> resultsList = new List<LotteryResults>();
- 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<LotteryResults>();
- }
- }
- /// <summary>
- /// 获取p3开奖详情
- /// </summary>
- /// <param name="detail"></param>
- /// <param name="takenum"></param>
- /// <returns></returns>
- public static List<LotteryResults> GetLotteryResultsP3(string detail)
- {
- List<LotteryResults> resultsList = new List<LotteryResults>();
- 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;
- }
- /// <summary>
- /// 获取p5开奖详情
- /// </summary>
- /// <param name="detail"></param>
- /// <param name="takenum"></param>
- /// <returns></returns>
- public static List<LotteryResults> GetLotteryResultsP5(string detail)
- {
- List<LotteryResults> resultsList = new List<LotteryResults>();
- 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;
- }
- /// <summary>
- /// 根据类名获取take个数
- /// </summary>
- /// <param name="key"></param>
- /// <returns></returns>
- public static int GetDaXiaoTake(string key)
- {
- if (DaxiaoTake.Keys.Contains(key))
- {
- return DaxiaoTake[key];
- }
- else
- {
- return 0;
- }
- }
- /// <summary>
- /// 跟据类名获取要计算大小的中间值
- /// </summary>
- /// <param name="key"></param>
- /// <returns></returns>
- public static int GetDaXiaoZJZ(string key)
- {
- if (DaXiaoZJZ.Keys.Contains(key))
- {
- return DaXiaoZJZ[key];
- }
- else
- {
- return 0;
- }
- }
- /// <summary>
- /// 根据类型名获取用来计算大小比的个数
- /// </summary>
- /// <param name="key"></param>
- /// <returns></returns>
- public static int GetDaxiaoCount(string key)
- {
- if (DaxiaoCount.Keys.Contains(key))
- {
- return DaxiaoCount[key];
- }
- else
- {
- return 0;
- }
- }
- /// <summary>
- /// 跟据类型名获取球类型
- /// </summary>
- /// <param name="key"></param>
- /// <returns></returns>
- 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;
- }
- }
- /// <summary>
- /// 根据彩票种类获取需要调用的方法名
- /// </summary>
- /// <param name="key"></param>
- /// <returns></returns>
- 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;
- }
- }
- }
- }
|