Pārlūkot izejas kodu

团组费用未审核数据Item优化

LEIYI 9 mēneši atpakaļ
vecāks
revīzija
281733ce89

+ 233 - 182
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -5824,13 +5824,19 @@ Group by PriceType ", dto.diId);
             _DailyFeePaymentResult.gz = _paymentDatas.Where(it => it.OrbitalPrivateTransfer == 0).Sum(it => ((it.PayMoney * it.DayRate) / 100) * it.PayPercentage); //公转
             _DailyFeePaymentResult.sz = _paymentDatas.Where(it => it.OrbitalPrivateTransfer == 1).Sum(it => ((it.PayMoney * it.DayRate) / 100) * it.PayPercentage); ; //私转
 
+
             #region 相关基础数据源
             var userDatas = _sqlSugar.Queryable<Sys_Users>().ToList();
             var setDatas = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0).ToList();
             var countryFeeDatas = _sqlSugar.Queryable<Grp_NationalTravelFee>().Where(it => it.IsDel == 0).ToList();
 
+            //76	酒店预订
             var hotelDatas = _sqlSugar.Queryable<Grp_HotelReservations>()
-                                      .Where(it => it.IsDel == 0 && _groupIds.Contains(it.DiId))
+                                      .InnerJoin<Grp_CreditCardPayment>((hr,ccp) => hr.Id == ccp.CId && 
+                                                                                    ccp.CTable == 76 &&
+                                                                                    ccp.IsDel == 0
+                                                                        )
+                                      .Where((hr, ccp) => hr.IsDel == 0 && _groupIds.Contains(hr.DiId) && ccp.IsAuditGM == 0)
                                       .ToList();
             var hotelContentDatas = _sqlSugar.Queryable<Grp_HotelReservationsContent>()
                                              .Where(it => it.IsDel == 0 && 
@@ -5839,29 +5845,69 @@ Group by PriceType ", dto.diId);
                                                           _groupIds.Contains(it.DiId)
                                                     )
                                              .ToList();
+            //79	车/导游地接
             var opDatas = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>()
-                                   .Where(it => it.IsDel == 0 && _groupIds.Contains(it.DiId))
+                                   .InnerJoin<Grp_CreditCardPayment>((ctggr, ccp) => ctggr.Id == ccp.CId &&
+                                                                                     ccp.CTable == 79 &&
+                                                                                     ccp.IsDel == 0
+                                                                    )
+                                   .Where((ctggr, ccp) => ctggr.IsDel == 0 && _groupIds.Contains(ctggr.DiId) && ccp.IsAuditGM == 0)
                                    .ToList();
+            // 80   签证
             var visaDatas = _sqlSugar.Queryable<Grp_VisaInfo>()
-                                     .Where(it => it.IsDel == 0 && _groupIds.Contains(it.DIId))
+                                     .InnerJoin<Grp_CreditCardPayment>((vi, ccp) => vi.Id == ccp.CId &&
+                                                                                    ccp.CTable == 80 &&
+                                                                                    ccp.IsDel == 0
+                                                                    )
+                                     .Where((vi, ccp) => vi.IsDel == 0 && _groupIds.Contains(vi.DIId) && ccp.IsAuditGM == 0)
                                      .ToList();
+            // 81	邀请/公务活动
             var ioaDatas = _sqlSugar.Queryable<Grp_InvitationOfficialActivities>()
-                                    .Where(it => it.IsDel == 0 && _groupIds.Contains(it.DiId))
+                                    .InnerJoin<Grp_CreditCardPayment>((ioa, ccp) => ioa.Id == ccp.CId &&
+                                                                                    ccp.CTable == 81 &&
+                                                                                    ccp.IsDel == 0
+                                                                    )
+                                    .Where((ioa, ccp) => ioa.IsDel == 0 && _groupIds.Contains(ioa.DiId) && ccp.IsAuditGM == 0)
                                     .ToList();
+            // 82	团组客户保险
             var insureDatas = _sqlSugar.Queryable<Grp_Customers>()
-                                       .Where(it => it.IsDel == 0 && _groupIds.Contains(it.DiId))
+                                       .InnerJoin<Grp_CreditCardPayment>((c, ccp) => c.Id == ccp.CId &&
+                                                                                    ccp.CTable == 82 &&
+                                                                                    ccp.IsDel == 0
+                                                                         )
+                                       .Where((c, ccp) => c.IsDel == 0 && _groupIds.Contains(c.DiId) && ccp.IsAuditGM == 0)
                                        .ToList();
