diff --git a/Src/Dlhis.ScheduledTask/CommonJobs/MealSupplementHandlerJob.cs b/Src/Dlhis.ScheduledTask/CommonJobs/MealSupplementHandlerJob.cs index 26972e13..682066d7 100644 --- a/Src/Dlhis.ScheduledTask/CommonJobs/MealSupplementHandlerJob.cs +++ b/Src/Dlhis.ScheduledTask/CommonJobs/MealSupplementHandlerJob.cs @@ -85,7 +85,7 @@ public class MealSupplementHandlerJob var effect = await _dbContext.Updateable() .SetColumns(x => x.Balance == b) .SetColumns(x => x.ModifiedTime == DateTime.Now) - .Where(x => x.Id == mealUser.Id && x.Version == mealUser.Version) + .Where(x => x.UserCode == mealUser.UserCode && x.Version == mealUser.Version) .ExecuteCommandAsync(); if (effect <= 0) @@ -95,9 +95,11 @@ public class MealSupplementHandlerJob }, 5); - mealSupplement.Status = MealSupplementStatusEnumtype.Sucess; - mealSupplement.Sync = true; - await _dbContext.UpdateAsync(mealSupplement); + await _dbContext.Updateable() + .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Sucess) + .SetColumns(x => x.Sync == true) + .Where(x => x.UniqueId == mealSupplement.UniqueId) + .ExecuteCommandAsync(); //FAIL SUCCESS await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List @@ -112,9 +114,11 @@ public class MealSupplementHandlerJob } catch (Exception ex) { - mealSupplement.Status = MealSupplementStatusEnumtype.Error; - mealSupplement.Result = ex.Message; - await _dbContext.UpdateAsync(mealSupplement); + await _dbContext.Updateable() + .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Error) + .SetColumns(x => x.Result == ex.Message) + .Where(x => x.UniqueId == mealSupplement.UniqueId) + .ExecuteCommandAsync(); await _dbContext.Client.Ado.RollbackTranAsync(); } diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/Implements/JinkoJIPService.cs b/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/Implements/JinkoJIPService.cs index e7db78bc..6ae18823 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/Implements/JinkoJIPService.cs +++ b/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/Implements/JinkoJIPService.cs @@ -68,6 +68,8 @@ public class JinkoJIPService : IJinkoJIPService var response = await GetHttpClient().PostAsync(requestUrl, content); var responseJson = await response.Content.ReadAsStringAsync(); + _logger.LogInformation("餐补状态同步响应:{json}", responseJson); + var jobj = JObject.Parse(responseJson); jobj.ContainsKey("exp").ThrowIfTrue(jobj.GetValue("exp").Value());