Browse Source

费用审核
费用列表 提示Msg

leiy 1 year ago
parent
commit
009c7c02f4
1 changed files with 142 additions and 35 deletions
  1. 142 35
      OASystem/OASystem.Api/Controllers/GroupsController.cs

+ 142 - 35
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -950,6 +950,33 @@ namespace OASystem.API.Controllers
 
                 List<CreditCardPaymentCurrencyPriceItem> ccpCurrencyPrices = new List<CreditCardPaymentCurrencyPriceItem>();
 
+                /*
+                 * 76://酒店预订
+                 */
+
+                List<Grp_HotelReservations> _HotelReservations = await _groupRepository
+                                                                       .Query<Grp_HotelReservations>(s => s.DiId == _dto.DiId && s.IsDel == 0)
+                                                                       .ToListAsync();
+
+                /*
+                 * 79://车/导游地接
+                 */
+                List<Grp_CarTouristGuideGroundReservations> _CarTouristGuideGroundReservations = await _groupRepository
+                                                                                                       .Query<Grp_CarTouristGuideGroundReservations>(s => s.DiId == _dto.DiId && s.IsDel == 0)
+                                                                                                       .ToListAsync();
+                List<Grp_CarTouristGuideGroundReservationsContent> _CarTouristGuideGroundReservationsContent = await _groupRepository
+                                                                     .Query<Grp_CarTouristGuideGroundReservationsContent>(s => s.DiId == _dto.DiId && s.IsDel == 0)
+                                                                     .ToListAsync();
+
+
+                /*
+                 * 80: //签证
+                 */
+
+                List<Grp_VisaInfo> _VisaInfos = await _groupRepository
+                                                      .Query<Grp_VisaInfo>(s => s.DIId == _dto.DiId && s.IsDel == 0)
+                                                      .ToListAsync();
+
                 /*
                  *  Label = 98 其他款项
                  */
@@ -965,12 +992,20 @@ namespace OASystem.API.Controllers
                                                                     .Query<Grp_AirTicketReservations>(s => s.DIId == _dto.DiId && s.IsDel == 0)
                                                                     .ToListAsync();
 
+
+
                 /*
                  * 币种信息
                  */
 
                 var currencyItems = await _groupRepository.Query<Sys_SetData>(s => s.STid == 66 && s.IsDel == 0).ToListAsync();
 
+                /*
+                 * 车/导游地接 费用类型
+                 */
+
+                var carFeeTypeItems = await _groupRepository.Query<Sys_SetData>(s => s.STid == 17 && s.IsDel == 0).ToListAsync();
+
                 /*
                  * 用户信息
                  */
@@ -996,41 +1031,6 @@ namespace OASystem.API.Controllers
 
                     _detail.Id = entity.Id;
 
-                    /*
-                     * Bus名称
-                     */
-                    _detail.BusName = "";
-
-                    /*
-                     *费用所属
-                     */
-                    switch (entity.CTable)
-                    {
-                        case 85:
-                            Grp_AirTicketReservations jpRes = _groupRepository.Query<Grp_AirTicketReservations>(s => s.Id == entity.CId).First();
-                            if (jpRes != null)
-                            {
-                                string FlightsDescription = jpRes.FlightsDescription;
-                                string PriceDescription = jpRes.PriceDescription;
-                                _detail.PriceMsgContent = "航班号:" + jpRes.FlightsCode + "<br/>城市A-B:" + jpRes.FlightsCity + "<br/>航班描述:" + FlightsDescription.Replace("\r\n", "<br />") + "<br/>" + "价格描述:" + PriceDescription;
-                                _detail.PriceNameContent = "(" + jpRes.FlightsCode + ")";
-                            }
-                            break;
-                        case 79:
-                            _detail.BusName = "待增加";
-                            break;
-                        case 98:
-                            Grp_DecreasePayments gdpRes = _DecreasePayments.Where(s => s.Id == entity.CId).FirstOrDefault();
-                            if (gdpRes != null)
-                            {
-                                _detail.PriceMsgContent = "备注:" + gdpRes.Remark;
-                                _detail.PriceNameContent = gdpRes.PriceName;
-                            }
-                            break;
-                        default:
-                            break;
-                    }
-
                     _detail.PriceName = priceModule;
 
                     /*
@@ -1038,9 +1038,13 @@ namespace OASystem.API.Controllers
                      */
                     Sys_SetData sdPaymentCurrency_WaitPay = currencyItems.Where(s => s.Id == entity.PaymentCurrency).FirstOrDefault();
                     string PaymentCurrency_WaitPay = "Unknown";
+                    string hotelCurrncyCode = "Unknown";
+                    string hotelCurrncyName = "Unknown";
                     if (sdPaymentCurrency_WaitPay != null)
                     {
                         PaymentCurrency_WaitPay = sdPaymentCurrency_WaitPay.Name;
+                        hotelCurrncyCode = sdPaymentCurrency_WaitPay.Name;
+                        hotelCurrncyName = sdPaymentCurrency_WaitPay.Remark;
                     }
                     _detail.WaitPay = entity.PayMoney.ConvertToDecimal1() + " " + PaymentCurrency_WaitPay;
 