+            // 85	机票预订
             var airDatas = _sqlSugar.Queryable<Grp_AirTicketReservations>()
-                                    .Where(it => it.IsDel == 0 && _groupIds.Contains(it.DIId))
+                                    .InnerJoin<Grp_CreditCardPayment>((atr, ccp) => atr.Id == ccp.CId &&
+                                                                                    ccp.CTable == 85 &&
+                                                                                    ccp.IsDel == 0
+                                                                      )
+                                    .Where((atr, ccp) => atr.IsDel == 0 && _groupIds.Contains(atr.DIId) && ccp.IsAuditGM == 0)
                                     .ToList();
+            // 98	其他款项
             var otherMoneyDatas = _sqlSugar.Queryable<Grp_DecreasePayments>()
-                                           .Where(it => it.IsDel == 0 && _groupIds.Contains(it.DiId))
+                                           .InnerJoin<Grp_CreditCardPayment>((dp, ccp) => dp.Id == ccp.CId &&
+                                                                                          ccp.CTable == 98 &&
+                                                                                          ccp.IsDel == 0
+                                                                            )
+                                           .Where((dp, ccp) => dp.IsDel == 0 && _groupIds.Contains(dp.DiId) && ccp.IsAuditGM == 0)
                                            .ToList();
+            // 285 收款退还
             var refundPaymentDatas = _sqlSugar.Queryable<Fin_PaymentRefundAndOtherMoney>()
-                                              .Where(it => it.IsDel == 0 && _groupIds.Contains(it.DiId))
+                                              .InnerJoin<Grp_CreditCardPayment>((prom, ccp) => prom.Id == ccp.CId &&
+                                                                                               ccp.CTable == 285 &&
+                                                                                               ccp.IsDel == 0
+                                                                               )
+                                              .Where((prom, ccp) => prom.IsDel == 0 && _groupIds.Contains(prom.DiId) && ccp.IsAuditGM == 0)
                                               .ToList();
+            // 1015	超支费用
             var extraCostDatas = _sqlSugar.Queryable<Fin_GroupExtraCost>()
-                                          .Where(it => it.IsDel == 0 && _groupIds.Contains(it.DiId))
+                                          .InnerJoin<Grp_CreditCardPayment>((gec, ccp) => gec.Id == ccp.CId &&
+                                                                                          ccp.CTable == 1015 &&
+                                                                                          ccp.IsDel == 0
+                                                                           )
+                                          .Where((gec, ccp) => gec.IsDel == 0 && _groupIds.Contains(gec.DiId) && ccp.IsAuditGM == 0)
                                           .ToList();
             #endregion
             //Expense company
@@ -5870,220 +5916,225 @@ Group by PriceType ", dto.diId);
                 var childList = new List<Group_DailyFeePaymentContentInfolView>();
 
                 var groupPaymentDatas = _paymentDatas.Where(it => groupInfo.Id == it.DIId).ToList();
