Browse Source

凌晨1-2点不执行数据交互

master
qian 7 months ago
parent
commit
c399e7fee5
  1. 4
      北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs
  2. 15
      北京北汽/UniApiWpf/MainWindow.xaml.cs

4
北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs

@ -551,8 +551,8 @@ namespace CK.SCP.Controller
{
ScpEntities scpdb = EntitiesFactory.CreateScpInstance();
ExchangeCenterContext db = EntitiesFactory.CreateExchangeCenterInstance();
var _list = scpdb.TS_UNI_API.Where(p => p.State == (int)DataState.Enabled&&p.Domain== "BJBMPT").OrderBy(p => p.UID).ToList();
var _list1 = scpdb.TS_UNI_API.Where(p => p.State == (int)DataState.Enabled && p.Domain == "BJBMPT" && p.InterfaceType== "Price").OrderBy(p => p.UID).ToList();
var _list = scpdb.TS_UNI_API.Where(p => p.State == (int)DataState.Enabled&&p.Domain== "CQBMPT").OrderBy(p => p.UID).ToList();
var _list1 = scpdb.TS_UNI_API.Where(p => p.State == (int)DataState.Enabled && p.Domain == "CQBMPT" && p.InterfaceType== "Price").OrderBy(p => p.UID).ToList();
var apiii = _list1.Count();
if (apiii > 0) {

15
北京北汽/UniApiWpf/MainWindow.xaml.cs

@ -173,6 +173,11 @@ namespace UniApiWpf
}
private void BgwPutDoWork(object sender, DoWorkEventArgs e)
{
TimeSpan nowDt = DateTime.Now.TimeOfDay;
TimeSpan workstartDT = DateTime.Parse("1:00").TimeOfDay;
TimeSpan workendDT = DateTime.Parse("2:00").TimeOfDay;
if (nowDt < workstartDT || nowDt > workendDT)
{
SCP_DC_UNI_CONTROLLER.WriteService((rs) =>
{
@ -186,6 +191,7 @@ namespace UniApiWpf
}
});
}
}
private void BgwGetRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
@ -197,6 +203,12 @@ namespace UniApiWpf
{
try
{
TimeSpan nowDt = DateTime.Now.TimeOfDay;
TimeSpan workstartDT = DateTime.Parse("1:00").TimeOfDay;
TimeSpan workendDT = DateTime.Parse("2:00").TimeOfDay;
if (nowDt < workstartDT || nowDt > workendDT)
{
#region
SCP_DC_UNI_CONTROLLER.ReadService((rs) =>
{
List<LogModel> _list = new List<LogModel>();
@ -215,6 +227,9 @@ namespace UniApiWpf
CreateLogDataList(_list, WriteLogEnum.Get);
}
});
#endregion
}
}
catch (Exception ex)
{

Loading…
Cancel
Save