Explorar o código

1、应收报表 -> 页面、excel(ALL) 新增成单人字段、相关代码编写;
2、三公费用 -> 出入境费用计算 保存新增返回参数 备注描述、城市区间计算并整理;

Lyyyi hai 2 semanas
pai
achega
bb1593d71d

+ 428 - 55
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -13599,7 +13599,6 @@ FROM
             }));
         }
 
-
         #region 城市区间交通费
         /// <summary>
         /// 团组模块 - 出入境费用 - 草稿 - 基础数据源(境外用车)
@@ -13714,7 +13713,7 @@ FROM
             var view = new
             {
                 visitCountries = string.Join("、", countries),
-                groupSize = 0,                 //出访人数
+                //groupSize = 0,                 //出访人数
                 defAirportTransferCoeff = Def_AirportTransferCoeff, //接送机默认报价系数
                 defServiceCount = Def_ServiceCount,                 //接送机默认服务次数
                 defTrainCoeff = Def_TrainCoeff,                     //火车默认报价系数
@@ -13733,29 +13732,26 @@ FROM
         }
 
         /// <summary>
-        /// 团组模块 - 出入境费用 - 境外用车计算详细信息
+        /// 团组模块 - 出入境费用 - 草稿 - 境外用车计算详细信息
         /// </summary>
-        /// <param name="groupId"></param>
+        /// <param name="draftId"></param>
         /// <param name="currUserId"></param>
         /// <returns></returns>
         [HttpGet("{groupId}")]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> EnterExitCostDraftOVFeeDetails(int groupId, int currUserId)
+        public async Task<IActionResult> EnterExitCostDraftOVFeeDetails(int draftId, int currUserId)
         {
-            var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.Id == groupId).FirstAsync();
-            if (groupInfo == null)
+            var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().Where(x => x.Id == draftId && x.IsDel == 0).FirstAsync();
+            if (eecInfo == null)
             {
-                return Ok(JsonView(false, "团组信息为空"));
+                return Ok(JsonView(false, "草稿信息为空"));
             }
 
-            var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == groupId).FirstAsync();
+            var info = new CityIntervalDraftInfo();
 
-            //CityIntervalInfo
-            var info = new CityIntervalInfo();
-
-            if (eecInfo != null && !string.IsNullOrEmpty(eecInfo.CityIntervalFeeDetails))
+            if (eecInfo != null)
             {
-                info = JsonConvert.DeserializeObject<CityIntervalInfo>(eecInfo.CityIntervalFeeDetails);
+                info = eecInfo.CityIntervalFeeDetails;
                 return Ok(JsonView(true, "查询成功!", info));
             }
 
@@ -13764,7 +13760,7 @@ FROM
             var nowTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
 
             //返回默认数据
-            info = new CityIntervalInfo()
+            info = new CityIntervalDraftInfo()
             {
                 APTFeeDetails = new List<RoundTripTransferInfo>() { new() { No = 1, Coefficient = Def_AirportTransferCoeff, ServiceCount = Def_ServiceCount } },
                 PullCartFeeDetails = new List<PullCartInfo>() { new() { No = 1, Coefficient = Def_PullCartCoeff } },
@@ -13773,7 +13769,7 @@ FROM
                 LastUpdateUserName = userName,
                 LastUpdateTime = nowTime,
                 CreateUserName = userName,
-                Currencies = await GeneralMethod.EnterExitCostOVFeeUsedCurrencyAsync(groupId),
+                Currencies = await GeneralMethod.EnterExitCostDrafOVFeeUsedCurrencyAsync(draftId),
                 CreateTime = nowTime
             };
 
@@ -13781,18 +13777,18 @@ FROM
         }
 
         /// <summary>