-                int rouNumber = 1;
-                foreach (var payInfo in groupPaymentDatas)
-                {
-                    string priName = "-";
 
-                    string orbitalPrivateTransfer = payInfo.OrbitalPrivateTransfer == 0 ? "公转" : payInfo.OrbitalPrivateTransfer == 1 ? "私转" : "-";
-                    switch (payInfo.CTable)
+                if (groupPaymentDatas.Count > 0)
+                {
+                    int rouNumber = 1;
+                    foreach (var payInfo in groupPaymentDatas)
                     {
-                        case 76:  //76	酒店预订
-                            priName = $"[费用名称:{hotelDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.HotelName ?? ""}]";
-                            break;
-                        case 79:  //79	车/导游地接
-                            var opData = opDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id);
-                            if (opData != null)
-                            {
-                                string area = "";
-                                bool b = int.TryParse(opData.Area, out int areaId);
-                                if (b)
+                        string priName = "-";
+
+                        string orbitalPrivateTransfer = payInfo.OrbitalPrivateTransfer == 0 ? "公转" : payInfo.OrbitalPrivateTransfer == 1 ? "私转" : "-";
+                        switch (payInfo.CTable)
+                        {
+                            case 76:  //76	酒店预订
+                                priName = $"[费用名称:{hotelDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.HotelName ?? ""}]";
+                                break;
+                            case 79:  //79	车/导游地接
+                                var opData = opDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id);
+                                if (opData != null)
                                 {
-                                    string area1 = countryFeeDatas.Find(it => it.Id == areaId)?.Country ?? "-";
-                                    area = $"{area1}({setDatas.Find(it => it.Id == opData.PriceType)?.Name ?? "-"})";
-                                }
-                                else area = opData.Area;
+                                    string area = "";
+                                    bool b = int.TryParse(opData.Area, out int areaId);
+                                    if (b)
+                                    {
+                                        string area1 = countryFeeDatas.Find(it => it.Id == areaId)?.Country ?? "-";
+                                        area = $"{area1}({setDatas.Find(it => it.Id == opData.PriceType)?.Name ?? "-"})";
+                                    }
+                                    else area = opData.Area;
 
-                                string opPriName = "-";
-                                if (!string.IsNullOrEmpty(opData.PriceName)) opPriName = opData.PriceName;
+                                    string opPriName = "-";
+                                    if (!string.IsNullOrEmpty(opData.PriceName)) opPriName = opData.PriceName;
 
-                                area += $"({opPriName})";
+                                    area += $"({opPriName})";
 
-                                if (payInfo.OrbitalPrivateTransfer == 0) //公转
-                                {
-                                    priName = $"【{orbitalPrivateTransfer}】【导游: {opData.ServiceGuide} 】[费用名称:{area}]";
-                                }
-                                else if (payInfo.OrbitalPrivateTransfer == 1) //私转
-                                {
-                                    priName = $"【{orbitalPrivateTransfer}】【导游:{opData.ServiceGuide}】[费用名称:{area}]";
+                                    if (payInfo.OrbitalPrivateTransfer == 0) //公转
+                                    {
+                                        priName = $"【{orbitalPrivateTransfer}】【导游: {opData.ServiceGuide} 】[费用名称:{area}]";
+                                    }
+                                    else if (payInfo.OrbitalPrivateTransfer == 1) //私转
+                                    {
+                                        priName = $"【{orbitalPrivateTransfer}】【导游:{opData.ServiceGuide}】[费用名称:{area}]";
+                                    }
                                 }
-                            }
-                            break;
-                        case 80:  // 80   签证
+                                break;
+                            case 80:  // 80   签证
 
-                            string sql = string.Format("select b.Id,b.Pinyin,b.lastName,b.firstName,b.phone from  Grp_TourClientList a, Crm_DeleClient b where a.clientid = b.id and a.isdel = 0 and a.diid = {0}", groupInfo.Id);
-                            List<SimplClientInfo> arr = _sqlSugar.SqlQueryable<SimplClientInfo>(sql).ToList();
+                                string sql = string.Format("select b.Id,b.Pinyin,b.lastName,b.firstName,b.phone from  Grp_TourClientList a, Crm_DeleClient b where a.clientid = b.id and a.isdel = 0 and a.diid = {0}", groupInfo.Id);
+                                List<SimplClientInfo> arr = _sqlSugar.SqlQueryable<SimplClientInfo>(sql).ToList();
 
-                            string visaClientName = visaDatas.Find(it => payInfo.DIId == it.DIId && payInfo.CId == it.Id)?.VisaClient ?? "";
-                            string clientName = "-";
-                            if (Regex.Match(visaClientName, @"\d+,?").Value.Length > 0)
-                            {
-                                string[] temparr = visaClientName.Split(',');
-                                string fistrStr = temparr[0];
-                                int count = temparr.Count();
-
-                                int tempId;
-                                bool success = int.TryParse(fistrStr, out tempId);
-                                if (success)
+                                string visaClientName = visaDatas.Find(it => payInfo.DIId == it.DIId && payInfo.CId == it.Id)?.VisaClient ?? "";
+                                string clientName = "-";
+                                if (Regex.Match(visaClientName, @"\d+,?").Value.Length > 0)
                                 {
-                                    SimplClientInfo tempInfo = arr.FirstOrDefault(s => s.Id == tempId);
-                                    if (tempInfo != null)
+                                    string[] temparr = visaClientName.Split(',');
+                                    string fistrStr = temparr[0];
+                                    int count = temparr.Count();
+
+                                    int tempId;
+                                    bool success = int.TryParse(fistrStr, out tempId);
+                                    if (success)
                                     {
-                                        if (count > 1)
+                                        SimplClientInfo tempInfo = arr.FirstOrDefault(s => s.Id == tempId);
+                                        if (tempInfo != null)
                                         {
-                                            clientName = string.Format(@"{0}{1}等{2}人", tempInfo.LastName, tempInfo.FirstName, count);
-                                        }
-                                        else
-                                        {
-                                            clientName = string.Format(@"{0}{1}", tempInfo.LastName, tempInfo.FirstName);
+                                            if (count > 1)
+                                            {
+                                                clientName = string.Format(@"{0}{1}等{2}人", tempInfo.LastName, tempInfo.FirstName, count);
+                                            }
+                                            else
+                                            {
+                                                clientName = string.Format(@"{0}{1}", tempInfo.LastName, tempInfo.FirstName);
+                                            }
                                         }
                                     }
+                                    else
+                                    {
+                                        clientName = fistrStr;
+                                    }
                                 }
-                                else
-                                {
-                                    clientName = fistrStr;
-                                }
-                            }
 
-                            priName = $"[费用名称:{clientName}]";
-                            break;
-                        case 81:  // 81	邀请/公务活动
-                            priName = $"[费用名称:{ioaDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.Inviter ?? " -"}]";
-                            break;
-                        case 82:  // 82	团组客户保险
-                            priName = $"[费用名称:{insureDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.ClientName ?? " -"}]";
-                            break;
-                        case 85:  // 85	机票预订
-                            string flightsCode = airDatas.Find(it => payInfo.DIId == it.DIId && payInfo.CId == it.Id)?.FlightsCode ?? "-";
-                            string airPayType = setDatas.Find(it => it.Id == payInfo.PayDId)?.Name ?? "-";
-                            priName = $"{flightsCode}{airPayType}】";
-                            break;
-                        case 98:  //  98	其他款项
-                            priName = $"[费用名称:{otherMoneyDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.PriceName ?? " -"}]";
-                            break;
-                        case 285:  //  285 收款退还
-                            priName = $"[费用名称:{refundPaymentDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.PriceName ?? " -"}]";
-                            break;
-                        case 1015:  //  1015	超支费用
-                            priName = $"[费用名称:{extraCostDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.PriceName ?? " -"}]";
-                            break;
-                        default:
-                            priName = "";
-                            break;
-                    }
+                                priName = $"[费用名称:{clientName}]";
+                                break;
+                            case 81:  // 81	邀请/公务活动
+                                priName = $"[费用名称:{ioaDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.Inviter ?? " -"}]";
+                                break;
+                            case 82:  // 82	团组客户保险
+                                priName = $"[费用名称:{insureDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.ClientName ?? " -"}]";
+                                break;
+                            case 85:  // 85	机票预订
+                                string flightsCode = airDatas.Find(it => payInfo.DIId == it.DIId && payInfo.CId == it.Id)?.FlightsCode ?? "-";
+                                string airPayType = setDatas.Find(it => it.Id == payInfo.PayDId)?.Name ?? "-";
+                                priName = $"{flightsCode}{airPayType}】";
+                                break;
+                            case 98:  //  98	其他款项
+                                priName = $"[费用名称:{otherMoneyDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.PriceName ?? " -"}]";
+                                break;
+                            case 285:  //  285 收款退还
+                                priName = $"[费用名称:{refundPaymentDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.PriceName ?? " -"}]";
+                                break;
+                            case 1015:  //  1015	超支费用
+                                priName = $"[费用名称:{extraCostDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.PriceName ?? " -"}]";
+                                break;
+                            default:
+                                priName = "";
+                                break;
+                        }
 
