Commit e6ac644f by wangonghui

提交修改CBAbug

parent 3b0be8eb
......@@ -323,6 +323,7 @@ namespace VIZ.TVP.CBA.Module
if (value==null)
{
ClearData();
return;
}
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA查看选择赛程:" + value.HomeTeamName + "VS" + value.VisitingTeamName);
......@@ -470,6 +471,92 @@ namespace VIZ.TVP.CBA.Module
}
}
private void ClearData()
{
#region 球员统计信息
if (NewTeamStatsViewModel.TeamStatsViewModelInstance.Count > 0)
{
foreach (var tempTeamStatsViewModel in NewTeamStatsViewModel.TeamStatsViewModelInstance)
{
tempTeamStatsViewModel.ScheduleID = "";
tempTeamStatsViewModel.Matchtypeid = "";
if (tempTeamStatsViewModel.page != null && ApplicationDomainEx.CurrentPage == tempTeamStatsViewModel.page)
{
tempTeamStatsViewModel.SetTeamData();
}
}
}
#endregion
#region 单个球员信息
if (NewSinglePlayerViewModel.SinglePlayerViewModelInstance.Count > 0)
{
foreach (var tempSinglePlayerViewModel in NewSinglePlayerViewModel.SinglePlayerViewModelInstance)
{
tempSinglePlayerViewModel.ScheduleID = "";
tempSinglePlayerViewModel.Matchtypeid = "";
if (tempSinglePlayerViewModel.page != null && ApplicationDomainEx.CurrentPage == tempSinglePlayerViewModel.page)
{
tempSinglePlayerViewModel.SetSingleData();
}
}
}
#endregion
#region Mvp球员信息
if (MvpPlayerViewModel.MvpPlayerViewModelInstance.Count > 0)
{
foreach (var tempSinglePlayerViewModel in MvpPlayerViewModel.MvpPlayerViewModelInstance)
{
tempSinglePlayerViewModel.ScheduleID = "";
tempSinglePlayerViewModel.Matchtypeid = "";
if (tempSinglePlayerViewModel.page != null && ApplicationDomainEx.CurrentPage == tempSinglePlayerViewModel.page)
{
tempSinglePlayerViewModel.SetSingleData();
}
}
}
#endregion
#region 球员对比信息
if (NewPlayerComPareViewModel.PlayerCompareViewModelInstance.Count > 0)
{
foreach (var playerCompareViewModel in NewPlayerComPareViewModel.PlayerCompareViewModelInstance)
{
playerCompareViewModel.ScheduleID = "";
playerCompareViewModel.Matchtypeid = "";
//PlayerCompareViewModel playerCompareViewModel = PlayerCompareViewModel.CreateInstance;
if (playerCompareViewModel.page != null && ApplicationDomainEx.CurrentPage == playerCompareViewModel.page)
{
playerCompareViewModel.SetCompareData();
}
}
}
#endregion
}
/// <summary>
/// 今日赛程日期
......
......@@ -24,7 +24,7 @@ namespace VIZ.TVP.CBA.Module
/// <summary>
/// 插件名称
/// </summary>
public const string PLUGIN_NAME = "CBA赛事配置";
public const string PLUGIN_NAME = "篮球数据访问配置";
/// <summary>
/// 注册
......
......@@ -17,7 +17,7 @@
<Grid>
<!-- 数据访问设置 -->
<GroupBox Header="CBA赛事配置" Margin="10" Padding="10">
<GroupBox Header="篮球赛事配置" Margin="10" Padding="10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"></ColumnDefinition>
......
......@@ -41,7 +41,7 @@ namespace VIZ.TVP.FTB.Module
/// 艾果平台的明日赛程数据服务器接口
/// </summary>
/// <returns></returns>
public async static Task<Dayschedules> PostTomorrowMatch_Path(string round)
public async static Task<Dayschedules> PostTomorrowMatch_Path(string round,string selectFootballType)
{
......@@ -56,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", AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectFootballType);
dict.Add("competitionId", selectFootballType);
string newKey = Utils.GetKey(appID, appKey);
......@@ -88,7 +88,7 @@ namespace VIZ.TVP.FTB.Module
///球队积分数据服务器地址
/// </summary>
/// <returns></returns>
public static TeamRanks PostTeamScoreData_Path()
public static TeamRanks PostTeamScoreData_Path(string footballType,string seasonId)
{
try
{
......@@ -97,8 +97,8 @@ namespace VIZ.TVP.FTB.Module
Dictionary<string, string> dict = new Dictionary<string, string>();
dict.Add("competitionId", AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectFootballType);
dict.Add("seasonId", AppSetup_InitLiteDB.HttpUrlConfigEntity.SeasonId);//"110000005454"
dict.Add("competitionId", footballType);
dict.Add("seasonId", seasonId);//"110000005454"
string newKey = Utils.GetKey(appID, appKey);
......@@ -157,10 +157,51 @@ namespace VIZ.TVP.FTB.Module
return null;
}
}
/// <summary>
/// 获取球队射手榜数据
/// </summary>
/// <param name="footballType"></param>
/// <param name="seasonId"></param>
/// <returns></returns>
public static ShootPlayerRanks Post_ShootPlayerRankData(string footballType, string seasonId)
{
try
{
string shootPath = strUrl + "player/getplayerstats";
Dictionary<string, string> dict = new Dictionary<string, string>();
dict.Add("competitionId", footballType);
dict.Add("seasonId", seasonId);//"110000005454"
string newKey = Utils.GetKey(appID, appKey);
string result = JsonHelper.Post(shootPath, dict, newKey);
Log.Info("足球球员射手排行==>" + result);
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
ShootPlayerRanks shootPlayerRanks = JsonConvert.DeserializeObject<ShootPlayerRanks>(result, settings);
var sortPlayerShoot = shootPlayerRanks.playerstats.OrderBy(a => a.rank).Take(5).ToList();
shootPlayerRanks.playerstats = sortPlayerShoot;
return shootPlayerRanks;
}
catch(Exception ex)
{
Log.Error(ex.Message);
return null;
}
}
}
}
......@@ -26,7 +26,7 @@ namespace VIZ.TVP.FTB.Module
public partial class FDayMatchView : UserControl, IPluginView
{
FDayMatchViewModel vm = null;
public FDayMatchViewModel vm = new FDayMatchViewModel();
/// <summary>
/// 日志
......@@ -36,9 +36,9 @@ namespace VIZ.TVP.FTB.Module
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new FDayMatchViewModel());
WPFHelper.BindingViewModel(this, vm);
vm = this.DataContext as FDayMatchViewModel;
FDayMatchViewModel.FDayMatchViewModelInstance = vm;
}
......
......@@ -17,6 +17,9 @@ namespace VIZ.TVP.FTB.Module
/// </summary>
private static ILog Log = LogManager.GetLogger(typeof(FDayMatchViewModel));
public static FDayMatchViewModel FDayMatchViewModelInstance=new FDayMatchViewModel();
public FDayMatchViewModel()
{
//初始化方法
......@@ -65,6 +68,15 @@ namespace VIZ.TVP.FTB.Module
}
/// <summary>
/// 足球赛事类型
/// </summary>
public string FoolballType = "";
/// <summary>
/// 赛季ID
/// </summary>
public string SeasonId = "";
/// <summary>
......@@ -83,7 +95,7 @@ namespace VIZ.TVP.FTB.Module
// SetRoundMatchData();
RoundMatchData = await JsonModel.PostTomorrowMatch_Path(roundMatchItem.ToString());
RoundMatchData = await JsonModel.PostTomorrowMatch_Path(roundMatchItem.ToString(), FoolballType);
if (RoundMatchData == null) return;
......@@ -204,6 +216,8 @@ namespace VIZ.TVP.FTB.Module
}
roundMatchItem = 1;
FoolballType = DateHeaderViewModel.FoolballType;
SeasonId = DateHeaderViewModel.SeasonId;
}
......
......@@ -23,7 +23,7 @@ namespace VIZ.TVP.FTB.Module
/// </summary>
public partial class FTeamStandingView : UserControl, IPluginView
{
FTeamStandingViewModel vm= null;
FTeamStandingViewModel vm= new FTeamStandingViewModel();
/// <summary>
/// 操作日志服务
......@@ -34,9 +34,11 @@ namespace VIZ.TVP.FTB.Module
InitializeComponent();
WPFHelper.BindingViewModel(this, new FTeamStandingViewModel());
WPFHelper.BindingViewModel(this, vm);
vm = this.DataContext as FTeamStandingViewModel;
//vm = this.DataContext as FTeamStandingViewModel;
FTeamStandingViewModel.FTeamStandingViewModelInstance = vm;
}
......
......@@ -15,6 +15,11 @@ namespace VIZ.TVP.FTB.Module
/// 日志
/// </summary>
private static ILog Log = LogManager.GetLogger(typeof(FTeamStandingViewModel));
/// <summary>
///
/// </summary>
public static FTeamStandingViewModel FTeamStandingViewModelInstance = new FTeamStandingViewModel();
public FTeamStandingViewModel()
{
//初始化方法
......@@ -44,7 +49,34 @@ namespace VIZ.TVP.FTB.Module
private void BtmCommand()
{
teamStands = new TeamRanks();
teamStands = JsonModel.PostTeamScoreData_Path();
if (FoolballType == "英超")
{
SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.EPCSeasonId;
}
else if (FoolballType == "法甲")
{
SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.FL1SeasonId;
}
else if (FoolballType == "意甲")
{
SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.ISASeasonId;
}
else if (FoolballType == "德甲")
{
SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.LIGASeasonId;
}
else if (FoolballType == "西甲")
{
SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.SLPSeasonId;
}
teamStands = JsonModel.PostTeamScoreData_Path(FoolballType, SeasonId);
if (teamStands == null) return;
TeamRanksModel = new ObservableCollection<Teamrank>();
int i = 1;
......@@ -139,6 +171,18 @@ namespace VIZ.TVP.FTB.Module
}
/// <summary>
/// 足球赛事类型
/// </summary>
public string FoolballType = "";
/// <summary>
/// 赛季ID
/// </summary>
public string SeasonId = "";
/// <summary>
/// 初始话
/// </summary>
......@@ -147,6 +191,9 @@ namespace VIZ.TVP.FTB.Module
BtnCmd = new VCommand(BtmCommand);
PromptCommand = new VCommand(PromptCmd);
FoolballType = DateHeaderViewModel.FoolballType;
SeasonId = DateHeaderViewModel.SeasonId;
}
#region 打开更新数据时间日志
......
......@@ -24,14 +24,21 @@
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="90"/>
<ColumnDefinition Width="40"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="280"/>
</Grid.ColumnDefinitions>
<TextBlock Text="赛事:" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
<dxe:ComboBoxEdit Grid.Column="1" Height="30" Grid.Row="8" Width="100"
ItemsSource="{Binding Path=FootballTypes,Mode=TwoWay}" SelectedItem="{Binding Path=SelectFootballType,Mode=TwoWay}"></dxe:ComboBoxEdit>
<WrapPanel Grid.Column="4" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
......
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
......@@ -17,6 +18,17 @@ namespace VIZ.TVP.FTB.Module
public class DateHeaderViewModel : ViewModelBase
{
public DateHeaderViewModel()
{
FootballTypes = new ObservableCollection<string>()
{
"英超","法甲","意甲","德甲","西甲"
};
SelectFootballType = "英超";
}
private static AppSetup_InitLiteDB appSetup_InitCBALiteDB = AppSetup_InitLiteDB.CreateInstance;
/// <summary>
/// 操作日志服务
/// </summary>
......@@ -69,5 +81,94 @@ namespace VIZ.TVP.FTB.Module
}
/// <summary>
/// 足球赛事类型
/// </summary>
public static string FoolballType= "";
/// <summary>
/// 赛季ID
/// </summary>
public static string SeasonId ="";
/// <summary>
/// 足球类型选择
/// </summary>
private ObservableCollection<string> footballTypes;
public ObservableCollection<string> FootballTypes
{
get { return footballTypes; }
set { footballTypes = value; this.RaisePropertyChanged(nameof(FootballTypes)); }
}
/// <summary>
/// 选择的足球比赛
/// </summary>
private string selectFootballType;
public string SelectFootballType
{
get { return selectFootballType; }
set
{
selectFootballType = value;
this.RaisePropertyChanged(nameof(SelectFootballType));
//if(string.IsNullOrEmpty(selectFootballType))
//{
// FDayMatchViewModel.FDayMatchViewModelInstance.FoolballType = "";
// FTeamStandingViewModel.FTeamStandingViewModelInstance.FoolballType = "";
// SeasonId = "";
// FoolballType = "";
// return;
//}
FDayMatchViewModel.FDayMatchViewModelInstance.FoolballType = selectFootballType;
FTeamStandingViewModel.FTeamStandingViewModelInstance.FoolballType = selectFootballType;
FoolballType = selectFootballType;
//if (selectFootballType=="英超")
//{
// FDayMatchViewModel.FDayMatchViewModelInstance.SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.EPCSeasonId;
// FTeamStandingViewModel.FTeamStandingViewModelInstance.SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.EPCSeasonId;
// SeasonId= AppSetup_InitLiteDB.HttpUrlConfigEntity.EPCSeasonId;
//}
//else if(selectFootballType == "法甲")
//{
// FDayMatchViewModel.FDayMatchViewModelInstance.SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.FL1SeasonId;
// FTeamStandingViewModel.FTeamStandingViewModelInstance.SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.FL1SeasonId;
// SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.FL1SeasonId;
//}
//else if(selectFootballType == "意甲")
//{
// FDayMatchViewModel.FDayMatchViewModelInstance.SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.ISASeasonId;
// FTeamStandingViewModel.FTeamStandingViewModelInstance.SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.ISASeasonId;
// SeasonId= AppSetup_InitLiteDB.HttpUrlConfigEntity.ISASeasonId;
//}
//else if(selectFootballType == "德甲")
//{
// FDayMatchViewModel.FDayMatchViewModelInstance.SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.LIGASeasonId;
// FTeamStandingViewModel.FTeamStandingViewModelInstance.SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.LIGASeasonId;
// SeasonId= AppSetup_InitLiteDB.HttpUrlConfigEntity.LIGASeasonId;
//}
//else if(selectFootballType == "西甲")
//{
// FDayMatchViewModel.FDayMatchViewModelInstance.SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.SLPSeasonId;
// FTeamStandingViewModel.FTeamStandingViewModelInstance.SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.SLPSeasonId;
// SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.SLPSeasonId;
//}
}
}
}
}
......@@ -16,25 +16,34 @@
<Grid>
<!-- 数据访问设置 -->
<GroupBox Header="主数据访问配置" Margin="10" Padding="10">
<GroupBox Header="足球赛事配置" Margin="10" Padding="10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
......@@ -74,10 +83,10 @@
<!-- 地址 -->
<TextBlock Text="比赛类型:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0" Grid.Row="8" ></TextBlock>
<TextBlock Text="赛季配置:" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="8" ></TextBlock>
<WrapPanel Grid.Column="1" Grid.Row="8" HorizontalAlignment="Left" VerticalAlignment="Center">
<WrapPanel Grid.Column="1" Grid.Row="9" HorizontalAlignment="Left" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
......@@ -85,27 +94,107 @@
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="200"/>
</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="0" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
<TextBlock Text="赛季:" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
<dxe:ComboBoxEdit Grid.Column="2" Height="30" Grid.Row="8" Width="190"
ItemsSource="{Binding Path=EPCSeasons,Mode=TwoWay}" SelectedItem="{Binding Path=EPCSelectSeason,Mode=TwoWay}"></dxe:ComboBoxEdit>
</Grid>
</WrapPanel>
<WrapPanel Grid.Column="1" Grid.Row="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="200"/>
</Grid.ColumnDefinitions>
<TextBlock Text="法甲:" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
<TextBlock Text="赛季:" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
<dxe:ComboBoxEdit Grid.Column="2" Height="30" Grid.Row="8" Width="190"
ItemsSource="{Binding Path=Seasons,Mode=TwoWay}" SelectedItem="{Binding Path=SelectSeason,Mode=TwoWay}"></dxe:ComboBoxEdit>
ItemsSource="{Binding Path=FL1Seasons,Mode=TwoWay}" SelectedItem="{Binding Path=FL1SelectSeason,Mode=TwoWay}"></dxe:ComboBoxEdit>
</Grid>
</WrapPanel>
<WrapPanel Grid.Column="1" Grid.Row="11" HorizontalAlignment="Left" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="200"/>
</Grid.ColumnDefinitions>
<TextBlock Text="意甲:" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
<TextBlock Text="赛季:" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
<dxe:ComboBoxEdit Grid.Column="2" Height="30" Grid.Row="8" Width="190"
ItemsSource="{Binding Path=ISASeasons,Mode=TwoWay}" SelectedItem="{Binding Path=ISASelectSeason,Mode=TwoWay}"></dxe:ComboBoxEdit>
</Grid>
</WrapPanel>
<WrapPanel Grid.Column="1" Grid.Row="12" HorizontalAlignment="Left" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="200"/>
</Grid.ColumnDefinitions>
<TextBlock Text="德甲:" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
<TextBlock Text="赛季:" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
<dxe:ComboBoxEdit Grid.Column="2" Height="30" Grid.Row="8" Width="190"
ItemsSource="{Binding Path=LIGASeasons,Mode=TwoWay}" SelectedItem="{Binding Path=LIGASelectSeason,Mode=TwoWay}"></dxe:ComboBoxEdit>
</Grid>
</WrapPanel>
<WrapPanel Grid.Column="1" Grid.Row="13" HorizontalAlignment="Left" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="200"/>
</Grid.ColumnDefinitions>
<TextBlock Text="西甲:" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
<TextBlock Text="赛季:" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
<dxe:ComboBoxEdit Grid.Column="2" Height="30" Grid.Row="8" Width="190"
ItemsSource="{Binding Path=SLPSeasons,Mode=TwoWay}" SelectedItem="{Binding Path=SLPSelectSeason,Mode=TwoWay}"></dxe:ComboBoxEdit>
</Grid>
</WrapPanel>
</Grid>
......
......@@ -33,10 +33,10 @@ namespace VIZ.TVP.FTB.Module
// HttpUrlConfigEntity config = AppSetup_InitCBALiteDB.HttpUrlConfigEntity;
FootballTypes = new ObservableCollection<string>()
{
"英超","法甲","意甲","德甲","西甲"
};
//FootballTypes = new ObservableCollection<string>()
//{
// "英超","法甲","意甲","德甲","西甲"
//};
}
/// <summary>
......@@ -154,84 +154,292 @@ namespace VIZ.TVP.FTB.Module
/// <summary>
/// 足球类型选择
/// </summary>
private ObservableCollection<string> footballTypes;
//private ObservableCollection<string> footballTypes;
//public ObservableCollection<string> FootballTypes
//{
// get { return footballTypes; }
// set { footballTypes = value; this.RaisePropertyChanged(nameof(FootballTypes)); }
//}
///// <summary>
///// 选择的足球比赛
///// </summary>
//private string selectFootballType="德甲";
//public string SelectFootballType
//{
// get { return selectFootballType; }
// set
// {
// selectFootballType = value;
// this.RaisePropertyChanged(nameof(SelectFootballType));
// SetSeasonDict();
// if (selectSeason == null) return;
// if (SeasonDict.ContainsKey(selectSeason))
// {
// SeasonId = SeasonDict[selectSeason];
// }
// }
//}
/// <summary>
/// 英超赛季绑定集合
/// </summary>
public ObservableCollection<string> FootballTypes
public Dictionary<string, string> EPCSeasonDict = new Dictionary<string, string>();
private ObservableCollection<string> EPCseasons;
public ObservableCollection<string> EPCSeasons
{
get { return footballTypes; }
set { footballTypes = value; this.RaisePropertyChanged(nameof(FootballTypes)); }
get { return EPCseasons; }
set { EPCseasons = value;this.RaisePropertyChanged(nameof(EPCSeasons)); }
}
private string ePCselectSeason;
/// <summary>
/// 选择的足球比赛
/// 英超选中的赛季
/// </summary>
private string selectFootballType="德甲";
public string SelectFootballType
public string EPCSelectSeason
{
get { return selectFootballType; }
get { return ePCselectSeason; }
set
{
selectFootballType = value;
this.RaisePropertyChanged(nameof(SelectFootballType));
SetSeasonDict();
ePCselectSeason = value;
this.RaisePropertyChanged(nameof(EPCSelectSeason));
if (selectSeason == null) return;
if (SeasonDict.ContainsKey(selectSeason))
if (ePCselectSeason == null) return;
if(EPCSeasonDict.ContainsKey(ePCselectSeason))
{
SeasonId = SeasonDict[selectSeason];
EPCSeasonId = EPCSeasonDict[ePCselectSeason];
}
}
}
/// <summary>
/// 赛季绑定集合
/// 法甲赛季绑定集合
/// </summary>
private ObservableCollection<string> seasons;
public Dictionary<string, string> FL1SeasonDict = new Dictionary<string, string>();
private ObservableCollection<string> FL1seasons;
public ObservableCollection<string> Seasons
public ObservableCollection<string> FL1Seasons
{
get { return seasons; }
set { seasons = value;this.RaisePropertyChanged(nameof(Seasons)); }
get { return FL1seasons; }
set { FL1seasons = value; this.RaisePropertyChanged(nameof(FL1Seasons)); }
}
private string selectSeason;
private string fL1selectSeason;
/// <summary>
/// 选中的赛季
/// 法甲选中的赛季
/// </summary>
public string SelectSeason
public string FL1SelectSeason
{
get { return selectSeason; }
set
{
selectSeason = value;
this.RaisePropertyChanged(nameof(SelectSeason));
get { return fL1selectSeason; }
set
{
fL1selectSeason = value;
this.RaisePropertyChanged(nameof(FL1SelectSeason));
if (fL1selectSeason == null) return;
if (FL1SeasonDict.ContainsKey(fL1selectSeason))
{
FL1SeasonId = FL1SeasonDict[fL1selectSeason];
}
}
}
/// <summary>
/// 意甲赛季绑定集合
/// </summary>
public Dictionary<string, string> ISASeasonDict = new Dictionary<string, string>();
private ObservableCollection<string> ISAseasons;
public ObservableCollection<string> ISASeasons
{
get { return ISAseasons; }
set { ISAseasons = value; this.RaisePropertyChanged(nameof(ISASeasons)); }
}
private string iSAselectSeason;
/// <summary>
/// 意甲选中的赛季
/// </summary>
public string ISASelectSeason
{
get { return iSAselectSeason; }
set
{
iSAselectSeason = value;
this.RaisePropertyChanged(nameof(ISASelectSeason));
if (iSAselectSeason == null) return;
if (ISASeasonDict.ContainsKey(iSAselectSeason))
{
ISASeasonId = ISASeasonDict[iSAselectSeason];
}
}
}
/// <summary>
/// 德甲赛季绑定集合
/// </summary>
public Dictionary<string, string> LIGASeasonDict = new Dictionary<string, string>();
private ObservableCollection<string> LIGAseasons;
if (selectSeason == null) return;
if(SeasonDict.ContainsKey(selectSeason))
public ObservableCollection<string> LIGASeasons
{
get { return LIGAseasons; }
set { LIGAseasons = value; this.RaisePropertyChanged(nameof(LIGASeasons)); }
}
private string lIGAselectSeason;
/// <summary>
/// 德甲选中的赛季
/// </summary>
public string LIGASelectSeason
{
get { return lIGAselectSeason; }
set
{
lIGAselectSeason = value;
this.RaisePropertyChanged(nameof(LIGASelectSeason));
if (lIGAselectSeason == null) return;
if (LIGASeasonDict.ContainsKey(lIGAselectSeason))
{
SeasonId = SeasonDict[selectSeason];
LIGASeasonId = LIGASeasonDict[lIGAselectSeason];
}
}
}
/// <summary>
/// 赛季Id
/// 西甲赛季绑定集合
/// </summary>
public string SeasonId
public Dictionary<string, string> SLPSeasonDict = new Dictionary<string, string>();
private ObservableCollection<string> SLPseasons;
public ObservableCollection<string> SLPSeasons
{
get { return SLPseasons; }
set { SLPseasons = value; this.RaisePropertyChanged(nameof(SLPSeasons)); }
}
private string sLPselectSeason;
/// <summary>
/// 西甲选中的赛季
/// </summary>
public string SLPSelectSeason
{
get { return sLPselectSeason; }
set
{
sLPselectSeason = value;
this.RaisePropertyChanged(nameof(SLPSelectSeason));
if (sLPselectSeason == null) return;
if (SLPSeasonDict.ContainsKey(sLPselectSeason))
{
SLPSeasonId = SLPSeasonDict[sLPselectSeason];
}
}
}
/// <summary>
/// 英超赛季Id
/// </summary>
public string EPCSeasonId
{
get; set;
}
/// <summary>
/// 法甲赛季Id
/// </summary>
public string FL1SeasonId
{
get;set;
}
/// <summary>
/// 意甲赛季Id
/// </summary>
public string ISASeasonId
{
get; set;
}
/// <summary>
/// 德甲赛季Id
/// </summary>
public string LIGASeasonId
{
get; set;
}
/// <summary>
/// 西甲赛季Id
/// </summary>
public string SLPSeasonId
{
get; set;
}
#endregion
......@@ -269,12 +477,43 @@ namespace VIZ.TVP.FTB.Module
this.BAppKey = AppSetup_InitLiteDB.HttpUrlConfigEntity.BAppKey;
this.SelectFootballType = AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectFootballType;
// this.SelectFootballType = AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectFootballType;
// this.SelectSeason = AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectSeason;
//英超
this.EPCSeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.EPCSeasonId;
//法甲
this.FL1SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.FL1SeasonId;
this.SelectSeason = AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectSeason;
//意甲
this.ISASeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.ISASeasonId;
//德甲
this.LIGASeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.LIGASeasonId;
//西甲
this.SLPSeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.SLPSeasonId;
//选择的英超赛季
this.EPCSelectSeason = AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectEPCSeasonId;
//选择的法甲赛季
this.FL1SelectSeason = AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectFL1SeasonId;
//选择的意甲赛季
this.ISASelectSeason= AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectISASeasonId;
//选择的德甲赛季
this.LIGASelectSeason = AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectLIGASeasonId;
//选择的西甲赛季
this.SLPSelectSeason = AppSetup_InitLiteDB.HttpUrlConfigEntity.SelectSLPSeasonId;
this.SeasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.SeasonId;
SetSeasonDict();
......@@ -299,46 +538,141 @@ namespace VIZ.TVP.FTB.Module
config.BUrl = this.BUrl;
config.BAppId = this.BAppId;
config.BAppKey = this.BAppKey;
config.SelectFootballType = this.SelectFootballType;
//config.SelectFootballType = this.SelectFootballType;
// 选择赛事和赛事Id
config.SelectSeason = this.SelectSeason;
config.SeasonId = this.SeasonId;
//config.SelectSeason = this.SelectSeason;
config.EPCSeasonId = this.EPCSeasonId;
config.FL1SeasonId = this.FL1SeasonId;
config.ISASeasonId = this.ISASeasonId;
config.LIGASeasonId = this.LIGASeasonId;
config.SLPSeasonId = this.SLPSeasonId;
//选择的英超赛季
config.SelectEPCSeasonId = this.EPCSelectSeason;
//选择的法甲赛季
config.SelectFL1SeasonId = this.FL1SelectSeason;
//选择的意甲赛季
config.SelectISASeasonId = this.ISASelectSeason ;
//选择的德甲赛季
config.SelectLIGASeasonId = this.LIGASelectSeason;
//选择的西甲赛季
config.SelectSLPSeasonId = this.SLPSelectSeason;
AppSetup_InitLiteDB.localDbContext.HttpUrlConfig.Upsert(config);
}
public Dictionary<string, string> SeasonDict = new Dictionary<string, string>();
/// <summary>
/// 赛季数据
/// </summary>
public Seasons dictSeasons = null;
// 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)
try
{
string seasonNameKey = $"{dict.seasonName}_{dict.seasonId}";
if(!SeasonDict.ContainsKey(seasonNameKey))
var EPCDictSeasons = JsonModel.Post_MatchSeasonData_Path("英超");
foreach (var dict in EPCDictSeasons.matchseason)
{
SeasonDict.Add(seasonNameKey, dict.seasonId);
string seasonNameKey = $"{dict.seasonName}_{dict.seasonId}";
if (!EPCSeasonDict.ContainsKey(seasonNameKey))
{
EPCSeasonDict.Add(seasonNameKey, dict.seasonId);
}
}
}
Seasons = new ObservableCollection<string>();
EPCSeasons = new ObservableCollection<string>();
EPCSeasons = EPCSeasonDict.Keys.ToObservableCollection();
var FL1DictSeasons = JsonModel.Post_MatchSeasonData_Path("法甲");
foreach (var dict in FL1DictSeasons.matchseason)
{
string seasonNameKey = $"{dict.seasonName}_{dict.seasonId}";
if (!FL1SeasonDict.ContainsKey(seasonNameKey))
{
FL1SeasonDict.Add(seasonNameKey, dict.seasonId);
}
}
FL1Seasons = new ObservableCollection<string>();
FL1Seasons = FL1SeasonDict.Keys.ToObservableCollection();
var ISADictSeasons = JsonModel.Post_MatchSeasonData_Path("意甲");
foreach (var dict in ISADictSeasons.matchseason)
{
string seasonNameKey = $"{dict.seasonName}_{dict.seasonId}";
if (!ISASeasonDict.ContainsKey(seasonNameKey))
{
ISASeasonDict.Add(seasonNameKey, dict.seasonId);
}
}
ISASeasons = new ObservableCollection<string>();
ISASeasons = ISASeasonDict.Keys.ToObservableCollection();
var LIGADictSeasons = JsonModel.Post_MatchSeasonData_Path("德甲");
foreach (var dict in LIGADictSeasons.matchseason)
{
string seasonNameKey = $"{dict.seasonName}_{dict.seasonId}";
if (!LIGASeasonDict.ContainsKey(seasonNameKey))
{
LIGASeasonDict.Add(seasonNameKey, dict.seasonId);
}
}
LIGASeasons = new ObservableCollection<string>();
LIGASeasons = LIGASeasonDict.Keys.ToObservableCollection();
var SLPDictSeasons = JsonModel.Post_MatchSeasonData_Path("西甲");
foreach (var dict in SLPDictSeasons.matchseason)
{
string seasonNameKey = $"{dict.seasonName}_{dict.seasonId}";
if (!SLPSeasonDict.ContainsKey(seasonNameKey))
{
SLPSeasonDict.Add(seasonNameKey, dict.seasonId);
}
}
SLPSeasons = new ObservableCollection<string>();
SLPSeasons = SLPSeasonDict.Keys.ToObservableCollection();
}
catch(Exception ex)
{
log.Error(ex.Message);
}
Seasons = SeasonDict.Keys.ToObservableCollection();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{
public class ShootPlayerRank
{
/// <summary>
/// 球队名称
/// </summary>
public string teamName { get; set; }
/// <summary>
/// 球员图片
/// </summary>
public string playerLogo { get; set; }
/// <summary>
/// 球队国旗
/// </summary>
public string teamLogo { get; set; }
/// <summary>
/// 进球数量
/// </summary>
public string goals { get; set; }
/// <summary>
/// 球员名称
/// </summary>
public string figureName { get; set; }
/// <summary>
/// 球员Id
/// </summary>
public string PlayerID { get; set; }
/// <summary>
/// 排名
/// </summary>
public string rank { get; set; }
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{
public class ShootPlayerRanks
{
/// <summary>
/// 最后推送时间
/// </summary>
public string LastPushDataDateTime { get; set; }
/// <summary>
/// 球员统计
/// </summary>
public List<ShootPlayerRank> playerstats { get; set; }
}
}
......@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{
public class AppSetup_InitLiteDB
public class AppSetup_InitLiteDB
{
private static AppSetup_InitLiteDB _createInstance = null;
......
......@@ -56,20 +56,49 @@ namespace VIZ.TVP.FTB.Module
/// <summary>
/// 五大联赛
/// </summary>
public string SelectFootballType { get; set; } = "德甲";
// public string SelectFootballType { get; set; } = "德甲";
/// <summary>
/// 选择赛季
/// </summary>
public string SelectSeason { get; set; }
// public string SelectSeason { get; set; }
/// <summary>
/// 赛季Id
/// </summary>
public string SeasonId { get; set; }
#endregion
//英超赛季Id
public string EPCSeasonId { get; set; }
//英超选中赛季
public string SelectEPCSeasonId { get; set; }
//法甲赛季Id
public string FL1SeasonId { get; set; }
// 法甲选中赛季
public string SelectFL1SeasonId { get; set; }
//意甲赛季Id
public string ISASeasonId { get; set; }
//意甲选中赛季
public string SelectISASeasonId { get; set; }
//德甲赛季Id
public string LIGASeasonId { get; set; }
//德甲选中赛季
public string SelectLIGASeasonId { get; set; }
//西甲赛季Id
public string SLPSeasonId { get; set; }
//西甲选中赛季
public string SelectSLPSeasonId { get; set; }
#endregion
}
}
......@@ -128,6 +128,8 @@
<Compile Include="Setting\httpUrl\View\HttpUrlConfigView.xaml.cs">
<DependentUpon>HttpUrlConfigView.xaml</DependentUpon>
</Compile>
<Compile Include="ShootPlayerRank\Model\ShootPlayerRank.cs" />
<Compile Include="ShootPlayerRank\Model\ShootPlayerRanks.cs" />
<Compile Include="Storge\AppSetup_InitLiteDB.cs" />
<Compile Include="Storge\HttpUrlConfigEntity.cs" />
<Compile Include="Storge\LocalDbContext.cs" />
......@@ -194,7 +196,10 @@
<Name>VIZ.Package.Storage</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="ShootPlayerRank\ViewModel\" />
<Folder Include="ShootPlayerRank\View\" />
</ItemGroup>
<ItemGroup>
<Page Include="FDayMatch\View\FDayMatchView.xaml">
<SubType>Designer</SubType>
......
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