fix job
This commit is contained in:
@@ -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 海宁餐补数据
|
||||
|
||||
Reference in New Issue
Block a user