+                        if (payInfo.CTable == 76) //酒店单独处理
+                        {
+                            var hotelContents = hotelContentDatas.Where(it => it.HrId == payInfo.CId);
+                            List<Group_DailyFeePaymentContentInfolView> childInfos = new List<Group_DailyFeePaymentContentInfolView>();
+                            foreach (var hotelContent in hotelContents)
+                            {
+                                string subPriceName = "";
+                                if (hotelContent.PriceType == 1) subPriceName = "房费";
+                                else if (hotelContent.PriceType == 2) subPriceName = "早餐";
+                                else if (hotelContent.PriceType == 3) subPriceName = "地税";
+                                else if (hotelContent.PriceType == 4) subPriceName = "城市税";
 
-                    bool status1 = false;
-                    if (_groupIds != null)
-                    {
-                        status1 = _groupIds.Contains(payInfo.Id);
-                    }
+                                if (string.IsNullOrEmpty(subPriceName)) subPriceName = priName;
+                                else subPriceName = $"{priName.Replace("]", "")}-{subPriceName}]";
 
-                    if (payInfo.CTable == 76) //酒店单独处理
-                    {
-                        var hotelContents = hotelContentDatas.Where(it => it.HrId == payInfo.CId);
-                        List<Group_DailyFeePaymentContentInfolView> childInfos = new List<Group_DailyFeePaymentContentInfolView>();
-                        foreach (var hotelContent in hotelContents)
-                        {
-                            string subPriceName = "";
-                            if (hotelContent.PriceType == 1) subPriceName = "房费";
-                            else if (hotelContent.PriceType == 2) subPriceName = "早餐";
-                            else if (hotelContent.PriceType == 3) subPriceName = "地税";
-                            else if (hotelContent.PriceType == 4) subPriceName = "城市税";
+                                string payeeStr1 = string.Format(@" {0},开户行:{1},银行卡号:{2} ",
+                                string.IsNullOrEmpty(hotelContent.Payee) ? "-" : hotelContent.Payee,
+                                string.IsNullOrEmpty(hotelContent.OtherBankName) ? "-" : hotelContent.OtherBankName,
+                                string.IsNullOrEmpty(hotelContent.OtherSideNo) ? "-" : hotelContent.OtherSideNo);
 
-                            if (string.IsNullOrEmpty(subPriceName)) subPriceName = priName;
-                            else subPriceName = $"{priName.Replace("]", "")}-{subPriceName}]";
+                                decimal _PaymentAmount1 = hotelContent.Price;//此次付款金额
+                                decimal _CNYSubTotalAmount1 = _PaymentAmount1 * hotelContent.Rate;//此次付款金额
+                                _CNYSubTotalAmount1 = Convert.ToDecimal(_CNYSubTotalAmount1.ToString("#0.00"));
 
-                            string payeeStr1 = string.Format(@" {0},开户行:{1},银行卡号:{2} ",
-                            string.IsNullOrEmpty(hotelContent.Payee) ? "-" : hotelContent.Payee,
-                            string.IsNullOrEmpty(hotelContent.OtherBankName) ? "-" : hotelContent.OtherBankName,
-                            string.IsNullOrEmpty(hotelContent.OtherSideNo) ? "-" : hotelContent.OtherSideNo);
+                                var childInfo1 = new Group_DailyFeePaymentContentInfolView()
+                                {
+                                    Id = payInfo.Id,
+                                    HotelSubId = hotelContent.Id,
+                                    Payee = payeeStr1,
+                                    RowNumber = rouNumber,
+                                    Applicant = userDatas.Find(it => it.Id == payInfo.CreateUserId)?.CnName ?? "",
+                                    ApplicantDt = payInfo.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
+                                    PayType = setDatas.Find(it => it.Id == hotelContent.PayDId)?.Name ?? "",
+                                    TransferMark = orbitalPrivateTransfer,
+                                    PriceName = subPriceName,
+                                    ModuleName = setDatas.Find(it => it.Id == payInfo.CTable)?.Name ?? "",
+                                    PayCurrCode = setDatas.Find(it => it.Id == hotelContent.Currency)?.Name ?? "",
+                                    PaymentAmount = _PaymentAmount1,
+                                    PayRate = hotelContent.Rate,
+                                    CNYSubTotalAmount = _CNYSubTotalAmount1,
+                                    AuditStatus = payInfo.IsAuditGM
+
+                                };
+                                string remaksDescription1 = $"【{childInfo1.PayType}】【{childInfo1.ModuleName}{rouNumber}、[申请人:{childInfo1.Applicant}]{subPriceName}[收款方:{childInfo1.Payee}] {childInfo1.PayCurrCode} {_PaymentAmount1.ToString("#0.00")}、CNY:{childInfo1.CNYSubTotalAmount.ToString("#0.00")}(团组:{groupInfo.TeamName})";
+
+                                childInfo1.RemaksDescription = remaksDescription1;
+                                childInfos.Add(childInfo1);
+                                rouNumber++;
+                            }
 
-                            decimal _PaymentAmount1 = hotelContent.Price;//此次付款金额
-                            decimal _CNYSubTotalAmount1 = _PaymentAmount1 * hotelContent.Rate;//此次付款金额
-                            _CNYSubTotalAmount1 = Convert.ToDecimal(_CNYSubTotalAmount1.ToString("#0.00"));
+                            childList.AddRange(childInfos);
+                        }
+                        else
+                        {
+                            string payeeStr = string.Format(@" {0},开户行:{1},银行卡号:{2} ",
+                                string.IsNullOrEmpty(payInfo.Payee) ? "-" : payInfo.Payee,
+                                string.IsNullOrEmpty(payInfo.OtherBankName) ? "-" : payInfo.OtherBankName,
+                                string.IsNullOrEmpty(payInfo.OtherSideNo) ? "-" : payInfo.OtherSideNo);
 
-                            var childInfo1 = new Group_DailyFeePaymentContentInfolView()
+
+                            decimal _PaymentAmount = (payInfo.PayMoney / 100) * payInfo.PayPercentage;//此次付款金额
+                            decimal _CNYSubTotalAmount = _PaymentAmount * payInfo.DayRate;//此次付款金额
+                            _CNYSubTotalAmount = Convert.ToDecimal(_CNYSubTotalAmount.ToString("#0.00"));
+                            var childInfo = new Group_DailyFeePaymentContentInfolView()
                             {
-                                IsChecked = status1,
                                 Id = payInfo.Id,
-                                HotelSubId = hotelContent.Id,
-                                Payee = payeeStr1,
+                                Payee = payeeStr,
                                 RowNumber = rouNumber,
                                 Applicant = userDatas.Find(it => it.Id == payInfo.CreateUserId)?.CnName ?? "",
                                 ApplicantDt = payInfo.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
-                                PayType = setDatas.Find(it => it.Id == hotelContent.PayDId)?.Name ?? "",
+                                PayType = setDatas.Find(it => it.Id == payInfo.PayDId)?.Name ?? "",
                                 TransferMark = orbitalPrivateTransfer,
-                                PriceName = subPriceName,
+                                PriceName = priName,
                                 ModuleName = setDatas.Find(it => it.Id == payInfo.CTable)?.Name ?? "",
-                                PayCurrCode = setDatas.Find(it => it.Id == hotelContent.Currency)?.Name ?? "",
-                                PaymentAmount = _PaymentAmount1,
-                                PayRate = hotelContent.Rate,
-                                CNYSubTotalAmount = _CNYSubTotalAmount1,
+                                PayCurrCode = setDatas.Find(it => it.Id == payInfo.PaymentCurrency)?.Name ?? "",
+                                PaymentAmount = _PaymentAmount,
+                                PayRate = payInfo.DayRate,
+                                CNYSubTotalAmount = _CNYSubTotalAmount,
                                 AuditStatus = payInfo.IsAuditGM
-
                             };
-                            string remaksDescription1 = $"【{childInfo1.PayType}】【{childInfo1.ModuleName}{rouNumber}、[申请人:{childInfo1.Applicant}]{subPriceName}[收款方:{childInfo1.Payee}] {childInfo1.PayCurrCode} {_PaymentAmount1.ToString("#0.00")}、CNY:{childInfo1.CNYSubTotalAmount.ToString("#0.00")}(团组:{groupInfo.TeamName})";
 
-                            childInfo1.RemaksDescription = remaksDescription1;
-                            childInfos.Add(childInfo1);
+                            string remaksDescription = $"【{childInfo.PayType}】【{childInfo.ModuleName}{rouNumber}、[申请人:{childInfo.Applicant}]{priName}[收款方:{childInfo.Payee}] {childInfo.PayCurrCode} {_PaymentAmount.ToString("#0.00")}、CNY:{childInfo.CNYSubTotalAmount.ToString("#0.00")}(团组:{groupInfo.TeamName})";
+
+                            childInfo.RemaksDescription = remaksDescription;
+                            childList.Add(childInfo);
                             rouNumber++;
                         }