-        /// 团组模块 - 出入境费用 - 境外用车计算 保存
+        /// 团组模块 - 出入境费用 - 草稿 - 境外用车计算 保存
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> EnterExitCostDraftOVFeeSave(GetEnterExitCostOVFeeSaveDto dto)
+        public async Task<IActionResult> EnterExitCostDraftOVFeeSave(EnterExitCostDraftOVFeeSaveDto dto)
         {
-            var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.Id == dto.GroupId).FirstAsync();
-            if (groupInfo == null)
+            var draftInfo = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().Where(x => x.Id == dto.DraftId).FirstAsync();
+            if (draftInfo == null)
             {
-                return Ok(JsonView(false, "团组信息为空"));
+                return Ok(JsonView(false, "草稿信息为空"));
             }
 
             var userInfo = await _sqlSugar.Queryable<Sys_Users>().Where(x => x.IsDel == 0 && x.Id == dto.CurrUserId).FirstAsync();
@@ -13801,23 +13797,12 @@ FROM
                 return Ok(JsonView(false, "员工信息为空"));
             }
 
-            var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == dto.GroupId).FirstAsync();
-
-            if (eecInfo == null)
-            {
-                return Ok(JsonView(false, "出入境费用信息为空"));
-            }
-            var oldData = new CityIntervalInfo();
-            if (!string.IsNullOrEmpty(eecInfo.CityIntervalFeeDetails))
-            {
-                oldData = JsonConvert.DeserializeObject<CityIntervalInfo>(eecInfo.CityIntervalFeeDetails);
-            }
-
             var userName = userInfo?.CnName ?? "-";
             var nowTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
 
-            var info = new CityIntervalInfo()
+            var info = new CityIntervalDraftInfo()
             {
+                GroupSize = dto.GroupSize,
                 APTFeeTotal = dto.APTFeeTotal,
                 APTFeeDetails = dto.APTFeeDetails,
                 PullCartFeeTotal = dto.PullCartFeeTotal,
@@ -13829,17 +13814,13 @@ FROM
                 Currencies = dto.Currencies,
                 LastUpdateUserName = userName,
                 LastUpdateTime = nowTime,
-                CreateUserName = oldData?.CreateUserName ?? userName,
-                CreateTime = oldData?.CreateTime ?? nowTime
+                CreateUserName = draftInfo.CityIntervalFeeDetails?.CreateUserName ?? userName,
+                CreateTime = draftInfo.CityIntervalFeeDetails?.CreateTime ?? nowTime
             };
 
-            eecInfo.CityIntervalFeeDetails = JsonConvert.SerializeObject(info);
-
-            var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>()
-                .SetColumns(it => it.CityIntervalFeeDetails == eecInfo.CityIntervalFeeDetails)
-                .SetColumns(it => it.LastUpdateUserId == dto.CurrUserId)
-                .SetColumns(it => it.LastUpdateTime == nowTime)
-                .Where(x => x.Id == eecInfo.Id)
+            var upd = await _sqlSugar.Updateable<Grp_EnterExitCostDraft>()
+                .SetColumns(it => it.CityIntervalFeeDetails == info)
+                .Where(x => x.Id == draftInfo.Id)
                 .ExecuteCommandAsync();
             if (upd < 1)
             {
@@ -13902,20 +13883,24 @@ FROM
                 string subLabel = $"城市机票({string.Join("、", amounts)});";
                 label.AppendLine(subLabel);
             }
+            //费用
+            decimal quote = (dto.APTFeeTotal + dto.PullCartFeeTotal + dto.TrainFeeTotal + dto.CityAirTicketFeeTotal).ConvertToDecimal1();
+            decimal jjcQuote = quote;
+            decimal gwcQuote = quote;
+            decimal tdcQuote = quote;
 
-            decimal total = dto.APTFeeTotal + dto.PullCartFeeTotal + dto.TrainFeeTotal + dto.CityAirTicketFeeTotal;
-            decimal jjcTotal = total;
-            decimal gwcTotal = total;
-            decimal tdcTotal = total;
-
-
-
-            return Ok(JsonView(true));
+            var view = new
+            {
+                label = label.ToString(),
+                jjcQuote,
+                gwcQuote,
+                tdcQuote
+            };
+            return Ok(JsonView(view));
         }
 
         #endregion
 
