|
|
@@ -161,6 +161,150 @@ public class WlApi {
|
|
|
return this.getOapResponse("/openApi/scenicSpot", dataMap);
|
|
|
}
|
|
|
|
|
|
+ @ServiceMethod(method = "wlapi.lcy.scenic.spot", title = "景区列表 - 龙城云")
|
|
|
+ public OapResponse scenicSpotLcy(@RequestBody ScenicSpotRequest request) throws Exception {
|
|
|
+ Map<String, String> dataMap = new HashMap<>();
|
|
|
+ dataMap.put("page", request.getPage().toString());
|
|
|
+ dataMap.put("limit", request.getLimit().toString());
|
|
|
+ if (StringUtils.isNotBlank(request.getTitle())) {
|
|
|
+ dataMap.put("title", request.getTitle());
|
|
|
+ }
|
|
|
+ OapResponse response = this.getOapResponse("/openApi/scenicSpot", dataMap);
|
|
|
+ if (response.getCode().equals("SUCCESS")) {
|
|
|
+ JSONObject object = (JSONObject) response.getBody();
|
|
|
+ JSONArray array = object.getJSONArray("list");
|
|
|
+ JSONArray newArray = new JSONArray();
|
|
|
+ array.forEach(item -> {
|
|
|
+ JSONObject newItem = new JSONObject();
|
|
|
+ JSONObject obj = (JSONObject) item;
|
|
|
+ JSONObject fieldValues = obj.getJSONObject("fieldValues");
|
|
|
+ newItem.put("id", obj.getString("id"));
|
|
|
+ newItem.put("title", obj.getString("title"));//名称
|
|
|
+ if(fieldValues.containsKey("scenicAreaLocation")){
|
|
|
+ newItem.put("scenicAreaLocation", fieldValues.getString("scenicAreaLocation"));//景区位置坐标
|
|
|
+ }else {
|
|
|
+ newItem.put("scenicAreaLocation", "");//景区位置坐标
|
|
|
+ }
|
|
|
+ if(fieldValues.containsKey("service_contactPhone")){
|
|
|
+ newItem.put("serviceContactPhone", fieldValues.getString("service_contactPhone"));//服务电话
|
|
|
+ }else {
|
|
|
+ newItem.put("serviceContactPhone", "");//服务电话
|
|
|
+ }
|
|
|
+ if(fieldValues.containsKey("openTime")){
|
|
|
+ newItem.put("openTime", fieldValues.getString("openTime"));//开放时间
|
|
|
+ }else {
|
|
|
+ newItem.put("openTime", "");//开放时间
|
|
|
+ }
|
|
|
+ newItem.put("areaAddr", obj.getString("areaAddr"));//地址
|
|
|
+ newItem.put("brief", obj.getString("brief"));//简介
|
|
|
+ newItem.put("text", obj.getString("text"));//详情
|
|
|
+ newItem.put("pic", obj.getString("pic"));//图片
|
|
|
+ newArray.add(newItem);
|
|
|
+ });
|
|
|
+ JSONObject newBody = new JSONObject();
|
|
|
+ newBody.put("list", newArray);
|
|
|
+ newBody.put("total", object.getInteger("total"));
|
|
|
+ response.setBody(newBody);
|
|
|
+ System.out.println(response.getBody());
|
|
|
+ }
|
|
|
+ return response;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ServiceMethod(method = "wlapi.lcy.scenic.spot.complaint", title = "各景区的投诉联系方式 - 龙城云")
|
|
|
+ public OapResponse scenicSpotComplaint(@RequestBody ScenicSpotRequest request) throws Exception {
|
|
|
+ Map<String, String> dataMap = new HashMap<>();
|
|
|
+ dataMap.put("page", request.getPage().toString());
|
|
|
+ dataMap.put("limit", request.getLimit().toString());
|
|
|
+ if (StringUtils.isNotBlank(request.getTitle())) {
|
|
|
+ dataMap.put("title", request.getTitle());
|
|
|
+ }
|
|
|
+ OapResponse response = this.getOapResponse("/openApi/scenicSpot", dataMap);
|
|
|
+ if (response.getCode().equals("SUCCESS")) {
|
|
|
+ JSONObject object = (JSONObject) response.getBody();
|
|
|
+ JSONArray array = object.getJSONArray("list");
|
|
|
+ JSONArray newArray = new JSONArray();
|
|
|
+ array.forEach(item -> {
|
|
|
+ JSONObject newItem = new JSONObject();
|
|
|
+ JSONObject obj = (JSONObject) item;
|
|
|
+ JSONObject fieldValues = obj.getJSONObject("fieldValues");
|
|
|
+ newItem.put("id", obj.getString("id"));
|
|
|
+ newItem.put("title", obj.getString("title"));//名称
|
|
|
+ if(fieldValues.containsKey("scenicAreaLocation")){
|
|
|
+ newItem.put("scenicAreaLocation", fieldValues.getString("scenicAreaLocation"));//景区位置坐标
|
|
|
+ }else {
|
|
|
+ newItem.put("scenicAreaLocation", "");//景区位置坐标
|
|
|
+ }
|
|
|
+ if(fieldValues.containsKey("service_contactPhone")){
|
|
|
+ newItem.put("serviceContactPhone", fieldValues.getString("service_contactPhone"));//服务电话
|
|
|
+ }else {
|
|
|
+ newItem.put("serviceContactPhone", "");//服务电话
|
|
|
+ }
|
|
|
+ newItem.put("complaintContactPhone", "12301");//投诉电话
|
|
|
+ if(fieldValues.containsKey("openTime")){
|
|
|
+ newItem.put("openTime", fieldValues.getString("openTime"));//开放时间
|
|
|
+ }else {
|
|
|
+ newItem.put("openTime", "");//开放时间
|
|
|
+ }
|
|
|
+ newItem.put("areaAddr", obj.getString("areaAddr"));//地址
|
|
|
+ newArray.add(newItem);
|
|
|
+ });
|
|
|
+ JSONObject newBody = new JSONObject();
|
|
|
+ newBody.put("list", newArray);
|
|
|
+ newBody.put("total", object.getInteger("total"));
|
|
|
+ response.setBody(newBody);
|
|
|
+ System.out.println(response.getBody());
|
|
|
+ }
|
|
|
+ return response;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ServiceMethod(method = "wlapi.lcy.scenic.spot.weather", title = "各景区的天气 - 龙城云")
|
|
|
+ public OapResponse scenicSpotWeather(@RequestBody ScenicSpotRequest request) throws Exception {
|
|
|
+ Map<String, String> dataMap = new HashMap<>();
|
|
|
+ dataMap.put("page", request.getPage().toString());
|
|
|
+ dataMap.put("limit", request.getLimit().toString());
|
|
|
+ if (StringUtils.isNotBlank(request.getTitle())) {
|
|
|
+ dataMap.put("title", request.getTitle());
|
|
|
+ }
|
|
|
+ return this.getListOapResponse("/openApi/scenicSpot/weather", dataMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ServiceMethod(method = "wlapi.lcy.tourism.news", title = "文旅局新闻资讯 - 龙城云")
|
|
|
+ public OapResponse tourismNews(@RequestBody ScenicSpotRequest request) throws Exception {
|
|
|
+ Map<String, String> dataMap = new HashMap<>();
|
|
|
+ dataMap.put("page", request.getPage().toString());
|
|
|
+ dataMap.put("limit", request.getLimit().toString());
|
|
|
+ dataMap.put("code", "xinwenzixun");
|
|
|
+ if (StringUtils.isNotBlank(request.getTitle())) {
|
|
|
+ dataMap.put("title", request.getTitle());
|
|
|
+ }
|
|
|
+ OapResponse response = this.getOapResponse("/openApi/content/page", dataMap);
|
|
|
+ if (response.getCode().equals("SUCCESS")) {
|
|
|
+ JSONObject object = (JSONObject) response.getBody();
|
|
|
+ JSONArray array = object.getJSONArray("list");
|
|
|
+ JSONArray newArray = new JSONArray();
|
|
|
+ array.forEach(item -> {
|
|
|
+ JSONObject newItem = new JSONObject();
|
|
|
+ JSONObject obj = (JSONObject) item;
|
|
|
+ JSONObject fieldValues = obj.getJSONObject("fieldValues");
|
|
|
+ newItem.put("id", obj.getString("id"));
|
|
|
+ newItem.put("title", obj.getString("title"));//名称
|
|
|
+ newItem.put("text", obj.getString("text"));//详情
|
|
|
+ if(fieldValues!=null && fieldValues.containsKey("unit")){
|
|
|
+ newItem.put("unit", fieldValues.getString("unit"));//发布单位
|
|
|
+ }else {
|
|
|
+ newItem.put("unit", "");//发布单位
|
|
|
+ }
|
|
|
+ newArray.add(newItem);
|
|
|
+ });
|
|
|
+ JSONObject newBody = new JSONObject();
|
|
|
+ newBody.put("list", newArray);
|
|
|
+ newBody.put("total", object.getInteger("total"));
|
|
|
+ response.setBody(newBody);
|
|
|
+ System.out.println(response.getBody());
|
|
|
+ }
|
|
|
+ return response;
|
|
|
+ }
|
|
|
+
|
|
|
@ServiceMethod(method = "wlapi.scenic.spot.detail", title = "景区详情")
|
|
|
public OapResponse scenicSpotDetail(@RequestBody ScenicSpotDetailRequest request) throws Exception {
|
|
|
Map<String, String> dataMap = new HashMap<>();
|