|
@@ -67,6 +67,58 @@ public class StationController {
|
|
|
return gson.toJson(resultData);
|
|
|
}
|
|
|
|
|
|
+ //支付宝小程序获取油站列表
|
|
|
+ @RequestMapping(value = "/getStationListToAliPay", method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public String getStationListToAliPay(){
|
|
|
+ Gson gson =new Gson();
|
|
|
+ //返回结果集
|
|
|
+ ResultData resultData=null;
|
|
|
+ StationInfo stationInfo = new StationInfo();
|
|
|
+ List<StationInfo> stationList = stationService.getStationListToAliPay(stationInfo);
|
|
|
+ logger.info("支付宝小程序无经纬度油站列表:"+stationList.toString());
|
|
|
+ resultData = ResultData.success(stationList);
|
|
|
+ return gson.toJson(resultData);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 支付宝小程序坐标获取油站列表
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/getStationInfoListNewToAliPay", method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public String getStationInfoListNewToAliPay(@RequestParam String stationLongitude,String stationLatitude,Integer pageNum,Integer pageSize){
|
|
|
+ Gson gson =new Gson();
|
|
|
+ //返回结果集
|
|
|
+ ResultData resultData= null;
|
|
|
+ StationRequest stationRequest = new StationRequest();
|
|
|
+ stationRequest.setJiBie("2");
|
|
|
+ if(StringUtils.isNotBlank(stationLatitude) && StringUtils.isNotBlank(stationLongitude)){
|
|
|
+ stationRequest.setStationLatitude(stationLatitude);
|
|
|
+ stationRequest.setStationLongitude(stationLongitude);
|
|
|
+ stationRequest.setPageNum(pageNum);
|
|
|
+ stationRequest.setPageSize(pageSize);
|
|
|
+ //调用接口 根据坐标筛选距离最近的加油站
|
|
|
+ StationInfoVo stationInfoVo = stationService.stationInfoList(stationRequest);
|
|
|
+ logger.info("支付宝小程序有经纬度获取油站列表:"+stationInfoVo.toString());
|
|
|
+ JSONObject location = BaiduMapUtil.getLocation(stationLongitude, stationLatitude);
|
|
|
+ if(location !=null && location.containsKey("status") && location.get("status").toString().equals("0")){
|
|
|
+ JSONObject result = location.getJSONObject("result").getJSONObject("addressComponent");
|
|
|
+ if(!result.getString("street").equals("")){
|
|
|
+ stationInfoVo.setAddress(result.getString("street"));
|
|
|
+ }else {
|
|
|
+ stationInfoVo.setAddress("未知街道");
|
|
|
+ }
|
|
|
+ resultData=ResultData.success(stationInfoVo);
|
|
|
+ }else {
|
|
|
+ resultData=ResultData.error(CodeMsg.BAIDUMAP_FAIL);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ resultData=ResultData.error(CodeMsg.REQUEST_FAIL);
|
|
|
+ }
|
|
|
+ return gson.toJson(resultData);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//获取油站公众号ID
|
|
|
@RequestMapping(value = "/getStationGzhAppId", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
@@ -231,6 +283,7 @@ public class StationController {
|
|
|
StationRequest stationRequest = new StationRequest();
|
|
|
//StationInfo stationInfo = new StationInfo();
|
|
|
stationRequest.setAppId(appId);
|
|
|
+ stationRequest.setJiBie("2");
|
|
|
//stationInfo.setAppId(appId);
|
|
|
if(StringUtils.isNotBlank(stationLatitude) && StringUtils.isNotBlank(stationLongitude)){
|
|
|
stationRequest.setStationLatitude(stationLatitude);
|