-
         /// <summary>
         /// 团组模块 - 出入境费用-草稿 - Info
         /// </summary>
@@ -15547,12 +15532,91 @@ FROM
                 return Ok(JsonView(false));
             }
 
-            return Ok(JsonView(true));
-        }
+            //返回数据处理
+            var label = new StringBuilder();
 
-        #endregion
+            //接送机
+            if (dto.APTFeeDetails?.Any() == true)
+            {
+                var ovIds = dto.APTFeeDetails.Select(x => x.OvId).ToList();
+
+                var areas = await _sqlSugar.Queryable<Res_OverseaVehicleTypePrice>()
+                    .LeftJoin<Res_OverseaVehicle>((ovtp, ov) => ovtp.OvId == ov.Id)
+                    .Where((ovtp, ov) => ovtp.IsDel == 0 && ovIds.Contains(ovtp.Id))
+                    .Select((ovtp, ov) => new
+                    {
+                        ovtp.Id,
+                        ov.CountryName,
+                        ov.CityName
+                    }).ToListAsync();
+
+                var items = dto.APTFeeDetails
+                    .Select(item =>
+                    {
+                        var areaInfo = areas.FirstOrDefault(x => x.Id == item.OvId);
+                        if (areaInfo == null) return null;
 
+                        return areaInfo.CountryName == areaInfo.CityName
+                            ? $"{areaInfo.CountryName}({item.Quote:#0.00} CNY)"
+                            : $"{areaInfo.CountryName}-{areaInfo.CityName}({item.Quote:#0.00} CNY)";
+                    })
+                    .Where(item => item != null)
+                    .ToList();
 
+                label.AppendLine($"接送机({string.Join("、", items)});");
+            }
+
+            //拉车
+            if (dto.PullCartFeeDetails?.Any() == true)
+            {
+                var feeLabel = string.Join("、",
+                    dto.PullCartFeeDetails.Select(x =>
+                        $"{x.Quote:#0.00} CNY"
+                    ));
+
+                label.AppendLine($"拉车({feeLabel});");
+            }
+
+            //火车
+            if (dto.TrainFeeDetails?.Any() == true)
+            {
+                var feeLabel = string.Join("、",
+                     dto.TrainFeeDetails.Select(x =>
+                         $"{x.Quote:#0.00} CNY"
+                     ));
+
+                label.AppendLine($"火车票({feeLabel});");
+            }
+
+            //城市机票
+            if (dto.CityAirTicketFeeDetails?.Any() == true)
+            {
+                var feeLabel = string.Join("、",
+                     dto.CityAirTicketFeeDetails.Select(x =>
+                         $"{x.Quote:#0.00} CNY"
+                     ));
+
+                label.AppendLine($"城市机票({feeLabel});");
+            }
+
+            //费用
+            decimal quote = (dto.APTFeeTotal + dto.PullCartFeeTotal + dto.TrainFeeTotal + dto.CityAirTicketFeeTotal).ConvertToDecimal1();
+            decimal jjcQuote = quote;
+            decimal gwcQuote = quote;
+            decimal tdcQuote = quote;
+
+            var view = new
+            {
+                label = label.ToString(),
+                jjcQuote,
+                gwcQuote,
+                tdcQuote
+            };
+
+            return Ok(JsonView(view));
+        }
+
+        #endregion
 
         /// <summary>
         /// 获取币种基础数据(含逻辑处理)
@@ -17252,6 +17316,309 @@ FROM
             return Ok(JsonView(false));
         }
 
