/// <summary> /// 计算北京芝麻西西网站数据 /// </summary> /// <param name="collectResult">采集结果</param> /// <returns></returns> public SourceDataEntity Calculate(CollectResultEntity collectResult) { SourceDataEntity result = new SourceDataEntity(); result.PeriodNum = collectResult.PeriodNum; result.RetTime = collectResult.RetTime; result.SiteSysNo = (int)Site.ZhiMaXiXi; result.CollectRet = collectResult.Result; result.Status = 1; #region retMidNum int retMidNum1 = 0; int retMidNum2 = 0; int retMidNum3 = 0; //取2 5 8 11 14 17位数字之和 int i = 1; while (i < 17) { retMidNum1 += collectResult.Group[i]; i += 3; } //取3 6 9 12 15 18位数字之和 int j = 2; while (j < 18) { retMidNum2 += collectResult.Group[j]; j += 3; } //取4 7 10 13 16 19位数字之和 int k = 3; while (k < 19) { retMidNum3 += collectResult.Group[k]; k += 3; } #endregion #region RetNum int retNum = retMidNum1 % 10; retNum += retMidNum2 % 10; retNum += retMidNum3 % 10; #endregion #region RetOddNum int retOddNum = (retMidNum1 % 10) * 100 + (retMidNum2 % 10) * 10 + (retMidNum3 % 10); #endregion result.RetOddNum = retOddNum; result.RetNum = retNum; result.RetMidNum = string.Format("{0}|{1}|{2}", retMidNum1, retMidNum2, retMidNum3); return result; }
/// <summary> /// 计算北京71豆网站数据 /// </summary> /// <param name="collectResult">采集结果</param> /// <returns></returns> public SourceDataEntity Calculate(CollectResultEntity collectResult) { SourceDataEntity result = new SourceDataEntity(); result.PeriodNum = collectResult.PeriodNum; result.RetTime = collectResult.RetTime; result.SiteSysNo = (int)Site.QiYiDou; result.CollectRet = collectResult.Result; result.Status = 1; #region retMidNum int retMidNum1 = 0; int retMidNum2 = 0; int retMidNum3 = 0; //取1-6位数字之和 for (int i = 0; i < 6; i++) retMidNum1 += collectResult.Group[i]; //取7-12位数字之和 for (int i = 6; i < 12; i++) retMidNum2 += collectResult.Group[i]; //取13-18位数字之和 for (int i = 12; i < 18; i++) retMidNum3 += collectResult.Group[i]; #endregion #region RetNum int retNum = retMidNum1 % 10; retNum += retMidNum2 % 10; retNum += retMidNum3 % 10; #endregion #region RetOddNum int retOddNum = (retMidNum1 % 10) * 100 + (retMidNum2 % 10) * 10 + (retMidNum3 % 10); #endregion result.RetOddNum = retOddNum; result.RetNum = retNum; result.RetMidNum = string.Format("{0}|{1}|{2}", retMidNum1, retMidNum2, retMidNum3); return result; }
/// <summary> /// 失败时写入失败的数据 /// </summary> /// <param name="source">采集计算源</param> /// <param name="periodNum">期号</param> /// <param name="retTime">开奖时间</param> public void FailInsertData(Source source, long periodNum, DateTime retTime) { List<SourceDataEntity> dataList = new List<SourceDataEntity>(); SourceDataEntity item = new SourceDataEntity(); #region 龙虎网站数据 item.SiteSysNo = (int)Site.LongHu; item.PeriodNum = periodNum; item.RetTime = retTime; dataList.Add(item); #endregion #region 计算71豆网站数据 item = new SourceDataEntity(); item.SiteSysNo = (int)Site.QiYiDou; item.PeriodNum = periodNum; item.RetTime = retTime; dataList.Add(item); #endregion #region 计算芝麻西西网站数据 item = new SourceDataEntity(); item.SiteSysNo = (int)Site.ZhiMaXiXi; item.PeriodNum = periodNum; item.RetTime = retTime; dataList.Add(item); #endregion Insert28Data(source, dataList); }