Exemplo n.º 1
0
        /// <summary>
        /// 获取混合单关数据
        /// </summary>
        /// <param name="gameType"></param>
        /// <param name="matchDate"></param>
        /// <param name="isLeftJoin"></param>
        /// <returns></returns>
        public static List <JCLQ_MatchInfo_WEB> GetJCLQHHDGList()
        {
            BettingHelper bizHelper = new BettingHelper();
            var           match     = bizHelper.GetMatchInfoList <JCLQHHDGBase>(GetFilePath("New/Match_HHDG_List"));
            var           list      = new List <JCLQ_MatchInfo_WEB>();

            match = match.Where(t => long.Parse(Convert.ToDateTime(t.FSStopBettingTime).ToString("yyyyMMddHHmmss")) > long.Parse(DateTime.Now.ToString("yyyyMMddHHmmss"))).ToList();
            if (match != null && match.Count > 0)
            {
                foreach (var item in match)
                {
                    var matchDataTime = ConvertHelper.ConvertStrToDateTime("20" + item.MatchData);
                    var info          = new JCLQ_MatchInfo_WEB()
                    {
                        //CreateTime = item.CreateTime.ToString("yyyyMMddHHmmss"),
                        //DSStopBettingTime = item.DSStopBettingTime.ToString("yyyyMMddHHmmss"),
                        MatcheDateTime = matchDataTime,
                        //FSStopBettingTime = bizHelper.ConvertDateTimeInt(Convert.ToDateTime(item.FSStopBettingTime)).ToString(),
                        FSStopBettingTime = item.FSStopBettingTime,
                        //FSStopBettingTime = item.FSStopBettingTime.ToString("yyyyMMddHHmmss"),
                        //GuestTeamId = item.GuestTeamId,
                        GuestTeamName = BettingHelper.GetTeamName(item.GuestTeamName),
                        HomeTeamName  = BettingHelper.GetTeamName(item.HomeTeamName),
                        //HomeTeamId = item.HomeTeamId,
                        LeagueColor = item.LeagueColor.Contains("#") ? item.LeagueColor : "#" + "DB7917",
                        //LeagueId = item.LeagueId,
                        LeagueName  = item.LeagueName,
                        MatchIdName = item.MatchIdName,
                        //StartDateTime = bizHelper.ConvertDateTimeInt(Convert.ToDateTime(item.StartDateTime)).ToString(),
                        StartDateTime = Convert.ToDateTime(item.StartDateTime),
                        //StartDateTime = item.StartDateTime.ToString("yyyyMMddHHmmss"),
                        MatchData   = item.MatchData,
                        MatchId     = item.MatchId,
                        MatchNumber = item.MatchNumber,
                        //AverageLose = item.AverageLose,
                        //AverageWin = item.AverageWin,
                        //Mid = item.Mid,
                        FXId           = item.FXId,
                        State_HHDG     = item.State,
                        PrivilegesType = item.PrivilegesType == null ? string.Empty : item.PrivilegesType,
                    };

                    #region 附加胜负sp数据

                    if (item.SF != null)
                    {
                        var sfcjson = JsonHelper.Deserialize <JCLQ_SF_SPInfo>(item.SF);
                        if (sfcjson != null)
                        {
                            info.SF_WinSP  = sfcjson.WinSP;
                            info.SF_LoseSP = sfcjson.LoseSP;
                        }
                    }
                    #endregion


                    #region 附加让分胜负sp数据
                    if (item.RFSF != null)
                    {
                        var json = JsonHelper.Deserialize <JCLQ_RFSF_SPInfo>(item.RFSF);
                        if (json != null)
                        {
                            info.RF        = json.RF;
                            info.RF_LoseSP = json.LoseSP;
                            info.RF_WinSP  = json.WinSP;
                        }
                    }
                    #endregion

                    #region 附加胜分差sp数据

                    if (item.SFC != null)
                    {
                        var json = JsonHelper.Deserialize <JCLQ_SFC_SPInfo>(item.SFC);
                        if (json != null)
                        {
                            info.GuestWin1_5   = json.GuestWin1_5;
                            info.GuestWin11_15 = json.GuestWin11_15;
                            info.GuestWin16_20 = json.GuestWin16_20;
                            info.GuestWin21_25 = json.GuestWin21_25;
                            info.GuestWin26    = json.GuestWin26;
                            info.GuestWin6_10  = json.GuestWin6_10;

                            info.HomeWin1_5   = json.HomeWin1_5;
                            info.HomeWin11_15 = json.HomeWin11_15;
                            info.HomeWin16_20 = json.HomeWin16_20;
                            info.HomeWin21_25 = json.HomeWin21_25;
                            info.HomeWin26    = json.HomeWin26;
                            info.HomeWin6_10  = json.HomeWin6_10;
                        }
                    }

                    #endregion

                    #region 附加大小分sp数据

                    if (item.DXF != null)
                    {
                        var json = JsonHelper.Deserialize <JCLQ_DXF_SPInfo>(item.DXF);
                        if (json != null)
                        {
                            info.DF   = json.DF;
                            info.XF   = json.XF;
                            info.YSZF = json.YSZF;
                        }
                    }

                    #endregion

                    list.Add(info);
                }
            }
            return(list);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 查询队伍信息与队伍比赛结果信息 - WEB页面使用
        /// - 合并队伍基础信息与队伍结果信息
        /// - 合并各玩法SP数据
        /// </summary>
        /// <param name="service">HttpServerUtilityBase对象</param>
        /// <param name="type">玩法类型</param>
        /// <param name="matchDate">查询日期</param>
        /// <param name="isLeftJoin">是否查询没有结果的队伍比赛信息</param>
        /// <returns>队伍信息及比赛结果信息</returns>
        public static List <JCLQ_MatchInfo_WEB> MatchList_WEB(string gameType, string matchDate = null, bool isLeftJoin = true)
        {
            BettingHelper bizHelper   = new BettingHelper();
            var           match       = bizHelper.GetMatchInfoList <JCLQ_MatchInfo>(MatchFile(gameType, matchDate));
            var           matchresult = bizHelper.GetMatchInfoList <JCLQ_MatchResultInfo>(MatchResultFile(matchDate));
            //var sp_sf =bizHelper.GetMatchInfoList<JCLQ_SF_SPInfo>(SPFile("SF", matchDate)); //胜负sp数据
            //var sp_rfsf = bizHelper.GetMatchInfoList<JCLQ_RFSF_SPInfo>(SPFile("RFSF", matchDate)); //让分胜负sp数据
            //var sp_sfc = bizHelper.GetMatchInfoList<JCLQ_SFC_SPInfo>(SPFile("SFC", matchDate)); //胜分差sp数据
            //var sp_dxf = bizHelper.GetMatchInfoList<JCLQ_DXF_SPInfo>(SPFile("DXF", matchDate)); //大小分sp数据

            var sp_sf   = bizHelper.GetMatchInfoList <JCLQ_SF_SPInfo>(SPFile(gameType, matchDate));   //胜负sp数据
            var sp_rfsf = bizHelper.GetMatchInfoList <JCLQ_RFSF_SPInfo>(SPFile(gameType, matchDate)); //让分胜负sp数据
            var sp_sfc  = bizHelper.GetMatchInfoList <JCLQ_SFC_SPInfo>(SPFile(gameType, matchDate));  //胜分差sp数据
            var sp_dxf  = bizHelper.GetMatchInfoList <JCLQ_DXF_SPInfo>(SPFile(gameType, matchDate));  //大小分sp数据

            var list = new List <JCLQ_MatchInfo_WEB>();

            match = match.Where(t => long.Parse(Convert.ToDateTime(t.FSStopBettingTime).ToString("yyyyMMddHHmmss")) > long.Parse(DateTime.Now.ToString("yyyyMMddHHmmss"))).ToList();
            foreach (var item in match)
            {
                #region 队伍基础信息

                var matchDataTime = ConvertHelper.ConvertStrToDateTime("20" + item.MatchData);
                var info          = new JCLQ_MatchInfo_WEB()
                {
                    //CreateTime = item.CreateTime.ToString("yyyyMMddHHmmss"),
                    //DSStopBettingTime = item.DSStopBettingTime.ToString("yyyyMMddHHmmss"),
                    MatcheDateTime = matchDataTime,
                    //FSStopBettingTime = bizHelper.ConvertDateTimeInt(Convert.ToDateTime(item.FSStopBettingTime)).ToString(),
                    FSStopBettingTime = item.FSStopBettingTime,
                    //FSStopBettingTime = item.FSStopBettingTime.ToString("yyyyMMddHHmmss"),
                    //GuestTeamId = item.GuestTeamId,
                    GuestTeamName = BettingHelper.GetTeamName(item.GuestTeamName),
                    HomeTeamName  = BettingHelper.GetTeamName(item.HomeTeamName),
                    //HomeTeamId = item.HomeTeamId,
                    LeagueColor = item.LeagueColor.Contains("#") ? item.LeagueColor : "#" + "DB7917",
                    //LeagueId = item.LeagueId,
                    LeagueName    = item.LeagueName,
                    MatchIdName   = item.MatchIdName,
                    StartDateTime = Convert.ToDateTime(item.StartDateTime),
                    //StartDateTime = item.StartDateTime.ToString("yyyyMMddHHmmss"),
                    MatchData   = item.MatchData,
                    MatchId     = item.MatchId,
                    MatchNumber = item.MatchNumber,
                    //AverageLose = item.AverageLose,
                    //AverageWin = item.AverageWin,
                    //Mid = item.Mid,
                    FXId           = item.FXId,
                    PrivilegesType = item.PrivilegesType == null ? string.Empty : item.PrivilegesType,
                    State_HHDG     = item.State
                };
                #endregion

                #region 附加队伍结果信息
                var res = matchresult.FirstOrDefault(p => p.MatchId == item.MatchId);
                if (res != null)
                {
                    //info.DXF_Result = res.DXF_Result;
                    //info.DXF_SP = res.DXF_SP;
                    //info.DXF_Trend = res.DXF_Trend;
                    //info.GuestScore = res.GuestScore;
                    //info.HomeScore = res.HomeScore;
                    //info.RFSF_Result = res.RFSF_Result;
                    //info.RFSF_SP = res.RFSF_SP;
                    //info.RFSF_Trend = res.RFSF_Trend;
                    //info.SF_Result = res.SF_Result;
                    //info.SF_SP = res.SF_SP;
                    //info.SFC_Result = res.SFC_Result;
                    //info.SFC_SP = res.SFC_SP;
                    //info.MatchState = res.MatchState;
                }
                else if (!isLeftJoin)
                {
                    continue;
                }
                #endregion

                #region 附加胜负sp数据

                var sp_sf_item = sp_sf.FirstOrDefault(p => p.MatchId == item.MatchId);
                if (gameType.ToLower() == "hh")
                {
                    if (sp_sf_item != null && sp_sf_item.SF != null)
                    {
                        var json = JsonHelper.Deserialize <JCLQ_SF_SPInfo>(sp_sf_item.SF);
                        info.SF_WinSP  = json.WinSP;
                        info.SF_LoseSP = json.LoseSP;
                        //info.PrivilegesType = json.PrivilegesType == null ? string.Empty : json.PrivilegesType;
                    }
                }
                else
                {
                    if (sp_sf_item != null)
                    {
                        info.SF_WinSP  = sp_sf_item.WinSP;
                        info.SF_LoseSP = sp_sf_item.LoseSP;
                        //info.PrivilegesType = sp_sf_item.PrivilegesType == null ? string.Empty : sp_sf_item.PrivilegesType;
                    }
                }

                #endregion

                #region 附加让分胜负sp数据
                var sp_rfsf_item = sp_rfsf.FirstOrDefault(p => p.MatchId == item.MatchId);
                if (gameType.ToLower() == "hh")
                {
                    if (sp_rfsf_item != null && sp_rfsf_item.RFSF != null)
                    {
                        var json = JsonHelper.Deserialize <JCLQ_RFSF_SPInfo>(sp_rfsf_item.RFSF);
                        info.RF        = json.RF;
                        info.RF_LoseSP = json.LoseSP;
                        info.RF_WinSP  = json.WinSP;
                        //info.PrivilegesType = json.PrivilegesType == null ? string.Empty : json.PrivilegesType;
                    }
                }
                else
                {
                    if (sp_rfsf_item != null)
                    {
                        info.RF        = sp_rfsf_item.RF;
                        info.RF_LoseSP = sp_rfsf_item.LoseSP;
                        info.RF_WinSP  = sp_rfsf_item.WinSP;
                        //info.PrivilegesType = sp_rfsf_item.PrivilegesType == null ? string.Empty : sp_rfsf_item.PrivilegesType;
                    }
                }
                #endregion

                #region 附加胜分差sp数据
                var sp_sfc_item = sp_sfc.FirstOrDefault(p => p.MatchId == item.MatchId);

                if (gameType.ToLower() == "hh")
                {
                    if (sp_sfc_item != null && sp_sfc_item.SFC != null)
                    {
                        var json = JsonHelper.Deserialize <JCLQ_SFC_SPInfo>(sp_sfc_item.SFC);
                        info.GuestWin1_5   = json.GuestWin1_5;
                        info.GuestWin11_15 = json.GuestWin11_15;
                        info.GuestWin16_20 = json.GuestWin16_20;
                        info.GuestWin21_25 = json.GuestWin21_25;
                        info.GuestWin26    = json.GuestWin26;
                        info.GuestWin6_10  = json.GuestWin6_10;

                        info.HomeWin1_5   = json.HomeWin1_5;
                        info.HomeWin11_15 = json.HomeWin11_15;
                        info.HomeWin16_20 = json.HomeWin16_20;
                        info.HomeWin21_25 = json.HomeWin21_25;
                        info.HomeWin26    = json.HomeWin26;
                        info.HomeWin6_10  = json.HomeWin6_10;
                        //info.PrivilegesType = json.PrivilegesType == null ? string.Empty : json.PrivilegesType;
                    }
                }
                else
                {
                    if (sp_sfc_item != null)
                    {
                        info.GuestWin1_5   = sp_sfc_item.GuestWin1_5;
                        info.GuestWin11_15 = sp_sfc_item.GuestWin11_15;
                        info.GuestWin16_20 = sp_sfc_item.GuestWin16_20;
                        info.GuestWin21_25 = sp_sfc_item.GuestWin21_25;
                        info.GuestWin26    = sp_sfc_item.GuestWin26;
                        info.GuestWin6_10  = sp_sfc_item.GuestWin6_10;

                        info.HomeWin1_5   = sp_sfc_item.HomeWin1_5;
                        info.HomeWin11_15 = sp_sfc_item.HomeWin11_15;
                        info.HomeWin16_20 = sp_sfc_item.HomeWin16_20;
                        info.HomeWin21_25 = sp_sfc_item.HomeWin21_25;
                        info.HomeWin26    = sp_sfc_item.HomeWin26;
                        info.HomeWin6_10  = sp_sfc_item.HomeWin6_10;
                        //info.PrivilegesType = sp_sfc_item.PrivilegesType == null ? string.Empty : sp_sfc_item.PrivilegesType;
                    }
                }

                #endregion

                #region 附加大小分sp数据

                var sp_dxf_item = sp_dxf.FirstOrDefault(p => p.MatchId == item.MatchId);
                if (gameType.ToLower() == "hh")
                {
                    if (sp_dxf_item != null && sp_dxf_item.DXF != null)
                    {
                        var json = JsonHelper.Deserialize <JCLQ_DXF_SPInfo>(sp_dxf_item.DXF);
                        info.DF   = json.DF;
                        info.XF   = json.XF;
                        info.YSZF = json.YSZF;
                        //info.PrivilegesType = json.PrivilegesType == null ? string.Empty : json.PrivilegesType;
                    }
                }
                else
                {
                    if (sp_dxf_item != null)
                    {
                        info.DF   = sp_dxf_item.DF;
                        info.XF   = sp_dxf_item.XF;
                        info.YSZF = sp_dxf_item.YSZF;
                        //info.PrivilegesType = sp_dxf_item.PrivilegesType == null ? string.Empty : sp_dxf_item.PrivilegesType;
                    }
                }

                #endregion

                list.Add(info);
            }
            return(list);
        }