+
+        #region 城市区间交通费
+        /// <summary>
+        /// 团组模块 - 出入境费用 - 草稿 - 移动端 - 基础数据源(境外用车)
+        /// </summary>
+        /// <param name="draftId">草稿Id</param>
+        /// <returns></returns>
+        [HttpGet("{darfId}")]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> EnterExitCostDraftOVMobileByGroupId(int draftId)
+        {
+            var groupInfo = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().Where(x => x.Id == draftId).FirstAsync();
+            if (groupInfo == null)
+            {
+                return Ok(JsonView(false, "三公费用草稿信息为空"));
+            }
+
+            var cityIds = await _sqlSugar.Queryable<Grp_DayAndCostDraft>()
+                .Where(x => x.IsDel == 0 && x.ParentId == draftId)
+                .Select(x => x.NationalTravelFeeId)
+                .Distinct()
+                .ToListAsync();
+
+            var countries = await _sqlSugar.Queryable<Grp_NationalTravelFee>()
+                .Where(x => x.IsDel == 0 && cityIds.Contains(x.Id))
+                .Select(x => x.Country)
+                .Distinct()
+                .ToListAsync();
+
+            if (countries?.Any() != true)
+            {
+                return Ok(JsonView(false, "草稿选择城市信息为空"));
+            }
+
+            var currencies = await GeneralMethod.EnterExitCostDrafOVFeeUsedCurrencyAsync(draftId);
+
+            var currencyData = await _sqlSugar.Queryable<Sys_SetData>()
+                .Where(x => x.IsDel == 0 && x.STid == 66)
+                .ToListAsync();
+
+            var overseaVehicles = await _sqlSugar.Queryable<Res_OverseaVehicle>()
+                .Where(x => x.IsDel == 0 && countries.Contains(x.CountryName))
+                .ToListAsync();
+
+            var overseaVehicleIds = overseaVehicles.Select(x => x.Id).ToList();
+
+            //只返回接送机的数据
+            var overseaVehicleTypes = await _sqlSugar.Queryable<Res_OverseaVehicleTypePrice>()
+                .Where(x => x.IsDel == 0 && x.ServiceType == VehicleServiceTypeEnum.TransferService && overseaVehicleIds.Contains(x.OvId))
+                .ToListAsync();
+
+            var sysUers = await _sqlSugar.Queryable<Sys_Users>().Where(x => x.IsDel == 0).ToListAsync();
+
+            var overseaVehicleCityDatas = new List<dynamic>() {
+                new
+                {
+                    Id = 0,
+                    area= "未选择",
+                    CarTypeName = "",
+                    serviceType = "",
+                    Price = 0.00M,
+                    guidePrice = 0.00M,
+                    otherPrice = 0.00M,
+                    currency = 0,
+                    currencyName = "",
+                    currRate = 1.0000M,
+                    LastUpdateUserName =  "",
+                    LastUpdateTime = "",
+                    Remark = ""
+                }};
+
+            foreach (var item in overseaVehicleTypes)
+            {
+                var parentInfo = overseaVehicles.FirstOrDefault(x => x.Id == item.OvId);
+                string area = string.Empty,
+                    serviceType = "未设置",
+                    currencyName = string.Empty;
+                decimal otherPrice = 0.00M;
+                if (parentInfo != null)
+                {
+                    if (parentInfo.CountryName == parentInfo.CityName) area = parentInfo.CountryName;
+                    else area = $"{parentInfo.CountryName}-{parentInfo.CityName}";
+
+                    serviceType = item.ServiceType.GetDescription();
+                    currencyName = currencyData.FirstOrDefault(x => x.Id == parentInfo.Currency)?.Name ?? "-";
+                    otherPrice = parentInfo.OtherPrice1 + parentInfo.OtherPrice2;
+                }
+
+                //当前币种汇率值
+                var currRate = 1.0000M;
+                var currencyInfo = currencies.FirstOrDefault(x => x.CurrencyCode == currencyName);
+                if (currencyInfo != null) currRate = currencyInfo.Rate;
+
+                overseaVehicleCityDatas.add(new
+                {
+                    item.Id,
+                    area,
+                    item.CarTypeName,
+                    serviceType,
+                    item.Price,
+                    guidePrice = parentInfo?.GuidePrice ?? 0.00M,
+                    otherPrice,
+                    currency = parentInfo?.Currency ?? 0,
+                    currencyName,
+                    currRate,
+                    LastUpdateUserName = sysUers.FirstOrDefault(x => x.Id == item.LastUpdateUserId)?.CnName ?? "-",
+                    item.LastUpdateTime,
+                    item.Remark
+                });
+            }
+
+            var total = overseaVehicleCityDatas.Count;
+            var view = new
+            {
+                visitCountries = string.Join("、", countries),
+                //groupSize = 0,                 //出访人数
+                defAirportTransferCoeff = Def_AirportTransferCoeff, //接送机默认报价系数
+                defServiceCount = Def_ServiceCount,                 //接送机默认服务次数
+                defTrainCoeff = Def_TrainCoeff,                     //火车默认报价系数
+                defPullCartCoeff = Def_PullCartCoeff,               //拉车默认报价系数
+                defCityFlightCoeff = Def_CityFlightCoeff,           //城市机票默认报价系数
+                Currencies = currencies,
+                data = overseaVehicleCityDatas
+            };
+
+            if (overseaVehicleCityDatas.Count == 0)
+            {
+                return Ok(JsonView(true, "暂无数据!", view));
+            }
+
+            return Ok(JsonView(true, "查询成功!", view, total));
+        }
+
+        /// <summary>
+        /// 团组模块 - 出入境费用 - 草稿 - 境外用车计算详细信息
+        /// </summary>
+        /// <param name="draftId"></param>
+        /// <param name="currUserId"></param>
+        /// <returns></returns>
+        [HttpGet("{groupId}")]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> EnterExitCostDraftOVFeeMobileDetails(int draftId, int currUserId)
+        {
+            var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().Where(x => x.Id == draftId && x.IsDel == 0).FirstAsync();
+            if (eecInfo == null)
+            {
+                return Ok(JsonView(false, "草稿信息为空"));
+            }
+
+            var info = new CityIntervalDraftInfo();
+
+            if (eecInfo != null)
+            {
+                info = eecInfo.CityIntervalFeeDetails;
+                return Ok(JsonView(true, "查询成功!", info));
+            }
+
+            var userInfo = await _sqlSugar.Queryable<Sys_Users>().Where(x => x.IsDel == 0 && x.Id == currUserId).FirstAsync();
+            var userName = userInfo?.CnName ?? "-";
+            var nowTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+
+            //返回默认数据
+            info = new CityIntervalDraftInfo()
+            {
+                APTFeeDetails = new List<RoundTripTransferInfo>() { new() { No = 1, Coefficient = Def_AirportTransferCoeff, ServiceCount = Def_ServiceCount } },
+                PullCartFeeDetails = new List<PullCartInfo>() { new() { No = 1, Coefficient = Def_PullCartCoeff } },
+                TrainFeeDetails = new List<TrainInfo>() { new() { No = 1, Coefficient = Def_TrainCoeff } },
+                CityAirTicketFeeDetails = new List<CityAirTicketInfo>() { new() { No = 1, Coefficient = Def_CityFlightCoeff } },
+                LastUpdateUserName = userName,
+                LastUpdateTime = nowTime,
+                CreateUserName = userName,
+                Currencies = await GeneralMethod.EnterExitCostDrafOVFeeUsedCurrencyAsync(draftId),
+                CreateTime = nowTime
+            };
+
+            return Ok(JsonView(true, "查询成功!", info));
+        }
+
+        /// <summary>
+        /// 团组模块 - 出入境费用 - 草稿 - 境外用车计算 保存
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> EnterExitCostDraftOVFeeMobileSave(EnterExitCostDraftOVFeeSaveDto dto)
+        {
+            var draftInfo = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().Where(x => x.Id == dto.DraftId).FirstAsync();
+            if (draftInfo == null)
+            {
+                return Ok(JsonView(false, "草稿信息为空"));
+            }
+
+            var userInfo = await _sqlSugar.Queryable<Sys_Users>().Where(x => x.IsDel == 0 && x.Id == dto.CurrUserId).FirstAsync();
+            if (userInfo == null)
+            {
+                return Ok(JsonView(false, "员工信息为空"));
+            }
+
+            var userName = userInfo?.CnName ?? "-";
+            var nowTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+
+            var info = new CityIntervalDraftInfo()
+            {
+                GroupSize = dto.GroupSize,
+                APTFeeTotal = dto.APTFeeTotal,
+                APTFeeDetails = dto.APTFeeDetails,
+                PullCartFeeTotal = dto.PullCartFeeTotal,
+                PullCartFeeDetails = dto.PullCartFeeDetails,
+                TrainFeeTotal = dto.TrainFeeTotal,
+                TrainFeeDetails = dto.TrainFeeDetails,
+                CityAirTicketFeeTotal = dto.CityAirTicketFeeTotal,
+                CityAirTicketFeeDetails = dto.CityAirTicketFeeDetails,
+                Currencies = dto.Currencies,
+                LastUpdateUserName = userName,
+                LastUpdateTime = nowTime,
+                CreateUserName = draftInfo.CityIntervalFeeDetails?.CreateUserName ?? userName,
+                CreateTime = draftInfo.CityIntervalFeeDetails?.CreateTime ?? nowTime
+            };
+
+            var upd = await _sqlSugar.Updateable<Grp_EnterExitCostDraft>()
+                .SetColumns(it => it.CityIntervalFeeDetails == info)
+                .Where(x => x.Id == draftInfo.Id)
+                .ExecuteCommandAsync();
+            if (upd < 1)
+            {
+                return Ok(JsonView(false));
+            }
+
+            //返回参数处理
+            var label = new StringBuilder();
+            if (dto.APTFeeDetails.Any())
+            {
+                var ovIds = dto.APTFeeDetails.Select(x => x.OvId).ToList();
+                var areas = await _sqlSugar.Queryable<Res_OverseaVehicleTypePrice>()
+                    .LeftJoin<Res_OverseaVehicle>((ovtp, ov) => ovtp.OvId == ov.Id)
+                    .Where((ovtp, ov) => ovtp.IsDel == 0 && ovIds.Contains(ovtp.Id))
+                    .Select((ovtp, ov) => new
+                    {
+                        ovtp.Id,
+                        ov.CountryName,
+                        ov.CityName
+                    })
+                    .ToListAsync();
+                if (areas.Any())
+                {
+                    var items = dto.APTFeeDetails
+                        .Select(item =>
+                        {
+                            var areaInfo = areas.FirstOrDefault(x => x.Id == item.OvId);
+                            if (areaInfo == null) return null;
+
+                            return areaInfo.CountryName == areaInfo.CityName
+                                ? $"{areaInfo.CountryName}({item.Quote:#0.00} CNY)"
+                                : $"{areaInfo.CountryName}-{areaInfo.CityName}({item.Quote:#0.00} CNY)";
+                        })
+                        .Where(item => item != null)
+                        .ToList();
+
+                    string areaLabel = $"接送机({string.Join("、", items)});";
+
+                    label.AppendLine(areaLabel);
+                }
+            }
+
+            if (dto.PullCartFeeDetails.Any())
+            {
+                var amounts = dto.PullCartFeeDetails.Select(item => $"{item.Quote:#0.00}");
+                string subLabel = $"拉车({string.Join("、", amounts)});";
+                label.AppendLine(subLabel);
+            }
+
+            if (dto.TrainFeeDetails.Any())
+            {
+                var amounts = dto.TrainFeeDetails.Select(item => $"{item.Quote:#0.00}");
+                string subLabel = $"火车票({string.Join("、", amounts)});";
+                label.AppendLine(subLabel);
+            }
+
+            if (dto.CityAirTicketFeeDetails.Any())
+            {
+                var amounts = dto.TrainFeeDetails.Select(item => $"{item.Quote:#0.00}");
+                string subLabel = $"城市机票({string.Join("、", amounts)});";
+                label.AppendLine(subLabel);
+            }
+            //费用
+            decimal quote = (dto.APTFeeTotal + dto.PullCartFeeTotal + dto.TrainFeeTotal + dto.CityAirTicketFeeTotal).ConvertToDecimal1();
+            decimal jjcQuote = quote;
+            decimal gwcQuote = quote;
+            decimal tdcQuote = quote;
+
+            var view = new
+            {
+                label = label.ToString(),
+                jjcQuote,
+                gwcQuote,
+                tdcQuote
+            };
+            return Ok(JsonView(view));
+        }
+
+        #endregion
+
         /// <summary>
         /// 团组模块 - 出入境费用-草稿-移动端 - 创建
         /// </summary>
