| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | //获取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){ |
| | |
| | | //获取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); |
| | |
| | | tOpenCityBusinessService.update(business,new EntityWrapper<TOpenCityBusiness>().eq("openCityId",tOpenCity.getId())); |
| | | //添加经营业务 |
| | | testJSONStrToJSONArray(businessTypeStr,tOpenCity.getId()); |
| | | return SUCCESS_TIP; |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |