|
|
@@ -56,9 +56,19 @@ namespace HKCardOUT.Logic |
|
|
|
t.NodePath = ApiRoute.GetTime; |
|
|
|
t.ReqType = MultiType.GET; |
|
|
|
}).Build().RunStringFirst(); |
|
|
|
DataBus.Times = data.ToModel<JObject>()["data"]["data"].ToJson().ToModel<TimeSpilte>(); |
|
|
|
var dtoTime = data.ToModel<JObject>()["data"]["data"].ToJson().ToModel<TimeSpilteDto>(); |
|
|
|
var time = GetNetWorkTime(); |
|
|
|
var tims = $"{time.Year}-{time.Month}-{time.Day}"; |
|
|
|
DataBus.Times = new TimeSpilte(); |
|
|
|
DataBus.Times.AMStartTime = DateTime.Parse($"{tims} {dtoTime.AMStartTime}"); |
|
|
|
DataBus.Times.AMEndTime = DateTime.Parse($"{tims} {dtoTime.AMEndTime}"); |
|
|
|
DataBus.Times.PMStartTime = DateTime.Parse($"{tims} {dtoTime.PMStartTime}"); |
|
|
|
DataBus.Times.PMEndTime = DateTime.Parse($"{tims} {dtoTime.PMEndTime}"); |
|
|
|
DataBus.Times.ATStartTime = DateTime.Parse($"{tims} {dtoTime.ATStartTime}"); |
|
|
|
DataBus.Times.ATEndTime = DateTime.Parse($"{tims} {dtoTime.ATEndTime}"); |
|
|
|
|
|
|
|
HKLogImport.WriteInfo("同步时间:" + DataBus.Times); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
@@ -99,7 +109,7 @@ namespace HKCardOUT.Logic |
|
|
|
{ |
|
|
|
var Ids = dto.Select(t => t.Id).ToList(); |
|
|
|
var check = DbContext.Context.Queryable<SaleLog>().Where(t => Ids.Contains(t.Id)).Any(t => t.IsSync); |
|
|
|
if (check) return null ; |
|
|
|
if (check) return null; |
|
|
|
var data = IHttpMultiClient.HttpMulti.AddHeader(t => |
|
|
|
{ |
|
|
|
t.HeaderKey = "TenantId"; |
|
|
@@ -178,7 +188,8 @@ namespace HKCardOUT.Logic |
|
|
|
/// <summary> |
|
|
|
/// 获取网络服务器时间 |
|
|
|
/// </summary> |
|
|
|
public static DateTime GetNetWorkTime() { |
|
|
|
public static DateTime GetNetWorkTime() |
|
|
|
{ |
|
|
|
|
|
|
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.baidu.com"); |
|
|
|
request.Method = "HEAD"; |
|
|
|