@@ -17438,6 +17805,8 @@ FROM
                     AirGW = eecInfo.AirGW,
                     AirTD = eecInfo.AirTD,
                     CityTranffic = eecInfo.CityTranffic,
+                    CityTranffic1 = eecInfo.CityTranffic1,
+                    CityTranffic2 = eecInfo.CityTranffic2,
                     TwoItemRemark = eecInfo.TwoItemRemark
                 };
                 return Ok(JsonView(twoData));
@@ -18099,6 +18468,8 @@ FROM
             info.AirGW = dto.AirGW;
             info.AirTD = dto.AirTD;
             info.CityTranffic = dto.CityTranffic;
+            info.CityTranffic1 = dto.CityTranffic1;
+            info.CityTranffic2 = dto.CityTranffic2;
             info.TwoItemRemark = dto.TwoItemRemark;
             info.SumJJC = dto.ChoiceTwoJJ;
             info.SumGWC = dto.ChoiceTwoGW;
@@ -18129,6 +18500,8 @@ FROM
                         x.AirGW,
                         x.AirTD,
                         x.CityTranffic,
+                        x.CityTranffic1,
+                        x.CityTranffic2,
                         x.TwoItemRemark
                     })
                     .Where(x => x.Id == id)

+ 11 - 1
OASystem/OASystem.Domain/Dtos/Groups/EnterExitCostDraftDto.cs

