Bläddra i källkod

对接口,全部接口都有数据了

wuweihao 4 år sedan
förälder
incheckning
e0436e1c9a

+ 2 - 1
gis_application/src/main/resources/application.properties

@@ -1,4 +1,4 @@
-server.port=8105
+server.port=8106
 
 spring.profiles.active=dev
 
@@ -16,3 +16,4 @@ spring.servlet.multipart.max-request-size=256MB
 
 
 
+

+ 1 - 0
gis_common/src/main/java/com/gis/common/deyuan/util/HttpUtils.java

@@ -255,6 +255,7 @@ public class HttpUtils {
         if (!StringUtils.isBlank(path)) {
             sbUrl.append(path);
         }
+        LOGGER.info("request api: " + sbUrl.toString());
         if (null != querys) {
             StringBuilder sbQuery = new StringBuilder();
             for (Map.Entry<String, String> query : querys.entrySet()) {

+ 2 - 0
gis_common/src/main/java/com/gis/common/deyuan/util/ResultUtils.java

@@ -66,6 +66,7 @@ public class ResultUtils {
         querys.put("Content-Type", "application/json;charset=utf-8");
 
         String resultData = null;
+//        log.info("request url: "+ path);
         try {
             HttpResponse httpResponse = HttpUtils.doGet(host, path, headers, querys);
             String restResult = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
@@ -127,6 +128,7 @@ public class ResultUtils {
         querys.put("Content-Type", "application/json;charset=utf-8");
 
         String resultData = null;
+//        log.info("request url: "+ path);
         try {
             HttpResponse httpResponse = HttpUtils.doGet(host, path, headers, querys);
             String restResult = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");

+ 5 - 0
gis_common/src/main/java/com/gis/common/util/DoorUtils.java

@@ -353,6 +353,8 @@ public class DoorUtils {
      */
     public static Result doPostDecrypt(String url, TreeMap<String, Object> param) throws Exception {
         Map<String, Object> encryptMap = encrypt(param);
+        log.warn("request param: " + param.toString());
+
         String result = HttpUtil.post(url, encryptMap);
         log.info("result: {}", result);
         JSONObject resultJson = JSON.parseObject(result);
@@ -369,6 +371,7 @@ public class DoorUtils {
 
 
     public static Result doPost(String url, TreeMap<String, Object> param) throws Exception {
+        log.info("request url: "+ url);
         String result = HttpUtil.post(url, encrypt(param));
         log.info("result: {}", result);
         JSONObject resultJson = JSON.parseObject(result);
@@ -383,6 +386,8 @@ public class DoorUtils {
 
 
     public static Result doGet(String url, TreeMap<String, Object> param) throws Exception {
+        log.info("request url: "+ url);
+
         String result = HttpUtil.get(url, encrypt(param));
         log.info("result: {}", result);
         JSONObject resultJson = JSON.parseObject(result);

+ 19 - 3
gis_web/src/main/java/com/gis/web/controller/DoorController.java

@@ -6,7 +6,10 @@ import cn.hutool.core.date.DateUtil;
 import com.gis.common.util.Result;
 import com.gis.web.dto.PageDateDto;
 import com.gis.common.util.DoorUtils;
+import com.gis.web.dto.PageDto;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.log4j.Log4j2;
 import org.junit.Test;
@@ -67,11 +70,15 @@ public class DoorController  {
 
     @ApiOperation("车辆进出日志(code:510124112006001)")
     @PostMapping("entranceCarLogList")
-    public Result entranceCarLogList(@RequestBody PageDateDto param) throws Exception {
+    public Result entranceCarLogList(@RequestBody PageDto param) throws Exception {
         String apiUrl = BASE_URL + "/bi/entranceCarLogList";
         TreeMap<String, Object> reqParam = new TreeMap<>();
         reqParam.put("code", param.getCode());
-        reqParam.put("pageSize", param.getPageSize());
+        Integer pageSize = param.getPageSize();
+        if (pageSize <= 0) {
+            pageSize = 10;
+        }
+        reqParam.put("pageSize", pageSize);
         reqParam.put("pageNo", param.getPageNum());
 
         return DoorUtils.doPost(apiUrl, reqParam);
@@ -105,6 +112,11 @@ public class DoorController  {
     /***
      * 返回数据进行了加密,需要解密
      */
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "startTime", value = "开始时间,格式:yyyy-MM-dd", dataType = "String", required = true),
+            @ApiImplicitParam(name = "endTime", value = "结束时间(不用传), ", dataType = "String")
+    })
     @ApiOperation("异常时间进出日志(指定查找0点-5点数据)")
     @PostMapping("findInOutLog")
     public Result findInOutLog(@RequestBody PageDateDto param) throws Exception {
@@ -112,7 +124,11 @@ public class DoorController  {
         TreeMap<String, Object> reqParam = new TreeMap<>();
         reqParam.put("code", param.getCode());
         reqParam.put("dateTime", param.getStartTime());
-        reqParam.put("pageSize", param.getPageSize());
+        Integer pageSize = param.getPageSize();
+        if (pageSize <= 0) {
+            pageSize = 10;
+        }
+        reqParam.put("pageSize", pageSize);
         reqParam.put("pageNo", param.getPageNum());
         return DoorUtils.doPostDecrypt(apiUrl, reqParam);
     }

+ 89 - 9
gis_web/src/main/java/com/gis/web/controller/ScreenController.java

@@ -1,11 +1,16 @@
 package com.gis.web.controller;
 
 
+import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson.JSONObject;
+import com.gis.common.deyuan.util.CommonUtil;
 import com.gis.common.deyuan.util.ResultUtils;
 import com.gis.common.util.Result;
+import com.gis.web.dto.PageDto;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.web.bind.annotation.*;
@@ -55,6 +60,21 @@ public class ScreenController  {
         return ResultUtils.doGet(apiUrl, param);
     }
 
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "code", value = "行政编码 (必传)", dataType = "String"),
+            @ApiImplicitParam(name = "labelType", value = "标签类型, residential:小区, house:房屋,proprietor:人员  ", dataType = "String")
+    })
+    @ApiOperationSupport(order=1)
+    @ApiOperation("街道概况-查询社区各类标签的使用详情")
+    @GetMapping("labelUsed/{code}/{labelType}")
+    public JSONObject labelUsed(@PathVariable String code, @PathVariable String labelType) {
+        String apiUrl = "/open/api/v1/community/label-used";
+        HashMap<String, Object> param = new HashMap<>();
+        param.put("code", code);
+        param.put("labelType", labelType);
+        return ResultUtils.doGet(apiUrl, param);
+    }
+
 
     @ApiOperationSupport(order=2)
     @ApiOperation("场景营造-社区活动")
@@ -68,7 +88,7 @@ public class ScreenController  {
     }
 
     @ApiOperationSupport(order=2)
-    @ApiOperation("场景营造-邻里交流,cityCode:460300")
+    @ApiOperation("场景营造-邻里交流,cityCode:510124112")
     @GetMapping("interFlow/{cityCode}")
     public Result interFlow(@PathVariable String cityCode) {
         String apiUrl = "/open/api/v1/community/statistics/interflow";
@@ -98,12 +118,13 @@ public class ScreenController  {
     }
 
     @ApiOperationSupport(order=2)
-    @ApiOperation("场景营造-可信生活圈:5f3de3d925892e0001e10312")
+    @ApiOperation("场景营造-可信生活圈")
     @GetMapping("businessData/{code}")
     public Result businessData(@PathVariable String code) {
         String apiUrl = "/open/api/v1/community/business-data";
         HashMap<String, Object> param = new HashMap<>();
-        param.put("group", code);
+        param.put("group", "5f3de3d925892e0001e10312");
+        param.put("cityCode", code);
 
         return ResultUtils.doGetResult(apiUrl, param);
     }
@@ -140,30 +161,89 @@ public class ScreenController  {
 
 
 
-    @ApiOperation("就业发展-就业专栏(code:510100)")
+    @ApiOperation("就业发展-就业专栏(code:510124112)")
     @GetMapping("getStatistics/{code}")
     public Result getStatistics(@PathVariable String code) {
         String apiUrl = "/open/api/v1/community/deyuan/getStatistics";
         HashMap<String, Object> param = new HashMap<>();
         param.put("cityCode", code);
+//        param.put("type", "DYNAMICTOP");
         // 商家分组编码
-        param.put("group", "5f34e07ffb01d500019698ea");
+        param.put("group", "5f3de3d925892e0001e10312");
         return Result.success(ResultUtils.doGet(apiUrl, param));
     }
 
 
-    @ApiOperation("网格治理-一键报警")
-    @GetMapping("getInfo/{code}")
-    public Result getInfo(@PathVariable String code) {
+    /**
+     * 2021-02-19
+     * @param code 行政编码
+     * @param xzLevel 行政级别
+     * @return
+     */
+    @ApiOperation("网格治理-一键报警, 510124112006:4, 510124112:3")
+    @GetMapping("getInfo/{code}/{xzLevel}")
+    public Result getInfo(@PathVariable String code, @PathVariable String xzLevel) {
         String apiUrl = "/open/api/v1/sspReportInfo/getInfo";
 
         HashMap<String, Object> param = new HashMap<>();
         param.put("xzCode", code);
-        param.put("xzLevel", "1");
+        param.put("xzLevel", xzLevel);
         param.put("topic", "111");
         return Result.success(ResultUtils.doGet(apiUrl, param));
     }
 
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "code", value = "行政编码 (必传)", dataType = "String"),
+            @ApiImplicitParam(name = "xzLevel", value = "行政级别(必传), ", dataType = "String"),
+            @ApiImplicitParam(name = "topic", value = "查询主题, DB 表示待办, YB 表示已办 (必传), ", dataType = "String")
+    })
+    @ApiOperation("网格治理-一键报警(已办/代办), 510124112006:4, 510124112:3")
+    @GetMapping("sspReportInfo/{code}/{xzLevel}/{topic}")
+    public Result sspReportInfo(@PathVariable String code, @PathVariable String xzLevel, @PathVariable String topic) {
+        String apiUrl = "/open/api/v1/sspReportInfo/getInfoList";
+
+        HashMap<String, Object> param = new HashMap<>();
+        param.put("xzCode", code);
+        param.put("xzLevel", xzLevel);
+        param.put("topic", topic);
+        return Result.success(ResultUtils.doGet(apiUrl, param));
+    }
+
+
+//    @ApiOperation("智慧门禁健康码推送")
+//    @GetMapping("health/{code}")
+//    public Result health(@PathVariable String code) {
+//        String apiUrl = "/open/api/v1/ entrance-guard/health/pull";
+//        HashMap<String, Object> param = new HashMap<>();
+//        param.put("code", code);
+//        return ResultUtils.doGetResult(apiUrl, param);
+//    }
+
+    /**
+     * 2021-02-19
+     * 新增接口
+     * @param pageDto
+     * @return
+     */
+    @ApiOperation("网格治理-走访打更")
+    @PostMapping("zfSignin/querySign")
+    public Result zfSignin(@RequestBody PageDto pageDto) {
+        String apiUrl = "/open/api/v1/zfSignin/querySign";
+        HashMap<String, Object> param = new HashMap<>();
+        param.put("townCode", pageDto.getCode());
+        Integer pageSize = pageDto.getPageSize();
+        Integer pageNum = pageDto.getPageNum();
+        if (pageSize <= 0) {
+            pageSize = 10;
+        }
+        if (pageNum <= 0) {
+            pageNum = 1;
+        }
+        param.put("size", pageSize);
+        param.put("page", pageNum);
+        return ResultUtils.doGetResult(apiUrl, param);
+    }
+