feat 订单消费数据增加软删除
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user