@@ -164,10 +164,20 @@ namespace OASystem.Domain.Dtos.Groups
         public decimal AirTD { get; set; }
 
         /// <summary>
-        ///  国外城市间交通费
+        ///  国外城市间交通费 - 经济舱
         /// </summary>
         public decimal CityTranffic { get; set; }
 
+        /// <summary>
+        ///  国外城市间交通费 - 公务舱
+        /// </summary>
+        public decimal CityTranffic1 { get; set; }
+
+        /// <summary>
+        ///  国外城市间交通费 - 头等舱
+        /// </summary>
+        public decimal CityTranffic2 { get; set; }
+
         public string TwoItemRemark { get; set; }
 
         /// <summary>

+ 29 - 1
OASystem/OASystem.Domain/Dtos/Groups/EnterExitCostDto.cs

@@ -483,10 +483,28 @@ namespace OASystem.Domain.Dtos.Groups
 
     public class GetEnterExitCostOVFeeSaveDto: CityIntervalInfo
     {
+        /// <summary>
+        /// 团组Id
+        /// </summary>
         public int GroupId { get; set; }
+        /// <summary>
+        /// 当前登录用户
+        /// </summary>
         public int CurrUserId { get; set; }
     }
 
+
+    public class EnterExitCostDraftOVFeeSaveDto : CityIntervalDraftInfo
+    {
+        /// <summary>
+        /// 草稿Id
+        /// </summary>
+        public int DraftId { get; set; }
+        /// <summary>
+        /// 当前用户Id
+        /// </summary>
+        public int CurrUserId { get; set; }
+    }
     #endregion
 
     #region Mobile Request Dto