@@ -1070,6 +1074,109 @@ namespace OASystem.API.Controllers
 
                     _detail.Balance = BalanceStr.ToString("#0.00") + " " + PaymentCurrency_WaitPay;
 
+
+
+                    /*
+                     * Bus名称
+                     */
+                    _detail.BusName = "";
+
+                    /*
+                     *费用所属
+                     */
+                    switch (entity.CTable)
+                    {
+
+                        case 76://酒店预订
+                            Grp_HotelReservations hotelReservations = _HotelReservations.Where(s => s.Id == entity.CId).FirstOrDefault();
+                            if (hotelReservations != null)
+                            {
+                                _detail.PriceMsgContent = "信用卡金额:" + _detail.WaitPay + " " + hotelCurrncyCode + "(" + hotelCurrncyName + ")<br/>" +
+                                                          "房间说明:" + hotelReservations.Remark;
+                                _detail.PriceNameContent = hotelReservations.HotelName;
+                            }
+
+                            break;
+                        case 79://车/导游地接
+                            Grp_CarTouristGuideGroundReservations touristGuideGroundReservations = _CarTouristGuideGroundReservations.Where(s => s.Id == entity.CId).FirstOrDefault();
+                            if (touristGuideGroundReservations != null)
+                            {
+                                _detail.BusName = touristGuideGroundReservations.BusName;
+                                _detail.PriceNameContent = touristGuideGroundReservations.Area;
+
+                                List<Grp_CarTouristGuideGroundReservationsContent> touristGuideGroundReservationsContents = _CarTouristGuideGroundReservationsContent
+                                    .Where(s => s.CTGGRId == touristGuideGroundReservations.Id && s.IsDel == 0 && s.Price != 0).ToList();
+
+                                string priceMsg = string.Empty;
+                                foreach (var item in touristGuideGroundReservationsContents)
+                                {
+                                    string typeName = "Unknown";
+                                    string carCurrencyCode = "Unknown";
+                                    string carCurrencyName = "Unknown";
+                                    var carTypeData = carFeeTypeItems.Where(s => s.Id == item.SId && s.IsDel == 0).FirstOrDefault();
+                                    if (carTypeData != null) typeName = carTypeData.Name;
+
+
+                                    var currencyData = currencyItems.Where(s => s.Id == item.Currency && s.IsDel == 0).FirstOrDefault();
+                                    if (currencyData != null) {
+                                        carCurrencyCode = currencyData.Name;
+                                        carCurrencyName = currencyData.Remark;
+                                    }
+
+                                    priceMsg += typeName + ":" + item.Price.ToString("#0.00") + " " + carCurrencyCode + "(" + carCurrencyName + ")<br/>" +
+                                                "明细:" + item.PriceContent + "<br/>" +
+                                                "备注:" + item.Remark + "<br/>";
+                                }
+
+
+                                _detail.PriceMsgContent = priceMsg;
+                            }
+
+                            break;
+                        case 80: //签证
+                            Grp_VisaInfo visaInfo = _VisaInfos.Where(s => s.Id == entity.CId).FirstOrDefault();
+                            if (visaInfo != null)
+                            {
+                                _detail.PriceNameContent = visaInfo.VisaClient;
+                                _detail.PriceMsgContent = visaInfo.Remark;
+                            }
+
+                            _detail.BusName = "待增加";
+                            break;
+                        case 81: //邀请/公务活动
+                            _detail.BusName = "待增加";
+                            break;
+                        case 82: //团组客户保险
+                            _detail.BusName = "待增加";
+                            break;
+                        case 85: //机票预订
+                            Grp_AirTicketReservations jpRes = _groupRepository.Query<Grp_AirTicketReservations>(s => s.Id == entity.CId).First();
+                            if (jpRes != null)
+                            {
+                                string FlightsDescription = jpRes.FlightsDescription;
+                                string PriceDescription = jpRes.PriceDescription;
+                                _detail.PriceMsgContent = "航班号:" + jpRes.FlightsCode + "<br/>城市A-B:" + jpRes.FlightsCity + "<br/>航班描述:" + FlightsDescription.Replace("\r\n", "<br />") + "<br/>" + "价格描述:" + PriceDescription;
+                                _detail.PriceNameContent = "(" + jpRes.FlightsCode + ")";
+                            }
+                            break;
+                        case 98://其他款项
+                            Grp_DecreasePayments gdpRes = _DecreasePayments.Where(s => s.Id == entity.CId).FirstOrDefault();
+                            if (gdpRes != null)
+                            {
+                                _detail.PriceMsgContent = "备注:" + gdpRes.Remark;
+                                _detail.PriceNameContent = gdpRes.PriceName;
+                            }
+                            break;
+                        case 285://收款退还
+                            
+                            break;
+                        case 751://酒店早餐
+                          
+                            break;
+                        default:
+                            break;
+                    }
+
                     /*
                      * 申请人
                      */