From 4c99ee7028c3fe58a2cd4b8273b22c75c45574fc Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期五, 16 五月 2025 10:27:41 +0800
Subject: [PATCH] 修改文档bug

---
 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOpenCityController.java |   33 +++++++++------------------------
 1 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOpenCityController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOpenCityController.java
index 999dee5..009b4c9 100644
--- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOpenCityController.java
+++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOpenCityController.java
@@ -7,6 +7,8 @@
 import com.baomidou.mybatisplus.plugins.Page;
 import com.stylefeng.guns.core.base.controller.BaseController;
 import com.stylefeng.guns.core.common.constant.factory.PageFactory;
+import com.stylefeng.guns.core.common.exception.BizExceptionEnum;
+import com.stylefeng.guns.core.exception.GunsException;
 import com.stylefeng.guns.core.shiro.ShiroKit;
 import com.stylefeng.guns.core.util.DateUtil;
 import com.stylefeng.guns.core.util.SinataUtil;
@@ -19,6 +21,7 @@
 import com.stylefeng.guns.modular.system.util.GaoDeMapUtil;
 import com.stylefeng.guns.modular.system.util.GoogleMap.FindPlaceFromTextVo;
 import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil;
+import com.stylefeng.guns.modular.system.util.ResultUtil;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
@@ -134,24 +137,15 @@
         //获取code
         tOpenCity.setCityId(cityId);
         City city = cityService.selectById(cityId);
-        FindPlaceFromTextVo textsearch = null;
-        try {
-            textsearch = GoogleMapUtil.textsearch(city.getEnglishName());
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        if(null == textsearch){
-            return "查询地图异常";
-        }
-        tOpenCity.setLat(textsearch.getLat());
-        tOpenCity.setLon(textsearch.getLng());
+        tOpenCity.setLat(city.getLat());
+        tOpenCity.setLon(city.getLon());
         tOpenCity.setInsertTime(new Date());
         tOpenCity.setInsertUser(ShiroKit.getUser().getId());
         tOpenCityService.insert(tOpenCity);
 
         //添加经营业务
         testJSONStrToJSONArray(businessTypeStr,tOpenCity.getId());
-        return SUCCESS_TIP;
+        return ResultUtil.success();
     }
 
     public void testJSONStrToJSONArray(String subArr,Integer tOpenCityId){
@@ -208,17 +202,8 @@
         //获取code
         tOpenCity.setCityId(cityId);
         City city = cityService.selectById(cityId);
-        FindPlaceFromTextVo textsearch = null;
-        try {
-            textsearch = GoogleMapUtil.textsearch(city.getEnglishName());
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        if(null == textsearch){
-            return "查询地图异常";
-        }
-        tOpenCity.setLat(textsearch.getLat());
-        tOpenCity.setLon(textsearch.getLng());
+        tOpenCity.setLat(city.getLat());
+        tOpenCity.setLon(city.getLon());
         tOpenCity.setUpdateTime(new Date());
         tOpenCity.setUpdateUser(ShiroKit.getUser().getId());
         tOpenCityService.updateById(tOpenCity);
@@ -229,7 +214,7 @@
         tOpenCityBusinessService.update(business,new EntityWrapper<TOpenCityBusiness>().eq("openCityId",tOpenCity.getId()));
         //添加经营业务
         testJSONStrToJSONArray(businessTypeStr,tOpenCity.getId());
-        return SUCCESS_TIP;
+        return ResultUtil.success();
     }
 
     /**

--
Gitblit v1.7.1