fix job
This commit is contained in:
@@ -98,11 +98,11 @@ public class MealSupplementHandlerJob
|
||||
await _dbContext.Updateable<MealSupplementRecordEntity>()
|
||||
.SetColumns(x => x.Status == MealSupplementStatusEnumtype.Sucess)
|
||||
.SetColumns(x => x.Sync == true)
|
||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||
.Where(x => x.UniqueId == mealSupplement.UniqueId)
|
||||
.ExecuteCommandAsync();
|
||||
|
||||
//FAIL SUCCESS
|
||||
await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List<SyncMealSupplementRecordRequest>
|
||||
var r = await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List<SyncMealSupplementRecordRequest>
|
||||
{
|
||||
new()
|
||||
{
|
||||
@@ -111,6 +111,14 @@ public class MealSupplementHandlerJob
|
||||
Msg = "操作成功"
|
||||
}
|
||||
});
|
||||
|
||||
await _dbContext.Updateable<MealSupplementRecordEntity>()
|
||||
.SetColumns(x => x.Result == r)
|
||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||
.Where(x => x.UniqueId == mealSupplement.UniqueId)
|
||||
.ExecuteCommandAsync();
|
||||
|
||||
await _dbContext.Client.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -119,6 +127,7 @@ public class MealSupplementHandlerJob
|
||||
await _dbContext.Updateable<MealSupplementRecordEntity>()
|
||||
.SetColumns(x => x.Status == MealSupplementStatusEnumtype.Error)
|
||||
.SetColumns(x => x.Result == ex.Message)
|
||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||
.Where(x => x.UniqueId == mealSupplement.UniqueId)
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
@@ -6,5 +6,5 @@ public interface IJinkoJIPService : ISingletonDependency
|
||||
{
|
||||
Task<UploadAttendanceResponse> UploadAttendancesAsync(List<UploadAttendanceRequest> requests);
|
||||
|
||||
Task SyncMealSupplementRecordsAsync(List<SyncMealSupplementRecordRequest> requests);
|
||||
Task<string> SyncMealSupplementRecordsAsync(List<SyncMealSupplementRecordRequest> requests);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class JinkoJIPService : IJinkoJIPService
|
||||
}
|
||||
|
||||
|
||||
public async Task SyncMealSupplementRecordsAsync(List<SyncMealSupplementRecordRequest> requests)
|
||||
public async Task<string> SyncMealSupplementRecordsAsync(List<SyncMealSupplementRecordRequest> requests)
|
||||
{
|
||||
var requestUrl = "/JIP/DHR/DHR_DL_CALLBACK";
|
||||
|
||||
@@ -76,6 +76,8 @@ public class JinkoJIPService : IJinkoJIPService
|
||||
jobj.ContainsKey("message").ThrowIfTrue(jobj.GetValue("message").Value<string>());
|
||||
|
||||
(jobj.GetValue("code").Value<int>() != 200).ThrowIfTrue(jobj.GetValue("message").Value<string>());
|
||||
|
||||
return responseJson;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,13 @@
|
||||
"yikatong": "yikatong"
|
||||
}
|
||||
},
|
||||
"JinkoOptions": {
|
||||
"Jip": {
|
||||
"BaseUrl": "http://172.16.202.34:8000",
|
||||
"Key": "FACE-7409WIBX",
|
||||
"Secret": "be0a4b88-cd80-4509-b9b9-865205d0d3d8"
|
||||
}
|
||||
},
|
||||
"IdentityServerOptions": {
|
||||
"Authority": "https://yikatong.isawesome.cn/oauth2",
|
||||
"RequireHttpsMetadata": true,
|
||||
|
||||
@@ -52,9 +52,9 @@
|
||||
},
|
||||
"JinkoOptions": {
|
||||
"Jip": {
|
||||
"BaseUrl": "http://172.16.202.34:8000",
|
||||
"Key": "FACE-7409WIBX",
|
||||
"Secret": "be0a4b88-cd80-4509-b9b9-865205d0d3d8"
|
||||
"BaseUrl": "http://jip.jinkosolar.com",
|
||||
"Key": "FACE-CUOJG9N7",
|
||||
"Secret": "130c2f2d-03a0-4720-8e25-538ffac7a7cb"
|
||||
}
|
||||
},
|
||||
"RedisOptions": {
|
||||
|
||||
Reference in New Issue
Block a user