@@ -1162,9 +1180,19 @@ namespace OASystem.Domain.Dtos.Groups
         public decimal AirTD { get; set; }
 
         /// <summary>
-        ///  国外城市间交通费
+        ///  国外城市间交通费 - 经济舱
         /// </summary>
         public decimal CityTranffic { get; set; }
+
+        /// <summary>
+        ///  国外城市间交通费 - 公务舱
+        /// </summary>
+        public decimal CityTranffic1 { get; set; }
+
+        /// <summary>
+        ///  国外城市间交通费 - 头等舱 
+        /// </summary>
+        public decimal CityTranffic2 { get; set; }
         public string TwoItemRemark { get; set; }
     }
 

+ 23 - 3
OASystem/OASystem.Domain/Entities/Groups/Grp_EnterExitCostDraft.cs

@@ -1,4 +1,5 @@
-using System;
+using OASystem.Domain.ViewModels.Groups;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -12,7 +13,6 @@ namespace OASystem.Domain.Entities.Groups
     [SugarTable("Grp_EnterExitCostDraft")]
     public class Grp_EnterExitCostDraft : EntityBase
     {
-
         /// <summary>
         /// 归属省份Id
         /// </summary>
@@ -123,11 +123,31 @@ namespace OASystem.Domain.Entities.Groups
         public decimal AirTD { get; set; }
 
         /// <summary>
-        ///  国外城市间交通费
+        ///  国外城市间交通费 - 经济舱
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
         public decimal CityTranffic { get; set; }
 
+        /// <summary>
+        ///  国外城市间交通费 - 公务舱
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal CityTranffic1{ get; set; }
+
+
+        /// <summary>
+        ///  国外城市间交通费 - 头等舱
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal CityTranffic2 { get; set; }
+
+        /// <summary>
+        /// 城市区间费用详情 
+        /// json 格式存储 CityIntervalInfo
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(max)",IsJson = true)]
+        public CityIntervalDraftInfo CityIntervalFeeDetails { get; set; } = new CityIntervalDraftInfo();
+
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
         public string TwoItemRemark { get; set; }
         #region 汇率币种

+ 8 - 0
OASystem/OASystem.Domain/ViewModels/Groups/EnterExitCostView.cs

@@ -1293,6 +1293,14 @@ namespace OASystem.Domain.ViewModels.Groups
 
     #region 境外用车
 
+    public class CityIntervalDraftInfo : CityIntervalInfo
+    {
+        /// <summary>
+        /// 团组人数
+        /// </summary>
+        public int GroupSize { get; set; } = 1;
+    }
+
     /// <summary>
     /// 城市区间费用详情
     /// </summary>

+ 14 - 14
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostDraftRepository.cs

@@ -243,20 +243,20 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     enterExitCostInfoView.TrainingExpenseData = dayAndCostDraftData.Where(it => it.Type == 4).ToList();  //培训费 4
 
                     enterExitCostInfoView.DayOtherPriceData = _sqlSugar.Queryable<Grp_DayOtherPriceDraft>()
-                                                                .Where(x => x.IsDel == 0 && x.ParentId == id)
-                                                                .Select(x => new DayOtherPriceDraftView
-                                                                {
-                                                                    ParentId = x.ParentId,
-                                                                    Id = x.Id,
-                                                                    Cost = x.Cost,
-                                                                    Currency = x.Currency,
-                                                                    Index = x.Index,
-                                                                    SetDataId = x.SetDataId,
-                                                                    SubTotal = x.SubTotal,
-                                                                    Remark = x.Remark,
-                                                                })
-                                                                .OrderBy(x => x.Index)
-                                                                .ToList();
+                        .Where(x => x.IsDel == 0 && x.ParentId == id)
+                        .Select(x => new DayOtherPriceDraftView
+                        {
+                            ParentId = x.ParentId,
+                            Id = x.Id,
+                            Cost = x.Cost,
+                            Currency = x.Currency,
+                            Index = x.Index,
+                            SetDataId = x.SetDataId,
+                            SubTotal = x.SubTotal,
+                            Remark = x.Remark,
+                        })
+                        .OrderBy(x => x.Index)
+                        .ToList();
 
                     enterExitCostInfoView.Currencys = (List<CurrencyInfo>?)CommonFun.GetCurrencyChinaToList(enterExitCostDraftData.CurrencyRemark);