Bläddra i källkod

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

Lyyyi 1 dag sedan
förälder
incheckning
074e8946c3

+ 14 - 9
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -2359,17 +2359,19 @@ namespace OASystem.API.Controllers
                 .AnyAsync();
 
             var list_rst = await _sqlSugar.Queryable<Grp_DelegationInfo>()
-                .Where(x => x.IsDel == 0)
-                .WhereIF(startTimeFlag && endTimeFlag, x => x.VisitDate >= begintime && x.VisitDate <= endtime)
-                .WhereIF(!string.IsNullOrEmpty(groupName), x => x.TeamName.Contains(groupName))
-                .WhereIF(marketStaffFlag, x => x.JietuanOperator == currUserId)
-                .OrderBy(x => x.VisitDate)
-                .Select(x => new PostSyntheticalReceivableByDateRangeView()
+                .LeftJoin<Sys_Users>((x, y) => x.JietuanOperator == y.Id)
+                .Where((x, y) => x.IsDel == 0)
+                .WhereIF(startTimeFlag && endTimeFlag, (x, y) => x.VisitDate >= begintime && x.VisitDate <= endtime)
+                .WhereIF(!string.IsNullOrEmpty(groupName), (x, y) => x.TeamName.Contains(groupName))
+                .WhereIF(marketStaffFlag, (x, y) => x.JietuanOperator == currUserId)
+                .OrderBy((x, y) => x.VisitDate)
+                .Select((x, y) => new PostSyntheticalReceivableByDateRangeView()
                 {
                     diid = x.Id,
                     teamName = x.TeamName,
                     clientUnit = x.ClientUnit,
-                    visitDate = x.VisitDate.ToString("yyyy-MM-dd")
+                    visitDate = x.VisitDate.ToString("yyyy-MM-dd"),
+                    fulfiller = y.CnName,
                 })
                 .ToListAsync();
 
@@ -2789,6 +2791,7 @@ namespace OASystem.API.Controllers
                             Balance = item.balPrice,
                             Collection = item.schedule,
                             GroupCost = item.groupCost.ToString("#0.00"),
+                            fulfiller = item.fulfiller
                         };
                         excNo++;
                         DateTime time = Convert.ToDateTime(item.visitDate);
@@ -2851,7 +2854,8 @@ namespace OASystem.API.Controllers
                             ClientUnit = item.clientUnit,
                             VisitDate = item.visitDate,
                             ChangeColorLabel = item.ChangeColorLabel,
-                            GroupCost = item.groupCost.ToString("#0.00")
+                            GroupCost = item.groupCost.ToString("#0.00"),
+                            fulfiller = item.fulfiller
                         };
                         excNo1++;
                         list_Ex_Orange.Add(exc);
@@ -2865,7 +2869,8 @@ namespace OASystem.API.Controllers
                             ClientUnit = item.clientUnit,
                             VisitDate = item.visitDate,
                             ChangeColorLabel = item.ChangeColorLabel,
-                            GroupCost = item.groupCost.ToString("#0.00")
+                            GroupCost = item.groupCost.ToString("#0.00"),
+                            fulfiller = item.fulfiller
                         };
                         excNo2++;
                         list_Ex_Red.Add(exc);

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

@@ -1,4 +1,5 @@
 using Aspose.Cells;
+using Aspose.Cells.Drawing;
 using Aspose.Words;
 using Aspose.Words.Drawing;
 using Aspose.Words.Tables;
@@ -67,6 +68,7 @@ using System.Text.Json;
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using System.Web;
+using YamlDotNet.Core;
 using static OASystem.API.OAMethodLib.JWTHelper;
 using static OASystem.Infrastructure.Repositories.Groups.AirTicketResRepository;
 using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
@@ -10981,7 +10983,24 @@ FROM
 
             var sysUers = await _sqlSugar.Queryable<Sys_Users>().Where(x => x.IsDel == 0).ToListAsync();
 
-            var overseaVehicleCityDatas = new List<dynamic>();
+            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);
@@ -11158,7 +11177,87 @@ FROM
                 return Ok(JsonView(false));
             }
 
-            return Ok(JsonView(true));
+            //返回数据处理
+            var label = new StringBuilder();
+
+            //接送机
+            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
@@ -13500,6 +13599,323 @@ FROM
             }));
         }
 
