feat 订单消费数据增加软删除

This commit is contained in:
2024-04-01 11:12:55 +08:00
parent 3288e33788
commit 175ca143e2
3 changed files with 13 additions and 6 deletions

View File

@@ -49,15 +49,14 @@ public class OrderService : BaseOrderService, IOrderService
//消费权限控制
await CheckPermissionAsync(gainfo.No, request.DeviceUniqueNo);
var canteenUserExists = await DbContext.Queryable<GainfoMealEntity>()
if (!await DbContext.Queryable<GainfoMealEntity>()
.Where(x => x.UserNo == gainfo.No)
.AnyAsync();
if (!canteenUserExists)
.AnyAsync())
{
await DbContext.InsertAsync(new GainfoMealEntity
{
UserNo = gainfo.No,
UserCode = gainfo.Code,
Balance = 0,
BalanceOfRecharge = 0,
BalanceOfSubsidies = 0,

View File

@@ -10,7 +10,7 @@ namespace Dlhis.Entity.Canteen.Entities;
/// 充值/消费记录
/// </summary>
[SugarTable(TableName = "BalanceRecord", TableDescription = "充值/消费记录")]
public class BalanceRecordEntity : SugarBaseEntity, ITenantId
public class BalanceRecordEntity : SugarBaseEntity, ISoftDeleted, ITenantId
{
/// <summary>
/// 流水号
@@ -147,4 +147,8 @@ public class BalanceRecordEntity : SugarBaseEntity, ITenantId
public string TenantId { get; set; }
[SugarColumn(ColumnDataType = "bit")]
public bool IsDeleted { get; set; }
}

View File

@@ -8,7 +8,7 @@ namespace Dlhis.Entity.Canteen.Entities;
/// 订餐明细表
/// </summary>
[SugarTable(TableName = "CanteenOrderDetail", TableDescription = "订单明细表")]
public class CanteenOrderDetailEntity : SugarBaseEntity, ITenantId
public class CanteenOrderDetailEntity : SugarBaseEntity, ISoftDeleted, ITenantId
{
/// <summary>
/// 订单号
@@ -47,4 +47,8 @@ public class CanteenOrderDetailEntity : SugarBaseEntity, ITenantId
public string Unit { get; set; }
public string TenantId { get; set; }
[SugarColumn(ColumnDataType = "bit")]
public bool IsDeleted { get; set; }
}