fix 消费明细记录
This commit is contained in:
@@ -22,4 +22,10 @@ public enum CanteenApplicaitonTypeEnumType
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("扫码点餐")]
|
[Description("扫码点餐")]
|
||||||
QrCode = 300,
|
QrCode = 300,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 餐补发放
|
||||||
|
/// </summary>
|
||||||
|
[Description("餐补发放")]
|
||||||
|
MealSupplement = 400
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ public enum DeviceTaskStatusEnumType
|
|||||||
[Description("下发完成")]
|
[Description("下发完成")]
|
||||||
Success = 10,
|
Success = 10,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 人脸照片不存在
|
||||||
|
/// </summary>
|
||||||
|
[Description("人脸照片不存在")]
|
||||||
|
FaceNotFound = 20,
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 取消
|
/// 取消
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ using Dlhis.Canteen.Api.Request;
|
|||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Basic.Enums;
|
using Dlhis.Entity.Basic.Enums;
|
||||||
using Dlhis.Entity.Canteen.Entities;
|
using Dlhis.Entity.Canteen.Entities;
|
||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Dlhis.ScheduledTask.SyncSapInfo;
|
using Dlhis.ScheduledTask.SyncSapInfo;
|
||||||
using Dlhis.ScheduledTask.SyncSapInfo.Services;
|
using Dlhis.ScheduledTask.SyncSapInfo.Services;
|
||||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||||
|
using Kurisu.AspNetCore.Utils;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Scheduled;
|
using Kurisu.Scheduled;
|
||||||
using Kurisu.Scheduled.Attributes;
|
using Kurisu.Scheduled.Attributes;
|
||||||
@@ -22,7 +24,9 @@ public class MealSupplementHandlerJob : BaseJob
|
|||||||
private readonly IHainingMealSupplementApi _hainingMealSupplementApi;
|
private readonly IHainingMealSupplementApi _hainingMealSupplementApi;
|
||||||
private readonly IJinkoJIPService _jinkoJIPService;
|
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;
|
_hainingMealSupplementApi = hainingMealSupplementApi;
|
||||||
_jinkoJIPService = jinkoJIPService;
|
_jinkoJIPService = jinkoJIPService;
|
||||||
@@ -78,12 +82,12 @@ public class MealSupplementHandlerJob : BaseJob
|
|||||||
}
|
}
|
||||||
else
|
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();
|
await DbContext.Client.Ado.BeginTranAsync();
|
||||||
try
|
try
|
||||||
@@ -125,6 +129,40 @@ public class MealSupplementHandlerJob : BaseJob
|
|||||||
.Where(x => x.UniqueId == mealSupplement.UniqueId)
|
.Where(x => x.UniqueId == mealSupplement.UniqueId)
|
||||||
.ExecuteCommandAsync();
|
.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();
|
await DbContext.Client.Ado.CommitTranAsync();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
Reference in New Issue
Block a user