Explorar el Código

地接list 新增 根据id获取城市

yuanrf hace 1 año
padre
commit
98b3d2fbe9

+ 36 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

@@ -490,6 +490,17 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 #endregion
                 int startIndex = (dto.PageIndex - 1) * dto.PageSize + 1;
                 int endIndex = startIndex + dto.PageSize - 1;
+
+                Regex regex = new Regex("^[\u4e00-\u9fa5]*$");
+
+                //城市列表
+                var data = _sqlSugar.Queryable<Grp_NationalTravelFee>().Where(x => x.IsDel == 0).Select(x => new
+                {
+                    x.Id,
+                    x.Country,
+                    x.City,
+                }).ToList();
+
                 if (dto.PortType == 1)
                 {
                     string sql = string.Format(@"select t.*,s.Name as CurrencyStr,c.IsAuditGM,c.PayPercentage,c.PayMoney,c.PayDid from 
@@ -498,8 +509,22 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                                 left Join Sys_SetData s on s.Id=c.PaymentCurrency {0}
                                                 order by c.IsAuditGM,c.PayPercentage desc", sqlWhere);
                     List<Grp_CarTouristGuideGroundView> infoViews = _sqlSugar.SqlQueryable<Grp_CarTouristGuideGroundView>(sql).ToList();
+
+                    
+
                     foreach (var item in infoViews)
                     {
+                        if(!regex.IsMatch(item.Area))
+                        {
+                            for(int i = 0; i < data.Count; i++)
+                            {
+                                if (item.Area.Equals(data[i].Id.ToString()))
+                                {
+                                    item.Area = string.Format("{0} {1}", data[i].Country, data[i].City);
+                                }
+                            }
+                        }
+                        
                         if (item.OrbitalPrivateTransfer == 0) item.OrbitalPrivateTransferStr = "公转";
                         else if (item.OrbitalPrivateTransfer == 1) item.OrbitalPrivateTransferStr = "私转";
                         
@@ -533,6 +558,17 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     List<Grp_CarTouristGuideGroundView> grp_CarTourists = _sqlSugar.SqlQueryable<Grp_CarTouristGuideGroundView>(sql).ToList();
                     foreach (var item in grp_CarTourists)
                     {
+                        if (!regex.IsMatch(item.Area))
+                        {
+                            for (int i = 0; i < data.Count; i++)
+                            {
+                                if (item.Area.Equals(data[i].Id.ToString()))
+                                {
+                                    item.Area = string.Format("{0} {1}", data[i].Country, data[i].City);
+                                }
+                            }
+                        }
+
                         if (item.OrbitalPrivateTransfer == 0) item.OrbitalPrivateTransferStr = "公转";
                         else if (item.OrbitalPrivateTransfer == 1) item.OrbitalPrivateTransferStr = "私转";
                         item.ServiceStartTime = Convert.ToDateTime(item.ServiceStartTime).ToString("yyyy-MM-dd");