luo
2024-01-31 021640e69b32dbd9b88a538402671c47f280df9e
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();
    }
    /**