From cac5a9a4457c72be0b04e80b70276517816fcee3 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Thu, 4 Jul 2024 16:26:39 +0800 Subject: [PATCH] test . --- Src/Dlhis.Entity/Visitor/Entity/BusinessTripEntity.cs | 6 ++++-- .../Common/Response/SapBusinessTripInfoResponse.cs | 6 +++--- Src/Dlhis.ScheduledTask/Jobs/SyncBusinessTripJob.cs | 9 +++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Src/Dlhis.Entity/Visitor/Entity/BusinessTripEntity.cs b/Src/Dlhis.Entity/Visitor/Entity/BusinessTripEntity.cs index d0097416..a288af24 100644 --- a/Src/Dlhis.Entity/Visitor/Entity/BusinessTripEntity.cs +++ b/Src/Dlhis.Entity/Visitor/Entity/BusinessTripEntity.cs @@ -32,12 +32,14 @@ public class BusinessTripEntity : SugarBaseEntity /// /// 开始时间 /// - public DateTime BeginDateTime { get; set; } + [SugarColumn(IsNullable = false, ColumnDataType = "time")] + public TimeOnly BeginDateTime { get; set; } /// /// 结束时间 /// - public DateTime EndDateTime { get; set; } + [SugarColumn(IsNullable = false, ColumnDataType = "time")] + public TimeOnly EndDateTime { get; set; } /// /// 出差类型 diff --git a/Src/Dlhis.ScheduledTask/Common/Response/SapBusinessTripInfoResponse.cs b/Src/Dlhis.ScheduledTask/Common/Response/SapBusinessTripInfoResponse.cs index 86af6eea..34c88b79 100644 --- a/Src/Dlhis.ScheduledTask/Common/Response/SapBusinessTripInfoResponse.cs +++ b/Src/Dlhis.ScheduledTask/Common/Response/SapBusinessTripInfoResponse.cs @@ -41,13 +41,13 @@ public class SapBusinessTripInfoItem /// 开始时间 /// [JsonProperty("OV_BEGUZ")] - public DateTime BeginDateTime { get; set; } + public TimeOnly BeginDateTime { get; set; } /// /// 结束时间 /// [JsonProperty("OV_ENDUZ")] - public DateTime EndDateTime { get; set; } + public TimeOnly EndDateTime { get; set; } /// /// 出差类型 @@ -82,6 +82,6 @@ public class SapBusinessTripInfoItem /// /// 出差目的地描述 /// - [JsonProperty("OV_CCMDDM")] + [JsonProperty("OV_CCMDDMS")] public string DestinationDesc { get; set; } } \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/Jobs/SyncBusinessTripJob.cs b/Src/Dlhis.ScheduledTask/Jobs/SyncBusinessTripJob.cs index 24d38d8e..f7a0aaf2 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/SyncBusinessTripJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/SyncBusinessTripJob.cs @@ -25,15 +25,16 @@ public class SyncBusinessTripJob : BaseJob var validDepartments = tops.ToList(); tops.ForEach(x => RecursionGetNext(x, departments, validDepartments)); - foreach (var departmentNos in validDepartments.Select(x => x.No).Chunk(100)) + foreach (var departmentNos in validDepartments.Select(x => x.No).Chunk(20)) { try { var tripResponse = await jipService.GetTravelInfosByDepartmentsAsync(today, today, departmentNos.ToList()); foreach (var tripInfoItem in tripResponse.Items) { - if (await DbContext.Queryable().Where(x => x.Code == tripInfoItem.Code && x.BeginDate == tripInfoItem.BeginDate && x.EndDate == tripInfoItem.EndDate) - .AnyAsync()) + if (await DbContext.Queryable().Where(x => x.Code == tripInfoItem.Code + && x.BeginDate == tripInfoItem.BeginDate + && x.EndDate == tripInfoItem.EndDate).AnyAsync()) { continue; } @@ -44,7 +45,7 @@ public class SyncBusinessTripJob : BaseJob } catch (Exception e) { - Logger.LogError(e, "获取部门出差数据执行失败:{message}", e.Message); + Logger.LogError(e, "获取部门出差数据执行失败:{message}", e.Message); } } }