Browse Source

部分代码修改

yuanrf 1 year ago
parent
commit
4e503b7464
1 changed files with 16 additions and 2 deletions
  1. 16 2
      OASystem/OASystem.Api/Controllers/GroupsController.cs

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

@@ -5264,10 +5264,23 @@ namespace OASystem.API.Controllers
                         {
                             var itemSp = item.Split(' ').Where(x => !string.IsNullOrWhiteSpace(x)).ToList();
                             var IndexSelect = itemSp[2];
+                            var cityArrCodeLength = cityArrCode.Count - 1;
                             var startCity = IndexSelect.Substring(0, 3);
+                            if (cityArrCodeLength > 0)
+                            {
+                                var arrEndCity = cityArrCode[cityArrCodeLength];
+                                if (arrEndCity != startCity)
+                                {
+                                    cityArrCode.Add(startCity.ToUpper());
+                                }
+                            }
+                            else
+                            {
+                                cityArrCode.Add(startCity.ToUpper());
+                            }
+                            
                             var endCity = IndexSelect.Substring(3, 3);
-                            cityArrCode.Add(startCity.ToUpper());
-                            cityArrCode.Add(startCity.ToUpper());
+                            cityArrCode.Add(endCity.ToUpper());
                         }
 
                         var cityThree = string.Empty;
@@ -5293,6 +5306,7 @@ namespace OASystem.API.Controllers
                                 city += item + "三字码未收入/";
                             }
                         }
+                        city = city.TrimEnd('/');
                     }
                     catch (Exception e)
                     {