fix 增加上传完成提醒

This commit is contained in:
2024-08-28 11:54:54 +08:00
parent c9938bd258
commit bfc14604b3

View File

@@ -69,18 +69,18 @@ public class BalanceRecordCheckBackgroundService : BackgroundService
{ {
throw new Exception(r.Msg); throw new Exception(r.Msg);
} }
var d = r.Data; var d = r.Data;
//更新本地余额表 //更新本地余额表
await db.Updateable<LocalGainfoMealEntity>() await db.Updateable<LocalGainfoMealEntity>()
.SetColumns(x => x.Balance == d.Balance) .SetColumns(x => x.Balance == d.Balance)
.Where(x => x.UserCode == d.UserCode) .Where(x => x.UserCode == d.UserCode)
.ExecuteCommandAsync(stoppingToken); .ExecuteCommandAsync(stoppingToken);
//eg:一定要在此处更新为已同步 //eg:一定要在此处更新为已同步
balanceRecord.IsSync = true; balanceRecord.IsSync = true;
await db.UpdateAsync(balanceRecord); await db.UpdateAsync(balanceRecord);
await db.Client.Ado.CommitTranAsync(); await db.Client.Ado.CommitTranAsync();
} }
catch (Exception e) catch (Exception e)
@@ -89,6 +89,12 @@ public class BalanceRecordCheckBackgroundService : BackgroundService
await db.Client.Ado.RollbackTranAsync(); await db.Client.Ado.RollbackTranAsync();
} }
} }
balanceRecords = await db.Queryable<LocalBalanceRecordEntity>().Where(x => x.TenantId == factory).Where(x => !x.IsSync).ToListAsync(stoppingToken);
if (!balanceRecords.Any())
{
_logger.LogInformation("上传离线订单完成");
}
} }
} }
catch (Exception e) catch (Exception e)