From 718d62b2bd5df79cd130514f5aa6a77a7e26d93f Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 17 七月 2024 09:18:49 +0800
Subject: [PATCH] 提交

---
 server/web/src/main/java/com/doumee/api/web/CommonApi.java                                       |   12 ++++++
 server/web/src/main/java/com/doumee/api/web/ApiController.java                                   |    2 -
 server/service/src/main/java/com/doumee/biz/zbom/ZbomZhongTaiService.java                        |    1 
 server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java               |   22 +++++++++++
 server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTAreaTreeResponse.java |   43 +++++++++++++++++++++
 server/web/src/main/java/com/doumee/api/web/CatalogApi.java                                      |    1 
 server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTConstants.java                 |    5 ++
 7 files changed, 83 insertions(+), 3 deletions(-)

diff --git a/server/service/src/main/java/com/doumee/biz/zbom/ZbomZhongTaiService.java b/server/service/src/main/java/com/doumee/biz/zbom/ZbomZhongTaiService.java
index 9851db4..765c74e 100644
--- a/server/service/src/main/java/com/doumee/biz/zbom/ZbomZhongTaiService.java
+++ b/server/service/src/main/java/com/doumee/biz/zbom/ZbomZhongTaiService.java
@@ -33,6 +33,7 @@
     ZTBasePageResponse<ZTContentListResponse> pageLikeList(ZTContentListRequest param);
     ZTBasePageResponse<ZTBehaviorInfoResponse> pageBehavoirList(ZTContentListRequest param);
     List<ZTAreaInfoResponse> getAreaList(ZTAreaListRequest param);
+    List<ZTAreaTreeResponse> getAreaTreeList(ZTAreaListRequest param);
     boolean bindCustomerFavorites(ZTBindCusFavoriteDoRequest param);
     ZSZXCatalogResponse getZSZXCatalogs();
     ZTBasePageResponse<ZTCusFavoritesInfoResponse> pageCusFavoriteList(ZTContentListRequest param);
diff --git a/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java b/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java
index 07eaea0..5001973 100644
--- a/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java
@@ -387,6 +387,28 @@
         }
         return  null;
     }
+    /**
+     * 鑾峰彇鑾峰彇鐪佸競鍖洪泦鍚�
+     * @param param
+     * @return
+     */
+    @Override
+    public List<ZTAreaTreeResponse> getAreaTreeList(ZTAreaListRequest param){
+       if(StringUtils.isBlank(param.getPid())){
+           param.setPid(ZTConstants.DEFAULT_PID);//榛樿鍙栧叏閮ㄧ渷浠�
+       }
+        ZTBaseResponse<List<ZTAreaTreeResponse>> result = sendHttpRequest(
+                ZTConstants.IntegerUrl.AREA_TREE_URL,
+                ZTConstants.IntegerName.AREA_TREE_NAME,
+                param.getToken(),
+                param.getUserType(),
+                JSONObject.toJSONString(param ),
+                new TypeReference<ZTBaseResponse<List<ZTAreaTreeResponse>>>(){});
+        if(result!=null){
+            return result.getData();
+        }
+        return  null;
+    }
 
 
     public   <T>   ZTBaseResponse<T> sendHttpRequest(String url,String name,String token,String userType,String param,TypeReference<ZTBaseResponse<T>> typeReference){
diff --git a/server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTConstants.java b/server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTConstants.java
index abedc76..8ddcaee 100644
--- a/server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTConstants.java
+++ b/server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTConstants.java
@@ -39,6 +39,8 @@
         String COLLECT_LIST_URL ="/behavior/getFavorite";
         String LIKE_LIST_URL ="/behavior/getLike";
         String AREA_LIST_URL ="/base/admin/bAreaRegion/getChildren";
+        String AREA_TREE_URL ="/base/admin/bAreaRegion/getTree";
+        String AREA_ALL_URL ="/base/admin/bAreaRegion/getNotTree";
         String BIND_CUSTOMER_FAVORITES_URL ="/behavior/api/bindCustomerFavorites";
         String CUSTOMER_FAVORITES_LIST_URL ="/behavior/api/customerFavorites";
         String BEHAVIOR_LIST_URL ="/behavior/api/customerBehaviors";
@@ -61,5 +63,8 @@
         String BIND_CUSTOMER_FAVORITES_NAME  ="缁戝畾瀹㈡埛鍠滄";
         String CUSTOMER_FAVORITES_LIST_NAME  ="鑾峰彇瀹㈡埛鍠滄";
         String BEHAVIOR_LIST_NAME  ="鑾峰彇琛屼负杞ㄨ抗";
+
+        String AREA_TREE_NAME ="鍏ㄩ噺鐪佸競鍖烘爲褰㈡暟鎹�";
+        String AREA_ALL_NAME ="鍏ㄩ噺鐪佸競鍖鸿瘎绾ф暟鎹�";
     }
 }
