|
@@ -1617,6 +1617,30 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
Result ffrData = await _proceedsReceivedRep.PostAmountReceivedAddOrEditDto(dto);
|
|
|
|
|
|
+ #region 判断金额是否收完
|
|
|
+
|
|
|
+ //已收
|
|
|
+ var Fin_ProceedsReceived_SumPrice = _sqlSugar
|
|
|
+ .Queryable<Fin_ProceedsReceived>()
|
|
|
+ .Where(x => x.Diid == dto.DiId && x.IsDel == 0)
|
|
|
+ .Sum(x=>x.Price);
|
|
|
+
|
|
|
+ //收款账单金额 (应收)
|
|
|
+ var Fin_ForeignReceivables_SumPrice = _sqlSugar
|
|
|
+ .Queryable<Fin_ForeignReceivables>()
|
|
|
+ .Where(x => x.Diid == dto.DiId && x.IsDel == 0)
|
|
|
+ .Sum(x => x.ItemSumPrice);
|
|
|
+
|
|
|
+ if ((Fin_ProceedsReceived_SumPrice - Fin_ForeignReceivables_SumPrice) >= 0)
|
|
|
+ {
|
|
|
+ _sqlSugar.Updateable<Grp_DelegationInfo>()
|
|
|
+ .Where(x => x.Id == dto.DiId && x.IsDel == 0)
|
|
|
+ .SetColumns(x => new Grp_DelegationInfo { IsSure = 1 })
|
|
|
+ .ExecuteCommand();
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
if (dto.PortType == 1)
|
|
|
{
|
|
|
if (ffrData.Code != 0)
|
|
@@ -5335,8 +5359,8 @@ Group by PriceType ", dto.diId);
|
|
|
JoinQueryInfos(
|
|
|
JoinType.Left, a.Id == x.DIId,
|
|
|
JoinType.Left, b.CTable == 85 && b.CId == x.Id)
|
|
|
- ).Where((x, a, b) => x.IsDel == 0 && x.CreateUserId == userId && (b.IsAuditGM == 1 || b.IsAuditGM == 3)
|
|
|
- && a.IsDel == 0 && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && b.IsDel == 0 && a.IsSure == 1 && auditState.Contains(b.IsAuditGM))
|
|
|
+ ).Where((x, a, b) => x.IsDel == 0 && x.CreateUserId == userId && a.IsDel == 0 && a.VisitDate >= StartDateTime
|
|
|
+ && a.VisitDate <= EndDateTime && b.IsDel == 0 && auditState.Contains(b.IsAuditGM)) // 取消团组确认状态 && a.IsSure == 1
|
|
|
.Select((x, a, b) => new
|
|
|
{
|
|
|
x.FlightsDescription,
|
|
@@ -5349,6 +5373,7 @@ Group by PriceType ", dto.diId);
|
|
|
x.ClientName,
|
|
|
x.ClientNum,
|
|
|
x.FlightsCode,
|
|
|
+ a.IsSure
|
|
|
}).ToList();
|
|
|
|
|
|
var groupByid = listAir.GroupBy(x => x.Id);
|
|
@@ -5460,6 +5485,7 @@ Group by PriceType ", dto.diId);
|
|
|
VisitDate = groupinfo.VisitDate,
|
|
|
Temp = temp,
|
|
|
Price = (groupAirCount * 10),
|
|
|
+ State = groupinfo.IsSure
|
|
|
});
|
|
|
}
|
|
|
}
|