|
@@ -367,7 +367,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
_sqlSugar.BeginTran();
|
|
|
try
|
|
|
{
|
|
|
- Fin_DailyFeePayment _fee = _mapper.Map<Fin_DailyFeePayment>(dto);
|
|
|
+ var _fee = _mapper.Map<Fin_DailyFeePayment>(dto);
|
|
|
_fee.CreateUserId = dto.UserId;
|
|
|
|
|
|
/*
|
|
@@ -385,9 +385,9 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
|
|
|
int? feeId = await _sqlSugar.Insertable(_fee).ExecuteReturnIdentityAsync();
|
|
|
|
|
|
- if (dto.FeeContents.Count > 0)
|
|
|
+ if (dto.FeeContents.Any())
|
|
|
{
|
|
|
- List<Fin_DailyFeePaymentContent> _feeContents = _mapper.Map<List<Fin_DailyFeePaymentContent>>(dto.FeeContents);
|
|
|
+ var _feeContents = _mapper.Map<List<Fin_DailyFeePaymentContent>>(dto.FeeContents);
|
|
|
|
|
|
foreach (var item in _feeContents)
|
|
|
{
|
|
@@ -410,7 +410,6 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -422,23 +421,21 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
{
|
|
|
Result result = new Result() { Code = -2 };
|
|
|
|
|
|
- #region 已审核过的日付申请不可编辑
|
|
|
-
|
|
|
- var _DailyFeePayment = await _sqlSugar.Queryable<Fin_DailyFeePayment>().Where(it => it.Id == dto.Id && it.IsDel == 0).FirstAsync();
|
|
|
- if (_DailyFeePayment != null)
|
|
|
+ #region 已审核的数据不可编辑
|
|
|
+ var dailyFeePayment = await _sqlSugar.Queryable<Fin_DailyFeePayment>().Where(it => it.Id == dto.Id && it.IsDel == 0).FirstAsync();
|
|
|
+ if (dailyFeePayment != null)
|
|
|
{
|
|
|
- if (_DailyFeePayment.FAudit == 1 || _DailyFeePayment.MAudit == 1)
|
|
|
+ if (dailyFeePayment.FAudit == 1 || dailyFeePayment.MAudit == 1)
|
|
|
{
|
|
|
var setData = await _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && x.Id == dto.PriceTypeId).FirstAsync();
|
|
|
if (setData != null)
|
|
|
{
|
|
|
if (setData.STid == 90)
|
|
|
{
|
|
|
- if (_DailyFeePayment.IsPay == 1)
|
|
|
+ if (dailyFeePayment.IsPay == 1)
|
|
|
{
|
|
|
result.Msg = "该笔费用已付款,不可修改!";
|
|
|
return result;
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -471,10 +468,10 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
TransferTypeId = dto.TransferTypeId,
|
|
|
PriceTypeId = dto.PriceTypeId,
|
|
|
CompanyId = dto.CompanyId,
|
|
|
+ GroupId = dto.GroupId,
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
- List<Fin_DailyFeePaymentContent> _feeContents = _mapper.Map<List<Fin_DailyFeePaymentContent>>(dto.FeeContents);
|
|
|
-
|
|
|
+ var _feeContents = _mapper.Map<List<Fin_DailyFeePaymentContent>>(dto.FeeContents);
|
|
|
|
|
|
await _sqlSugar.Updateable<Fin_DailyFeePaymentContent>()
|
|
|
.Where(a => a.DFPId == _fee.Id)
|
|
@@ -485,22 +482,15 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
-
|
|
|
- if (_feeContents.Count > 0)
|
|
|
+ if (_feeContents.Any())
|
|
|
{
|
|
|
foreach (var item in _feeContents)
|
|
|
{
|
|
|
-
|
|
|
item.DFPId = _fee.Id;
|
|
|
item.CreateUserId = dto.UserId;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- if (_feeContents.Count > 0)
|
|
|
- {
|
|
|
- await _sqlSugar.Insertable(_feeContents).ExecuteCommandAsync();
|
|
|
-
|
|
|
- }
|
|
|
+ await _sqlSugar.Insertable(_feeContents).ExecuteCommandAsync();
|
|
|
}
|
|
|
|
|
|
_sqlSugar.CommitTran();
|