Commit f81cdbed by wangonghui

修改bug和足球球队积分功能开发

parent 708a98ce
......@@ -1537,8 +1537,8 @@ namespace VIZ.TVP.CBA.Module
mainViewModel.VisitTeamCompareOptionDictionary.Add("得分", mainViewModel.onAirDataModel.liveTeamStatV.Points);
mainViewModel.VisitTeamCompareOptionDictionary.Add("篮板", mainViewModel.onAirDataModel.liveTeamStatV.Rebounds);
mainViewModel.VisitTeamCompareOptionDictionary.Add("助攻", mainViewModel.onAirDataModel.liveTeamStatV.Assists);
mainViewModel.VisitTeamCompareOptionDictionary.Add("抢断", mainViewModel.onAirDataModel.liveTeamStatV.Blocked);
mainViewModel.VisitTeamCompareOptionDictionary.Add("盖帽", mainViewModel.onAirDataModel.liveTeamStatV.Steals);
mainViewModel.VisitTeamCompareOptionDictionary.Add("抢断", mainViewModel.onAirDataModel.liveTeamStatV.Steals);//Steals
mainViewModel.VisitTeamCompareOptionDictionary.Add("盖帽", mainViewModel.onAirDataModel.liveTeamStatV.Blocked);
mainViewModel.VisitTeamCompareOptionDictionary.Add("失误", mainViewModel.onAirDataModel.liveTeamStatV.Turnovers);
mainViewModel.VisitTeamCompareOptionDictionary.Add("犯规", mainViewModel.onAirDataModel.liveTeamStatV.PersonalFouls);
//HomeTeamCompareOptionDictionary.Add(TeamDataCompareOptionChinese[7], Json_OnAirData.liveTeamStatH.FlagrantFouls);
......
......@@ -31,7 +31,9 @@ namespace VIZ.TVP.FTB.Module
//sd.Settings["AppID"].Value.ToString();
public static string appKey = AppSetup_InitLiteDB.HttpUrlConfigEntity.AppKey;
public static string type = AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectFootballType;
//public string type = AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectFootballType;
//public string seasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.SeasonId;
......@@ -54,7 +56,7 @@ namespace VIZ.TVP.FTB.Module
Dictionary<string, string> dict = new Dictionary<string, string>();
//dict.Add("leagueid", "401");
dict.Add("round", round);
dict.Add("competitionId", type);
dict.Add("competitionId", AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectFootballType);
string newKey = Utils.GetKey(appID, appKey);
......@@ -95,8 +97,8 @@ namespace VIZ.TVP.FTB.Module
Dictionary<string, string> dict = new Dictionary<string, string>();
dict.Add("competitionId", type);
dict.Add("seasonId", "110000005454");
dict.Add("competitionId", AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectFootballType);
dict.Add("seasonId", AppSetup_InitLiteDB.HttpUrlConfigEntity.SeasonId);//"110000005454"
string newKey = Utils.GetKey(appID, appKey);
......@@ -107,7 +109,7 @@ namespace VIZ.TVP.FTB.Module
settings.NullValueHandling = NullValueHandling.Ignore;
TeamRanks teamRanks = JsonConvert.DeserializeObject<TeamRanks>(result, settings);
var sortRanks = teamRanks.teamstats.OrderBy(a => a.score).ToList();
var sortRanks = teamRanks.teamstats.OrderByDescending(a => a.score).ToList();
teamRanks.teamstats = sortRanks;
Console.WriteLine("球队积分排行数据============>:" + TeamScoreDataPath);
......@@ -122,6 +124,43 @@ namespace VIZ.TVP.FTB.Module
}
/// <summary>
/// 获取赛季数据接口
/// </summary>
/// <returns></returns>
public static Seasons Post_MatchSeasonData_Path(string selectFootballType)
{
try
{
string MatchDataPath = strUrl + "matchSeason";
Dictionary<string, string> dict = new Dictionary<string, string>();
dict.Add("competitionId", selectFootballType);
string newKey = Utils.GetKey(appID, appKey);
string result = JsonHelper.Post(MatchDataPath, dict, newKey);
Log.Info("足球赛季数据==>" + result);
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
Seasons seasons = JsonConvert.DeserializeObject<Seasons>(result, settings);
var sortSeason = seasons.matchseason.OrderByDescending(a => a.seasonName).ToList();
seasons.matchseason = sortSeason;
Console.WriteLine("足球赛季数据=========>" + MatchDataPath);
return seasons;
}
catch(Exception ex)
{
Log.Error(ex.Message);
return null;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{
public class Season
{
/// <summary>
/// 赛季Id
/// </summary>
public string seasonId { get; set; }
/// <summary>
/// 赛季名称
/// </summary>
public string seasonName { get; set; }
/// <summary>
/// 赛季名称简写
/// </summary>
public string shortName { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{
public class Seasons
{
/// <summary>
/// 更新的时间
/// </summary>
public string LastPushDataDateTime { get; set; }
/// <summary>
/// 赛季数据
/// </summary>
public List<Season> matchseason { get; set; }
}
}
......@@ -74,7 +74,7 @@
<!-- 地址 -->
<TextBlock Text="比赛类型:" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,10,0" Grid.Row="8" ></TextBlock>
<TextBlock Text="比赛类型:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0" Grid.Row="8" ></TextBlock>
<WrapPanel Grid.Column="1" Grid.Row="8" HorizontalAlignment="Left" VerticalAlignment="Center">
......@@ -83,11 +83,20 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="150"/>
</Grid.ColumnDefinitions>
<dxe:ComboBoxEdit Grid.Column="0" Height="30" Grid.Row="8" Width="100"
ItemsSource="{Binding Path= FootballTypes,Mode=TwoWay}" SelectedItem="{Binding Path=SelectFootballType,Mode=TwoWay}"></dxe:ComboBoxEdit>
<TextBlock Text="赛季:" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
<dxe:ComboBoxEdit Grid.Column="2" Height="30" Grid.Row="8" Width="140"
ItemsSource="{Binding Path=Seasons,Mode=TwoWay}" SelectedItem="{Binding Path=SelectSeason,Mode=TwoWay}"></dxe:ComboBoxEdit>
</Grid>
</WrapPanel>
......
......@@ -172,7 +172,64 @@ namespace VIZ.TVP.FTB.Module
public string SelectFootballType
{
get { return selectFootballType; }
set { selectFootballType = value; this.RaisePropertyChanged(nameof(SelectFootballType)); }
set
{
selectFootballType = value;
this.RaisePropertyChanged(nameof(SelectFootballType));
SetSeasonDict();
if (selectSeason == null) return;
if (SeasonDict.ContainsKey(selectSeason))
{
SeasonId = SeasonDict[selectSeason];
}
}
}
/// <summary>
/// 赛季绑定集合
/// </summary>
private ObservableCollection<string> seasons;
public ObservableCollection<string> Seasons
{
get { return seasons; }
set { seasons = value;this.RaisePropertyChanged(nameof(Seasons)); }
}
private string selectSeason;
/// <summary>
/// 选中的赛季
/// </summary>
public string SelectSeason
{
get { return selectSeason; }
set
{
selectSeason = value;
this.RaisePropertyChanged(nameof(SelectSeason));
if (selectSeason == null) return;
if(SeasonDict.ContainsKey(selectSeason))
{
SeasonId = SeasonDict[selectSeason];
}
}
}
/// <summary>
/// 赛季Id
/// </summary>
public string SeasonId
{
get;set;
}
#endregion
......@@ -192,29 +249,34 @@ namespace VIZ.TVP.FTB.Module
/// </summary>
public VCommand LoadedCommand { get; set; }
/// <summary>
/// 加载
/// </summary>
private void Loaded()
{
this.Url = AppSetup_InitLiteDB.HttpUrlConfigEntity.Url;
this.AppId = AppSetup_InitLiteDB.HttpUrlConfigEntity.AppId;
this.AppKey = AppSetup_InitLiteDB.HttpUrlConfigEntity.AppKey;
this.BUrl = AppSetup_InitLiteDB.HttpUrlConfigEntity.BUrl;
this.BAppId = AppSetup_InitLiteDB.HttpUrlConfigEntity.BAppId;
this.BAppKey = AppSetup_InitLiteDB.HttpUrlConfigEntity.BAppKey;
this.SelectFootballType = AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectFootballType;
this.SelectSeason = AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectSeason;
this.SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.SeasonId;
SetSeasonDict();
}
......@@ -238,11 +300,44 @@ namespace VIZ.TVP.FTB.Module
config.BAppId = this.BAppId;
config.BAppKey = this.BAppKey;
config.SelectFootballType = this.SelectFootballType;
// 选择赛事和赛事Id
config.SelectSeason = this.SelectSeason;
config.SeasonId = this.SeasonId;
AppSetup_InitLiteDB.localDbContext.HttpUrlConfig.Upsert(config);
}
public Dictionary<string, string> SeasonDict = new Dictionary<string, string>();
/// <summary>
/// 赛季数据
/// </summary>
public Seasons dictSeasons = null;
/// <summary>
/// 设置赛季接口
/// </summary>
private void SetSeasonDict()
{
SeasonDict.Clear();
if (string.IsNullOrEmpty(selectFootballType)) return;
dictSeasons = JsonModel.Post_MatchSeasonData_Path(selectFootballType);
foreach(var dict in dictSeasons.matchseason)
{
if(!SeasonDict.ContainsKey(dict.seasonName))
{
SeasonDict.Add(dict.seasonName,dict.seasonId);
}
}
Seasons = new ObservableCollection<string>();
Seasons = SeasonDict.Keys.ToObservableCollection();
}
}
}
......@@ -53,9 +53,21 @@ namespace VIZ.TVP.FTB.Module
/// </summary>
public string BAppKey { get; set; } = "ffrw7ilc8i6r3pkzvl";
/// <summary>
/// 五大联赛
/// </summary>
public string SelectFootballType { get; set; } = "德甲";
/// <summary>
/// 选择赛季
/// </summary>
public string SelectSeason { get; set; }
/// <summary>
/// 赛季Id
/// </summary>
public string SeasonId { get; set; }
#endregion
......
......@@ -92,6 +92,8 @@
<ItemGroup>
<Compile Include="Common\JsonHelper.cs" />
<Compile Include="Common\JsonModel.cs" />
<Compile Include="Common\Model\Season.cs" />
<Compile Include="Common\Model\Seasons.cs" />
<Compile Include="Common\PluginConstant.cs" />
<Compile Include="Common\Utils.cs" />
<Compile Include="FDayMatch\FDayMatchViewPlugin.cs" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment