浏览代码

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

yuanrf 6 月之前
父节点
当前提交
03c7604c2f

+ 9 - 2
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -1721,7 +1721,6 @@ namespace OASystem.API.Controllers
 
                                 string priceMsg = $"<span style='font-weight:800;'>{touristGuideGroundReservations.PriceName}({touristGuideGroundReservations.ServiceStartTime} - {touristGuideGroundReservations.ServiceEndTime})</span><br/>";
 
-
                                 foreach (var item in touristGuideGroundReservationsContents)
                                 {
                                     string typeName = "Unknown";
@@ -1738,6 +1737,10 @@ namespace OASystem.API.Controllers
                                         carCurrencyName = currencyData.Remark;
                                     }
 
+                                    //op、成本 币种是否一致
+                                    bool IsCurrencyAgreement = false;
+                                    if (carCurrencyCode.Equals(_groupCurrencyCode)) IsCurrencyAgreement = true;
+
                                     string opCostStr = string.Empty;
                                     decimal opCostTypePrice = 0.00M;
                                     #region 处理成本各项费用
@@ -1780,12 +1783,16 @@ namespace OASystem.API.Controllers
                                                                                                                      //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //1076    晚餐超支费用
                                         }
                                         opCostStr = $"&nbsp;&nbsp;/&nbsp;&nbsp;成本:{opCostTypePrice.ToString("#0.00")} {_groupCurrencyCode}(汇率:{_groupRate.ToString("#0.0000")})";
+                                        if (!IsCurrencyAgreement) opCostStr += $" ≈ {(opCostTypePrice * _groupRate).ToString("#0.00")} CNY";
                                     }
 
                                     #endregion
 
+                                    string opTypeStr = $"{typeName}:{item.Price.ToString("#0.00")} {carCurrencyCode}(汇率:{entity.DayRate.ToString("#0.0000")})" ;
+                                    if (!IsCurrencyAgreement) opTypeStr += $" ≈ {(item.Price * entity.DayRate).ToString("#0.00")} CNY";
+
                                     priceMsg += $"日期:{item.DatePrice?.ToString("yyyy-MM-dd") ?? "-"}<br/>" +
-                                                $"{typeName}:{item.Price.ToString("#0.00")} {carCurrencyCode}(汇率:{entity.DayRate.ToString("#0.0000")})   {opCostStr}<br/>" +
+                                                $"{opTypeStr}   {opCostStr}<br/>" +
                                                 $"明细:{item.PriceContent ?? "-"}<br/>" +
                                                 $"备注:{item.Remark ?? "-"}<br/><br/>";
                                 }

+ 1 - 1
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -1739,7 +1739,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             Result groupData = await _officialActivitiesRep.OpOfficialActivities(dto);
             if (groupData.Code != 0)
             {
-                return Ok(JsonView(false, groupData.Msg));
+                return Ok(JsonView(StatusCodes.Status400BadRequest, groupData.Msg, new { Id = 0 }));
             }
 
             try

+ 0 - 3
OASystem/OASystem.Domain/ViewModels/Financial/Fin_DailyFeePaymentView.cs

@@ -1226,9 +1226,6 @@ namespace OASystem.Domain.ViewModels.Financial
     }
 
 
-
-
-
     public class StatisticsOPYOY
     {
         public int FeeId { get; set; }

+ 28 - 19
OASystem/OASystem.Infrastructure/Repositories/Groups/FeeAuditRepository.cs

@@ -44,6 +44,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             var groupInfo = _sqlSugar.Queryable<Grp_GroupCostParameter>().Where(x => x.IsDel == 0 && x.DiId == diId).First();
             if (groupInfo == null) { _view.Msg = $"团组成本信息未填写!"; return _view; }
             _teamCurrency = groupInfo.Currency;
+            decimal _teamRate = groupInfo.Rate;
             //币种验证  统一为currencycode三字码
             if (int.TryParse(_teamCurrency,out int currency)) _teamCurrency = setData.Find(x => x.Id == currency)?.Name ?? "";
 
@@ -194,16 +195,24 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     return _view;
                 }
                 //获取C表汇率
-                decimal _rate = 1.0000M;
-                var payInfo = _sqlSugar.Queryable<Grp_CreditCardPayment>().Where(x => x.IsDel == 0 && x.DIId == diId && x.CTable == 79 && x.Id == dataId).First();
+                decimal _opRate = 1.0000M;
+                var payInfo = _sqlSugar.Queryable<Grp_CreditCardPayment>().Where(x => x.IsDel == 0 && x.DIId == diId && x.CTable == 79 && x.CId == dataId).First();
                 if (payInfo == null)
                 {
                     _view.Msg = $"OP费用付款数据未填写";
                     return _view;
                 }
-                _rate = payInfo.DayRate;
+                _opRate = payInfo.DayRate;
 
                 string opCurrencyName = setData.Find(x => x.Id == opContents[0].Currency)?.Name ?? "";
+
+                //团组、OP币种 验证是否一致
+                if (opCurrencyName.Equals(_teamCurrency))
+                {
+                    _opRate = payInfo.DayRate;
+                    _teamRate = payInfo.DayRate;
+                }
+
                 
                 var opBasicDatas = setData.Where(x => x.STid == 17).ToList(); //费用类型基础数据
                 bool isAutoAudit = true;
@@ -255,56 +264,56 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                     //车费 91
                     var opCarCost = item.FirstOrDefault(x => x.SId == 91);
-                    if (opCarCost != null) if (opCarCost.Price * _rate > _rate * opCostInfo.Sum(x => x.CarFee)) isAutoAudit = false;
+                    if (opCarCost != null) if (opCarCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.CarFee)) isAutoAudit = false;
                     //982 车超时费 -- 暂无
                     //92  导游费
                     var opGuideCost = item.FirstOrDefault(x => x.SId == 92);
