소스 검색

搜索四维看看场景时,过滤激光场景数据

wuweihao 3 년 전
부모
커밋
7e2e7075b4

+ 3 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/HttpUtils.java

@@ -1,6 +1,7 @@
 package com.gis.common.util;
 
 import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.http.HttpResponse;
 import org.apache.http.NameValuePair;
@@ -33,6 +34,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+@Slf4j
 public class HttpUtils {
 
     protected static final Logger LOGGER = LoggerFactory.getLogger(HttpUtils.class);
@@ -149,6 +151,7 @@ public class HttpUtils {
 
         // 请求体
         if (body != null) {
+            log.info("请求参数:{}", body);
             StringEntity stringEntity = new StringEntity(body.toJSONString(), "utf-8");
             stringEntity.setContentType("application/json;charset=UTF-8");
             request.setEntity(stringEntity);

+ 10 - 12
720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/WorkServiceImpl.java

@@ -79,7 +79,6 @@ public class WorkServiceImpl extends IBaseServiceImpl<WorkEntity, Long> implemen
     FileUtils fileUtils;
 
 
-
     @Override
     public IBaseMapper<WorkEntity, Long> getBaseMapper() {
         return this.entityMapper;
@@ -94,7 +93,6 @@ public class WorkServiceImpl extends IBaseServiceImpl<WorkEntity, Long> implemen
     }
 
 
-
     /**
      * 目前只是用来保存密码, 也可以使用保存实体信息
      */
@@ -115,7 +113,6 @@ public class WorkServiceImpl extends IBaseServiceImpl<WorkEntity, Long> implemen
     }
 
 
-
     @Override
     public Result<WorkEntity> entityAdd() {
         WorkEntity entity = new WorkEntity();
@@ -134,12 +131,11 @@ public class WorkServiceImpl extends IBaseServiceImpl<WorkEntity, Long> implemen
         } else {
             // 获取文件内容
             log.info("创建someData.json");
-            content  = FileUtils.getResourceContent("data/someData.json");
+            content = FileUtils.getResourceContent("data/someData.json");
             FileUtil.writeUtf8String(content, baseSomeDataPath);
         }
 
 
-
         Long id = entity.getId();
 
         JSONObject jsonObject = JSONObject.parseObject(content);
@@ -261,7 +257,7 @@ public class WorkServiceImpl extends IBaseServiceImpl<WorkEntity, Long> implemen
 
         log.info("更新作品完成");
         // 保存someData.json
-        editSomeData( param);
+        editSomeData(param);
 
         return Result.success();
     }
@@ -272,7 +268,6 @@ public class WorkServiceImpl extends IBaseServiceImpl<WorkEntity, Long> implemen
     private boolean editEntity(SomeDataDto param, WorkEntity entity) {
 
 
-
         String someData = param.getSomeData();
         JSONObject sd = JSONObject.parseObject(someData);
         entity.setName(sd.getString("name"));
@@ -301,8 +296,10 @@ public class WorkServiceImpl extends IBaseServiceImpl<WorkEntity, Long> implemen
 
     }
 
-    /** 更新二维码 */
-    private Boolean updateQrCode(Long id, String logoUrl){
+    /**
+     * 更新二维码
+     */
+    private Boolean updateQrCode(Long id, String logoUrl) {
 
         // 网络下载logo图片
         logoUrl = logoUrl + "?m=" + System.currentTimeMillis();
@@ -349,7 +346,6 @@ public class WorkServiceImpl extends IBaseServiceImpl<WorkEntity, Long> implemen
     public Result select4dkk(PageDto param, Long workId) {
         startPage(param);
 
-//        String url = "https://test.4dkankan.com/api/user/scene/list";
         String url = configConstant.domain4dKK + "/api/user/scene/list";
         JSONObject reqParam = new JSONObject();
         reqParam.put("pageNum", param.getPageNum().toString());
@@ -357,6 +353,8 @@ public class WorkServiceImpl extends IBaseServiceImpl<WorkEntity, Long> implemen
         reqParam.put("searchKey", param.getSearchKey());
         // type=11, 计算成功的场景
         reqParam.put("type", "11");
+        // 2022-2-10 excludeSceneSource=4, 过滤激光场景数据
+        reqParam.put("excludeSceneSource", 4);
 
         HashMap<String, String> headers = new HashMap<>();
         String token = getToken();
@@ -367,6 +365,7 @@ public class WorkServiceImpl extends IBaseServiceImpl<WorkEntity, Long> implemen
         String restResult = null;
         JSONObject reJson = null;
         try {
+
             HttpResponse httpResponse = HttpUtils.doPost(url, headers, reqParam);
             restResult = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
             log.debug("restResult: " + restResult);
@@ -388,8 +387,7 @@ public class WorkServiceImpl extends IBaseServiceImpl<WorkEntity, Long> implemen
                 return Result.failure(msg);
             }
 
-            JSONObject dataJson = reJson.getJSONObject("data");
-                    } catch (Exception e) {
+        } catch (Exception e) {
             e.printStackTrace();
         }