|
@@ -434,9 +434,14 @@ namespace OASystem.API.Controllers
|
|
|
#region 团组支出
|
|
|
GroupExpenditureView _geView = new GroupExpenditureView();
|
|
|
|
|
|
- var isAuditSql = string.Format($"And (ccp.IsAuditGM = 1 OR ccp.IsAuditGM = 3)");
|
|
|
+ var isAudit = _dto.isAudit;
|
|
|
+ var isAuditSql = string.Format($" AND (ccp.IsAuditGM = 1 OR ccp.IsAuditGM = 3) ");
|
|
|
+ var isAuditStatus = new int[] {
|
|
|
+ 1, //已通过
|
|
|
+ 3, //自动审核
|
|
|
+ };
|
|
|
|
|
|
- #region 酒店预定费用
|
|
|
+ #region 酒店预定费用 76 isAuditSql
|
|
|
List<GroupHotelFeeView> groupHotelFeeViews = new List<GroupHotelFeeView>();
|
|
|
|
|
|
//ccp.RMBPrice As CNYPrice
|
|
@@ -495,7 +500,8 @@ WHERE
|
|
|
AND ccp.PayMoney <> 0
|
|
|
AND hr.DiId = {0}
|
|
|
ORDER BY
|
|
|
- CheckInDate Asc", _dto.DiId, _dto.isAudit ? isAuditSql : " ");
|
|
|
+ CheckInDate Asc",
|
|
|
+ _dto.DiId, _dto.isAudit ? isAuditSql : string.Empty);
|
|
|
|
|
|
groupHotelFeeViews = await _sqlSugar.SqlQueryable<GroupHotelFeeView>(hotelFeeSql).ToListAsync();
|
|
|
|
|
@@ -618,7 +624,7 @@ ORDER BY
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- #region 地接费用
|
|
|
+ #region 地接费用 79 isAuditSql
|
|
|
|
|
|
List<GroupCTGGRFeeView> groupCTGGRFeeViews = new List<GroupCTGGRFeeView>();
|
|
|
string CTGGRFeeSql = string.Empty;
|
|
@@ -643,7 +649,7 @@ ORDER BY
|
|
|
Left Join Sys_SetData sd2 On ccp.PaymentCurrency = sd2.Id
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
Where ctggr.IsDel = 0 {1} And ctggr.DiId = {0}
|
|
|
- Order By CreateTime", _dto.DiId, _dto.isAudit ? "And (ccp.IsAuditGM = 1 OR ccp.IsAuditGM = 3)" : " ");
|
|
|
+ Order By CreateTime", _dto.DiId, _dto.isAudit ? isAuditSql : string.Empty);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -660,7 +666,7 @@ ORDER BY
|
|
|
Left Join Sys_SetData sd2 On ccp.PaymentCurrency = sd2.Id
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
Where ctggr.IsDel = 0 {1} And ctggr.DiId = {0}
|
|
|
- Order By CreateTime", _dto.DiId, _dto.isAudit ? isAuditSql : " ");
|
|
|
+ Order By CreateTime", _dto.DiId, _dto.isAudit ? isAuditSql : string.Empty);
|
|
|
}
|
|
|
|
|
|
groupCTGGRFeeViews = await _sqlSugar.SqlQueryable<GroupCTGGRFeeView>(CTGGRFeeSql).ToListAsync();
|
|
@@ -735,7 +741,7 @@ ORDER BY
|
|
|
_geView.GroupCTGGRFeeStr = string.Format(@"{0}人民币总费用:{1} CNY", CTGGRFeeStr, CTGGRCNYTotalPrice.ToString("#0.00"));
|
|
|
#endregion
|
|
|
|
|
|
- #region 机票预订费用
|
|
|
+ #region 机票预订费用 85 isAuditSql
|
|
|
//(((ccp.PayMoney * ccp.DayRate) / ccp.PayPercentage) * 100) As CNYPrice
|
|
|
//ccp.RMBPrice As CNYPrice
|
|
|
List<GroupAirFeeView> groupAirFeeViews = new List<GroupAirFeeView>();
|
|
@@ -751,7 +757,8 @@ ORDER BY
|
|
|
Left Join Sys_SetData sd3 On ccp.CTDId = sd3.Id
|
|
|
Left Join Sys_SetData sd4 On atr.CType = sd4.Id
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
- Where atr.IsDel = 0 {1} And atr.DiId = {0} Order By CreateTime", _dto.DiId, _dto.isAudit ? "And ccp.IsAuditGM = 1" : " ");
|
|
|
+ Where atr.IsDel = 0 {1} And atr.DiId = {0} Order By CreateTime",
|
|
|
+ _dto.DiId, _dto.isAudit ? isAuditSql : string.Empty);
|
|
|
groupAirFeeViews = await _sqlSugar.SqlQueryable<GroupAirFeeView>(groupAirFeeSql).ToListAsync();
|
|
|
|
|
|
string str = "";
|
|
@@ -951,7 +958,7 @@ ORDER BY
|
|
|
_geView.GroupAirFeeStr = $@"人民币总费用:{AirCNYTotalPrice.ToString("#0.00")} CNY\r\n{str}\r\n经济舱均价为:{JJCAveragePrice.ToString("#0.00")}CNY/人;公务舱均价为:{GWCAveragePrice.ToString("#0.00")}CNY/人;";
|
|
|
#endregion
|
|
|
|
|
|
- #region 签证费用
|
|
|
+ #region 签证费用 80 isAuditSql
|
|
|
|
|
|
List<GroupVisaFeeView> groupVisaFeeViews = new List<GroupVisaFeeView>();
|
|
|
string groupVisaFeeSql = string.Format(@"Select vi.Id As VisaId,vi.DIId As VisaDiId,vi.VisaClient,ccp.PayMoney,sd1.Name As PayMoneyCurrency,
|
|
@@ -964,7 +971,8 @@ ORDER BY
|
|
|
Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
|
|
|
Left Join Sys_SetData sd3 On ccp.CTDId = sd3.Id
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
- Where vi.IsDel = 0 {1} And vi.DIId = {0} Order By CreateTime", _dto.DiId, _dto.isAudit ? isAuditSql : " ");
|
|
|
+ Where vi.IsDel = 0 {1} And vi.DIId = {0} Order By CreateTime",
|
|
|
+ _dto.DiId, _dto.isAudit ? isAuditSql : string.Empty);
|
|
|
|
|
|
groupVisaFeeViews = await _sqlSugar.SqlQueryable<GroupVisaFeeView>(groupVisaFeeSql).ToListAsync();
|
|
|
|
|
@@ -1026,7 +1034,7 @@ ORDER BY
|
|
|
_geView.GroupVisaFeeStr = string.Format(@"人民币总费用:{0} CNY", VisaCNYTotalPirce.ConvertToDecimal1().ToString("#.00"));
|
|
|
#endregion
|
|
|
|
|
|
- #region 邀请/公务活动 CTable = 81
|
|
|
+ #region 邀请/公务活动 81 isAuditSql
|
|
|
|
|
|
List<GroupInvitationalFeeView> groupInvitationalFeeViews = new List<GroupInvitationalFeeView>();
|
|
|
string groupInvitationalFeeSql = string.Format(@"Select ioa.Id As IOAId,ioa.DiId As IOADiId,ioa.InviterArea,ioa.Inviter,ioa.InviteTime,
|
|
@@ -1045,7 +1053,8 @@ ORDER BY
|
|
|
Left Join Sys_SetData sd6 On ioa.TranslateCurrency = sd6.Id
|
|
|
Left Join Sys_SetData sd7 On ccp.PaymentCurrency = sd7.Id
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
- Where ioa.IsDel = 0 {1} And ioa.Diid = {0} Order By CreateTime", _dto.DiId, _dto.isAudit ? "And ccp.IsAuditGM = 1" : " ");
|
|
|
+ Where ioa.IsDel = 0 {1} And ioa.Diid = {0} Order By CreateTime",
|
|
|
+ _dto.DiId, _dto.isAudit ? isAuditSql : string.Empty );
|
|
|
|
|
|
groupInvitationalFeeViews = await _sqlSugar.SqlQueryable<GroupInvitationalFeeView>(groupInvitationalFeeSql).ToListAsync();
|
|
|
|
|
@@ -1133,7 +1142,7 @@ ORDER BY
|
|
|
_geView.GroupInvitationalFeeStr = string.Format(@"人民币总费用:{0} CNY", InvitationalCNYTotalPrice.ToString("#.00"));
|
|
|
#endregion
|
|
|
|
|
|
- #region 保险费用
|
|
|
+ #region 保险费用 82 isAuditSql
|
|
|
List<GroupInsuranceFeeView> groupInsuranceFeeViews = new List<GroupInsuranceFeeView>();
|
|
|
string groupInsuranceFeeSql = string.Format(@"Select ic.Id As InsuranceId,ic.Diid As InsuranceDiId,ClientName,ccp.PayMoney,ccp.PayMoney * ccp.DayRate As CNYPrice,
|
|
|
sd1.Name As PayMoneyCurrency,ccp.Payee,ccp.AuditGMDate,ccp.OrbitalPrivateTransfer,
|
|
@@ -1143,7 +1152,8 @@ ORDER BY
|
|
|
Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
|
|
|
Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
- Where ic.IsDel = 0 {1} And ic.DiId = {0} Order By CreateTime", _dto.DiId, _dto.isAudit ? "And ccp.IsAuditGM = 1" : " ");
|
|
|
+ Where ic.IsDel = 0 {1} And ic.DiId = {0} Order By CreateTime",
|
|
|
+ _dto.DiId, _dto.isAudit ? isAuditSql : string.Empty);
|
|
|
groupInsuranceFeeViews = await _sqlSugar.SqlQueryable<GroupInsuranceFeeView>(groupInsuranceFeeSql).ToListAsync();
|
|
|
|
|
|
decimal InsuranceCNYTotalPrice = 0.00M;
|
|
@@ -1216,7 +1226,7 @@ ORDER BY
|
|
|
_geView.GroupInsuranceFeeStr = string.Format(@"人民币总费用:{0} CNY", InsuranceCNYTotalPrice.ToString("#0.00"));
|
|
|
#endregion
|
|
|
|
|
|
- #region 其他款项费用 98
|
|
|
+ #region 其他款项费用 98 isAuditSql
|
|
|
List<GroupDecreaseFeeView> groupDecreaseFeeViews = new List<GroupDecreaseFeeView>();
|
|
|
string groupDecreaseFeeSql = string.Format(@"Select dp.Id As DPId,dp.DiId As DPDiId,dp.PriceName,ccp.PayMoney,sd1.Name As PayMoneyCurrency,
|
|
|
(((ccp.PayMoney * ccp.DayRate) / ccp.PayPercentage) * 100) As CNYPrice,
|
|
@@ -1228,7 +1238,7 @@ ORDER BY
|
|
|
Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
Where dp.IsDel = 0 And ccp.Ctable = 98 {1} And dp.Diid = {0}
|
|
|
- Order By CreateTime", _dto.DiId, _dto.isAudit ? "And ccp.IsAuditGM = 1" : " ");
|
|
|
+ Order By CreateTime", _dto.DiId, _dto.isAudit ? isAuditSql : string.Empty);
|
|
|
groupDecreaseFeeViews = await _sqlSugar.SqlQueryable<GroupDecreaseFeeView>(groupDecreaseFeeSql).ToListAsync();
|
|
|
|
|
|
#region 保险费用 - 模拟数据
|
|
@@ -1288,7 +1298,7 @@ ORDER BY
|
|
|
_geView.GroupDecreaseFeeStr = string.Format(@"人民币总费用:{0} CNY", DecreaseCNYTotalPrice.ToString("#0.00"));
|
|
|
#endregion
|
|
|
|
|
|
- #region 公司内部操作人员提成
|
|
|
+ #region 公司内部操作人员提成(提成表) isAudit
|
|
|
|
|
|
var royaltyDatas = await _sqlSugar
|
|
|
.Queryable<Fin_RoyaltyConfirm, Sys_Users, Sys_Users>((rc, u1, u2) =>
|
|
@@ -1296,7 +1306,8 @@ ORDER BY
|
|
|
JoinType.Left, rc.UserId == u1.Id,
|
|
|
JoinType.Left, rc.CreateUserId == u2.Id
|
|
|
))
|
|
|
- .Where((rc, u1, u2) => rc.IsDel == 0 && rc.TeamId == _dto.DiId && rc.IsConfirm == 1)
|
|
|
+ .Where((rc, u1, u2) => rc.IsDel == 0 && rc.TeamId == _dto.DiId)
|
|
|
+ .WhereIF(isAudit, (rc, u1, u2) => rc.IsConfirm == 1)
|
|
|
.Select((rc, u1, u2) => new GroupRoyaltyFeeInfo()
|
|
|
{
|
|
|
GroupId = rc.TeamId,
|
|
@@ -1315,7 +1326,7 @@ ORDER BY
|
|
|
_geView.GroupRoyaltyFeeStr = string.Format(@"人民币总费用:{0} CNY", royaltyCNYTotalPrice.ToString("#0.00"));
|
|
|
#endregion
|
|
|
|
|
|
- #region 公司内部人员报销
|
|
|
+ #region 公司内部人员报销(日付表) isAuditStatus
|
|
|
var reimburseDatas = await _sqlSugar
|
|
|
.Queryable<Fin_DailyFeePayment, Sys_Users, Sys_SetData, Sys_Company>((dfp, u, sd1, c) =>
|
|
|
new JoinQueryInfos(
|
|
@@ -1324,6 +1335,7 @@ ORDER BY
|
|
|
JoinType.Left, dfp.CompanyId == c.Id
|
|
|
))
|
|
|
.Where((dfp, u, sd1, c) => dfp.IsDel == 0 && dfp.PriceTypeId == 1353 && dfp.GroupId == _dto.DiId)
|
|
|
+ .WhereIF(isAudit, (dfp, u, sd1, c) => isAuditStatus.Contains(dfp.FAudit) && isAuditStatus.Contains(dfp.MAudit))
|
|
|
.Select((dfp, u, sd1, c) => new GroupReimburseFeeInfoView()
|
|
|
{
|
|
|
TotalAmt = dfp.SumPrice,
|