fix 调整生日券退款.增加数据上传
This commit is contained in:
@@ -7,6 +7,7 @@ using Dlhis.Constants;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Canteen.Entities;
|
||||
using Dlhis.Entity.Canteen.Entities.EMealVoucher;
|
||||
using Dlhis.Entity.Canteen.Entities.Voucher;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Dlhis.Entity.Device;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
@@ -203,6 +204,25 @@ public class BalanceService : IBalanceService
|
||||
.ExecuteCommandThrowVersionAsync();
|
||||
}, 5);
|
||||
}
|
||||
else if (balanceRecord.Source == BalanceRecordSourceEnumType.Birthday)
|
||||
{
|
||||
//生日券消费退款
|
||||
throw new UserFriendlyException("不支持生日券消费退款");
|
||||
//var voucherNo = balanceRecord.Remark.Replace("(生日券消费)", "");
|
||||
|
||||
//await CommonHelper.RetryAsync(async () =>
|
||||
//{
|
||||
// var voucher = await _dbContext.Queryable<VoucherEntity>().Where(x => x.No == voucherNo).SingleAsync();
|
||||
// var amount = Math.Abs(balanceRecord.Amount);
|
||||
// await _dbContext.Updateable<VoucherEntity>()
|
||||
// .SetColumns(x => x.Version == x.Version + 1)
|
||||
// .SetColumns(x => x.Balance == x.Balance + amount)
|
||||
// .SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||
// .Where(x => x.No == voucherNo && x.Version == voucher.Version)
|
||||
// .ExecuteCommandThrowVersionAsync();
|
||||
|
||||
//},5);
|
||||
}
|
||||
else
|
||||
{
|
||||
await _balanceRepository.CalculateBalanceAsync(balanceRecord.UserCode);
|
||||
@@ -413,6 +433,7 @@ public class BalanceService : IBalanceService
|
||||
{
|
||||
var balanceInfo = await _dbContext.Queryable<BalanceRecordEntity>().Where(x => x.No == request.No).SingleAsync();
|
||||
balanceInfo.ThrowIfNull("明细数据不存在");
|
||||
BalanceRecordSourceConstants.IgnoreSources.Contains(balanceInfo.Source).ThrowIfTrue("类型不支持");
|
||||
(balanceInfo.Status != BalanceRecordStatusEnumType.Valid || balanceInfo.Type != BalanceRecordTypeEnumType.Out).ThrowIfTrue("消费明细状态有误");
|
||||
|
||||
balanceInfo.Status = BalanceRecordStatusEnumType.Obsolute;
|
||||
|
||||
Reference in New Issue
Block a user