fix 海宁储能餐补
This commit is contained in:
@@ -17,4 +17,13 @@ public interface IHainingMealSupplementApi
|
||||
/// <returns></returns>
|
||||
[Post("/jingke/api/canteen/InputCredit")]
|
||||
Task<HainingResponse<object>> AddMealSupplementAsync(AddHainingMealSupplementRequest request);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 海宁储能
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[Post("/jschuneng/api/canteen/InputCredit")]
|
||||
Task<HainingResponse<object>> AddHsChuNengMealSupplementAsync(AddHainingMealSupplementRequest request);
|
||||
}
|
||||
|
||||
@@ -110,7 +110,8 @@ public class MealSupplementHandlerJob : BaseJob
|
||||
|
||||
if (item.Workplace == "5")
|
||||
{
|
||||
await SetHainingMealSupplementAsync(item);
|
||||
var isChunneng = item.Factory == "501";
|
||||
await SetHainingMealSupplementAsync(isChunneng, item);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -205,19 +206,28 @@ public class MealSupplementHandlerJob : BaseJob
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SetHainingMealSupplementAsync(MealSupplementRecordEntity mealSupplement)
|
||||
private async Task SetHainingMealSupplementAsync(bool isChuneng, MealSupplementRecordEntity mealSupplement)
|
||||
{
|
||||
await DbContext.Client.Ado.BeginTranAsync();
|
||||
try
|
||||
{
|
||||
var hnResponse = await _hainingMealSupplementApi.AddMealSupplementAsync(new AddHainingMealSupplementRequest
|
||||
{
|
||||
Code = mealSupplement.Code,
|
||||
Amount = mealSupplement.Amount,
|
||||
Date = mealSupplement.Date.Date,
|
||||
Remark = mealSupplement.Remark,
|
||||
UniqueId = mealSupplement.UniqueId,
|
||||
});
|
||||
var hnResponse = isChuneng
|
||||
? await _hainingMealSupplementApi.AddHsChuNengMealSupplementAsync(new AddHainingMealSupplementRequest
|
||||
{
|
||||
Code = mealSupplement.Code,
|
||||
Amount = mealSupplement.Amount,
|
||||
Date = mealSupplement.Date.Date,
|
||||
Remark = mealSupplement.Remark,
|
||||
UniqueId = mealSupplement.UniqueId
|
||||
})
|
||||
: await _hainingMealSupplementApi.AddMealSupplementAsync(new AddHainingMealSupplementRequest
|
||||
{
|
||||
Code = mealSupplement.Code,
|
||||
Amount = mealSupplement.Amount,
|
||||
Date = mealSupplement.Date.Date,
|
||||
Remark = mealSupplement.Remark,
|
||||
UniqueId = mealSupplement.UniqueId
|
||||
});
|
||||
|
||||
(hnResponse == null || hnResponse.Code != 200).ThrowIfTrue("海宁餐补写入失败:" + hnResponse?.Message);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user