|
@@ -1,5 +1,4 @@
|
|
|
package com.platform.yijia.controller;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.google.gson.GsonBuilder;
|
|
|
import com.platform.yijia.config.YiJiaRequest;
|
|
@@ -11,9 +10,11 @@ import com.platform.yijia.service.AppUserInfoService;
|
|
|
import com.platform.yijia.service.StationNoticeManageService;
|
|
|
import com.platform.yijia.service.StationOilGunService;
|
|
|
import com.platform.yijia.service.StationService;
|
|
|
+import com.platform.yijia.utils.BaiduMapUtil;
|
|
|
import com.platform.yijia.utils.CodeMsg;
|
|
|
import com.platform.yijia.utils.FeiEPrinterUtil;
|
|
|
import com.platform.yijia.utils.ResultData;
|
|
|
+import net.sf.json.JSONObject;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -127,21 +128,24 @@ public class StationController {
|
|
|
return gson.toJson(resultData);
|
|
|
}
|
|
|
|
|
|
-// //获取油站公告信息
|
|
|
-// @RequestMapping(value = "/getStationNoticeInfo", method = RequestMethod.GET)
|
|
|
-// @ResponseBody
|
|
|
-// public String getStationNoticeInfo(@RequestParam Integer stationId){
|
|
|
-// Gson gson =new Gson();
|
|
|
-// //返回结果集
|
|
|
-// ResultData resultData=null;
|
|
|
-// if(stationId !=null){
|
|
|
-// Map<String, Object> stationNoticeInfo = stationService.getStationNoticeInfo(stationId);
|
|
|
-// resultData =ResultData.success(stationNoticeInfo);
|
|
|
-// }else {
|
|
|
-// resultData =ResultData.error(CodeMsg.REQUEST_FAIL);
|
|
|
-// }
|
|
|
-// return gson.toJson(resultData);
|
|
|
-// }
|
|
|
+ //获取油站地址信息
|
|
|
+ @RequestMapping(value = "/getStationAddress", method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public String getStationAddress(@RequestParam String lng, @RequestParam String lat){
|
|
|
+ Gson gson =new Gson();
|
|
|
+ //返回结果集
|
|
|
+ ResultData resultData=null;
|
|
|
+ JSONObject location = BaiduMapUtil.getLocation(lng, lat);
|
|
|
+ if(location !=null && location.containsKey("status") && location.get("status").toString().equals("0")){
|
|
|
+ JSONObject result = location.getJSONObject("result");
|
|
|
+ Map<String, Object> m = new HashMap<>();
|
|
|
+ m.put("address", result.getString("formatted_address"));
|
|
|
+ resultData = ResultData.success(m);
|
|
|
+ }else {
|
|
|
+ resultData = ResultData.error(CodeMsg.YEWU_FAIL);
|
|
|
+ }
|
|
|
+ return gson.toJson(resultData);
|
|
|
+ }
|
|
|
|
|
|
//获取油站轮播图
|
|
|
@RequestMapping(value = "/getStationPicList", method = RequestMethod.GET)
|