-
-                        childList.AddRange(childInfos);
                     }
-                    else
-                    {
-                        string payeeStr = string.Format(@" {0},开户行:{1},银行卡号:{2} ",
-                            string.IsNullOrEmpty(payInfo.Payee) ? "-" : payInfo.Payee,
-                            string.IsNullOrEmpty(payInfo.OtherBankName) ? "-" : payInfo.OtherBankName,
-                            string.IsNullOrEmpty(payInfo.OtherSideNo) ? "-" : payInfo.OtherSideNo);
 
-
-                        decimal _PaymentAmount = (payInfo.PayMoney / 100) * payInfo.PayPercentage;//此次付款金额
-                        decimal _CNYSubTotalAmount = _PaymentAmount * payInfo.DayRate;//此次付款金额
-                        _CNYSubTotalAmount = Convert.ToDecimal(_CNYSubTotalAmount.ToString("#0.00"));
-                        var childInfo = new Group_DailyFeePaymentContentInfolView()
-                        {
-                            IsChecked = status1,
-                            Id = payInfo.Id,
-                            Payee = payeeStr,
-                            RowNumber = rouNumber,
-                            Applicant = userDatas.Find(it => it.Id == payInfo.CreateUserId)?.CnName ?? "",
-                            ApplicantDt = payInfo.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
-                            PayType = setDatas.Find(it => it.Id == payInfo.PayDId)?.Name ?? "",
-                            TransferMark = orbitalPrivateTransfer,
-                            PriceName = priName,
-                            ModuleName = setDatas.Find(it => it.Id == payInfo.CTable)?.Name ?? "",
-                            PayCurrCode = setDatas.Find(it => it.Id == payInfo.PaymentCurrency)?.Name ?? "",
-                            PaymentAmount = _PaymentAmount,
-                            PayRate = payInfo.DayRate,
-                            CNYSubTotalAmount = _CNYSubTotalAmount,
-                            AuditStatus = payInfo.IsAuditGM
-                        };
-
-                        string remaksDescription = $"【{childInfo.PayType}】【{childInfo.ModuleName}{rouNumber}、[申请人:{childInfo.Applicant}]{priName}[收款方:{childInfo.Payee}] {childInfo.PayCurrCode} {_PaymentAmount.ToString("#0.00")}、CNY:{childInfo.CNYSubTotalAmount.ToString("#0.00")}(团组:{groupInfo.TeamName})";
-
-                        childInfo.RemaksDescription = remaksDescription;
-                        //childList.Add(childInfo);
-                        rouNumber++;
-                    }
+                    CompanyInfo companyInfo = new CompanyInfo();
+                    companyInfo = ExpenseCompanyByTeamId(groupInfo.TeamDid);
+                    dataList.Add(new tree_Group_DailyFeePaymentPageListView()
+                    {
+                        Id = Guid.NewGuid().ToString("N"),
+                        GroupName = groupInfo.TeamName,
+                        CompanyId = companyInfo.Id,
+                        ConpanyName = companyInfo.ConpanyName,
+                        CNYTotalAmount = childList.Sum(it => it.CNYSubTotalAmount),
+                        ChildList = childList,
+                    });
                 }