+
+        #region 城市区间交通费
+        /// <summary>
+        /// 团组模块 - 出入境费用 - 草稿 - 基础数据源(境外用车)
+        /// </summary>
+        /// <param name="draftId">草稿Id</param>
+        /// <returns></returns>
+        [HttpGet("{darfId}")]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> EnterExitCostDraftOVByGroupId(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="groupId"></param>
+        /// <param name="currUserId"></param>
+        /// <returns></returns>
+        [HttpGet("{groupId}")]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> EnterExitCostDraftOVFeeDetails(int groupId, int currUserId)
+        {
+            var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.Id == groupId).FirstAsync();
+            if (groupInfo == null)
+            {
+                return Ok(JsonView(false, "团组信息为空"));
+            }
+
+            var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == groupId).FirstAsync();
+
+            //CityIntervalInfo
+            var info = new CityIntervalInfo();
+
+            if (eecInfo != null && !string.IsNullOrEmpty(eecInfo.CityIntervalFeeDetails))
+            {
+                info = JsonConvert.DeserializeObject<CityIntervalInfo>(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 CityIntervalInfo()
+            {
+                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.EnterExitCostOVFeeUsedCurrencyAsync(groupId),
+                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> EnterExitCostDraftOVFeeSave(GetEnterExitCostOVFeeSaveDto dto)
+        {
+            var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.Id == dto.GroupId).FirstAsync();
+            if (groupInfo == 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 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()
+            {
+                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 = oldData?.CreateUserName ?? userName,
+                CreateTime = oldData?.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)
+                .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 total = dto.APTFeeTotal + dto.PullCartFeeTotal + dto.TrainFeeTotal + dto.CityAirTicketFeeTotal;
+            decimal jjcTotal = total;
+            decimal gwcTotal = total;
+            decimal tdcTotal = total;
+
+
+
+            return Ok(JsonView(true));
+        }
+
+        #endregion
+
+
         /// <summary>
         /// 团组模块 - 出入境费用-草稿 - Info
         /// </summary>
@@ -14896,6 +15312,248 @@ FROM
 
         #region 团组经理模块 出入境费用 移动端(Android/IOS)
 
+        #region 城市区间交通费
+        /// <summary>
+        /// 团组模块 - 出入境费用 - 移动端 - 基础数据源(境外用车)
+        /// </summary>
+        /// <param name="groupId"></param>
+        /// <returns></returns>
+        [HttpGet("{groupId}")]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> EnterExitCostMobileOVByGroupId(int groupId)
+        {
+            var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.Id == groupId).FirstAsync();
+            if (groupInfo == null)
+            {
+                return Ok(JsonView(false, "团组信息为空"));
+            }
+
+            var countryies = _groupRepository.GroupSplitCountry(groupInfo.VisitCountry);
+            if (countryies?.Any() != true)
+            {
+                return Ok(JsonView(false, "团组出访国家信息为空"));
+            }
+
+            var currencies = await GeneralMethod.EnterExitCostOVFeeUsedCurrencyAsync(groupId);
+
+            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 && countryies.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("、", countryies),
+                groupSize = groupInfo.VisitPNumber,     //出访人数
+                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="groupId"></param>
+        /// <param name="currUserId"></param>
+        /// <returns></returns>
+        [HttpGet("{groupId}")]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> EnterExitCostMobileOVFeeDetails(int groupId, int currUserId)
+        {
+            var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.Id == groupId).FirstAsync();
+            if (groupInfo == null)
+            {
+                return Ok(JsonView(false, "团组信息为空"));
+            }
+
+            var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == groupId).FirstAsync();
+
+            //CityIntervalInfo
+            var info = new CityIntervalInfo();
+
+            if (eecInfo != null && !string.IsNullOrEmpty(eecInfo.CityIntervalFeeDetails))
+            {
+                info = JsonConvert.DeserializeObject<CityIntervalInfo>(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 CityIntervalInfo()
+            {
+                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.EnterExitCostOVFeeUsedCurrencyAsync(groupId),
+                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> EnterExitCostMobileOVFeeSave(GetEnterExitCostOVFeeSaveDto dto)
+        {
+            var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.Id == dto.GroupId).FirstAsync();
+            if (groupInfo == 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 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()
+            {
+                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 = oldData?.CreateUserName ?? userName,
+                CreateTime = oldData?.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)
+                .ExecuteCommandAsync();
+            if (upd < 1)
+            {
+                return Ok(JsonView(false));
+            }
+
+            return Ok(JsonView(true));
+        }
+
+        #endregion
+
+
+
         /// <summary>
         /// 获取币种基础数据(含逻辑处理)
         /// </summary>

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

@@ -5142,7 +5142,7 @@ OPTION (MAXRECURSION 0); -- 允许无限递归      ";
                 dto.PageIndex = 1;
             }
 
-            if (dto.PageSize < 1 || dto.PageSize > 100)
+            if ((dto.PageSize < 1 || dto.PageSize > 100) && dto.PortType != 3)
             {
                 dto.PageSize = 10;
             }

+ 786 - 0
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -6,10 +6,12 @@ using OASystem.API.OAMethodLib.DeepSeekAPI;
 using OASystem.API.OAMethodLib.GenericSearch;
 using OASystem.Domain.AesEncryption;
 using OASystem.Domain.Attributes;
+using OASystem.Domain.Entities;
 using OASystem.Domain.Entities.Customer;
 using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
 using System.Collections;
+using System.ComponentModel;
 using System.Data;
 using System.Dynamic;
 using System.Linq;
@@ -4644,6 +4646,790 @@ GROUP BY
             public string Remark { get; set; }
 
         }
+
+        /// <summary>
+        /// excel导出 客户资料 (YQY)
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> ExcelDownloadClientYQY()
+        {
+            var yqyClientIds = new List<int>() {
+2468,
+2539,
+2345,
+2322,
+2685,
+6066,
+2531,
+2293,
+2339,
+2631,
+2485,
+2359,
+2551,
+6630,
+2645,
+6481,
+2522,
+6587,
+2402,
+2365,
+2353,
+6550,
+2565,
+2316,
+2608,
+6664,
+2419,
+2396,
+6687,
+2465,
+2442,
+6478,
+2471,
+6432,
+2342,
+2542,
+2588,
+2333,
+2582,
+2488,
+2482,
+2634,
+2880,
+2574,
+2883,
+2382,
+6057,
+6578,
+6627,
+6063,
+2356,
+2611,
+2605,
+2462,
+2313,
+2466,
+2297,
+2391,
+2589,
+2380,
+6659,
+2629,
+6613,
+2483,
+2477,
+2643,
+6064,
+2569,
+2669,
+2620,
+2520,
+6648,
+2320,
+2663,
+6585,
+2463,
+2314,
+2609,
+2586,
+2371,
+2540,
+2417,
+2772,
+2517,
+2494,
+2580,
+6908,
+6622,
+6668,
+2285,
+2486,
+6439,
+2523,
+2646,
+6061,
+2603,
+2403,
+6055,
+2305,
+2411,
+6617,
+2372,
+2541,
+6780,
+2303,
+2518,
+2495,
+6431,
+2627,
+2426,
+2687,
+2286,
+2529,
+2635,
+6663,
+2581,
+2406,
+2475,
+6654,
+6554,
+2661,
+6683,
+2612,
+2363,
+2538,
+2492,
+2515,
+2369,
+2352,
+2469,
+2323,
+2300,
+2398,
+6528,
+2592,
+6067,
+6906,
+2392,
+2784,
+2678,
+2684,
+2584,
+6912,
+2621,
+2289,
+2552,
+2452,
+6651,
+2521,
+2644,
+2615,
+6053,
+6588,
+2315,
+2309,
+2409,
+2301,
+2633,
+2610,
+2516,
+2441,
+2393,
+6429,
+2639,
+2284,
+6907,
+2673,
+6669,
+2622,
+6440,
+6583,
+2453,
+2524,
+2596,
+6652,
+6775,
+6054,
+2318,
+2659,
+6589,
+2410,
+2891,
+6480,
+2390,
+2473,
+6065,
+6612,
+2630,
+2381,
+2530,
+2484,
+2407,
+2599,
+2527,
+2670,
+2570,
+6778,
+6586,
+2613,
+2364,
+
+            };
+
+            var datas = await _sqlSugar.Queryable<Crm_NewClientData>().Where(x => x.IsDel == 0 && yqyClientIds.Contains(x.Id)).ToListAsync();
+
+            //解密
+            var dataView = new List<Crm_NewClientDataView>();
+            foreach (var item in datas)
+            {
+                EncryptionProcessor.DecryptProperties(item);
+
+                var area = await _sqlSugar.Queryable<Sys_SetData>()
+                    .Where(x => x.IsDel == 0 && x.Id == item.Lvlid)
+                    .Select(x => x.Name)
+                    .FirstAsync();
+
+                var sex = item.Gender switch { 
+                    0 => "男",
+                    1 => "女",
+                    _ => "未设置"
+                };
+
+                var category = await _sqlSugar.Queryable<Sys_SetData>()
+                    .Where(x => x.IsDel == 0 && x.Id == item.Category)
+                    .Select(x => x.Name)
+                    .FirstAsync();
+
+                var lastUpdateUserName = await _sqlSugar.Queryable<Sys_Users>()
+                    .Where(x => x.Id == item.LastUpdateUserId)
+                    .Select(x => x.CnName)
+                    .FirstAsync();
+
+                dataView.Add(new Crm_NewClientDataView
+                {
+                    Id = item.Id,
+                    Area = area,
+                    Client = item.Client,
+                    Weight = item.Weight,
+                    ClientShort = item.ClientShort,
+                    Contact = item.Contact,
+                    Sex = sex,
+                    Passport = item.Passport,
+                    PassportDate = item.PassportDate,
+                    Job = item.Job,
+                    Telephone = item.Telephone,
+                    Phone = item.Phone,
+                    Email = item.Email,
+                    Location = item.Location,
+                    Address = item.Address,
+                    Birthday = item.Birthday,
+                    OtherInfo = item.OtherInfo,
+                    Wechat = item.Wechat,
+                    Category = category,
+                    LastUpdateUserName = lastUpdateUserName,
+                    LastUpdateTime = item.LastUpdateTime,
+                });
+            }
+
+            var exportResult = await GeneralMethod.ExportToExcel<Crm_NewClientDataView>(dataView, "客户资料资料(YQY)", "客户资料资料(YQY)");
+
+            return Ok(JsonView(exportResult));
+        }
+
+        /// <summary>
+        /// excel导出 客户资料 (ZQ)
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> ExcelDownloadClientZQ()
+        {
+            var yqyClientIds = new List<int>() {
+5763,
+5764,
+5765,
+5766,
+5767,
+5768,
+5769,
+5770,
+5771,
+5781,
+5782,
+5783,
+5784,
+5785,
+5786,
+5787,
+5788,
+5789,
+5790,
+5801,
+5802,
+5803,
+5804,
+5805,
+5806,
+5807,
+5808,
+5809,
+5810,
+5821,
+5822,
+5823,
+5824,
+5825,
+5826,
+5827,
+5828,
+5829,
+5830,
+5841,
+5842,
+5843,
+5844,
+5845,
+5846,
+5847,
+5848,
+5849,
+5850,
+5861,
+5862,
+2572,
+2575,
+6593,
+2366,
+2433,
+2436,
+6660,
+2548,
+2619,
+4114,
+2385,
+6200,
+2583,
+2903,
+2412,
+2839,
+2384,
+2681,
+2877,
+6632,
+6645,
+2388,
+2354,
+2373,
+2375,
+6682,
+2470,
+2432,
+2472,
+2379,
+2290,
+2431,
+2434,
+2585,
+2580,
+2586,
+2599,
+6652,
+2584,
+2608,
+2541,
+6583,
+6053,
+2588,
+2540,
+2589,
+6617,
+6780,
+6664,
+6439,
+6630,
+2634,
+2565,
+2552,
+2592,
+2345,
+6063,
+2359,
+6054,
+6627,
+2352,
+2391,
+6550,
+2468,
+2471,
+2685,
+2639,
+2333,
+2629,
+2610,
+2645,
+2477,
+2315,
+2316,
+2323,
+2880,
+2772,
+6654,
+6065,
+2530,
+6651,
+2453,
+2615,
+2409,
+2284,
+2406,
+2570,
+2542,
+2419,
+2452,
+6554,
+2417,
+2465,
+2475,
+2611,
+2393,
+2411,
+6528,
+2390,
+2687,
+2466,
+2301,
+2380,
+2527,
+6683,
+6480,
+6481,
+2784,
+2678,
+2643,
+2669,
+2486,
+2492,
+2300,
+2673,
+6586,
+6588,
+2891,
+2520,
+2521,
+6778,
+6669,
+6668,
+6663,
+6659,
+2551,
+2369,
+6648,
+2441,
+2883,
+2630,
+2631,
+2633,
+2635,
+2613,
+2469,
+2605,
+2342,
+6429,
+2398,
+2402,
+2403,
+2646,
+2314,
+2309,
+2320,
+2627,
+2612,
+2463,
+6578,
+6061,
+2396,
+2371,
+2365,
+2286,
+2313,
+2372,
+2353,
+2356,
+2407,
+2381,
+2644,
+6622,
+2297,
+2609,
+2620,
+2473,
+6432,
+6067,
+2410,
+2322,
+2621,
+2289,
+6066,
+2303,
+2495,
+2426,
+6057,
+2603,
+2582,
+2285,
+2318,
+2293,
+2622,
+2462,
+6055,
+2488,
+6440,
+2659,
+2515,
+6906,
+6587,
+6907,
+2523,
+2529,
+2539,
+2516,
+6912,
+2663,
+6478,
+2538,
+2522,
+2531,
+2485,
+2484,
+6589,
+6064,
+2483,
+6612,
+6613,
+6585,
+2517,
+2684,
+2574,
+2339,
+2524,
+2670,
+2569,
+2596,
+2518,
+2494,
+2305,
+2392,
+6775,
+2482,
+6687,
+6431,
+2363,
+6908,
+2382,
+2364,
+2442,
+2661,
+2581,
+2576,
+
+            };
+
+            var datas = await _sqlSugar.Queryable<Crm_NewClientData>().Where(x => x.IsDel == 0 && yqyClientIds.Contains(x.Id)).ToListAsync();
+
+            //解密
+            var dataView = new List<Crm_NewClientDataView>();
+            foreach (var item in datas)
+            {
+                EncryptionProcessor.DecryptProperties(item);
+
+                var area = await _sqlSugar.Queryable<Sys_SetData>()
+                    .Where(x => x.IsDel == 0 && x.Id == item.Lvlid)
+                    .Select(x => x.Name)
+                    .FirstAsync();
+
+                var sex = item.Gender switch
+                {
+                    0 => "男",
+                    1 => "女",
+                    _ => "未设置"
+                };
+
+                var category = await _sqlSugar.Queryable<Sys_SetData>()
+                    .Where(x => x.IsDel == 0 && x.Id == item.Category)
+                    .Select(x => x.Name)
+                    .FirstAsync();
+
+                var lastUpdateUserName = await _sqlSugar.Queryable<Sys_Users>()
+                    .Where(x => x.Id == item.LastUpdateUserId)
+                    .Select(x => x.CnName)
+                    .FirstAsync();
+
+                dataView.Add(new Crm_NewClientDataView
+                {
+                    Id = item.Id,
+                    Area = area,
+                    Client = item.Client,
+                    Weight = item.Weight,
+                    ClientShort = item.ClientShort,
+                    Contact = item.Contact,
+                    Sex = sex,
+                    Passport = item.Passport,
+                    PassportDate = item.PassportDate,
+                    Job = item.Job,
+                    Telephone = item.Telephone,
+                    Phone = item.Phone,
+                    Email = item.Email,
+                    Location = item.Location,
+                    Address = item.Address,
+                    Birthday = item.Birthday,
+                    OtherInfo = item.OtherInfo,
+                    Wechat = item.Wechat,
+                    Category = category,
+                    LastUpdateUserName = lastUpdateUserName,
+                    LastUpdateTime = item.LastUpdateTime,
+                });
+            }
+
+            var exportResult = await GeneralMethod.ExportToExcel<Crm_NewClientDataView>(dataView, "客户资料资料(ZQ)", "客户资料资料(ZQ)");
+
+            return Ok(JsonView(exportResult));
+        }
+
+        /// <summary>
+        /// 新客户资料表
+        /// </summary>
+        public class Crm_NewClientDataView : EntityBase
+        {
+            private int number;
+            private string client;
+            private string weight;
+            private string clientshort;
+            private string contact;
+            private int gender;
+            private string passport;
+            private DateTime? passportDate;
+            private string job;
+            private string telephone;
+            private string phone;
+            private string email;
+            private string location;
+            private string address;
+            private string birthday;
+            private string otherinfo;
+            private string wechat;
+            private string category;
+            private int predele;
+            private int finlishedDele;
+            private string lastUpdateUserName;
+            private DateTime lastUpdateTime;
+            private string area;
+            private string sex;
+
+            /// <summary>
+            /// 序号
+            /// </summary>
+            public int Number { get => number; set => number = value; }
+
+            /// <summary>
+            /// 客户区域
+            /// </summary>
+
+            public string Area { get => area; set => area = value; }
+
+            /// <summary>
+            /// 客户单位
+            /// </summary>
+            public string Client { get => client; set => client = value; }
+
+            /// <summary>
+            /// 权重
+            /// </summary>
+            public string Weight { get => weight; set => weight = value; }
+
+            /// <summary>
+            /// 客户单位简写
+            /// </summary>
+            public string ClientShort { get => clientshort; set => clientshort = value; }
+
+            /// <summary>
+            /// 联系人
+            /// </summary>
+            public string Contact { get => contact; set => contact = value; }
+
+            /// <summary>
+            /// 联系人性别
+            /// </summary>
+            public string Sex { get => sex; set => sex = value; }
+
+            /// <summary>
+            /// 护照
+            /// </summary>
+            public string Passport { get => passport; set => passport = value; }
+
+            /// <summary>
+            /// 护照日期
+            /// </summary>
+            public DateTime? PassportDate { get => passportDate; set => passportDate = value; }
+
+            /// <summary>
+            /// 职位
+            /// </summary>
+            [Encrypted]
+            public string Job { get => job; set => job = value; }
+
+            /// <summary>
+            /// 联系手机号
+            /// </summary>
+            [Encrypted]
+            public string Telephone { get => telephone; set => telephone = value; }
+
+            /// <summary>
+            /// 联系座机号
+            /// </summary>
+            [Encrypted]
+            public string Phone { get => phone; set => phone = value; }
+
+            /// <summary>
+            /// 邮件
+            /// </summary>
+            [Encrypted]
+            public string Email { get => email; set => email = value; }
+
+            /// <summary>
+            /// 所属区域(所在城市)
+            /// </summary>
+            public string Location { get => location; set => location = value; }
+
+            /// <summary>
+            /// 地址
+            /// </summary>
+            public string Address { get => address; set => address = value; }
+
+            /// <summary>
+            /// 生日
+            /// </summary>
+            public string Birthday { get => birthday; set => birthday = value; }
+
+            /// <summary>
+            /// 其他信息
+            /// </summary>
+            public string OtherInfo { get => otherinfo; set => otherinfo = value; }
+
+            /// <summary>
+            /// 微信
+            /// </summary>
+            public string Wechat { get => wechat; set => wechat = value; }
+
+            /// <summary>
+            /// 分类
+            /// </summary>
+            public string Category { get => category; set => category = value; }
+
+            /// <summary>
+            /// 预计出团
+            /// </summary>
+            public int PreDele { get => predele; set => predele = value; }
+
+            /// <summary>
+            /// 已出团
+            /// </summary>
+            public int FinlishedDele { get => finlishedDele; set => finlishedDele = value; }
+
+            /// <summary>
+            /// 最后更新者Id
+            /// </summary>
+            public string LastUpdateUserName { get => lastUpdateUserName; set => lastUpdateUserName = value; }
+
+            /// <summary>
+            /// 最后更新时间
+            /// </summary>
+            public DateTime LastUpdateTime { get => lastUpdateTime; set => lastUpdateTime = value; }
+        }
+
+
         #endregion
 
         #region DeepSeek 测试

+ 93 - 2
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -4378,6 +4378,99 @@ namespace OASystem.API.OAMethodLib
             return infos;
         }
 
+        /// <summary>
+        /// 城市区间-草稿费用详情 使用的币种及汇率
+        /// </summary>
+        /// <param name="draftId"></param>
+        /// <returns></returns>
+        public static async Task<List<CurrencyInfo>> EnterExitCostDrafOVFeeUsedCurrencyAsync(int draftId = 0)
+        {
+            var infos = new List<CurrencyInfo>();
+
+            bool isUsedDraft = false;
+            var countryies = new List<string>();
+
+            var drafInfo = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().Where(x => x.Id == draftId).FirstAsync();
+
+            if (drafInfo != null)
+            {
+
+                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 (countryies.Any())
+                {
+                    isUsedDraft = true;
+                }
+            }
+
+            infos = await _sqlSugar.Queryable<Res_OverseaVehicle>()
+                .LeftJoin<Sys_SetData>((ov, sd) => ov.Currency == sd.Id)
+                .Where((ov, sd) => ov.IsDel == 0)
+                .WhereIF(isUsedDraft, (ov, sd) => countryies.Contains(ov.CountryName))
+                .Select((ov, sd) => new CurrencyInfo()
+                {
+                    CurrencyCode = sd.Name.ToUpper(),
+                    CurrencyName = sd.Remark
+                })
+                .Distinct()
+                .ToListAsync();
+
+            //出入境费用存储的币种及汇率
+            var eexCurrencyInfos = new List<CurrencyInfo>();
+            if (infos.Any())
+            {
+                if (drafInfo != null)
+                {
+                    eexCurrencyInfos = CommonFun.GetCurrencyChinaToList(drafInfo.CurrencyRemark);
+                }
+            }
+
+            //合并已使用币种及汇率
+            infos.ForEach(x =>
+            {
+                if (x.CurrencyCode.Equals("CNY")) x.Rate = 1.0000M;
+
+                var eexCurrencyInfo = eexCurrencyInfos.Where(y => y.CurrencyCode == x.CurrencyCode).FirstOrDefault();
+                if (eexCurrencyInfo != null)
+                {
+                    x.Rate = eexCurrencyInfo.Rate;
+                }
+            });
+
+            //未存储费用集合
+            var unSaveCurrInfos = infos.Where(x => !eexCurrencyInfos.Any(y => y.CurrencyCode == x.CurrencyCode)).ToList();
+            if (unSaveCurrInfos.Any())
+            {
+                var currencyRate = await _juHeApi.PostItemRateAsync(unSaveCurrInfos.Select(it => it.CurrencyCode!).ToArray());
+                if (currencyRate.Count > 0)
+                {
+                    foreach (var item in infos)
+                    {
+                        var rateInfo = currencyRate.Where(it => it.Name.Equals(item.CurrencyName)).FirstOrDefault();
+                        if (rateInfo != null)
+                        {
+                            decimal rate1 = Convert.ToDecimal(rateInfo.FSellPri) / 100.00M;
+                            rate1 *= _fxRateRise;
+
+                            item.Rate = rate1.TruncDecimals(4) + _xchgRateAdj;
+                        }
+                    }
+                }
+            }
+
+            return infos;
+        }
+
         #endregion
 
         /// <summary>
@@ -5994,8 +6087,6 @@ namespace OASystem.API.OAMethodLib
         }
         #endregion
 
-
-
         public static async Task<ExportResult> ExportToExcel<T>(IEnumerable<T> data, string fileName, string sheetName = "Sheet1", string templateType = "default")
         {
             try

BIN
OASystem/OASystem.Api/wwwroot/exports/exports/excel/客户资料资料(YQY)_0f4beae08b7b4f53b9f27113563fc5d2.xlsx


BIN
OASystem/OASystem.Api/wwwroot/exports/exports/excel/客户资料资料(ZQ)_6c09dbea11914d2eafe96e5a4fdb0a5d.xlsx


+ 11 - 0
OASystem/OASystem.Domain/ViewModels/Financial/Fin_ForeignReceivablesView.cs

@@ -319,6 +319,12 @@ namespace OASystem.Domain.ViewModels.Financial
         public string ChangeColorLabel { get; set; }
 
         public string GroupCost { get; set; }
+
+        /// <summary>
+        /// 成单人
+        /// 2025-12-23 新增
+        /// </summary>
+        public string fulfiller { get; set; }
     }
 
     public class PostSyntheticalReceivableByDateRangeResultView
@@ -434,6 +440,11 @@ namespace OASystem.Domain.ViewModels.Financial
         /// 团组成本 - 报价 明细
         /// </summary>
         public List<ChildFeeInfo> groupCostItem { get; set; }
+
+        /// <summary>
+        /// 成单人
+        /// </summary>
+        public string fulfiller { get; set; }
     }