fix 消费明细记录
This commit is contained in:
@@ -22,4 +22,10 @@ public enum CanteenApplicaitonTypeEnumType
|
||||
/// </summary>
|
||||
[Description("扫码点餐")]
|
||||
QrCode = 300,
|
||||
|
||||
/// <summary>
|
||||
/// 餐补发放
|
||||
/// </summary>
|
||||
[Description("餐补发放")]
|
||||
MealSupplement = 400
|
||||
}
|
||||
|
||||
@@ -26,6 +26,12 @@ public enum DeviceTaskStatusEnumType
|
||||
[Description("下发完成")]
|
||||
Success = 10,
|
||||
|
||||
/// <summary>
|
||||
/// 人脸照片不存在
|
||||
/// </summary>
|
||||
[Description("人脸照片不存在")]
|
||||
FaceNotFound = 20,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 取消
|
||||
|
||||
@@ -3,9 +3,11 @@ using Dlhis.Canteen.Api.Request;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using Dlhis.Entity.Canteen.Entities;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Dlhis.ScheduledTask.SyncSapInfo;
|
||||
using Dlhis.ScheduledTask.SyncSapInfo.Services;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Kurisu.AspNetCore.Utils;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Scheduled;
|
||||
using Kurisu.Scheduled.Attributes;
|
||||
@@ -22,7 +24,9 @@ public class MealSupplementHandlerJob : BaseJob
|
||||
private readonly IHainingMealSupplementApi _hainingMealSupplementApi;
|
||||
private readonly IJinkoJIPService _jinkoJIPService;
|
||||
|
||||
public MealSupplementHandlerJob(IServiceProvider serviceProvider, IHainingMealSupplementApi hainingMealSupplementApi, IJinkoJIPService jinkoJIPService) : base(serviceProvider)
|
||||
public MealSupplementHandlerJob(IServiceProvider serviceProvider,
|
||||
IHainingMealSupplementApi hainingMealSupplementApi,
|
||||
IJinkoJIPService jinkoJIPService) : base(serviceProvider)
|
||||
{
|
||||
_hainingMealSupplementApi = hainingMealSupplementApi;
|
||||
_jinkoJIPService = jinkoJIPService;
|
||||
@@ -78,12 +82,12 @@ public class MealSupplementHandlerJob : BaseJob
|
||||
}
|
||||
else
|
||||
{
|
||||
await SetMealSupplementAsync(item);
|
||||
await SetMealSupplementAsync(gainfo, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SetMealSupplementAsync(MealSupplementRecordEntity mealSupplement)
|
||||
private async Task SetMealSupplementAsync(GainfoEntity gainfo, MealSupplementRecordEntity mealSupplement)
|
||||
{
|
||||
await DbContext.Client.Ado.BeginTranAsync();
|
||||
try
|
||||
@@ -125,6 +129,40 @@ public class MealSupplementHandlerJob : BaseJob
|
||||
.Where(x => x.UniqueId == mealSupplement.UniqueId)
|
||||
.ExecuteCommandAsync();
|
||||
|
||||
await DbContext.InsertAsync(new BalanceRecordEntity
|
||||
{
|
||||
Amount = mealSupplement.Amount,
|
||||
//ApplicationType = CanteenApplicaitonTypeEnumType.
|
||||
Type = BalanceRecordTypeEnumType.In,
|
||||
BusinessPlaceCode = null,
|
||||
BusinessShiftCode = null,
|
||||
ShiftType = null,
|
||||
CostDate = mealSupplement.Date,
|
||||
CostDateTime = DateTime.Now,
|
||||
UserNo = gainfo.No,
|
||||
No = SnowFlakeHelper.Instance.NextId().ToString(),
|
||||
UserCode = gainfo.Code,
|
||||
TenantId = mealSupplement.Factory,
|
||||
Status = BalanceRecordStatusEnumType.Valid,
|
||||
Source = BalanceRecordSourceEnumType.LocalTenantSubsidies,
|
||||
Remark = gainfo.Remark,
|
||||
CostId = gainfo.CostId,
|
||||
SubsidiesFromMonth = mealSupplement.Date.ToString("yyyyMM"),
|
||||
OriginTenantId = gainfo.Factory,
|
||||
Name = gainfo.Name,
|
||||
IsCostCrossTenant = false,
|
||||
ApplicationType = CanteenApplicaitonTypeEnumType.MealSupplement,
|
||||
DepartmentNo = gainfo.DepartmentNo,
|
||||
DeviceUniqueNo = null,
|
||||
|
||||
IsDeleted = false,
|
||||
|
||||
CreatedBy = 1,
|
||||
CreateTime = DateTime.Now,
|
||||
ModifiedBy = 1,
|
||||
ModifiedTime = DateTime.Now,
|
||||
});
|
||||
|
||||
await DbContext.Client.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user