-
-                CompanyInfo companyInfo = new CompanyInfo();
-                companyInfo = ExpenseCompanyByTeamId(groupInfo.TeamDid);
-                dataList.Add(new tree_Group_DailyFeePaymentPageListView()
+            }
+            var dataList1 = new List<tree_Group_DailyFeePaymentPageListView>();
+            //移除没有数据的团
+            foreach (var item in dataList)
+            {
+                if (item.CNYTotalAmount > 0 && item.ChildList.Count >0)
                 {
-                    Id = Guid.NewGuid().ToString("N"),
-                    GroupName = groupInfo.TeamName,
-                    CompanyId = companyInfo.Id,
-                    ConpanyName = companyInfo.ConpanyName,
-                    CNYTotalAmount = childList.Sum(it => it.CNYSubTotalAmount),
-                    ChildList = childList,
-                });
+                    dataList1.Add(item);
+                }
             }
 
-            _DailyFeePaymentResult.dataList = dataList;
+
+            _DailyFeePaymentResult.dataList = dataList1;
 
             jw.Code = StatusCodes.Status200OK;
             jw.Msg = $"操作成功!";

+ 0 - 1
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -6386,7 +6386,6 @@ namespace OASystem.API.Controllers
         }
         #endregion
 
-
         #region 签证提成录入
 
         /// <summary>