-                    if (opGuideCost != null) if (opGuideCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideFee)) isAutoAudit = false;
+                    if (opGuideCost != null) if (opGuideCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.GuideFee)) isAutoAudit = false;
                     //94  导游景点费
                     var opGuideScenicCost = item.FirstOrDefault(x => x.SId == 94);
-                    if (opGuideScenicCost != null) if (opGuideScenicCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideScenicFee)) isAutoAudit = false;
+                    if (opGuideScenicCost != null) if (opGuideScenicCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.GuideScenicFee)) isAutoAudit = false;
                     //95  导游小费
                     var opGuideTipCost = item.FirstOrDefault(x => x.SId == 95);
-                    if (opGuideTipCost != null) if (opGuideTipCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideTipFee)) isAutoAudit = false;
+                    if (opGuideTipCost != null) if (opGuideTipCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.GuideTipFee)) isAutoAudit = false;
                     //983 导游餐补
                     var opGuideMealCost = item.FirstOrDefault(x => x.SId == 983);
-                    if (opGuideMealCost != null) if (opGuideMealCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideMealFee)) isAutoAudit = false;
+                    if (opGuideMealCost != null) if (opGuideMealCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.GuideMealFee)) isAutoAudit = false;
                     //984 导游房补
                     var opGuideRoomCost = item.FirstOrDefault(x => x.SId == 984);
-                    if (opGuideRoomCost != null) if (opGuideRoomCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideRoomFee)) isAutoAudit = false;
+                    if (opGuideRoomCost != null) if (opGuideRoomCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.GuideRoomFee)) isAutoAudit = false;
                     //985 导游交通
                     var opGuideTrafficCost = item.FirstOrDefault(x => x.SId == 985);
-                    if (opGuideTrafficCost != null) if (opGuideTrafficCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideTrafficFee)) isAutoAudit = false;
+                    if (opGuideTrafficCost != null) if (opGuideTrafficCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.GuideTrafficFee)) isAutoAudit = false;
                     //96  接送机费 -- 暂无
                     //97  其他费用 -- 暂无
                     //979 司机工资
                     var opDriverCost = item.FirstOrDefault(x => x.SId == 979);
-                    if (opDriverCost != null) if (opDriverCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DriverFee)) isAutoAudit = false;
+                    if (opDriverCost != null) if (opDriverCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.DriverFee)) isAutoAudit = false;
                     //980 司机小费
                     var opDriverTipCost = item.FirstOrDefault(x => x.SId == 980);
-                    if (opDriverTipCost != null) if (opDriverTipCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DriverTipFee)) isAutoAudit = false;
+                    if (opDriverTipCost != null) if (opDriverTipCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.DriverTipFee)) isAutoAudit = false;
                     //981 司机餐补
                     var opDriverMealCost = item.FirstOrDefault(x => x.SId == 981);
-                    if (opDriverMealCost != null) if (opDriverMealCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DriverMealFee)) isAutoAudit = false;
+                    if (opDriverMealCost != null) if (opDriverMealCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.DriverMealFee)) isAutoAudit = false;
                     //988 客户早餐费用
                     var opClientBreakfastCost = item.FirstOrDefault(x => x.SId == 988);
-                    if (opClientBreakfastCost != null) if (opClientBreakfastCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ClientBreakfastFee)) isAutoAudit = false;
+                    if (opClientBreakfastCost != null) if (opClientBreakfastCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.ClientBreakfastFee)) isAutoAudit = false;
                     //93  客户午餐费用
                     var opClientLunchCost = item.FirstOrDefault(x => x.SId == 93);
-                    if (opClientLunchCost != null) if (opClientLunchCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ClientLunchFee)) isAutoAudit = false;
+                    if (opClientLunchCost != null) if (opClientLunchCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.ClientLunchFee)) isAutoAudit = false;
                     //989 客户晚餐费用
                     var opClientDinnerCost = item.FirstOrDefault(x => x.SId == 989);
-                    if (opClientDinnerCost != null) if (opClientDinnerCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ClientDinnerFee)) isAutoAudit = false;
+                    if (opClientDinnerCost != null) if (opClientDinnerCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.ClientDinnerFee)) isAutoAudit = false;
                     //990 景点门票费
                     var opScenicTicketCost = item.FirstOrDefault(x => x.SId == 990);
-                    if (opScenicTicketCost != null) if (opScenicTicketCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ScenicTicketFee)) isAutoAudit = false;
+                    if (opScenicTicketCost != null) if (opScenicTicketCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.ScenicTicketFee)) isAutoAudit = false;
                     //991 饮料/零食/水果
                     var opDrinkSnackFruitCost = item.FirstOrDefault(x => x.SId == 991);
-                    if (opDrinkSnackFruitCost != null) if (opDrinkSnackFruitCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DrinkSnackFruitFee)) isAutoAudit = false;
+                    if (opDrinkSnackFruitCost != null) if (opDrinkSnackFruitCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.DrinkSnackFruitFee)) isAutoAudit = false;
                     //992 住补费用 -- 暂无
                     //994 翻译费
                     var opTranslatorCost = item.FirstOrDefault(x => x.SId == 994);
-                    if (opTranslatorCost != null) if (opTranslatorCost.Price * _rate > _rate * opCostInfo.Sum(x => x.TranslatorFee)) isAutoAudit = false;
+                    if (opTranslatorCost != null) if (opTranslatorCost.Price * _opRate > _teamRate * opCostInfo.Sum(x => x.TranslatorFee)) isAutoAudit = false;
                     //1059    导游超时费用 -- 暂无
                     //1070    尾款金额 -- 暂无
                     //1071    其他额外费用 -- 暂无