using Business.Util; using Common; using Models; using Models.Entity.LotteryNumDB; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Business.KJH { public class jobServiceBLL { public List GetLotteryListAsync(List TypeList) { try { if (TypeList==null) { return new List(); } List list = new List(200); lock (list) { Parallel.For(0, TypeList.Count, new ParallelOptions() { MaxDegreeOfParallelism = 20 }, item => { SCCLottery em = (SCCLottery)Enum.Parse(typeof(SCCLottery), TypeList[item].lotteryCode); string menuname = ""; if (TypeList[item].lotteryCode.Contains("QG")) { menuname = "qgc"; } else if (TypeList[item].lotteryCode.Contains("DF")) { menuname = "dfc"; } else if (TypeList[item].lotteryCode.Contains("11x5")) { menuname = "c11x5"; } else if (TypeList[item].lotteryCode.Contains("KL10F")) { menuname = "klsf"; } else if (TypeList[item].lotteryCode.Contains("SSC")|| TypeList[item].lotteryCode.Contains("SSL")) { menuname = "ssc"; } else if (TypeList[item].lotteryCode.Contains("KL12")) { menuname = "kl12"; } else if (em == SCCLottery.GP_KLPK3_ShanDong) { menuname = "qt"; } else if (em == SCCLottery.GP_QYH_ShanDong) { menuname = "klsf"; } else if (TypeList[item].lotteryCode.Contains("K3")) { menuname = "k3"; } else { menuname = "qt"; } var data = KJBLL.GetLastItem(em); if (data==null) { } else { var ary = Array.ConvertAll(data.GetCodeStr().Split(',').ToArray(), s => int.Parse(s)); var tmp = LottryDataHandle.GetLotteryData(TypeList[item].lotteryCode, int.Parse(data.Term.ToString()), data.OpenTime, data.ID, ary, data.Spare, menuname, data.KaiJiHao == null ? "" : data.KaiJiHao == null ? "" : data.KaiJiHao, data.ShiJiHao); if (tmp!=null) { list.Add(tmp); } } }); } for (int i = 0; i < list.Count; i++) { var lottery = Enum.Parse(typeof(SCCLottery), list[i].LotteryType); if (ZSlotterType.TypeOfNameDict.Keys.Contains(list[i].LotteryType)) { list[i].HasLotteryZS = true; } list[i].LotteryText = EnumHelper.GetLotteryText((SCCLottery)lottery); } return list; } catch (Exception ee) { LogHelper.Error(typeof(jobServiceBLL), ee.Message + "GetLotteryListAsync"); return null; } } } }