diff --git a/server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTAreaTreeResponse.java b/server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTAreaTreeResponse.java
new file mode 100644
index 0000000..5c91553
--- /dev/null
+++ b/server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTAreaTreeResponse.java
@@ -0,0 +1,43 @@
+package com.doumee.biz.zbom.model.zhongtai.response;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+ * 鐪佸競鍖鸿鎯呰繑鍥�
+ */
+@Data
+public class ZTAreaTreeResponse implements Serializable {
+
+
+    /**
+     * ID
+     */
+    private String id;
+    /**
+     * 鍦板尯绛夌骇
+     */
+    private String level;
+    /**
+     * 鍚嶇О
+     */
+    private String name;
+    /**
+     * 鐖剁骇ID
+     */
+    private String parentId;
+    /**
+     * 鎷奸煶
+     */
+    private String pinyin;
+    /**
+     * 涓夌淮瀹剁紪鐮�
+     */
+    private String swjCode;
+
+    List<ZTAreaTreeResponse>  children;
+
+}
diff --git a/server/web/src/main/java/com/doumee/api/web/ApiController.java b/server/web/src/main/java/com/doumee/api/web/ApiController.java
index 969c732..64e7118 100644
--- a/server/web/src/main/java/com/doumee/api/web/ApiController.java
+++ b/server/web/src/main/java/com/doumee/api/web/ApiController.java
@@ -42,7 +42,6 @@
         return request;
     }
 
-
     /**
      * 鑾峰彇鐢ㄦ埛ID
      *
@@ -75,7 +74,6 @@
         Member user = memberService.findById(userId);
       return user;
     }
-
 
     protected Long getUserType() {
         Object obj = this.getRequest().getAttribute(JwtTokenUtil.UserType);
diff --git a/server/web/src/main/java/com/doumee/api/web/CatalogApi.java b/server/web/src/main/java/com/doumee/api/web/CatalogApi.java
index 5926997..7d1264f 100644
--- a/server/web/src/main/java/com/doumee/api/web/CatalogApi.java
+++ b/server/web/src/main/java/com/doumee/api/web/CatalogApi.java
@@ -36,7 +36,6 @@
     @Autowired
     public SmsEmailService smsEmailService;
 
-
     @ApiOperation(value = "C绔皬绋嬪簭-鑾峰彇棣栭〉蹇楄瑁呬慨鍥涗釜妯″潡绫荤洰鏁版嵁", notes = "鑾峰彇棣栭〉蹇楄瑁呬慨鍥涗釜妯″潡绫荤洰鏁版嵁")
     @PostMapping("/getZSZXCatalogs")
     public ApiResponse<ZSZXCatalogResponse> getZSZXCatalogs() {
diff --git a/server/web/src/main/java/com/doumee/api/web/CommonApi.java b/server/web/src/main/java/com/doumee/api/web/CommonApi.java
index 3404a88..baf7a6c 100644
--- a/server/web/src/main/java/com/doumee/api/web/CommonApi.java
+++ b/server/web/src/main/java/com/doumee/api/web/CommonApi.java
@@ -4,6 +4,7 @@
 import com.doumee.biz.zbom.ZbomZhongTaiService;
 import com.doumee.biz.zbom.model.zhongtai.ZTAreaListRequest;
 import com.doumee.biz.zbom.model.zhongtai.response.ZTAreaInfoResponse;
+import com.doumee.biz.zbom.model.zhongtai.response.ZTAreaTreeResponse;
 import com.doumee.config.annotation.LoginRequired;
 import com.doumee.core.annotation.trace.Trace;
 import com.doumee.core.model.ApiResponse;
@@ -56,6 +57,17 @@
     }
 
 
+    @ApiOperation(value = "鑾峰彇鍖哄垝鍏ㄩ噺鏍戝舰淇℃伅", notes = "瀹㈡埛绔皬绋嬪簭")
+    @PostMapping("/getAreaTree")
+    public ApiResponse<List<ZTAreaTreeResponse>> getAreaTree(@RequestBody ZTAreaListRequest ztAreaListRequest) {
+        if(StringUtils.isBlank(ztAreaListRequest.getPid())){
+            ztAreaListRequest.setPid("1");
+        }
+        List<ZTAreaTreeResponse> ztAreaInfoResponses =  zbomZhongTaiService.getAreaTreeList(ztAreaListRequest);
+        return  ApiResponse.success(ztAreaInfoResponses);
+    }
+
+
 
 
 

--
Gitblit v1.9.3