123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- 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<LotteryData> GetLotteryListAsync(List<LotteryCode> TypeList)
- {
- try
- {
- if (TypeList==null)
- {
- return new List<LotteryData>();
- }
- List<LotteryData> list = new List<LotteryData>(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<OpenCode21Model>(em);
- if (data==null)
- {
- }
- else
- {
- var ary = Array.ConvertAll<string, int>(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;
- }
- }
- }
- }
|