TrendChartItemHelper.cs 82 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using SCC.Models;
  6. namespace SCC.Crawler.DT
  7. {
  8. /// <summary>
  9. /// 走势图帮助类
  10. /// </summary>
  11. public class TrendChartItemHelper<TEntity> where TEntity : LotteryOpenCode
  12. {
  13. /// <summary>
  14. /// 初始化走势图的各项
  15. /// </summary>
  16. /// <param name="chartCssConfigs">走势图样式配置列表</param>
  17. /// <param name="trendChartItems">走势图的项的列表</param>
  18. /// <returns></returns>
  19. public List<TrendChartItem<TEntity>> InitTrendChartItem(List<ChartCssConfigInfo> chartCssConfigs, List<TrendChartItemInfo> trendChartItems)
  20. {
  21. List<TrendChartItem<TEntity>> result = new List<TrendChartItem<TEntity>>(trendChartItems.Count);
  22. TrendChartItem<TEntity> item = null;
  23. for (var i = 0; i < trendChartItems.Count; i++)
  24. {
  25. if (trendChartItems[i].ClassName == ChartItemClassName.SingleValue)
  26. item = new SingleValueTrendChartItem<TEntity>();
  27. else if (trendChartItems[i].ClassName == ChartItemClassName.MultiValue)
  28. item = new MultiValueTrendChartItem<TEntity>();
  29. else if (trendChartItems[i].ClassName == ChartItemClassName.SpecialValue)
  30. item = new SpecialValueTrendChartItem<TEntity>();
  31. var cssItem = chartCssConfigs.Where(C => C.Id == trendChartItems[i].ChartCssId && C.FuntionTypeCss == (int)trendChartItems[i].FuntionType).FirstOrDefault();
  32. item.Init(cssItem, trendChartItems[i]);
  33. result.Add(item);
  34. }
  35. return result;
  36. }
  37. }
  38. /// <summary>
  39. /// 走势图的项的帮助类
  40. /// </summary>
  41. public abstract class TrendChartItem<TEntity> where TEntity : LotteryOpenCode
  42. {
  43. #region TrendChartItem 成员
  44. public abstract bool SetItemValue(TEntity entity);
  45. public abstract bool SetItemValue(TEntity entity, TEntity lastentity);
  46. public abstract string GetFomartString(string fomart, ChartCssConfigInfo cssConfig = null);
  47. #endregion
  48. /// <summary>
  49. /// 初始化走势图基本帮助类
  50. /// </summary>
  51. /// <param name="cssConfig"></param>
  52. /// <param name="itemConfig"></param>
  53. public void Init(ChartCssConfigInfo cssConfig, TrendChartItemInfo itemConfig)
  54. {
  55. this._itemConfig = itemConfig;
  56. this._localMiss = new int[this._itemConfig.ItemCount];
  57. this._cssConfig = cssConfig;
  58. }
  59. /// <summary>
  60. /// 初使化遗漏
  61. /// </summary>
  62. /// <param name="TrendChartCofig">遗漏数据(参考项,一般为前一期的遗漏数据)</param>
  63. /// <param name="i">项索引</param>
  64. public void InitMissData(TrendChartData TrendChartCofig, int i)
  65. {
  66. if (1 >= this._itemConfig.ItemCount)
  67. return;
  68. this._maxMiss = new int[this._itemConfig.ItemCount];
  69. this._avgMiss = new int[this._itemConfig.ItemCount];
  70. this._localMiss = new int[this._itemConfig.ItemCount];
  71. this._lastMiss = new int[this._itemConfig.ItemCount];
  72. this._times = new int[this._itemConfig.ItemCount];
  73. if (null == TrendChartCofig)
  74. return;
  75. this._recordCount = TrendChartCofig.RecordCount;
  76. //初使化上期遗漏
  77. string[] array = TrendChartCofig.LastMiss[i].Split(',');
  78. for (int j = array.Length - 1; j >= 0; j--)
  79. {
  80. this._lastMiss[j] = Convert.ToInt32(array[j]);
  81. }
  82. //初使化本期遗漏
  83. array = TrendChartCofig.LocalMiss[i].Split(',');
  84. for (int j = array.Length - 1; j >= 0; j--)
  85. {
  86. this._localMiss[j] = Convert.ToInt32(array[j]);
  87. }
  88. //初使化出现次数
  89. array = TrendChartCofig.AllTimes[i].Split(',');
  90. for (int j = array.Length - 1; j >= 0; j--)
  91. {
  92. this._times[j] = Convert.ToInt32(array[j]);
  93. }
  94. //初使化最大遗漏
  95. array = TrendChartCofig.AllMaxMiss[i].Split(',');
  96. for (int j = array.Length - 1; j >= 0; j--)
  97. {
  98. this._maxMiss[j] = Convert.ToInt32(array[j]);
  99. }
  100. //初使化平均遗漏
  101. array = TrendChartCofig.AllAvgMiss[i].Split(',');
  102. for (int j = array.Length - 1; j >= 0; j--)
  103. {
  104. this._avgMiss[j] = Convert.ToInt32(array[j]);
  105. }
  106. }
  107. /// <summary>
  108. /// 获取遗漏数据
  109. /// </summary>
  110. /// <param name="missDataType"></param>
  111. /// <returns></returns>
  112. public string GetMissData(MissDataType missDataType)
  113. {
  114. if (1 >= this._itemConfig.ItemCount)
  115. return "-1";
  116. switch (missDataType)
  117. {
  118. case MissDataType.AllAvgMiss:
  119. return GetMissDataString(this._avgMiss);
  120. case MissDataType.AllMaxMiss:
  121. return GetMissDataString(this._maxMiss);
  122. case MissDataType.AllTimes:
  123. return GetMissDataString(this._times);
  124. case MissDataType.LastMiss:
  125. return GetMissDataString(this._lastMiss);
  126. case MissDataType.LocalMiss:
  127. return GetMissDataString(this._localMiss);
  128. default:
  129. return "";
  130. }
  131. }
  132. /// <summary>
  133. /// 字符串返回遗漏数据(已逗号分隔)
  134. /// </summary>
  135. /// <param name="missDataArray">遗漏数据</param>
  136. /// <returns></returns>
  137. private string GetMissDataString(int[] missDataArray)
  138. {
  139. StringBuilder sb = new StringBuilder(missDataArray.Length * 5);
  140. for (int i = 0; i < missDataArray.Length; i++)
  141. {
  142. sb.Append(missDataArray[i].ToString() + ",");
  143. }
  144. return sb.ToString().TrimEnd(',');
  145. }
  146. /// <summary>
  147. /// 通用获取HTML部分的结构和样式
  148. /// </summary>
  149. /// <param name="fomart"></param>
  150. /// <param name="cssConfig"></param>
  151. /// <returns></returns>
  152. protected Tuple<string, string, string, string> GetFomartHTML(string fomart, ChartCssConfigInfo cssConfig = null)
  153. {
  154. string _fomart = fomart;
  155. string _cssNumber = "", _cssMiss = "", _lineColor = "";
  156. if (string.IsNullOrEmpty(_fomart))
  157. _fomart = "<td {0}>{1}</td>";
  158. _fomart = string.Format(_fomart, "class=\"{0}\"{1}", "{2}");
  159. var css = this._cssConfig;
  160. if (null != cssConfig)
  161. css = cssConfig;
  162. if (null != css)
  163. {
  164. _cssNumber = css.NumberCssName;
  165. _cssMiss = css.MissCssName;
  166. _lineColor = css.LineColor;
  167. }
  168. return new Tuple<string, string, string, string>(_fomart, _cssNumber, _cssMiss, _lineColor);
  169. }
  170. /// <summary>
  171. /// 根据是否画线和是否是项值判断画线(只有项值才画线)
  172. /// </summary>
  173. /// <param name="isValue">是否是项值</param>
  174. /// <param name="color">画线颜色(有默认值)</param>
  175. /// <returns></returns>
  176. protected string GetlgroupAndColor(bool isValue, string color)
  177. {
  178. if (this._itemConfig.DrawLine && isValue)
  179. {
  180. return " lgroup=\"" + this._cssConfig.Id + "\" lcolor=\"" + color + "\"";
  181. }
  182. return "";
  183. }
  184. #region 样式设置
  185. public string GetHtml(bool isValue, string fomart, string attr, string itemValue, int index)
  186. {
  187. string value = "";
  188. switch (this._itemConfig.FuntionType)
  189. {
  190. #region 多值
  191. case ChartItemType.MultiValue_ZheHaoNumber:
  192. value = CssValueFunction.MultiValue_ZheHaoNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  193. break;
  194. case ChartItemType.MultiValue_XieLianHaoNumber:
  195. value = CssValueFunction.MultiValue_XieLianHaoNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  196. break;
  197. case ChartItemType.MultiValue_XieTiaoHaoNumber:
  198. value = CssValueFunction.MultiValue_XieTiaoHaoNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  199. break;
  200. case ChartItemType.MultiValue_ShuSanLianHaoNumber:
  201. value = CssValueFunction.MultiValue_ShuSanLianHaoNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  202. break;
  203. case ChartItemType.MultiValue_OpenCodeItem:
  204. //多值多值开奖号
  205. value = CssValueFunction.MultiValue_OpenCodeItem(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  206. break;
  207. case ChartItemType.MultiValue_LinkNumber:
  208. //多值多列重号
  209. value = CssValueFunction.MultiValue_LinkNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  210. break;
  211. case ChartItemType.MultiValue_ShuTiaoHaoNumber:
  212. //多值多列坚跳号
  213. value = CssValueFunction.MultiValue_ShuTiaoHaoNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  214. break;
  215. //多值多列重号分布
  216. case ChartItemType.MultiValue_RepeatNumber:
  217. value = CssValueFunction.MultiValue_RepeatNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  218. break;
  219. case ChartItemType.MultiValue_K3ebt:
  220. value = CssValueFunction.SetK3ebtItemValue(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  221. break;
  222. case ChartItemType.MultiValue_Ebtxt:
  223. value = CssValueFunction.SetEbtxtItemValue(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  224. break;
  225. case ChartItemType.MultiValue_Sbtxt:
  226. value = CssValueFunction.SetSbtxtItemValue(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  227. break;
  228. #endregion
  229. #region 单值
  230. //单值单列期号
  231. case ChartItemType.Term_TermItem:
  232. value = CssValueFunction.SingleCell_TermItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  233. break;
  234. //单值单列和尾
  235. case ChartItemType.SingleCell_HeWeiItem:
  236. value = CssValueFunction.SingleCell_HeWeiItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  237. break;
  238. //单值单列开奖号码
  239. case ChartItemType.SingleCell_OpenCodeItem:
  240. value = CssValueFunction.SingleCell_OpenCodeItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  241. break;
  242. //单值单列012比
  243. case ChartItemType.SingleCell_ProportionOf012Item:
  244. value = CssValueFunction.SingleCell_ProportionOf012Item(isValue, fomart, attr, this._cssConfig, itemValue, index);
  245. break;
  246. //单值单列奇偶比例
  247. case ChartItemType.SingleCell_ProportionOfJoItem:
  248. value = CssValueFunction.SingleCell_ProportionOfJoItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  249. break;
  250. //单值单列大小比例
  251. case ChartItemType.SingleCell_ProportionOfDxItem:
  252. value = CssValueFunction.SingleCell_ProportionOfDxItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  253. break;
  254. //单值单列质合比例
  255. case ChartItemType.SingleCell_ProportionOfZhItem:
  256. value = CssValueFunction.SingleCell_ProportionOfZhItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  257. break;
  258. //单值单列跨度
  259. case ChartItemType.SingleCell_SpanItem:
  260. value = CssValueFunction.SingleCell_SpanItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  261. break;
  262. //单值单列组三跨度
  263. case ChartItemType.SingleCell_ZSSpanItem:
  264. value = CssValueFunction.SingleCell_ZSSpanItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  265. break;
  266. //单值单列和值
  267. case ChartItemType.SingleCell_SumItem:
  268. value = CssValueFunction.SingleCell_SumItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  269. break;
  270. //单值多列开奖号码和值奇偶分布
  271. case ChartItemType.SingleValue_HzJoStatusItem:
  272. value = CssValueFunction.SingleValue_HzJoStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  273. break;
  274. //单值多列开奖号码和值大小分布
  275. case ChartItemType.SingleValue_HzDxStatusItem:
  276. value = CssValueFunction.SingleValue_HzDxStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  277. break;
  278. case ChartItemType.SingleValue_DxStatusItem:
  279. break;
  280. case ChartItemType.SingleValue_JoStatusItem:
  281. break;
  282. //单值单列期试机号
  283. case ChartItemType.SingleCell_ShiJiHao:
  284. value = CssValueFunction.SingleCell_ShiJiHaoItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  285. break;
  286. //单值多列试机号分布
  287. case ChartItemType.SingleValue_ShiJiHao:
  288. value = CssValueFunction.SingleValue_ShiJiHao(isValue, fomart, attr, this._cssConfig, itemValue, index);
  289. break;
  290. //单值多列组三形态
  291. case ChartItemType.SingleValue_ZsStatusItem:
  292. value = CssValueFunction.SingleValue_ZsStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  293. break;
  294. //单值多列组三奇偶形态
  295. case ChartItemType.SingleValue_ZsJoStatusItem:
  296. value = CssValueFunction.SingleValue_ZsJoStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  297. break;
  298. //单值单列开奖号012路值
  299. case ChartItemType.SingleCell_012StatusItem:
  300. value = CssValueFunction.SingleCell_012StatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  301. break;
  302. //单值多列和尾分布项
  303. case ChartItemType.SingleValue_HeWeiItem:
  304. value = CssValueFunction.SingleValue_HeWeiItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  305. break;
  306. //单值多列奇偶状态项
  307. case ChartItemType.SingleValue_JiOuStatusItem:
  308. value = CssValueFunction.SingleValue_JiOuStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  309. break;
  310. //单值多列大小状态项
  311. case ChartItemType.SingleValue_DaXiaoStatusItem:
  312. value = CssValueFunction.SingleValue_DaXiaoStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  313. break;
  314. //单值多列012分布项
  315. case ChartItemType.SingleValue_Number012StatusItem:
  316. value = CssValueFunction.SingleValue_Number012StatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  317. break;
  318. //单值多列号码项
  319. case ChartItemType.SingleValue_NumberItem:
  320. value = CssValueFunction.SingleValue_NumberItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  321. break;
  322. //单值多列多于两个号码跨度
  323. case ChartItemType.SingleValue_SpanItem:
  324. value = CssValueFunction.SingleValue_SpanItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  325. break;
  326. //单值多列两个号码跨度
  327. case ChartItemType.SingleValue_SpanNumberItem:
  328. value = CssValueFunction.SingleValue_SpanNumberItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  329. break;
  330. //单值多列开奖号码和值分布
  331. case ChartItemType.SingleValue_SumItem:
  332. value = CssValueFunction.SingleValue_SumItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  333. break;
  334. //单值单列开奖号码质合项
  335. case ChartItemType.SingleCell_ZhiHeStatusItem:
  336. value = CssValueFunction.SingleCell_ZhiHeStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  337. break;
  338. //单值多列开奖号码质合分布项
  339. case ChartItemType.SingleValue_ZhiHeStatusItem:
  340. value = CssValueFunction.SingleValue_ZhiHeStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  341. break;
  342. //单值多列组三类型
  343. case ChartItemType.SingleValue_ZuHeStatusItem:
  344. value = CssValueFunction.SingleValue_ZuHeStatusItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  345. break;
  346. //单值单列AC值
  347. case ChartItemType.SingleCell_Ac:
  348. value = CssValueFunction.SingleCell_Ac(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  349. break;
  350. //单值单列双色球三区比
  351. case ChartItemType.SingleCell_SanQu:
  352. value = CssValueFunction.SingleCell_SanQu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  353. break;
  354. //单值单列福建31选7三区比
  355. case ChartItemType.SingleCell_FJ31X7SanQu:
  356. value = CssValueFunction.SingleCell_FJ31X7SanQu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  357. break;
  358. //单值单列福建36选7三区比
  359. case ChartItemType.SingleCell_FJ36X7SanQu:
  360. value = CssValueFunction.SingleCell_FJ36X7SanQu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  361. break;
  362. //单值单列华东15选5三区比
  363. case ChartItemType.SingleCell_Hd15x5SanQU:
  364. value = CssValueFunction.SingleCell_HD15X5SanQu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  365. break;
  366. //单值单列南粤36选7三区比
  367. case ChartItemType.SingleCell_NY36x7Sanqu:
  368. value = CssValueFunction.SingleCell_NY36x7SanQu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  369. break;
  370. //单值单列AC值奇偶值
  371. case ChartItemType.SingleCell_AcJiOu:
  372. value = CssValueFunction.SingleCell_AcJiOu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  373. break;
  374. //单值单列AC值质合值
  375. case ChartItemType.SingleCell_AcZhiHe:
  376. value = CssValueFunction.SingleCell_AcZhiHe(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  377. break;
  378. //单值单列AC值012路
  379. case ChartItemType.SingleCell_Ac012Lu:
  380. value = CssValueFunction.SingleCell_Ac012Lu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  381. break;
  382. case ChartItemType.SingleValue_QuJianFenBu:
  383. break;
  384. //和尾奇偶状态
  385. case ChartItemType.SingleValue_HeWeiJiOu:
  386. value = CssValueFunction.SingleValue_HeWeiJiOu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  387. break;
  388. case ChartItemType.SingleValue_HeWeiDx:
  389. value = CssValueFunction.SingleValue_HeWeiDx(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  390. break;
  391. //单值单列试机号和值项
  392. case ChartItemType.SingleCell_ShiJiHaoHzItem:
  393. value = CssValueFunction.SingleCell_ShiJiHaoHzItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  394. break;
  395. //单值单列试机号跨度项
  396. case ChartItemType.SingleCell_ShiJiHaoSpanItem:
  397. value = CssValueFunction.SingleCell_ShiJiHaoSpanItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  398. break;
  399. //单值单列试机号奇偶比项
  400. case ChartItemType.SingleCell_ProportionOfShiJiHaoJoItem:
  401. value = CssValueFunction.SingleCell_ProportionOfShiJiHaoJoItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  402. break;
  403. //单值单列试机号大小比项
  404. case ChartItemType.SingleCell_ProportionOfShiJiHaoDxItem:
  405. value = CssValueFunction.SingleCell_ProportionOfShiJiHaoDxItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  406. break;
  407. //单值多列试机号大小比项
  408. case ChartItemType.SingleValue_ShiJiHaoTypeItem:
  409. value = CssValueFunction.SingleValue_ShiJiHaoTypeItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  410. break;
  411. //单值单列组三遗漏
  412. case ChartItemType.SingleCell_ZsMissItem:
  413. value = CssValueFunction.SingleCell_ZsMissItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  414. break;
  415. //单值单列组三号码
  416. case ChartItemType.SingleCell_ZsHaoMaItem:
  417. value = CssValueFunction.SingleCell_ZsHaoMaItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
  418. break;
  419. //单值多列组三大小形态
  420. case ChartItemType.SingleValue_ZsDxStatusItem:
  421. value = CssValueFunction.SingleValue_ZsDxStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  422. break;
  423. //单值多列组三012形态
  424. case ChartItemType.SingleValue_Zs012StatusItem:
  425. value = CssValueFunction.SingleValue_Zs012StatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  426. break;
  427. // 单值单列后区号码
  428. case ChartItemType.SingleCell_HqItem:
  429. value = CssValueFunction.SingleCell_HqItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
  430. break;
  431. //单值单列重号
  432. case ChartItemType.SingleCell_RepeatedNumber:
  433. value = CssValueFunction.SingleCell_RepeatedNumber(isValue, fomart, attr, this._cssConfig, itemValue, index);
  434. break;
  435. //单值单列连号
  436. case ChartItemType.SingleCell_LinkNumber:
  437. value = CssValueFunction.SingleCell_LinkNumber(isValue, fomart, attr, this._cssConfig, itemValue, index);
  438. break;
  439. //和值(区间)分布
  440. case ChartItemType.SingleValue_SumItemGroup:
  441. value = CssValueFunction.SingleValue_SumItemGroup(isValue, fomart, attr, this._cssConfig, itemValue, index);
  442. break;
  443. //和值正幅
  444. case ChartItemType.SingleCell_ZF:
  445. value = CssValueFunction.SingleCell_ZF(isValue, fomart, attr, this._cssConfig, itemValue, index);
  446. break;
  447. //生肖
  448. case ChartItemType.SingleValue_ShengXiao:
  449. value = CssValueFunction.SingleValue_ShengXiao(isValue, fomart, attr, this._cssConfig, itemValue, index);
  450. break;
  451. case ChartItemType.SingleValue_Hd11x5Yq:
  452. value = CssValueFunction.SingleValue_Hd11x5Yq(isValue, fomart, attr, this._cssConfig, itemValue, index);
  453. break;
  454. case ChartItemType.SingleValue_Hd11x5Eq:
  455. value = CssValueFunction.SingleValue_Hd11x5Eq(isValue, fomart, attr, this._cssConfig, itemValue, index);
  456. break;
  457. case ChartItemType.SingleValue_Hd11x5Sq:
  458. value = CssValueFunction.SingleValue_Hd11x5Sq(isValue, fomart, attr, this._cssConfig, itemValue, index);
  459. break;
  460. case ChartItemType.SingleCell_Hz012:
  461. value = CssValueFunction.SingleCell_Hz012(isValue, fomart, attr, this._cssConfig, itemValue, index);
  462. break;
  463. case ChartItemType.SingleValue_K3sbt:
  464. value = CssValueFunction.SingleCell_K3sbt(isValue, fomart, attr, this._cssConfig, itemValue, index);
  465. break;
  466. case ChartItemType.SingleCell_K3ebt:
  467. value = CssValueFunction.SingleCell_K3ebt(isValue, fomart, attr, this._cssConfig, itemValue, index);
  468. break;
  469. case ChartItemType.SingleValue_JoValue:
  470. case ChartItemType.SingleValue_OsValue:
  471. value = CssValueFunction.SingleValue_JoValue(isValue, fomart, attr, this._cssConfig, itemValue, index);
  472. break;
  473. case ChartItemType.SingleValue_DxValue:
  474. value = CssValueFunction.SingleValue_DxValue(isValue, fomart, attr, this._cssConfig, itemValue, index);
  475. break;
  476. case ChartItemType.SingleValue_XsValue:
  477. value = CssValueFunction.SingleValue_DxValue(isValue, fomart, attr, this._cssConfig, itemValue, index);
  478. break;
  479. case ChartItemType.SingleValue_ZhValue:
  480. case ChartItemType.SingleValue_HsValue:
  481. value = CssValueFunction.SingleValue_ZhValue(isValue, fomart, attr, this._cssConfig, itemValue, index);
  482. break;
  483. case ChartItemType.SingleValue_DxjoValue:
  484. value = CssValueFunction.SingleValue_DxJoValue(isValue, fomart, attr, this._cssConfig, itemValue, index);
  485. break;
  486. #endregion
  487. #region 特殊
  488. case ChartItemType.SpecialValue_FC3D012_4:
  489. value = CssValueFunction.SpecialValue_FC3D012_4(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  490. break;
  491. case ChartItemType.SpecialValue_TCP3012_4:
  492. value = CssValueFunction.SpecialValue_TCP3012_4(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  493. break;
  494. case ChartItemType.SpecialValue_FCSSQ_ChuHaoPL:
  495. value = CssValueFunction.SpecialValue_FCSSQ_ChuHaoPL(this._LocalEntity, this._itemConfig, this._cssConfig, this._ItemIndex, fomart);
  496. break;
  497. #endregion
  498. #region 高频
  499. case ChartItemType.MultiValue_KL12:
  500. value = CssValueFunction.MultiValue_KL12(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  501. break;
  502. //单值多列回摆
  503. case ChartItemType.SingleValue_HB:
  504. value = CssValueFunction.SingleValue_HB(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
  505. break;
  506. #endregion
  507. default: //没有以默认样式显示
  508. value = CssValueFunction.GetCssValue(isValue, fomart, attr, this._cssConfig, itemValue, index);
  509. break;
  510. }
  511. return value;
  512. }
  513. #endregion
  514. #region 属性
  515. /// <summary>
  516. /// 最大遗漏
  517. /// </summary>
  518. protected int[] _maxMiss;
  519. /// <summary>
  520. /// 开奖记录
  521. /// </summary>
  522. protected int _recordCount;
  523. /// <summary>
  524. /// 平均遗漏
  525. /// </summary>
  526. protected int[] _avgMiss;
  527. /// <summary>
  528. /// 出现次数
  529. /// </summary>
  530. protected int[] _times;
  531. /// <summary>
  532. /// 上期遗漏
  533. /// </summary>
  534. protected int[] _lastMiss;
  535. /// <summary>
  536. /// 当前遗漏数据
  537. /// </summary>
  538. protected int[] _localMiss;
  539. /// <summary>
  540. /// 项配置
  541. /// </summary>
  542. protected TrendChartItemInfo _itemConfig;
  543. /// <summary>
  544. /// 样式配置
  545. /// </summary>
  546. protected ChartCssConfigInfo _cssConfig;
  547. /// <summary>
  548. /// 是否画线
  549. /// </summary>
  550. protected bool _drawLine { get; set; }
  551. /// <summary>
  552. /// 项值
  553. /// </summary>
  554. public string _itemValue;
  555. /// <summary>
  556. /// 项值索引号
  557. /// </summary>
  558. public int _itemIndex;
  559. /// <summary>
  560. /// 上期项值索引值
  561. /// </summary>
  562. public int[] _lastItemIndex;
  563. /// <summary>
  564. /// 上期期号
  565. /// </summary>
  566. public long _lastTerm;
  567. /// <summary>
  568. /// 本期数据实体
  569. /// </summary>
  570. protected TEntity _LocalEntity;
  571. /// <summary>
  572. /// 上期开奖号码(根据配置取出)
  573. /// </summary>
  574. protected IList<int> _LastOpentCode;
  575. /// <summary>
  576. /// 本期索引值
  577. /// </summary>
  578. public int[] _ItemIndex;
  579. #endregion
  580. }
  581. /// <summary>
  582. /// 单值项(单值多列项)走势图帮助类
  583. /// </summary>
  584. /// <typeparam name="TEntity"></typeparam>
  585. public class SingleValueTrendChartItem<TEntity> : TrendChartItem<TEntity> where TEntity : LotteryOpenCode
  586. {
  587. /// <summary>
  588. /// 设置走势图某一项的值
  589. /// </summary>
  590. /// <param name="entity"></param>
  591. /// <returns></returns>
  592. public override bool SetItemValue(TEntity entity, TEntity nextentity)
  593. {
  594. return SetSingleValueAndMiss(entity, nextentity);
  595. }
  596. /// <summary>
  597. /// 设置走势图某一项的值
  598. /// </summary>
  599. /// <param name="entity"></param>
  600. /// <returns></returns>
  601. public override bool SetItemValue(TEntity entity)
  602. {
  603. return SetSingleValueAndMiss(entity, null);
  604. }
  605. /// <summary>
  606. /// 单列项计算项值
  607. /// </summary>
  608. /// <param name="entity"></param>
  609. /// <returns></returns>
  610. protected bool SetSingleValueAndMiss(TEntity entity, TEntity nextentity)
  611. {
  612. if (!SetSingleValue(entity, nextentity))
  613. return false;
  614. //求遗漏
  615. if (1 < this._itemConfig.ItemCount)
  616. switch (this._itemConfig.FuntionType)
  617. {
  618. case ChartItemType.SingleValue_SumItemGroup:
  619. for (var i = this._itemConfig.ItemCount - 1; i >= 0; i--)
  620. {
  621. this._localMiss[i]++;
  622. if (Convert.ToInt32(this._itemValue) >=
  623. Convert.ToInt32(this._itemConfig.ItemString[i].Split('|')[0]) &&
  624. Convert.ToInt32(this._itemValue) <=
  625. Convert.ToInt32(this._itemConfig.ItemString[i].Split('|')[1]))
  626. {
  627. if (null != this._lastMiss)
  628. this._lastMiss[i] = this._localMiss[i];//上期遗漏
  629. this._localMiss[i] = 0;//重置当前遗漏
  630. if (null != this._times)
  631. this._times[i]++;//出现次数加1
  632. this._itemIndex = i;//设置项值索引号
  633. }
  634. //最大遗漏
  635. if (null != this._maxMiss)
  636. if (this._localMiss[i] > this._maxMiss[i])
  637. { this._maxMiss[i] = this._localMiss[i]; }
  638. //this._avgMiss[i] = this._maxMiss[i] / (this._times[i] + 1);//计算平均遗漏
  639. if (null != this._avgMiss && null != this._times)
  640. this._avgMiss[i] = (this._recordCount - this._times[i]) / (this._times[i] + 1);//计算平均遗漏
  641. }
  642. break;
  643. case ChartItemType.SingleValue_QuJianFenBu:
  644. for (var i = this._itemConfig.ItemCount - 1; i >= 0; i--)
  645. {
  646. this._localMiss[i]++;//当前遗漏
  647. if (Convert.ToInt32(this._itemValue) >=
  648. Convert.ToInt32(this._itemConfig.ItemString[i].Split('|')[0]) &&
  649. Convert.ToInt32(this._itemValue) <=
  650. Convert.ToInt32(this._itemConfig.ItemString[i].Split('|')[1]))
  651. {
  652. if (null != this._lastMiss)
  653. this._lastMiss[i] = this._localMiss[i];//上期遗漏
  654. this._localMiss[i] = 0;//重置当前遗漏
  655. if (null != this._times)
  656. this._times[i]++;//出现次数加1
  657. this._itemIndex = i;//设置项值索引号
  658. }
  659. //最大遗漏
  660. if (null != this._maxMiss)
  661. if (this._localMiss[i] > this._maxMiss[i])
  662. { this._maxMiss[i] = this._localMiss[i]; }
  663. //this._avgMiss[i] = this._maxMiss[i] / (this._times[i] + 1);//计算平均遗漏
  664. if (null != this._avgMiss && null != this._times)
  665. this._avgMiss[i] = (this._recordCount - this._times[i]) / (this._times[i] + 1);//计算平均遗漏
  666. }
  667. break;
  668. default:
  669. for (var i = this._itemConfig.ItemCount - 1; i >= 0; i--)
  670. {
  671. this._localMiss[i]++;
  672. if (this._itemValue == this._itemConfig.ItemString[i])
  673. {
  674. if (null != this._lastMiss)
  675. this._lastMiss[i] = this._localMiss[i];//上期遗漏
  676. this._localMiss[i] = 0;//重置当前遗漏
  677. if (null != this._times)
  678. this._times[i]++;//出现次数加1
  679. this._itemIndex = i;//设置项值索引号
  680. }
  681. //最大遗漏
  682. if (null != this._maxMiss)
  683. if (this._localMiss[i] > this._maxMiss[i])
  684. { this._maxMiss[i] = this._localMiss[i]; }
  685. //this._avgMiss[i] = this._maxMiss[i] / (this._times[i] + 1);//计算平均遗漏
  686. if (null != this._avgMiss && null != this._times)
  687. this._avgMiss[i] = (this._recordCount - this._times[i]) / (this._times[i] + 1);//计算平均遗漏
  688. }
  689. break;
  690. }
  691. return true;
  692. }
  693. /// <summary>
  694. /// 设置单值项 项的值
  695. /// </summary>
  696. /// <param name="entity"></param>
  697. /// <returns></returns>
  698. protected bool SetSingleValue(TEntity entity, TEntity nextentity)
  699. {
  700. bool yes = false;
  701. yes = !entity.OpenCode.Contains(-1);
  702. if (nextentity != null)
  703. {
  704. IList<int> list = new List<int>(nextentity.OpenCode);
  705. if (-1 != this._itemConfig.IndexEnd)
  706. {
  707. for (int i = list.Count - 1; i >= this._itemConfig.IndexEnd; i--)
  708. { list.RemoveAt(this._itemConfig.IndexEnd); }
  709. }
  710. for (int i = 0; i < this._itemConfig.IndexStart; i++)
  711. { list.RemoveAt(0); }
  712. _lastItemIndex = new int[list.Count];
  713. for (int i = 0; i < list.Count; i++)
  714. {
  715. _lastItemIndex[i] = list[i];
  716. }
  717. }
  718. switch (this._itemConfig.FuntionType)
  719. {
  720. case ChartItemType.Term_TermItem:
  721. if (entity.Term > 0)
  722. { this._itemValue = SingleValueFunction.GetTermItemValue(entity); yes = true; }
  723. break;
  724. case ChartItemType.SingleCell_HeWeiItem:
  725. if (!entity.OpenCode.Contains(-1))
  726. {
  727. this._itemValue = SingleValueFunction.GetHeWeiItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd);
  728. yes = true;
  729. }
  730. break;
  731. case ChartItemType.SingleCell_OpenCodeItem:
  732. if (!entity.OpenCode.Contains(-1))
  733. {
  734. this._itemValue = SingleValueFunction.GetOpenCodeItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  735. yes = true;
  736. }
  737. break;
  738. case ChartItemType.SingleCell_ProportionOf012Item:
  739. if (!entity.OpenCode.Contains(-1))
  740. {
  741. this._itemValue = SingleValueFunction.GetProportionOf012ItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  742. yes = true;
  743. }
  744. break;
  745. case ChartItemType.SingleCell_ProportionOfJoItem:
  746. if (!entity.OpenCode.Contains(-1))
  747. {
  748. this._itemValue = SingleValueFunction.GetProportionOfJoItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  749. yes = true;
  750. }
  751. break;
  752. case ChartItemType.SingleCell_ProportionOfDxItem:
  753. if (!entity.OpenCode.Contains(-1))
  754. {
  755. this._itemValue = SingleValueFunction.GetProportionOfDxItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd,
  756. this._itemConfig.ItemCount, this._itemConfig.SplitNumberOfDX);
  757. yes = true;
  758. }
  759. break;
  760. case ChartItemType.SingleCell_ProportionOfZhItem:
  761. if (!entity.OpenCode.Contains(-1))
  762. {
  763. this._itemValue = SingleValueFunction.GetProportionOfZhItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  764. yes = true;
  765. }
  766. break;
  767. case ChartItemType.SingleCell_SpanItem:
  768. if (!entity.OpenCode.Contains(-1))
  769. {
  770. this._itemValue = SingleValueFunction.GetSpanItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  771. yes = true;
  772. }
  773. break;
  774. case ChartItemType.SingleCell_ZSSpanItem:
  775. if (!entity.OpenCode.Contains(-1))
  776. {
  777. this._itemValue = SingleValueFunction.GetZSSpanItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  778. yes = true;
  779. }
  780. break;
  781. case ChartItemType.SingleCell_SumItem:
  782. if (!entity.OpenCode.Contains(-1))
  783. {
  784. this._itemValue = SingleValueFunction.GetSumItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  785. yes = true;
  786. }
  787. break;
  788. case ChartItemType.SingleValue_HzJoStatusItem:
  789. if (!entity.OpenCode.Contains(-1))
  790. {
  791. this._itemValue = SingleValueFunction.GetHzJoStatusValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  792. yes = true;
  793. }
  794. break;
  795. case ChartItemType.SingleValue_HzDxStatusItem:
  796. if (!entity.OpenCode.Contains(-1))
  797. {
  798. this._itemValue = SingleValueFunction.GetHzDxStatusValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.SplitNumberOfDX, this._itemConfig.ItemCount);
  799. yes = true;
  800. }
  801. break;
  802. case ChartItemType.SingleValue_DxStatusItem:
  803. if (!entity.OpenCode.Contains(-1))
  804. {
  805. this._itemValue = SingleValueFunction.GetDxStatusValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  806. yes = true;
  807. }
  808. break;
  809. case ChartItemType.SingleValue_JoStatusItem:
  810. if (!entity.OpenCode.Contains(-1))
  811. {
  812. this._itemValue = SingleValueFunction.GetJoStatusItem(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  813. yes = true;
  814. }
  815. break;
  816. case ChartItemType.SingleCell_ShiJiHao:
  817. if (entity.ShiJiHao.IndexOf("-1") == -1)
  818. {
  819. this._itemValue = SingleValueFunction.GetShiJiHaoItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  820. yes = true;
  821. }
  822. break;
  823. case ChartItemType.SingleValue_ShiJiHao:
  824. if (entity.ShiJiHao.IndexOf("-1") == -1)
  825. {
  826. this._itemValue = SingleValueFunction.GetShiJiHaoSingleValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  827. yes = true;
  828. }
  829. break;
  830. case ChartItemType.SingleValue_ZsStatusItem:
  831. if (!entity.OpenCode.Contains(-1))
  832. {
  833. this._itemValue = SingleValueFunction.GetZsStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  834. yes = true;
  835. }
  836. break;
  837. case ChartItemType.SingleValue_ZsJoStatusItem:
  838. if (!entity.OpenCode.Contains(-1))
  839. {
  840. this._itemValue = SingleValueFunction.GetZsJoStatusValue(entity);
  841. yes = true;
  842. }
  843. break;
  844. case ChartItemType.SingleCell_012StatusItem:
  845. if (!entity.OpenCode.Contains(-1))
  846. {
  847. this._itemValue = SingleValueFunction.Get012StatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  848. yes = true;
  849. }
  850. break;
  851. case ChartItemType.SingleValue_HeWeiItem:
  852. if (!entity.OpenCode.Contains(-1))
  853. {
  854. this._itemValue = SingleValueFunction.GetHeWeiSingleValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  855. yes = true;
  856. }
  857. break;
  858. case ChartItemType.SingleValue_JiOuStatusItem:
  859. if (!entity.OpenCode.Contains(-1))
  860. {
  861. this._itemValue = SingleValueFunction.GetJiOuStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  862. yes = true;
  863. }
  864. break;
  865. case ChartItemType.SingleValue_DaXiaoStatusItem:
  866. if (!entity.OpenCode.Contains(-1))
  867. {
  868. this._itemValue = SingleValueFunction.GetDaXiaoStatusItemValue(entity,
  869. this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.SplitNumberOfDX);
  870. yes = true;
  871. }
  872. break;
  873. case ChartItemType.SingleValue_Number012StatusItem:
  874. if (!entity.OpenCode.Contains(-1))
  875. {
  876. this._itemValue = SingleValueFunction.GetNumber012StatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  877. yes = true;
  878. }
  879. break;
  880. case ChartItemType.SingleValue_NumberItem:
  881. if (!entity.OpenCode.Contains(-1))
  882. {
  883. this._itemValue = SingleValueFunction.GetNumberItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  884. yes = true;
  885. }
  886. break;
  887. case ChartItemType.SingleValue_SpanItem:
  888. if (!entity.OpenCode.Contains(-1))
  889. {
  890. this._itemValue = SingleValueFunction.GetSpanSingleValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  891. yes = true;
  892. }
  893. break;
  894. case ChartItemType.SingleValue_SpanNumberItem:
  895. if (!entity.OpenCode.Contains(-1))
  896. {
  897. this._itemValue = SingleValueFunction.GetSpanNumberItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  898. yes = true;
  899. }
  900. break;
  901. case ChartItemType.SingleValue_SumItem:
  902. if (!entity.OpenCode.Contains(-1))
  903. {
  904. this._itemValue = SingleValueFunction.GetSumSingleValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  905. yes = true;
  906. }
  907. break;
  908. case ChartItemType.SingleValue_ZhiHeStatusItem:
  909. if (!entity.OpenCode.Contains(-1))
  910. {
  911. this._itemValue = SingleValueFunction.GetZhiHeStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  912. yes = true;
  913. }
  914. break;
  915. case ChartItemType.SingleCell_ZhiHeStatusItem:
  916. if (!entity.OpenCode.Contains(-1))
  917. {
  918. this._itemValue = SingleValueFunction.GetZhiHeItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  919. yes = true;
  920. }
  921. break;
  922. case ChartItemType.SingleValue_ZuHeStatusItem:
  923. if (!entity.OpenCode.Contains(-1))
  924. {
  925. this._itemValue = SingleValueFunction.GetZuHeStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  926. yes = true;
  927. }
  928. break;
  929. case ChartItemType.SingleCell_Ac:
  930. if (!entity.OpenCode.Contains(-1))
  931. {
  932. this._itemValue = SingleValueFunction.GetAcValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  933. yes = true;
  934. }
  935. break;
  936. case ChartItemType.SingleCell_SanQu:
  937. if (!entity.OpenCode.Contains(-1))
  938. {
  939. this._itemValue = SingleValueFunction.GetSsqsanqu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  940. yes = true;
  941. }
  942. break;
  943. case ChartItemType.SingleCell_AcJiOu:
  944. if (!entity.OpenCode.Contains(-1))
  945. {
  946. this._itemValue = SingleValueFunction.GetAcJiOu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  947. yes = true;
  948. }
  949. break;
  950. case ChartItemType.SingleCell_AcZhiHe:
  951. if (!entity.OpenCode.Contains(-1))
  952. {
  953. this._itemValue = SingleValueFunction.GetAcZhiHe(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  954. yes = true;
  955. }
  956. break;
  957. case ChartItemType.SingleCell_Ac012Lu:
  958. if (!entity.OpenCode.Contains(-1))
  959. {
  960. this._itemValue = SingleValueFunction.GetAc012Lu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  961. yes = true;
  962. }
  963. break;
  964. case ChartItemType.SingleValue_QuJianFenBu:
  965. if (!entity.OpenCode.Contains(-1))
  966. {
  967. this._itemValue = SingleValueFunction.GetQuJianStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  968. yes = true;
  969. }
  970. break;
  971. case ChartItemType.SingleValue_HeWeiJiOu:
  972. if (!entity.OpenCode.Contains(-1))
  973. {
  974. this._itemValue = SingleValueFunction.GetHeWeiJiOuFenBu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  975. yes = true;
  976. }
  977. break;
  978. case ChartItemType.SingleValue_HeWeiDx:
  979. if (!entity.OpenCode.Contains(-1))
  980. {
  981. this._itemValue = SingleValueFunction.GetHeWeiDxFenBu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.SplitNumberOfDX, this._itemConfig.ItemCount);
  982. yes = true;
  983. }
  984. break;
  985. case ChartItemType.SingleCell_ShiJiHaoHzItem:
  986. if (entity.ShiJiHao.IndexOf("-1") == -1)
  987. {
  988. this._itemValue = SingleValueFunction.GetShiJiHaoHzValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  989. yes = true;
  990. }
  991. break;
  992. case ChartItemType.SingleCell_ShiJiHaoSpanItem:
  993. if (entity.ShiJiHao.IndexOf("-1") == -1)
  994. {
  995. this._itemValue = SingleValueFunction.GetShiJiHaoSpanValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  996. yes = true;
  997. }
  998. break;
  999. case ChartItemType.SingleCell_ProportionOfShiJiHaoJoItem:
  1000. if (entity.ShiJiHao.IndexOf("-1") == -1)
  1001. {
  1002. this._itemValue = SingleValueFunction.GetProportionOfShiJiHaoJoItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1003. yes = true;
  1004. }
  1005. break;
  1006. case ChartItemType.SingleCell_ProportionOfShiJiHaoDxItem:
  1007. if (entity.ShiJiHao.IndexOf("-1") == -1)
  1008. {
  1009. this._itemValue = SingleValueFunction.GetProportionOfShiJiHaoDxItemValue(entity,
  1010. this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.SplitNumberOfDX);
  1011. yes = true;
  1012. }
  1013. break;
  1014. case ChartItemType.SingleValue_ShiJiHaoTypeItem:
  1015. if (entity.ShiJiHao.IndexOf("-1") == -1)
  1016. {
  1017. this._itemValue = SingleValueFunction.GetShiJiHaoTyepValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1018. yes = true;
  1019. }
  1020. break;
  1021. case ChartItemType.SingleCell_ZsMissItem:
  1022. if (!entity.OpenCode.Contains(-1))
  1023. {
  1024. this._itemValue = SingleValueFunction.GetZsMissItem(entity, ref _lastTerm);
  1025. yes = true;
  1026. }
  1027. break;
  1028. case ChartItemType.SingleCell_ZsHaoMaItem:
  1029. if (!entity.OpenCode.Contains(-1))
  1030. {
  1031. this._itemValue = SingleValueFunction.GetZsHaoMaValue(entity);
  1032. yes = true;
  1033. }
  1034. break;
  1035. case ChartItemType.SingleValue_ZsDxStatusItem:
  1036. if (!entity.OpenCode.Contains(-1))
  1037. {
  1038. this._itemValue = SingleValueFunction.GetZsDxStatusValue(entity, this._itemConfig.SplitNumberOfDX);
  1039. yes = true;
  1040. }
  1041. break;
  1042. case ChartItemType.SingleValue_Zs012StatusItem:
  1043. if (!entity.OpenCode.Contains(-1))
  1044. {
  1045. this._itemValue = SingleValueFunction.GetZs012StatusValue(entity);
  1046. yes = true;
  1047. }
  1048. break;
  1049. case ChartItemType.SingleCell_HqItem:
  1050. if (!entity.OpenCode.Contains(-1))
  1051. {
  1052. this._itemValue = SingleValueFunction.GetHqValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1053. yes = true;
  1054. }
  1055. break;
  1056. case ChartItemType.SingleCell_RepeatedNumber:
  1057. if (!entity.OpenCode.Contains(-1))
  1058. {
  1059. this._itemValue = SingleValueFunction.GetRepeatNumItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref _lastItemIndex, this._itemConfig.ItemCount);
  1060. yes = true;
  1061. }
  1062. break;
  1063. case ChartItemType.SingleCell_LinkNumber:
  1064. if (!entity.OpenCode.Contains(-1))
  1065. {
  1066. this._itemValue = SingleValueFunction.GetLinkNumItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1067. yes = true;
  1068. }
  1069. break;
  1070. case ChartItemType.SingleValue_SumItemGroup:
  1071. if (!entity.OpenCode.Contains(-1))
  1072. {
  1073. this._itemValue = SingleValueFunction.GetSumSingleValueGroup(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1074. yes = true;
  1075. }
  1076. break;
  1077. case ChartItemType.SingleValue_SX:
  1078. if (!entity.OpenCode.Contains(-1))
  1079. {
  1080. this._itemValue = SingleValueFunction.GetSXStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1081. yes = true;
  1082. }
  1083. break;
  1084. case ChartItemType.SingleValue_JJ:
  1085. if (!entity.OpenCode.Contains(-1))
  1086. {
  1087. this._itemValue = SingleValueFunction.GetJJStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1088. yes = true;
  1089. }
  1090. break;
  1091. case ChartItemType.SingleValue_FW:
  1092. if (!entity.OpenCode.Contains(-1))
  1093. {
  1094. this._itemValue = SingleValueFunction.GetFWStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1095. yes = true;
  1096. }
  1097. break;
  1098. case ChartItemType.SingleValue_HB:
  1099. if (!entity.OpenCode.Contains(-1))
  1100. {
  1101. this._itemValue = SingleValueFunction.HBSingleValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref _lastItemIndex, this._itemConfig.ItemCount);
  1102. yes = true;
  1103. }
  1104. break;
  1105. case ChartItemType.SingleCell_ZF:
  1106. if (!entity.OpenCode.Contains(-1))
  1107. {
  1108. this._itemValue = SingleValueFunction.ZFSingleCell(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref _lastItemIndex, this._itemConfig.ItemCount);
  1109. yes = true;
  1110. }
  1111. break;
  1112. case ChartItemType.SingleCell_FJ31X7SanQu:
  1113. if (!entity.OpenCode.Contains(-1))
  1114. {
  1115. this._itemValue = SingleValueFunction.GetFj31x7sanqu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1116. yes = true;
  1117. }
  1118. break;
  1119. case ChartItemType.SingleCell_FJ36X7SanQu:
  1120. if (!entity.OpenCode.Contains(-1))
  1121. {
  1122. this._itemValue = SingleValueFunction.GetFj36x7sanqu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1123. yes = true;
  1124. }
  1125. break;
  1126. case ChartItemType.SingleValue_ShengXiao:
  1127. if (!entity.OpenCode.Contains(-1))
  1128. {
  1129. this._itemValue = SingleValueFunction.Getdf6j1sx(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1130. yes = true;
  1131. }
  1132. break;
  1133. case ChartItemType.SingleCell_Hd15x5SanQU:
  1134. if (!entity.OpenCode.Contains(-1))
  1135. {
  1136. this._itemValue = SingleValueFunction.Gethd15x5sanqu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1137. yes = true;
  1138. }
  1139. break;
  1140. case ChartItemType.SingleCell_NY36x7Sanqu:
  1141. if (!entity.OpenCode.Contains(-1))
  1142. {
  1143. this._itemValue = SingleValueFunction.Getny36x7sanqu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1144. yes = true;
  1145. }
  1146. break;
  1147. case ChartItemType.SingleValue_Hd11x5Yq:
  1148. if (!entity.OpenCode.Contains(-1))
  1149. {
  1150. this._itemValue = SingleValueFunction.Gethd15x5Yq(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, 1, 5);
  1151. yes = true;
  1152. }
  1153. break;
  1154. case ChartItemType.SingleValue_Hd11x5Eq:
  1155. if (!entity.OpenCode.Contains(-1))
  1156. {
  1157. this._itemValue = SingleValueFunction.Gethd15x5Eq(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, 6, 10);
  1158. yes = true;
  1159. }
  1160. break;
  1161. case ChartItemType.SingleValue_Hd11x5Sq:
  1162. if (!entity.OpenCode.Contains(-1))
  1163. {
  1164. this._itemValue = SingleValueFunction.Gethd15x5Sq(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, 11, 15);
  1165. yes = true;
  1166. }
  1167. break;
  1168. case ChartItemType.SingleCell_Hz012:
  1169. if (!entity.OpenCode.Contains(-1))
  1170. {
  1171. this._itemValue = SingleValueFunction.GetHz012Value(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1172. yes = true;
  1173. }
  1174. break;
  1175. case ChartItemType.SingleValue_K3sbt:
  1176. if (!entity.OpenCode.Contains(-1))
  1177. {
  1178. this._itemValue = SingleValueFunction.GetK3sbtValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemString);
  1179. yes = true;
  1180. }
  1181. break;
  1182. case ChartItemType.SingleCell_K3ebt:
  1183. if (!entity.OpenCode.Contains(-1))
  1184. {
  1185. this._itemValue = SingleValueFunction.GetEbtValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1186. yes = true;
  1187. }
  1188. break;
  1189. case ChartItemType.SingleValue_JoValue:
  1190. if (!entity.OpenCode.Contains(-1))
  1191. {
  1192. this._itemValue = SingleValueFunction.GetJoValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1193. yes = true;
  1194. }
  1195. break;
  1196. case ChartItemType.SingleValue_DxValue:
  1197. if (!entity.OpenCode.Contains(-1))
  1198. {
  1199. this._itemValue = SingleValueFunction.GetDxValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.SplitNumberOfDX); ;
  1200. yes = true;
  1201. }
  1202. break;
  1203. case ChartItemType.SingleValue_ZhValue:
  1204. if (!entity.OpenCode.Contains(-1))
  1205. {
  1206. this._itemValue = SingleValueFunction.GetZhValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1207. yes = true;
  1208. }
  1209. break;
  1210. case ChartItemType.SingleValue_DxjoValue:
  1211. if (!entity.OpenCode.Contains(-1))
  1212. {
  1213. this._itemValue = SingleValueFunction.GetDxjoValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.SplitNumberOfDX, this._itemConfig.ItemCount);
  1214. yes = true;
  1215. }
  1216. break;
  1217. case ChartItemType.SingleValue_XsValue://小数个数
  1218. if (!entity.OpenCode.Contains(-1))
  1219. {
  1220. this._itemValue = SingleValueFunction.GetXsValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.SplitNumberOfDX);
  1221. yes = true;
  1222. }
  1223. break;
  1224. case ChartItemType.SingleValue_HsValue://合数个数
  1225. if (!entity.OpenCode.Contains(-1))
  1226. {
  1227. this._itemValue = SingleValueFunction.GetHsValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1228. yes = true;
  1229. }
  1230. break;
  1231. case ChartItemType.SingleValue_OsValue://偶数个数
  1232. if (!entity.OpenCode.Contains(-1))
  1233. {
  1234. this._itemValue = SingleValueFunction.GetOsValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
  1235. yes = true;
  1236. }
  1237. break;
  1238. }
  1239. if (yes)
  1240. this._LocalEntity = entity;
  1241. return yes;
  1242. }
  1243. /// <summary>
  1244. /// 获取格式化后的HTML内容
  1245. /// </summary>
  1246. /// <param name="fomart"></param>
  1247. /// <param name="cssConfig"></param>
  1248. /// <returns></returns>
  1249. public override string GetFomartString(string fomart, ChartCssConfigInfo cssConfig = null)
  1250. {
  1251. var html = GetFomartHTML(fomart, cssConfig);
  1252. //var attr = "";
  1253. //if (this._itemConfig.DrawLine)
  1254. //{
  1255. // attr = " lgroup=\"" + this._itemConfig.Id + "\" lcolor=\"" + html.Item4 + "\"";
  1256. //}
  1257. var sp = new StringBuilder((html.Item1.Length + 40) * this._itemConfig.ItemCount);
  1258. for (int i = 0; i < this._itemConfig.ItemCount; i++)
  1259. {
  1260. if (_itemValue == "")
  1261. {
  1262. sp.Append(GetHtml(false, html.Item1, GetlgroupAndColor(false, html.Item4), _localMiss[i].ToString(), i));
  1263. }
  1264. else
  1265. {
  1266. sp.Append(this._itemIndex == i ? GetHtml(true, html.Item1, GetlgroupAndColor(true, html.Item4), _itemValue, i) : GetHtml(false, html.Item1, GetlgroupAndColor(false, html.Item4), _localMiss[i].ToString(), i));
  1267. }
  1268. }
  1269. return sp.ToString();
  1270. }
  1271. /// <summary>
  1272. /// 核实开奖号码中是否存在-1
  1273. /// </summary>
  1274. /// <param name="entity"></param>
  1275. /// <returns></returns>
  1276. protected bool CheckOpenCodeContainNegativeOne(TEntity entity)
  1277. {
  1278. var entityType = typeof(TEntity);
  1279. var propertyOpenCode1 = entityType.GetProperty("OpenCode1");
  1280. if (propertyOpenCode1 != null && Convert.ToInt32(propertyOpenCode1.GetValue(entity, null)) == -1)
  1281. return true;
  1282. var propertyOpenCode2 = entityType.GetProperty("OpenCode2");
  1283. if (propertyOpenCode2 != null && Convert.ToInt32(propertyOpenCode2.GetValue(entity, null)) == -1)
  1284. return true;
  1285. var propertyOpenCode3 = entityType.GetProperty("OpenCode3");
  1286. if (propertyOpenCode3 != null && Convert.ToInt32(propertyOpenCode3.GetValue(entity, null)) == -1)
  1287. return true;
  1288. var propertyOpenCode4 = entityType.GetProperty("OpenCode4");
  1289. if (propertyOpenCode4 != null && Convert.ToInt32(propertyOpenCode4.GetValue(entity, null)) == -1)
  1290. return true;
  1291. var propertyOpenCode5 = entityType.GetProperty("OpenCode5");
  1292. if (propertyOpenCode5 != null && Convert.ToInt32(propertyOpenCode5.GetValue(entity, null)) == -1)
  1293. return true;
  1294. var propertyOpenCode6 = entityType.GetProperty("OpenCode6");
  1295. if (propertyOpenCode6 != null && Convert.ToInt32(propertyOpenCode6.GetValue(entity, null)) == -1)
  1296. return true;
  1297. var propertyOpenCode7 = entityType.GetProperty("OpenCode7");
  1298. if (propertyOpenCode7 != null && Convert.ToInt32(propertyOpenCode7.GetValue(entity, null)) == -1)
  1299. return true;
  1300. var propertyOpenCode8 = entityType.GetProperty("OpenCode8");
  1301. if (propertyOpenCode8 != null && Convert.ToInt32(propertyOpenCode8.GetValue(entity, null)) == -1)
  1302. return true;
  1303. return false;
  1304. }
  1305. }
  1306. /// <summary>
  1307. /// 多值项(多值多列项)走势图帮助类
  1308. /// </summary>
  1309. /// <typeparam name="TEntity"></typeparam>
  1310. public class MultiValueTrendChartItem<TEntity> : TrendChartItem<TEntity> where TEntity : LotteryOpenCode
  1311. {
  1312. public new int[] _itemIndex;
  1313. /// <summary>
  1314. /// 设置走势图某一项的值
  1315. /// </summary>
  1316. /// <param name="entity"></param>
  1317. /// <returns></returns>
  1318. public override bool SetItemValue(TEntity entity, TEntity lastentity)
  1319. {
  1320. _itemIndex = new int[this._itemConfig.ItemCount];
  1321. return SetMultiValueAndMiss(entity, ref _itemIndex, ref this._localMiss);
  1322. }
  1323. /// <summary>
  1324. /// 设置走势图某一项的值
  1325. /// </summary>
  1326. /// <param name="entity"></param>
  1327. /// <returns></returns>
  1328. public override bool SetItemValue(TEntity entity)
  1329. {
  1330. _itemIndex = new int[this._itemConfig.ItemCount];
  1331. return SetMultiValueAndMiss(entity, ref _itemIndex, ref this._localMiss);
  1332. }
  1333. /// <summary>
  1334. /// 获取格式化后的HTML内容
  1335. /// </summary>
  1336. /// <param name="fomart"></param>
  1337. /// <param name="cssConfig"></param>
  1338. /// <returns></returns>
  1339. public override string GetFomartString(string fomart, ChartCssConfigInfo cssConfig = null)
  1340. {
  1341. var html = GetFomartHTML(fomart, cssConfig);
  1342. var sp = new StringBuilder((html.Item1.Length + 40) * this._itemConfig.ItemCount);
  1343. for (int i = 0; i < this._itemConfig.ItemCount; i++)
  1344. {
  1345. sp.Append(0 < this._itemIndex[i] ? GetHtml(true, html.Item1, GetlgroupAndColor(true, html.Item4), this._itemConfig.ItemString[i], i) : GetHtml(false, html.Item1, GetlgroupAndColor(false, html.Item4), _localMiss[i].ToString(), i));
  1346. }
  1347. return sp.ToString();
  1348. }
  1349. /// <summary>
  1350. /// 设置多值项 项的值
  1351. /// </summary>
  1352. /// <param name="entity"></param>
  1353. /// <param name="index">项值索引</param>
  1354. /// <param name="missNumber">遗漏</param>
  1355. protected bool SetMultiValueAndMiss(TEntity entity, ref int[] index, ref int[] missNumber)
  1356. {
  1357. bool yes = false;
  1358. yes = !entity.OpenCode.Contains(-1);
  1359. switch (this._itemConfig.FuntionType)
  1360. {
  1361. #region 全国性彩种
  1362. case ChartItemType.MultiValue_OpenCodeItem:
  1363. MultiValueFunction.SetOpenCodeItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount);
  1364. break;
  1365. case ChartItemType.MultiValue_LinkNumber:
  1366. MultiValueFunction.SetLinkNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount);
  1367. break;
  1368. case ChartItemType.MultiValue_RepeatNumber:
  1369. MultiValueFunction.SetRepeatNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
  1370. break;
  1371. case ChartItemType.MultiValue_ZheHaoNumber:
  1372. MultiValueFunction.SetZheHaoHaoNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
  1373. break;
  1374. case ChartItemType.MultiValue_XieLianHaoNumber:
  1375. MultiValueFunction.SetXieLianHaoNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
  1376. break;
  1377. case ChartItemType.MultiValue_XieTiaoHaoNumber:
  1378. MultiValueFunction.SetTiaoHaoNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
  1379. break;
  1380. case ChartItemType.MultiValue_ShuSanLianHaoNumber:
  1381. MultiValueFunction.SetShuSanLianHaoNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
  1382. break;
  1383. case ChartItemType.MultiValue_ShuTiaoHaoNumber:
  1384. MultiValueFunction.SetShuTiaoHaoNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
  1385. break;
  1386. case ChartItemType.MultiValue_K3ebt:
  1387. MultiValueFunction.SetK3ebtItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, this._itemConfig.ItemString);
  1388. break;
  1389. case ChartItemType.MultiValue_Sbtxt:
  1390. MultiValueFunction.SetSbtxtItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, this._itemConfig.ItemString);
  1391. break;
  1392. case ChartItemType.MultiValue_Ebtxt:
  1393. MultiValueFunction.SetEbtxtItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, this._itemConfig.ItemString);
  1394. break;
  1395. #endregion
  1396. #region 高频彩种
  1397. case ChartItemType.MultiValue_KL12:
  1398. MultiValueFunction.SetKL12NumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
  1399. break;
  1400. #endregion
  1401. }
  1402. if (yes)
  1403. this._LocalEntity = entity;
  1404. return yes;
  1405. }
  1406. }
  1407. /// <summary>
  1408. /// 特殊项走势图帮助类
  1409. /// </summary>
  1410. /// <typeparam name="TEntity"></typeparam>
  1411. public class SpecialValueTrendChartItem<TEntity> : TrendChartItem<TEntity> where TEntity : LotteryOpenCode
  1412. {
  1413. public new int[] _itemIndex;
  1414. /// <summary>
  1415. /// 设置走势图某一项的值
  1416. /// </summary>
  1417. /// <param name="entity"></param>
  1418. /// <returns></returns>
  1419. public override bool SetItemValue(TEntity entity)
  1420. {
  1421. if (this._ItemIndex == null)
  1422. {
  1423. this._ItemIndex = new int[this._itemConfig.ItemCount];
  1424. }
  1425. _itemIndex = new int[this._itemConfig.ItemCount];
  1426. return SetSpecialValue(entity, ref _itemIndex, ref this._ItemIndex);
  1427. }
  1428. /// <summary>
  1429. /// 设置走势图某一项的值
  1430. /// </summary>
  1431. /// <param name="entity"></param>
  1432. /// <returns></returns>
  1433. public override bool SetItemValue(TEntity entity, TEntity lastentity)
  1434. {
  1435. if (this._ItemIndex == null)
  1436. {
  1437. this._ItemIndex = new int[this._itemConfig.ItemCount];
  1438. }
  1439. _itemIndex = new int[this._itemConfig.ItemCount];
  1440. return SetSpecialValue(entity, ref _itemIndex, ref this._ItemIndex);
  1441. }
  1442. /// <summary>
  1443. /// 获取格式化后的HTML内容
  1444. /// </summary>
  1445. /// <param name="fomart"></param>
  1446. /// <param name="cssConfig"></param>
  1447. /// <returns></returns>
  1448. public override string GetFomartString(string fomart, ChartCssConfigInfo cssConfig = null)
  1449. {
  1450. var html = GetFomartHTML(fomart, cssConfig);
  1451. var sp = new StringBuilder((html.Item1.Length + 40) * this._itemConfig.ItemCount);
  1452. switch (this._itemConfig.FuntionType)
  1453. {
  1454. case ChartItemType.SpecialValue_FCSSQ_ChuHaoPL:
  1455. sp.Append(CssValueFunction.SpecialValue_FCSSQ_ChuHaoPL(this._LocalEntity, this._itemConfig, this._cssConfig, this._ItemIndex, html.Item1));
  1456. break;
  1457. case ChartItemType.SpecialValue_TCDLT_ChuHaoPL:
  1458. sp.Append(CssValueFunction.SpecialValue_TCDLT_ChuHaoPL(this._LocalEntity, this._itemConfig, this._cssConfig, this._ItemIndex, html.Item1));
  1459. break;
  1460. default:
  1461. for (int i = 0; i < this._itemConfig.ItemCount; i++)
  1462. {
  1463. sp.Append(GetHtml(true, html.Item1, "", this._ItemIndex[i].ToString(), i));
  1464. }
  1465. break;
  1466. }
  1467. return sp.ToString();
  1468. }
  1469. protected bool SetSpecialValue(TEntity entity, ref int[] index, ref int[] itemIndex)
  1470. {
  1471. bool yes = false;
  1472. yes = !entity.OpenCode.Contains(-1);
  1473. switch (this._itemConfig.FuntionType)
  1474. {
  1475. case ChartItemType.SpecialValue_FC3D012_4:
  1476. SpecialValueFunction.SpecialValue_FC3D012_4(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index);
  1477. break;
  1478. case ChartItemType.SpecialValue_TCP3012_4:
  1479. SpecialValueFunction.SpecialValue_FC3D012_4(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index);
  1480. break;
  1481. case ChartItemType.SpecialValue_FCSSQ_ChuHaoPL:
  1482. SpecialValueFunction.SpecialValue_FCSSQ_ChuHaoPL(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref itemIndex);
  1483. break;
  1484. case ChartItemType.SpecialValue_TCDLT_ChuHaoPL:
  1485. SpecialValueFunction.SpecialValue_TCDLT_ChuHaoPL(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref itemIndex);
  1486. break;
  1487. }
  1488. if (yes)
  1489. this._LocalEntity = entity;
  1490. return yes;
  1491. }
  1492. }
  1493. }