This commit is contained in:
2024-04-07 15:25:24 +08:00
parent 6eddf943c2
commit 4c2e6d0d8e

View File

@@ -42,9 +42,7 @@ public class MealSupplementHandlerJob : BaseJob
foreach (var item in mealSupplements)
{
GainfoMealEntity mealUser = null;
var gainfo = await DbContext.Queryable<GainfoEntity>().Where(x => x.Code == item.Code).SingleAsync();
//档案不存在
if (gainfo == null)
{
gainfo = await DbContext.Queryable<GainfoEntity>().AS("GainfoLeave").Where(x => x.Code == item.Code).SingleAsync();
@@ -94,27 +92,27 @@ public class MealSupplementHandlerJob : BaseJob
continue;
}
}
else
{
//创建余额数据
mealUser = await DbContext.Queryable<GainfoMealEntity>().Where(x => x.UserCode == gainfo.Code).SingleAsync();
if (mealUser == null)
{
mealUser = new GainfoMealEntity
{
Balance = 0,
BalanceOfRecharge = 0,
BalanceOfSubsidies = 0,
UserNo = gainfo.No,
UserCode = gainfo.Code,
Version = 0,
TenantId = gainfo.Factory,
};
await DbContext.InsertAsync(mealUser);
}
//创建余额数据
var mealUser = await DbContext.Queryable<GainfoMealEntity>().Where(x => x.UserCode == gainfo.Code).SingleAsync();
if (mealUser == null)
{
mealUser = new GainfoMealEntity
{
Balance = 0,
BalanceOfRecharge = 0,
BalanceOfSubsidies = 0,
UserNo = gainfo.No,
UserCode = gainfo.Code,
Version = 0,
TenantId = gainfo.Factory,
};
await DbContext.InsertAsync(mealUser);
}
if (item.Workplace == "5")
{
//todo 海宁餐补数据