123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463 |
- using CP.Cache;
- using CP.Common;
- using CP.Model;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CP.Business
- {
- public class Fchebeipl7
- {
-
-
-
- static WMCache cache = WMCache.GetCacheService();
-
-
-
-
- public static List<Fchebeipl7Info> GetFchebeipl7List()
- {
- string key = string.Format(CacheKeys.FCHEBEIPL7_DATALIST);
- List<Fchebeipl7Info> list = cache.GetObject<List<Fchebeipl7Info>>(key);
- if (list == null)
- {
- list = Fchebeipl7Data.GetFchebeipl7List();
- cache.AddObject(key, list, (int)CacheTime.Data);
- }
- return list;
- }
-
-
-
-
-
-
-
-
-
- public static List<Fchebeipl7Info> GetFchebeipl7List(ref List<Fchebeipl7Info> list, int pagesize, int year, int sqi, int eqi, int week = 0)
- {
- List<Fchebeipl7Info> rlist = new List<Fchebeipl7Info>();
- int size = list.Count;
- if (pagesize > 0)
- {
- for (int i = (size - pagesize); i < size; i++)
- {
- rlist.Add(list[i]);
- }
- return rlist;
- }
- if (year > 0)
- {
- rlist.Clear();
- for (int i = 0; i < size; i++)
- {
- if (TypeConverter.StrToInt(list[i].qi.ToString().Substring(0, 4), 0) == year)
- rlist.Add(list[i]);
- }
- return rlist;
- }
- if (week > 0)
- {
- rlist.Clear();
- List<Fchebeipl7Info> temp = new List<Fchebeipl7Info>();
- for (int i = 0; i < size; i++)
- {
- if (list[i].week == week)
- temp.Add(list[i]);
- }
- for (int i = (temp.Count - 60); i < temp.Count; i++)
- {
- rlist.Add(temp[i]);
- }
- return rlist;
- }
- if (sqi > 0 && eqi > 0)
- {
- rlist.Clear();
- int srank = GetFchebeipl7Info(ref list, sqi).rank;
- int erank = GetFchebeipl7Info(ref list, eqi).rank;
- if (erank != 0 && srank != 0 && erank > srank)
- {
- for (int i = srank - 1; i < erank && i < size; i++)
- {
- rlist.Add(list[i]);
- }
- }
- return rlist;
- }
-
- if (pagesize == 0 && year == 0 && sqi == 0 && eqi == 0 && week == 0)
- return list;
- return rlist;
- }
-
-
-
-
-
- public static Fchebeipl7Info GetFchebeipl7Info(ref List<Fchebeipl7Info> list, int qi)
- {
- Fchebeipl7Info info = new Fchebeipl7Info();
- int size = list.Count;
- for (int i = 0; i < size; i++)
- {
- if (list[i].qi == qi)
- {
- info = list[i];
- break;
- }
- }
- return info;
- }
-
-
-
-
-
-
-
- public static Fchebeipl7Info GetLastFchebeipl7Info(ref List<Fchebeipl7Info> list, int val, int rank, int type)
- {
- Fchebeipl7Info info = new Fchebeipl7Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (type == 0 && list[i].n1 == val)
- {
- info = list[i];
- return info;
- }
- if (type == 1 && list[i].n2 == val)
- {
- info = list[i];
- return info;
- }
- if (type == 2 && list[i].n3 == val)
- {
- info = list[i];
- return info;
- }
- if (type == 3 && list[i].n4 == val)
- {
- info = list[i];
- return info;
- }
- if (type == 4 && list[i].n5 == val)
- {
- info = list[i];
- return info;
- }
- if (type == 5 && list[i].n6 == val)
- {
- info = list[i];
- return info;
- }
- if (type == 6 && list[i].n7 == val)
- {
- info = list[i];
- return info;
- }
- List<int> kjh = new List<int>() { list[i].n1, list[i].n2, list[i].n3, list[i].n4, list[i].n5, list[i].n6, list[i].n7 };
-
- if (type == 7 && kjh.Contains(val))
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Fchebeipl7Info GetLastHzFchebeipl7Info(ref List<Fchebeipl7Info> list, int val, int rank)
- {
- Fchebeipl7Info info = new Fchebeipl7Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (val < 21 && list[i].hz < 21)
- {
- info = list[i];
- return info;
- }
- if (val > 38 && list[i].hz > 38)
- {
- info = list[i];
- return info;
- }
- if (list[i].hz == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Fchebeipl7Info GetLastHwFchebeipl7Info(ref List<Fchebeipl7Info> list, int val, int rank)
- {
- Fchebeipl7Info info = new Fchebeipl7Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetHw(list[i].hz) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
- public static Fchebeipl7Info GetLastQiFchebeipl7Info(ref List<Fchebeipl7Info> list, int rank)
- {
- Fchebeipl7Info info = new Fchebeipl7Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (list[i].rank == rank - 1)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
-
-
- public static Fchebeipl7Info GetLastHzJoFchebeipl7Info(ref List<Fchebeipl7Info> list, int val, int rank)
- {
- Fchebeipl7Info info = new Fchebeipl7Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
-
- if (val == 0 && list[i].hz % 2 == 0)
- {
- info = list[i];
- return info;
- }
-
- if (val == 1 && list[i].hz % 2 != 0)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Fchebeipl7Info GetLastHzDxFchebeipl7Info(ref List<Fchebeipl7Info> list, int val, int rank)
- {
- Fchebeipl7Info info = new Fchebeipl7Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetQxcHzDx(list[i].hz) == val)
- return list[i];
- }
- return info;
- }
-
-
-
-
-
-
- public static Fchebeipl7Info GetLastHz012Fchebeipl7Info(ref List<Fchebeipl7Info> list, int val, int rank)
- {
- Fchebeipl7Info info = new Fchebeipl7Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.Get012(list[i].hz) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Fchebeipl7Info GetLastHwJoFchebeipl7Info(ref List<Fchebeipl7Info> list, int val, int rank)
- {
- Fchebeipl7Info info = new Fchebeipl7Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- int hw = ZstUtils.GetHw(list[i].hz);
- if (ZstUtils.GetJo(hw) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Fchebeipl7Info GetLastHwDxFchebeipl7Info(ref List<Fchebeipl7Info> list, int val, int rank)
- {
- Fchebeipl7Info info = new Fchebeipl7Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- int hw = ZstUtils.GetHw(list[i].hz);
- if (ZstUtils.GetDx(hw) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Fchebeipl7Info GetLastHwZhFchebeipl7Info(ref List<Fchebeipl7Info> list, int val, int rank)
- {
- Fchebeipl7Info info = new Fchebeipl7Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- int hw = ZstUtils.GetHw(list[i].hz);
- if (ZstUtils.GetZh(hw) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Fchebeipl7Info GetLastHw012Fchebeipl7Info(ref List<Fchebeipl7Info> list, int val, int rank)
- {
- Fchebeipl7Info info = new Fchebeipl7Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- int hw = ZstUtils.GetHw(list[i].hz);
- if (ZstUtils.Get012(hw) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Fchebeipl7Info GetLastHzZhFchebeipl7Info(ref List<Fchebeipl7Info> list, int val, int rank)
- {
- Fchebeipl7Info info = new Fchebeipl7Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetZh(list[i].hz) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
- }
- }
|