Przeglądaj źródła

完成点位评估(v1.0)

JensionDzero 1 rok temu
rodzic
commit
0695b15cc6
66 zmienionych plików z 1247 dodań i 132 usunięć
  1. 21 0
      benyun-core/src/main/java/com/benyun/core/constant/RedisContant.java
  2. 1 5
      benyun-core/src/main/java/com/benyun/core/controller/ChannelMapController.java
  3. 64 0
      benyun-core/src/main/java/com/benyun/core/controller/TopologicalBuildWdController.java
  4. 31 0
      benyun-core/src/main/java/com/benyun/core/controller/TopologicalCommonController.java
  5. 44 0
      benyun-core/src/main/java/com/benyun/core/controller/TopologicalEnterpriseWdController.java
  6. 65 0
      benyun-core/src/main/java/com/benyun/core/controller/TopologicalHouseWdController.java
  7. 66 0
      benyun-core/src/main/java/com/benyun/core/controller/TopologicalStoreWdController.java
  8. 9 0
      benyun-core/src/main/java/com/benyun/core/dao/ManageTypeDao.java
  9. 4 1
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalBuildWdDao.java
  10. 14 0
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalBuildWdStatisticsCategoryDao.java
  11. 5 1
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalEnterpriseWdDao.java
  12. 5 1
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalHouseWdDao.java
  13. 14 0
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalHouseWdStatisticsDataDao.java
  14. 6 1
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalStoreWdDao.java
  15. 15 0
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalStoreWdStatisticsCategoryDao.java
  16. 2 1
      benyun-core/src/main/java/com/benyun/core/dao/WdTopologicalDao.java
  17. 14 0
      benyun-core/src/main/java/com/benyun/core/dao/WdTopologicalInfoDao.java
  18. 2 1
      benyun-core/src/main/java/com/benyun/core/entity/BuildWd.java
  19. 2 1
      benyun-core/src/main/java/com/benyun/core/entity/EnterpriseWd.java
  20. 2 1
      benyun-core/src/main/java/com/benyun/core/entity/HouseWd.java
  21. 20 0
      benyun-core/src/main/java/com/benyun/core/entity/ManageType.java
  22. 2 1
      benyun-core/src/main/java/com/benyun/core/entity/StoreWd.java
  23. 1 1
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalBuildWdStatisticsCategory.java
  24. 1 2
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalBuildingWd.java
  25. 1 1
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalEnterpriseWd.java
  26. 2 1
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalHouseWd.java
  27. 1 1
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalHouseWdStatisticsData.java
  28. 3 0
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalStoreWd.java
  29. 1 1
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalStoreWdStatisticsCategory.java
  30. 15 10
      benyun-core/src/main/java/com/benyun/core/entity/WdTopologicalInfo.java
  31. 10 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BuildWdCategoryCount.java
  32. 16 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/StoreWdCategoryCount.java
  33. 12 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/StoreWdCategoryCountBody.java
  34. 1 1
      benyun-core/src/main/java/com/benyun/core/entity/bo/WdCount.java
  35. 1 1
      benyun-core/src/main/java/com/benyun/core/entity/bo/WdCountBody.java
  36. 34 0
      benyun-core/src/main/java/com/benyun/core/entity/vo/TopologicalWdAceeptVo.java
  37. 15 3
      benyun-core/src/main/java/com/benyun/core/init/BenyunCoreInit.java
  38. 1 2
      benyun-core/src/main/java/com/benyun/core/service/ChannelMapService.java
  39. 11 0
      benyun-core/src/main/java/com/benyun/core/service/ManageTypeService.java
  40. 13 0
      benyun-core/src/main/java/com/benyun/core/service/TopologicalBuildWdSerevice.java
  41. 10 0
      benyun-core/src/main/java/com/benyun/core/service/TopologicalCommonService.java
  42. 9 0
      benyun-core/src/main/java/com/benyun/core/service/TopologicalEnterpriseWdService.java
  43. 16 0
      benyun-core/src/main/java/com/benyun/core/service/TopologicalHouseWdService.java
  44. 15 0
      benyun-core/src/main/java/com/benyun/core/service/TopologicalStoreWdService.java
  45. 229 78
      benyun-core/src/main/java/com/benyun/core/service/impl/AnalyseWdServiceImpl.java
  46. 3 3
      benyun-core/src/main/java/com/benyun/core/service/impl/ChannelMapServiceImpl.java
  47. 29 0
      benyun-core/src/main/java/com/benyun/core/service/impl/ManageTypeServiceImpl.java
  48. 70 0
      benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalBuildWdSereviceImpl.java
  49. 42 0
      benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalCommonServiceImpl.java
  50. 29 0
      benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalEnterpriseWdServiceImpl.java
  51. 43 0
      benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalHouseServiceWdImpl.java
  52. 89 0
      benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalStoreWdServiceImpl.java
  53. 2 3
      benyun-core/src/main/java/com/benyun/core/service/impl/WdTopologicalServiceImpl.java
  54. 4 0
      benyun-core/src/main/java/com/benyun/core/valida/TopologicalWdGroup.java
  55. 4 0
      benyun-core/src/main/java/com/benyun/core/valida/TopologicalWdListGroup.java
  56. 12 3
      benyun-core/src/main/resources/application-dev.yaml
  57. 5 1
      benyun-core/src/main/resources/mapper/TopologicalBuildWdDao.xml
  58. 12 0
      benyun-core/src/main/resources/mapper/TopologicalBuildWdStatisticsCategoryDao.xml
  59. 6 1
      benyun-core/src/main/resources/mapper/TopologicalEnterpriseWdDao.xml
  60. 6 1
      benyun-core/src/main/resources/mapper/TopologicalHouseWdDao.xml
  61. 12 0
      benyun-core/src/main/resources/mapper/TopologicalHouseWdStatisticsDataDao.xml
  62. 7 1
      benyun-core/src/main/resources/mapper/TopologicalStoreWdDao.xml
  63. 16 0
      benyun-core/src/main/resources/mapper/TopologicalStoreWdStatisticsCategoryDao.xml
  64. 12 0
      benyun-core/src/main/resources/mapper/WdTopologicalInfoDao.xml
  65. 16 0
      benyun-core/src/test/java/com/benyun/core/service/AnalyseWdServiceImplTest.java
  66. 2 3
      benyun-core/src/test/java/com/benyun/core/service/ChannelMapServiceImplTest.java

+ 21 - 0
benyun-core/src/main/java/com/benyun/core/constant/RedisContant.java

@@ -9,4 +9,25 @@ public class RedisContant {
     public static String CHANNEL_MAP_POINT = "channel_point"; //保存渠道地图point数据的Hash名
 
     public static int CHANNEL_MAP_POINT_TIME = 30;  //渠道地图point数据的超时时间
+
+
+    public static String TOPOLOGICAL_STORE_WD_LIST = "topological_store_wd_list";
+
+    public static int TOPOLOGICAL_STORE_WD_LIST_TIME = 30;
+
+    public static String TOPOLOGICAL_STORE_WD_CATEGORY = "topological_store_wd_category";
+
+    public static int TOPOLOGICAL_STORE_WD_CATEGORY_TIME = 30;
+
+    public static String TOPOLOGICAL_BUILD_WD_LIST = "topological_build_wd_list";
+    public static int TOPOLOGICAL_BUILD_WD_LIST_TIME = 30;
+    public static String TOPOLOGICAL_BUILD_WD_CATEGORY= "topological_build_wd_category";
+    public static int TOPOLOGICAL_BUILD_WD_CATEGORY_TIME = 30;
+
+    public static String TOPOLOGICAL_ENTERPRISE_WD_LIST = "topological_enterprise_wd_list";
+    public static int TOPOLOGICAL_ENTERPRISE_WD_LIST_TIME = 30;
+    public static String TOPOLOGICAL_HOUSE_WD_LIST = "topological_house_wd_list";
+    public static int TOPOLOGICAL_HOUSE_WD_LIST_TIME = 30;
+    public static String TOPOLOGICAL_HOUSE_WD_INFO = "topological_house_wd_info";
+    public static int TOPOLOGICAL_HOUSE_WD_INFO_TIME = 30;
 }

+ 1 - 5
benyun-core/src/main/java/com/benyun/core/controller/ChannelMapController.java

@@ -1,12 +1,10 @@
 package com.benyun.core.controller;
 
-import com.benyun.core.constant.ChannelMapContant;
 import com.benyun.core.constant.RedisContant;
-import com.benyun.core.entity.WdCount;
+import com.benyun.core.entity.bo.WdCount;
 import com.benyun.core.entity.WdInfo;
 import com.benyun.core.entity.vo.ChannelMapAceeptVo;
 import com.benyun.core.service.ChannelMapService;
-import com.benyun.core.utils.HashUtil;
 import com.benyun.core.valida.ChannelAreaGroup;
 import com.benyun.core.valida.ChannelListGroup;
 import com.benyun.core.valida.ChannelPointGroup;
@@ -18,8 +16,6 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
 import java.util.Arrays;
 import java.util.concurrent.TimeUnit;
 

+ 64 - 0
benyun-core/src/main/java/com/benyun/core/controller/TopologicalBuildWdController.java

@@ -0,0 +1,64 @@
+package com.benyun.core.controller;
+
+import com.benyun.core.constant.RedisContant;
+import com.benyun.core.entity.TopologicalBuildingWd;
+import com.benyun.core.entity.bo.BuildWdCategoryCount;
+import com.benyun.core.entity.bo.WdCount;
+import com.benyun.core.entity.vo.TopologicalWdAceeptVo;
+import com.benyun.core.service.TopologicalBuildWdSerevice;
+import com.benyun.core.valida.TopologicalWdGroup;
+import com.benyun.core.valida.TopologicalWdListGroup;
+import com.github.pagehelper.PageInfo;
+import com.ruoyi.common.core.domain.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+@RestController
+@RequestMapping("/poi/topologicalBuildWd")
+public class TopologicalBuildWdController {
+    @Autowired
+    TopologicalBuildWdSerevice topologicalBuildWdSerevice;
+
+    @Autowired
+    RedisTemplate redisTemplate;
+
+    @RequestMapping("/buildingLevel")
+    public R buildingLevel(@Validated(value = {TopologicalWdGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
+        String md5 = topologicalWdAceeptVo.getHash();
+        //2.查看redis中是否存在有缓存
+        List<BuildWdCategoryCount> wdCount = (List<BuildWdCategoryCount>) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_BUILD_WD_CATEGORY).get(md5);
+        if (wdCount != null) {
+            return R.ok(wdCount);
+        }
+
+        List<BuildWdCategoryCount> list = topologicalBuildWdSerevice.buildingLevel(topologicalWdAceeptVo);
+
+        redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_BUILD_WD_CATEGORY).put(md5,list);
+        redisTemplate.expire(RedisContant.TOPOLOGICAL_BUILD_WD_CATEGORY,RedisContant.TOPOLOGICAL_BUILD_WD_CATEGORY_TIME, TimeUnit.MINUTES); //30分钟
+
+        return R.ok(list);
+    }
+
+    @RequestMapping("/list")
+    public R list(@Validated(value = {TopologicalWdListGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
+        String md5 = topologicalWdAceeptVo.getHash();
+        //2.查看redis中是否存在有缓存
+        PageInfo<TopologicalBuildingWd> wdCount = (PageInfo<TopologicalBuildingWd> )redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_BUILD_WD_LIST).get(md5);
+        if (wdCount != null) {
+            return R.ok(wdCount);
+        }
+
+        PageInfo<TopologicalBuildingWd> list = topologicalBuildWdSerevice.list(topologicalWdAceeptVo);
+
+        redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_BUILD_WD_LIST).put(md5,list);
+        redisTemplate.expire(RedisContant.TOPOLOGICAL_BUILD_WD_LIST,RedisContant.TOPOLOGICAL_BUILD_WD_LIST_TIME, TimeUnit.MINUTES); //30分钟
+
+        return R.ok(list);
+    }
+}

+ 31 - 0
benyun-core/src/main/java/com/benyun/core/controller/TopologicalCommonController.java

@@ -0,0 +1,31 @@
+package com.benyun.core.controller;
+
+import com.benyun.core.entity.WdInfo;
+import com.benyun.core.service.TopologicalCommonService;
+import com.ruoyi.common.core.domain.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+
+@RestController
+@RequestMapping("/poi/common")
+public class TopologicalCommonController {
+    @Autowired
+    TopologicalCommonService topologicalCommonService;
+    @RequestMapping("/prefixSearch")
+    public R prefixSearch(String searchText){
+        List<WdInfo> wdInfos = topologicalCommonService.prefixSearch(searchText);
+        return R.ok(wdInfos);
+    }
+    @RequestMapping("/range")
+    public R range(){
+        HashMap hashMap = new HashMap<>();
+        hashMap.put("500m",500);
+        hashMap.put("1km",1000);
+        hashMap.put("2km",2000);
+        return R.ok(hashMap);
+    }
+}

+ 44 - 0
benyun-core/src/main/java/com/benyun/core/controller/TopologicalEnterpriseWdController.java

@@ -0,0 +1,44 @@
+package com.benyun.core.controller;
+
+import com.benyun.core.constant.RedisContant;
+import com.benyun.core.entity.TopologicalEnterpriseWd;
+import com.benyun.core.entity.bo.WdCount;
+import com.benyun.core.entity.vo.TopologicalWdAceeptVo;
+import com.benyun.core.service.TopologicalEnterpriseWdService;
+import com.benyun.core.valida.TopologicalWdListGroup;
+import com.github.pagehelper.PageInfo;
+import com.ruoyi.common.core.domain.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.concurrent.TimeUnit;
+
+@RestController
+@RequestMapping("/poi/topologicalEnterpriseWd")
+public class TopologicalEnterpriseWdController {
+    @Autowired
+    TopologicalEnterpriseWdService topologicalEnterpriseWdService;
+
+    @Autowired
+    RedisTemplate redisTemplate;
+
+    @RequestMapping("/list")
+    public R list(@Validated(value = {TopologicalWdListGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
+        String md5 = topologicalWdAceeptVo.getHash();
+        //2.查看redis中是否存在有缓存
+        PageInfo<TopologicalEnterpriseWd>  wdCount = (PageInfo<TopologicalEnterpriseWd> ) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_ENTERPRISE_WD_LIST).get(md5);
+        if (wdCount != null) {
+            return R.ok(wdCount);
+        }
+
+        PageInfo<TopologicalEnterpriseWd> list = topologicalEnterpriseWdService.list(topologicalWdAceeptVo);
+
+        redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_ENTERPRISE_WD_LIST).put(md5,list);
+        redisTemplate.expire(RedisContant.TOPOLOGICAL_ENTERPRISE_WD_LIST,RedisContant.TOPOLOGICAL_ENTERPRISE_WD_LIST_TIME, TimeUnit.MINUTES); //30分钟
+
+        return R.ok(list);
+    }
+}

+ 65 - 0
benyun-core/src/main/java/com/benyun/core/controller/TopologicalHouseWdController.java

@@ -0,0 +1,65 @@
+package com.benyun.core.controller;
+
+import com.benyun.core.constant.RedisContant;
+import com.benyun.core.entity.TopologicalHouseWd;
+import com.benyun.core.entity.TopologicalHouseWdStatisticsData;
+import com.benyun.core.entity.bo.WdCount;
+import com.benyun.core.entity.vo.TopologicalWdAceeptVo;
+import com.benyun.core.service.TopologicalHouseWdService;
+import com.benyun.core.valida.TopologicalWdGroup;
+import com.benyun.core.valida.TopologicalWdListGroup;
+import com.github.pagehelper.PageInfo;
+import com.ruoyi.common.core.domain.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.concurrent.TimeUnit;
+
+@RestController
+@RequestMapping("/poi/topologicalHouseWd")
+public class TopologicalHouseWdController {
+    @Autowired
+    TopologicalHouseWdService topologicalHouseWdService;
+
+    @Autowired
+    RedisTemplate redisTemplate;
+
+    @RequestMapping("/info")
+    public R info(@Validated(value = {TopologicalWdGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
+        String md5 = topologicalWdAceeptVo.getHash();
+        //2.查看redis中是否存在有缓存
+        TopologicalHouseWdStatisticsData wdCount = (TopologicalHouseWdStatisticsData) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_HOUSE_WD_INFO).get(md5);
+        if (wdCount != null) {
+            return R.ok(wdCount);
+        }
+
+
+        TopologicalHouseWdStatisticsData info = topologicalHouseWdService.info(topologicalWdAceeptVo);
+
+        redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_HOUSE_WD_INFO).put(md5,info);
+        redisTemplate.expire(RedisContant.TOPOLOGICAL_HOUSE_WD_INFO,RedisContant.TOPOLOGICAL_HOUSE_WD_INFO_TIME, TimeUnit.MINUTES); //30分钟
+
+
+        return R.ok(info);
+    }
+
+    @RequestMapping("/list")
+    public R list(@Validated(value = {TopologicalWdListGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
+        String md5 = topologicalWdAceeptVo.getHash();
+        //2.查看redis中是否存在有缓存
+        PageInfo<TopologicalHouseWd> wdCount = (PageInfo<TopologicalHouseWd>) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_HOUSE_WD_LIST).get(md5);
+        if (wdCount != null) {
+            return R.ok(wdCount);
+        }
+
+        PageInfo<TopologicalHouseWd> list = topologicalHouseWdService.list(topologicalWdAceeptVo);
+
+        redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_HOUSE_WD_LIST).put(md5,list);
+        redisTemplate.expire(RedisContant.TOPOLOGICAL_HOUSE_WD_LIST,RedisContant.TOPOLOGICAL_HOUSE_WD_LIST_TIME, TimeUnit.MINUTES); //30分钟
+
+        return R.ok(list);
+    }
+}

+ 66 - 0
benyun-core/src/main/java/com/benyun/core/controller/TopologicalStoreWdController.java

@@ -0,0 +1,66 @@
+package com.benyun.core.controller;
+
+import com.benyun.core.constant.RedisContant;
+import com.benyun.core.entity.TopologicalStoreWd;
+import com.benyun.core.entity.bo.StoreWdCategoryCountBody;
+import com.benyun.core.entity.bo.WdCount;
+import com.benyun.core.entity.vo.TopologicalWdAceeptVo;
+import com.benyun.core.service.TopologicalStoreWdService;
+import com.benyun.core.valida.TopologicalWdGroup;
+import com.benyun.core.valida.TopologicalWdListGroup;
+import com.github.pagehelper.PageInfo;
+import com.ruoyi.common.core.domain.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+@RestController
+@RequestMapping("/poi/topologicalStoreWd")
+public class TopologicalStoreWdController {
+
+    @Autowired
+    TopologicalStoreWdService topologicalStoreWdService;
+
+    @Autowired
+    RedisTemplate redisTemplate;
+
+    @RequestMapping("/category")
+    public R category(@Validated(value = {TopologicalWdGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
+        String md5 = topologicalWdAceeptVo.getHash();
+        //2.查看redis中是否存在有缓存
+        List<StoreWdCategoryCountBody> wdCount = (List<StoreWdCategoryCountBody>) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_STORE_WD_CATEGORY).get(md5);
+        if (wdCount != null) {
+            return R.ok(wdCount);
+        }
+
+        List<StoreWdCategoryCountBody> category = topologicalStoreWdService.category(topologicalWdAceeptVo);
+
+        redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_STORE_WD_CATEGORY).put(md5,category);
+        redisTemplate.expire(RedisContant.TOPOLOGICAL_STORE_WD_CATEGORY,RedisContant.TOPOLOGICAL_STORE_WD_CATEGORY_TIME, TimeUnit.MINUTES); //30分钟
+
+        return R.ok(category);
+    }
+
+    @RequestMapping("/list")
+    public R list(@Validated(value = {TopologicalWdListGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
+        String md5 = topologicalWdAceeptVo.getHash();
+        //2.查看redis中是否存在有缓存
+        PageInfo<TopologicalStoreWd> wdCount = (PageInfo<TopologicalStoreWd>) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_STORE_WD_LIST).get(md5);
+        if (wdCount != null) {
+            return R.ok(wdCount);
+        }
+
+
+        PageInfo<TopologicalStoreWd> list = topologicalStoreWdService.list(topologicalWdAceeptVo);
+
+        redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_STORE_WD_LIST).put(md5,list);
+        redisTemplate.expire(RedisContant.TOPOLOGICAL_STORE_WD_LIST,RedisContant.TOPOLOGICAL_STORE_WD_LIST_TIME, TimeUnit.MINUTES); //30分钟
+
+        return R.ok(list);
+    }
+}

+ 9 - 0
benyun-core/src/main/java/com/benyun/core/dao/ManageTypeDao.java

@@ -0,0 +1,9 @@
+package com.benyun.core.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.benyun.core.entity.ManageType;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ManageTypeDao extends BaseMapper<ManageType> {
+}

+ 4 - 1
benyun-core/src/main/java/com/benyun/core/dao/TopologicalBuildWdDao.java

@@ -2,12 +2,15 @@ package com.benyun.core.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.benyun.core.entity.TopologicalBuildingWd;
+import com.benyun.core.entity.TopologicalStoreWd;
 import com.benyun.core.entity.WdTopological;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 @Mapper
 public interface TopologicalBuildWdDao extends BaseMapper<TopologicalBuildingWd> {
-    public void insertList(List<TopologicalBuildingWd> topologicalBuildingWds);
+    public void insertList(@Param("topologicalBuildingWds") List<TopologicalBuildingWd> topologicalBuildingWds);
+    List<TopologicalBuildingWd> list(@Param("centerWdId") String centerWdId, @Param("radius") int radius);
 }

+ 14 - 0
benyun-core/src/main/java/com/benyun/core/dao/TopologicalBuildWdStatisticsCategoryDao.java

@@ -0,0 +1,14 @@
+package com.benyun.core.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.benyun.core.entity.TopologicalBuildWdStatisticsCategory;
+import com.benyun.core.entity.TopologicalEnterpriseWd;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface TopologicalBuildWdStatisticsCategoryDao extends BaseMapper<TopologicalBuildWdStatisticsCategory> {
+    public void insertList(@Param("topologicalBuildWdStatisticsCategoryList")List<TopologicalBuildWdStatisticsCategory> topologicalBuildWdStatisticsCategoryList);
+}

+ 5 - 1
benyun-core/src/main/java/com/benyun/core/dao/TopologicalEnterpriseWdDao.java

@@ -3,11 +3,15 @@ package com.benyun.core.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.benyun.core.entity.TopologicalBuildingWd;
 import com.benyun.core.entity.TopologicalEnterpriseWd;
+import com.benyun.core.entity.TopologicalStoreWd;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 @Mapper
 public interface TopologicalEnterpriseWdDao extends BaseMapper<TopologicalEnterpriseWd> {
-    public void insertList(List<TopologicalEnterpriseWd> topologicalEnterpriseWds);
+    public void insertList(@Param("topologicalEnterpriseWds") List<TopologicalEnterpriseWd> topologicalEnterpriseWds);
+
+    List<TopologicalEnterpriseWd> list(@Param("centerWdId") String centerWdId, @Param("radius") int radius);
 }

+ 5 - 1
benyun-core/src/main/java/com/benyun/core/dao/TopologicalHouseWdDao.java

@@ -2,11 +2,15 @@ package com.benyun.core.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.benyun.core.entity.TopologicalHouseWd;
+import com.benyun.core.entity.TopologicalStoreWd;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 @Mapper
 public interface TopologicalHouseWdDao extends BaseMapper<TopologicalHouseWd> {
-    public void insertList(List<TopologicalHouseWd> topologicalHouseWds);
+    public void insertList(@Param("topologicalHouseWds") List<TopologicalHouseWd> topologicalHouseWds);
+
+    List<TopologicalHouseWd> list(@Param("centerWdId") String centerWdId, @Param("radius") int radius);
 }

+ 14 - 0
benyun-core/src/main/java/com/benyun/core/dao/TopologicalHouseWdStatisticsDataDao.java

@@ -0,0 +1,14 @@
+package com.benyun.core.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.benyun.core.entity.TopologicalBuildWdStatisticsCategory;
+import com.benyun.core.entity.TopologicalHouseWdStatisticsData;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface TopologicalHouseWdStatisticsDataDao extends BaseMapper<TopologicalHouseWdStatisticsData> {
+    public void insertList(@Param("topologicalHouseWdStatisticsDataList")List<TopologicalHouseWdStatisticsData> topologicalHouseWdStatisticsDataList);
+}

+ 6 - 1
benyun-core/src/main/java/com/benyun/core/dao/TopologicalStoreWdDao.java

@@ -3,11 +3,16 @@ package com.benyun.core.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.benyun.core.entity.TopologicalBuildingWd;
 import com.benyun.core.entity.TopologicalStoreWd;
+import com.benyun.core.entity.TopologicalStoreWdStatisticsCategory;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 @Mapper
 public interface TopologicalStoreWdDao extends BaseMapper<TopologicalStoreWd> {
-    public void insertList(List<TopologicalStoreWd> topologicalStoreWds);
+    public void insertList(@Param("topologicalStoreWds")List<TopologicalStoreWd> topologicalStoreWds);
+
+    List<TopologicalStoreWd> list(@Param("centerWdId") String centerWdId,@Param("radius") int radius);
+
 }

+ 15 - 0
benyun-core/src/main/java/com/benyun/core/dao/TopologicalStoreWdStatisticsCategoryDao.java

@@ -0,0 +1,15 @@
+package com.benyun.core.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.benyun.core.entity.TopologicalBuildWdStatisticsCategory;
+import com.benyun.core.entity.TopologicalStoreWdStatisticsCategory;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface TopologicalStoreWdStatisticsCategoryDao extends BaseMapper<TopologicalStoreWdStatisticsCategory> {
+    public void insertList(@Param("topologicalStoreWdStatisticsCategoryList")List<TopologicalStoreWdStatisticsCategory> topologicalStoreWdStatisticsCategoryList);
+    List<TopologicalStoreWdStatisticsCategory> category(@Param("centerWdId") String centerWdId, @Param("radius") int radius);
+}

+ 2 - 1
benyun-core/src/main/java/com/benyun/core/dao/WdTopologicalDao.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.benyun.core.entity.WdTopological;
 import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 import javax.security.sasl.SaslServer;
@@ -12,7 +13,7 @@ import java.util.List;
 @Mapper
 public interface WdTopologicalDao extends BaseMapper<WdTopological> {
 
-    public void insertList(List<WdTopological> wdTopological);
+    public void insertList(@Param("wdTopological") List<WdTopological> wdTopological);
 
     @Select("select * from bl_wd_topological where center_wd_id = #{centerWdId}")
     public List<WdTopological> selectWdTopologicalListById(String centerWdId);

+ 14 - 0
benyun-core/src/main/java/com/benyun/core/dao/WdTopologicalInfoDao.java

@@ -0,0 +1,14 @@
+package com.benyun.core.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.benyun.core.entity.TopologicalStoreWdStatisticsCategory;
+import com.benyun.core.entity.WdTopologicalInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface WdTopologicalInfoDao extends BaseMapper<WdTopologicalInfo> {
+    public void insertList(@Param("wdTopologicalInfoList")List<WdTopologicalInfo> wdTopologicalInfoList);
+}

+ 2 - 1
benyun-core/src/main/java/com/benyun/core/entity/BuildWd.java

@@ -1,13 +1,14 @@
 package com.benyun.core.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
 @Data
 @TableName("ddt_build_wd")
 public class BuildWd {
-    @TableField("wd_id")
+    @TableId("wd_id")
     private String wdId;
     @TableField("property_type")
     private String propertyType;

+ 2 - 1
benyun-core/src/main/java/com/benyun/core/entity/EnterpriseWd.java

@@ -1,13 +1,14 @@
 package com.benyun.core.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
 @Data
 @TableName("ddt_enterprise_wd")
 public class EnterpriseWd {
-    @TableField("wd_id")
+    @TableId("wd_id")
     private String wdId;
     @TableField("enterprise_usci")
     private String enterpriseUsci;

+ 2 - 1
benyun-core/src/main/java/com/benyun/core/entity/HouseWd.java

@@ -1,13 +1,14 @@
 package com.benyun.core.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
 @Data
 @TableName("ddt_house_wd")
 public class HouseWd {
-    @TableField("wd_id")
+    @TableId("wd_id")
     private String wdId;
     @TableField("property_type")
     private String propertyType;

+ 20 - 0
benyun-core/src/main/java/com/benyun/core/entity/ManageType.java

@@ -0,0 +1,20 @@
+package com.benyun.core.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@Data
+@TableName("ddt_manage_type")
+public class ManageType {
+    @TableField("manage_type_code")
+    private String manageTypeCode;
+    @TableField("big_category")
+    private String bigCategory;
+    @TableField("mid_category")
+    private String midCategory;
+    @TableField("sub_category")
+    private String subCategory;
+    @TableField("full_info")
+    private String fullInfo;
+}

+ 2 - 1
benyun-core/src/main/java/com/benyun/core/entity/StoreWd.java

@@ -1,13 +1,14 @@
 package com.benyun.core.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
 @Data
 @TableName("ddt_store_wd")
 public class StoreWd {
-    @TableField("wd_id")
+    @TableId("wd_id")
     private String wdId;
     @TableField("brand_id")
     private String brandId;

+ 1 - 1
benyun-core/src/main/java/com/benyun/core/entity/TopologicalBuildWdStatisticsCategory.java

@@ -13,7 +13,7 @@ public class TopologicalBuildWdStatisticsCategory {
     @TableField("center_wd_id")
     private String centerWdId;
     @TableField("radius")
-    private String radius;
+    private int radius;
     @TableField("property_type_statistics")
     private String propertyTypeStatistics;
 

+ 1 - 2
benyun-core/src/main/java/com/benyun/core/entity/TopologicalBuildingWd.java

@@ -32,8 +32,7 @@ public class TopologicalBuildingWd {
     @TableField("build_type")
     private String buildType;
     @TableField("property_type")
-    private String propertyTpe;
-
+    private String propertyType;
     @TableField("analyse_time")
     private LocalDateTime analyseTime;
 }

+ 1 - 1
benyun-core/src/main/java/com/benyun/core/entity/TopologicalEnterpriseWd.java

@@ -30,7 +30,7 @@ public class TopologicalEnterpriseWd {
     private String addrInfo;
 
     @TableField("industry_code")
-    private String industrycode;
+    private String industryCode;
     @TableField("registered_capital")
     private BigDecimal registeredCapital;
     @TableField("enterprise_scale")

+ 2 - 1
benyun-core/src/main/java/com/benyun/core/entity/TopologicalHouseWd.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 @Data
@@ -36,7 +37,7 @@ public class TopologicalHouseWd {
     public double rent;
 
     @TableField("property_type")
-    public String property_type;
+    public String propertyType;
 
     @TableField("households")
     public int households;

+ 1 - 1
benyun-core/src/main/java/com/benyun/core/entity/TopologicalHouseWdStatisticsData.java

@@ -14,7 +14,7 @@ public class TopologicalHouseWdStatisticsData {
     private String centerWdId;
 
     @TableField("radius")
-    private double radius;
+    private int radius;
 
     @TableField("house_wd_count")
     private int houseWdCount;

+ 3 - 0
benyun-core/src/main/java/com/benyun/core/entity/TopologicalStoreWd.java

@@ -37,4 +37,7 @@ public class TopologicalStoreWd {
 
     @TableField("analyse_time")
     private LocalDateTime analyseTime;
+
+    @TableField("brand_id")
+    private String brandId;
 }

+ 1 - 1
benyun-core/src/main/java/com/benyun/core/entity/TopologicalStoreWdStatisticsCategory.java

@@ -14,7 +14,7 @@ public class TopologicalStoreWdStatisticsCategory {
     private String centerWdId;
 
     @TableField("radius")
-    private String radius;
+    private int radius;
 
     @TableField("big_manage_type_code")
     private String bigManageTypeCode;

+ 15 - 10
benyun-core/src/main/java/com/benyun/core/entity/WdTopologicalInfo.java

@@ -4,31 +4,36 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 @Data
 @TableName("bl_wd_topological_info")
 public class WdTopologicalInfo {
     @TableField("center_wd_id")
-    private String center_wd_id;
+    private String centerWdId;
     @TableField("center_wd_name")
-    private String center_wd_name;
+    private String centerWdName;
     @TableField("center_wd_type_code")
-    private String center_wd_type_code;
+    private String centerWdTypeCode;
+
+    @TableField("type_code_by")
+    private String typeCodeBy;
+
     @TableField("radius")
-    private String radius;
+    private int radius;
     @TableField("addr_code")
-    private String addr_code;
+    private String addrCode;
     @TableField("addr_code_info")
-    private String addr_code_info;
+    private String addrCodeInfo;
     @TableField("addr_info")
-    private String addr_info;
+    private String addrInfo;
     @TableField("lat")
-    private String lat;
+    private BigDecimal lat;
     @TableField("lng")
-    private String lng;
+    private BigDecimal lng;
     @TableField("geo_hash")
-    private String geo_hash;
+    private String geoHash;
     @TableField("tag")
     private String tag;
 

+ 10 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BuildWdCategoryCount.java

@@ -0,0 +1,10 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+@Data
+public class BuildWdCategoryCount {
+    public String name;
+    private int count;
+    private double radio;
+}

+ 16 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/StoreWdCategoryCount.java

@@ -0,0 +1,16 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class StoreWdCategoryCount {
+    private String manage_type_code;
+
+    private String name;
+    private List<StoreWdCategoryCountBody> storeWdCategoryCountBodyList;
+
+    private int count;
+    private double radio;
+}

+ 12 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/StoreWdCategoryCountBody.java

@@ -0,0 +1,12 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+@Data
+public class StoreWdCategoryCountBody {
+
+    private String manage_type_code;
+    private String name;
+    private int count;
+    private double radio;
+}

+ 1 - 1
benyun-core/src/main/java/com/benyun/core/entity/WdCount.java → benyun-core/src/main/java/com/benyun/core/entity/bo/WdCount.java

@@ -1,4 +1,4 @@
-package com.benyun.core.entity;
+package com.benyun.core.entity.bo;
 
 import lombok.Data;
 

+ 1 - 1
benyun-core/src/main/java/com/benyun/core/entity/WdCountBody.java → benyun-core/src/main/java/com/benyun/core/entity/bo/WdCountBody.java

@@ -1,4 +1,4 @@
-package com.benyun.core.entity;
+package com.benyun.core.entity.bo;
 
 import lombok.Data;
 

+ 34 - 0
benyun-core/src/main/java/com/benyun/core/entity/vo/TopologicalWdAceeptVo.java

@@ -0,0 +1,34 @@
+package com.benyun.core.entity.vo;
+
+import com.benyun.core.utils.HashUtil;
+import com.benyun.core.valida.TopologicalWdGroup;
+import com.benyun.core.valida.TopologicalWdListGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+public class TopologicalWdAceeptVo {
+
+    @NotBlank(groups = {TopologicalWdGroup.class,TopologicalWdListGroup.class})
+    String centerWdId;
+    @NotNull(groups = {TopologicalWdGroup.class,TopologicalWdListGroup.class})
+    int radius;
+    @NotNull(groups = {TopologicalWdListGroup.class})
+    int pageNum = 1;
+    @NotNull(groups = {TopologicalWdListGroup.class})
+    int pageSize = 10;
+
+    public String getHash(){
+        StringBuilder stringBuilder = new StringBuilder();
+        stringBuilder.append(centerWdId);
+        stringBuilder.append(radius);
+        stringBuilder.append(pageNum);
+        stringBuilder.append(pageSize);
+
+        String s = stringBuilder.toString();
+        String md5 = HashUtil.hash(s, "MD5");
+        return md5;
+    }
+}

+ 15 - 3
benyun-core/src/main/java/com/benyun/core/init/BenyunCoreInit.java

@@ -2,6 +2,8 @@ package com.benyun.core.init;
 
 import com.benyun.core.dao.AddrCategoryDao;
 import com.benyun.core.entity.AddrCategory;
+import com.benyun.core.entity.ManageType;
+import com.benyun.core.service.ManageTypeService;
 import com.benyun.core.utils.HashUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
@@ -14,6 +16,9 @@ public class BenyunCoreInit {
     @Autowired
     AddrCategoryDao addrCategoryDao;
 
+    @Autowired
+    ManageTypeService manageTypeService;
+
     @Bean("cityTierMap")
     public HashMap getCityTierMap(){
         HashMap<String, String> hashMap = new HashMap<>();
@@ -27,10 +32,17 @@ public class BenyunCoreInit {
                     hashMap.put(addrCategory.getAddrCode().substring(0,2), addrCategory.getCityTier());
             }
         }
-//        for (String s : hashMap.keySet()) {
-//            System.out.println(s + " " +hashMap.get(s));
-//        }
+        return hashMap;
+    }
 
+    @Bean("ManageType")
+    public HashMap getManageType(){
+        HashMap<String,String> hashMap = new HashMap<>();
+        for (ManageType datum : manageTypeService.getData()) {
+            if(!datum.getMidCategory().equals(""))
+                hashMap.put(datum.getMidCategory(),datum.getManageTypeCode());
+        }
+        System.out.println(hashMap);
         return hashMap;
     }
 }

+ 1 - 2
benyun-core/src/main/java/com/benyun/core/service/ChannelMapService.java

@@ -1,7 +1,6 @@
 package com.benyun.core.service;
 
-import com.benyun.core.entity.WdCount;
-import com.benyun.core.entity.WdCountBody;
+import com.benyun.core.entity.bo.WdCount;
 import com.benyun.core.entity.WdInfo;
 import com.github.pagehelper.PageInfo;
 

+ 11 - 0
benyun-core/src/main/java/com/benyun/core/service/ManageTypeService.java

@@ -0,0 +1,11 @@
+package com.benyun.core.service;
+
+
+import com.benyun.core.entity.ManageType;
+
+import java.util.List;
+
+public interface ManageTypeService {
+    public void writeData(List<ManageType> list);
+    public List<ManageType> getData();
+}

+ 13 - 0
benyun-core/src/main/java/com/benyun/core/service/TopologicalBuildWdSerevice.java

@@ -0,0 +1,13 @@
+package com.benyun.core.service;
+
+import com.benyun.core.entity.TopologicalBuildingWd;
+import com.benyun.core.entity.bo.BuildWdCategoryCount;
+import com.benyun.core.entity.vo.TopologicalWdAceeptVo;
+import com.github.pagehelper.PageInfo;
+
+import java.util.List;
+
+public interface TopologicalBuildWdSerevice {
+    public List<BuildWdCategoryCount> buildingLevel(TopologicalWdAceeptVo topologicalWdAceeptVo);
+    public PageInfo<TopologicalBuildingWd> list(TopologicalWdAceeptVo topologicalWdAceeptVo);
+}

+ 10 - 0
benyun-core/src/main/java/com/benyun/core/service/TopologicalCommonService.java

@@ -0,0 +1,10 @@
+package com.benyun.core.service;
+
+import com.benyun.core.entity.WdInfo;
+
+import java.util.List;
+
+public interface TopologicalCommonService {
+    public List<WdInfo> prefixSearch(String searchText);
+    void search(String searchText,int radius);
+}

+ 9 - 0
benyun-core/src/main/java/com/benyun/core/service/TopologicalEnterpriseWdService.java

@@ -0,0 +1,9 @@
+package com.benyun.core.service;
+
+import com.benyun.core.entity.TopologicalEnterpriseWd;
+import com.benyun.core.entity.vo.TopologicalWdAceeptVo;
+import com.github.pagehelper.PageInfo;
+
+public interface TopologicalEnterpriseWdService {
+    public PageInfo<TopologicalEnterpriseWd> list(TopologicalWdAceeptVo topologicalWdAceeptVo);
+}

+ 16 - 0
benyun-core/src/main/java/com/benyun/core/service/TopologicalHouseWdService.java

@@ -0,0 +1,16 @@
+package com.benyun.core.service;
+
+import com.benyun.core.entity.TopologicalHouseWd;
+import com.benyun.core.entity.TopologicalHouseWdStatisticsData;
+import com.benyun.core.entity.TopologicalStoreWd;
+import com.benyun.core.entity.bo.StoreWdCategoryCountBody;
+import com.benyun.core.entity.vo.TopologicalWdAceeptVo;
+import com.github.pagehelper.PageInfo;
+
+import java.util.List;
+
+public interface TopologicalHouseWdService {
+    public PageInfo<TopologicalHouseWd> list(TopologicalWdAceeptVo topologicalWdAceeptVo);
+
+    public TopologicalHouseWdStatisticsData info(TopologicalWdAceeptVo topologicalWdAceeptVo);
+}

+ 15 - 0
benyun-core/src/main/java/com/benyun/core/service/TopologicalStoreWdService.java

@@ -0,0 +1,15 @@
+package com.benyun.core.service;
+
+
+import com.benyun.core.entity.TopologicalStoreWd;
+import com.benyun.core.entity.bo.StoreWdCategoryCountBody;
+import com.benyun.core.entity.vo.TopologicalWdAceeptVo;
+import com.github.pagehelper.PageInfo;
+
+import java.util.List;
+
+public interface TopologicalStoreWdService {
+    public PageInfo<TopologicalStoreWd> list(TopologicalWdAceeptVo topologicalWdAceeptVo);
+
+    List<StoreWdCategoryCountBody> category(TopologicalWdAceeptVo topologicalWdAceeptVo);
+}

+ 229 - 78
benyun-core/src/main/java/com/benyun/core/service/impl/AnalyseWdServiceImpl.java

@@ -1,6 +1,5 @@
 package com.benyun.core.service.impl;
 
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.benyun.core.dao.*;
 import com.benyun.core.entity.*;
@@ -12,16 +11,18 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.util.*;
 
+
 @Service
 @Transactional
 public class AnalyseWdServiceImpl implements AnalyseWdService {
 
     //分析范围集
-    List<Integer> anly = Arrays.asList(2000,1000,500);
+    List<Integer> anly = Arrays.asList(2000, 1000, 500);
 
     @Autowired
     WdInfoDao wdInfoDao;
@@ -41,6 +42,7 @@ public class AnalyseWdServiceImpl implements AnalyseWdService {
     @Autowired
     EnterpriseDao enterpriseDao;
 
+    /*分析信息*/
     @Autowired
     WdTopologicalDao wdTopologicalDao;
 
@@ -57,67 +59,103 @@ public class AnalyseWdServiceImpl implements AnalyseWdService {
     @Autowired
     TopologicalEnterpriseWdDao topologicalEnterpriseWdDao;
 
+    /*统计信息*/
+    @Autowired
+    TopologicalHouseWdStatisticsDataDao houseWdStatisticsDataDao;
+    @Autowired
+    TopologicalBuildWdStatisticsCategoryDao buildWdStatisticsCategoryDao;
+    @Autowired
+    TopologicalStoreWdStatisticsCategoryDao storeWdStatisticsCategoryDao;
+    @Autowired
+    WdTopologicalInfoDao wdTopologicalInfoDao;
 
 
     @Override
     public void analyse() {
-        for (WdInfo wdInfo : wdInfoDao.selectList(null)) {
+        ZoneId zone = ZoneId.of("Asia/Shanghai");
+        LocalDateTime now = LocalDateTime.now(zone);  //分析时间
+
+        //测试需要
+        QueryWrapper<WdInfo> queryWrapper1 = new QueryWrapper<>();
+        queryWrapper1.eq("wd_type_code", "1");
+
+        List<WdInfo> wdInfos1 = wdInfoDao.selectList(queryWrapper1);
+        int index = 1;
+        //1.遍历所有网点
+        for (WdInfo wdInfo : wdInfos1) {
             //1.找到该点半径 r = 4.89km 内的所有点
             QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
-            queryWrapper.likeRight("geo_hash",wdInfo.getGeoHash().substring(0,5));
+            queryWrapper.likeRight("geo_hash", wdInfo.getGeoHash().substring(0, 5));
             List<WdInfo> wdInfos = wdInfoDao.selectList(queryWrapper);
 
-            //经营分类统计
-            HashMap<String,HashMap<String,Integer>>[] storeCategory = new HashMap[anly.size()];
-
-            //小区分析统计
-            HashMap<String,Double>[] houseData = new HashMap[anly.size()];
-
+            //2.初始化
+            //关键信息统计
+            HashMap<String, HashMap<String, Integer>>[] storeCategory = new HashMap[anly.size()];  //经营分类统计:<中类,<小类,数量>>
+            HashMap<String, Double>[] houseData = new HashMap[anly.size()];  //小区分析统计:key:totalHouseholds、totalPeopleCount、totalRent
+            HashMap<String, Integer>[] buildCategory = new HashMap[anly.size()];   //楼宇网点分析统计,key:甲类、乙类...
+            HashMap<String, Integer>[] wdTopologicalInfoHash = new HashMap[anly.size()];
 
-            //楼宇网点分析统计
-            HashMap<String,Integer>[] buildCategory = new HashMap[anly.size()];
 
-            //初始化
-            for(int i=0;i<anly.size();i++){
+            for (int i = 0; i < anly.size(); i++) {
                 storeCategory[i] = new HashMap<>();
                 houseData[i] = new HashMap<>();
-                houseData[i].put("totalHouseholds",0.0);   //总户数
-                houseData[i].put("totalPeopleCount",0.0);  //总人口数
-                houseData[i].put("totalRent",0.0); //房价
+                houseData[i].put("houseWdCount", 0.0);
+                houseData[i].put("totalHouseholds", 0.0);   //总户数
+                houseData[i].put("totalPeopleCount", 0.0);  //总人口数
+                houseData[i].put("totalRent", 0.0); //房价
                 buildCategory[i] = new HashMap<>();
+                wdTopologicalInfoHash[i] = new HashMap<>();
             }
 
-            //各网点列表统计
-            List<WdTopological> wdTopologicalList = new ArrayList<>();
+            //关键信息集合
+            List<TopologicalStoreWdStatisticsCategory> storeWdStatisticsCategoryList = new ArrayList<>();
+            List<TopologicalBuildWdStatisticsCategory> buildWdStatisticsCategoryList = new ArrayList<>();
+            List<TopologicalHouseWdStatisticsData> houseWdStatisticsDataList = new ArrayList<>();
+            List<WdTopologicalInfo> wdTopologicalInfoList = new ArrayList<>();
+
+            //各拓扑网点集合
+            List<WdTopological> wdTopologicals = new ArrayList<>();
             List<TopologicalEnterpriseWd> topologicalEnterpriseWds = new ArrayList<>();
             List<TopologicalStoreWd> topologicalStoreWds = new ArrayList<>();
             List<TopologicalHouseWd> topologicalHouseWds = new ArrayList<>();
             List<TopologicalBuildingWd> topologicalBuildingWds = new ArrayList<>();
+
+            System.out.println("初始化完成------总进度:" + wdInfos1.size() + "/" + index++);
+            //3.开始分析
             for (WdInfo info : wdInfos) {
+
+                //网点等于自己不要
+                if (info.getWdId().equals(wdInfo.getWdId()))
+                    continue;
+
                 //计算距离
                 GlobalCoordinates source = new GlobalCoordinates(wdInfo.getLat().doubleValue(), wdInfo.getLng().doubleValue());
                 GlobalCoordinates target = new GlobalCoordinates(info.getLat().doubleValue(), info.getLng().doubleValue());
                 double meter2 = DistanceUtil.getDistanceMeter(source, target, Ellipsoid.WGS84);
 
                 //大于4.89Km不要
-                if(meter2 > anly.get(0))
+                if (meter2 > anly.get(0))
                     continue;
 
-                Integer r = anly.get(anly.size()-1);
-                int p = anly.size() - 1 ; //记录r位置
-                for(int i=1;i<anly.size();i++){
-                    if(meter2 >= anly.get(i)){
+                Integer r = anly.get(anly.size() - 1);
+                int p = anly.size() - 1; //记录r位置
+                for (int i = 1; i < anly.size(); i++) {
+                    if (meter2 > anly.get(i)) {
+                        r = anly.get(i - 1);
+                        p = i - 1;
+                        break;
+                    } else if (meter2 == anly.get(i)) {
                         r = anly.get(i);
                         p = i;
                         break;
                     }
                 }
+
+                //3.1 WdTopological
                 WdTopological wdTopological = new WdTopological();
                 wdTopological.setCenterWdId(wdInfo.getWdId());
                 wdTopological.setCenterWdName(wdInfo.getWdName());
                 wdTopological.setRadius(r);
-
-
                 wdTopological.setAroundWdId(info.getWdId());
                 wdTopological.setAroundWdName(info.getWdName());
                 wdTopological.setAroundWdTypeCode(info.getWdTypeCode());
@@ -128,14 +166,22 @@ public class AnalyseWdServiceImpl implements AnalyseWdService {
                 wdTopological.setLng(info.getLng());
                 wdTopological.setGeoHash(info.getGeoHash());
                 wdTopological.setAroundTypeCodeBy(info.getTypeCodeBy());
-
                 wdTopological.setDistance(meter2);
-                //规定时区
-                ZoneId zone = ZoneId.of("Asia/Shanghai");
-                wdTopological.setAnalyseTime(LocalDateTime.now(zone));
-                wdTopologicalList.add(wdTopological);
+                wdTopological.setAnalyseTime(now);
+
+                wdTopologicals.add(wdTopological);
 
-                if(wdTopological.getAroundWdTypeCode().equals("1")){
+                if (info.getTypeCodeBy() != null && !info.getTypeCodeBy().equals("")) {
+                    HashMap<String, Integer> wdTopologicalInfoHash1 = wdTopologicalInfoHash[p];
+                    Integer put = wdTopologicalInfoHash1.get(info.getTypeCodeBy());
+                    if (put == null) {
+                        wdTopologicalInfoHash1.put(info.getTypeCodeBy(), 1);
+                    } else {
+                        wdTopologicalInfoHash1.put(info.getTypeCodeBy(), wdTopologicalInfoHash1.get(info.getTypeCodeBy()) + 1);
+                    }
+                }
+
+                if (wdTopological.getAroundWdTypeCode().equals("1")) {
                     //门店网点
                     TopologicalStoreWd topologicalStoreWd = new TopologicalStoreWd();
                     topologicalStoreWd.setCenterWdId(wdTopological.getCenterWdId());
@@ -153,29 +199,33 @@ public class AnalyseWdServiceImpl implements AnalyseWdService {
 
                     //门店分析
                     StoreWd storeWd = storeWdDao.selectById(info.getWdId());
-                    if(storeWd != null){
+                    if (storeWd != null) {
                         topologicalStoreWd.setIndustryCode(storeWd.getIndustryCode());
                         String manageTypeCode = storeWd.getManageTypeCode();
                         topologicalStoreWd.setManageTypeCode(manageTypeCode);
+                        topologicalStoreWd.setBrandId(storeWd.getBrandId());
 
                         //分析经营分类
-                        HashMap<String, HashMap<String, Integer>> stringHashMapHashMap = storeCategory[p];
-                        HashMap<String, Integer> hashMap = stringHashMapHashMap.get(manageTypeCode.substring(0,4));
-                        if(hashMap == null){
-                            HashMap<String, Integer> map = new HashMap<>();
-                            map.put(manageTypeCode,1);
-                        }else {
-                            Integer integer = hashMap.get(manageTypeCode);
-                            if (integer == null)
-                                hashMap.put(manageTypeCode,1);
-                            else
-                                hashMap.put(manageTypeCode,hashMap.get(manageTypeCode)+1);
+                        if (manageTypeCode != null && !manageTypeCode.equals("")) {
+                            HashMap<String, HashMap<String, Integer>> stringHashMapHashMap = storeCategory[p];
+                            HashMap<String, Integer> hashMap = stringHashMapHashMap.get(manageTypeCode.substring(0, 4));
+                            if (hashMap == null) {
+                                HashMap<String, Integer> map = new HashMap<>();
+                                map.put(manageTypeCode, 1);
+                            } else {
+                                Integer integer = hashMap.get(manageTypeCode);
+                                if (integer == null)
+                                    hashMap.put(manageTypeCode, 1);
+                                else
+                                    hashMap.put(manageTypeCode, hashMap.get(manageTypeCode) + 1);
+                            }
                         }
+
                     }
 
                     topologicalStoreWd.setAnalyseTime(wdTopological.getAnalyseTime());
                     topologicalStoreWds.add(topologicalStoreWd);
-                }else if(wdTopological.getAroundWdTypeCode().equals("2")){
+                } else if (wdTopological.getAroundWdTypeCode().equals("2")) {
                     //小区网点
                     TopologicalHouseWd topologicalHouseWd = new TopologicalHouseWd();
                     topologicalHouseWd.setCenterWdId(wdTopological.getCenterWdId());
@@ -191,25 +241,26 @@ public class AnalyseWdServiceImpl implements AnalyseWdService {
 
                     topologicalHouseWd.setDistance(wdTopological.getDistance());
 
+                    HashMap<String, Double> houseDatum = houseData[p];
+                    houseDatum.put("houseWdCount", houseDatum.get("houseWdCount") + 1.0);
 
                     //小区分析
                     HouseWd houseWd = houseWdDao.selectById(info.getWdId());
-                    if(houseWd != null){
+                    if (houseWd != null) {
                         topologicalHouseWd.setHouseholds(houseWd.getHouseholds());
                         topologicalHouseWd.setRent(info.getRent());
                         topologicalHouseWd.setPeopleCount(houseWd.getPeopleCount());
-                        topologicalHouseWd.setProperty_type(houseWd.getPropertyType());
+                        topologicalHouseWd.setPropertyType(houseWd.getPropertyType());
 
                         //小区关键信息统计
-                        HashMap<String, Double> houseDatum = houseData[p];
-                        houseDatum.put("totalRent",houseDatum.get("totalRent")+topologicalHouseWd.getRent());
-                        houseDatum.put("totalHouseholds",houseDatum.get("totalHouseholds")+topologicalHouseWd.getHouseholds());
-                        houseDatum.put("totalPeopleCount",houseDatum.get("totalPeopleCount")+topologicalHouseWd.getPeopleCount());
+                        houseDatum.put("totalRent", houseDatum.get("totalRent") + topologicalHouseWd.getRent());
+                        houseDatum.put("totalHouseholds", houseDatum.get("totalHouseholds") + topologicalHouseWd.getHouseholds());
+                        houseDatum.put("totalPeopleCount", houseDatum.get("totalPeopleCount") + topologicalHouseWd.getPeopleCount());
                     }
 
                     topologicalHouseWd.setAnalyseTime(wdTopological.getAnalyseTime());
                     topologicalHouseWds.add(topologicalHouseWd);
-                }else if(wdTopological.getAroundWdTypeCode().equals("3")){
+                } else if (wdTopological.getAroundWdTypeCode().equals("3")) {
                     //楼宇网点
                     TopologicalBuildingWd topologicalBuildingWd = new TopologicalBuildingWd();
                     topologicalBuildingWd.setCenterWdId(wdTopological.getCenterWdId());
@@ -227,23 +278,26 @@ public class AnalyseWdServiceImpl implements AnalyseWdService {
 
                     //楼宇分析
                     BuildWd buildWd = buildWdDao.selectById(info.getWdId());
-                    if(buildWd != null){
+                    if (buildWd != null) {
                         topologicalBuildingWd.setRent(info.getRent());
                         topologicalBuildingWd.setBuildType(buildWd.getBuildType());
-                        topologicalBuildingWd.setPropertyTpe(buildWd.getPropertyType());
+                        topologicalBuildingWd.setPropertyType(buildWd.getPropertyType());
 
                         //分析楼宇分类
-                        HashMap<String, Integer> buildCategoryMap = buildCategory[p];
-                        Integer integer = buildCategoryMap.get(topologicalBuildingWd.getPropertyTpe());
-                        if(integer == null){
-                            buildCategoryMap.put(topologicalBuildingWd.getPropertyTpe(),1);
-                        }else
-                            buildCategoryMap.put(topologicalBuildingWd.getPropertyTpe(),buildCategoryMap.get(topologicalBuildingWd.getPropertyTpe())+1);
+                        if (topologicalBuildingWd.getPropertyType() != null && !topologicalBuildingWd.getPropertyType().equals("")) {
+                            HashMap<String, Integer> buildCategoryMap = buildCategory[p];
+                            Integer integer = buildCategoryMap.get(topologicalBuildingWd.getPropertyType());
+                            if (integer == null) {
+                                buildCategoryMap.put(topologicalBuildingWd.getPropertyType(), 1);
+                            } else
+                                buildCategoryMap.put(topologicalBuildingWd.getPropertyType(), buildCategoryMap.get(topologicalBuildingWd.getPropertyType()) + 1);
+
+                        }
                     }
 
                     topologicalBuildingWd.setAnalyseTime(wdTopological.getAnalyseTime());
                     topologicalBuildingWds.add(topologicalBuildingWd);
-                }else if(wdTopological.getAroundWdTypeCode().equals("5")){
+                } else if (wdTopological.getAroundWdTypeCode().equals("5")) {
                     //公司网点
                     TopologicalEnterpriseWd topologicalEnterpriseWd = new TopologicalEnterpriseWd();
                     topologicalEnterpriseWd.setCenterWdId(wdTopological.getCenterWdId());
@@ -261,10 +315,10 @@ public class AnalyseWdServiceImpl implements AnalyseWdService {
 
                     //公司分析
                     EnterpriseWd enterpriseWd = enterpriseWdDao.selectById(info.getWdId());
-                    if(enterpriseWd != null){
+                    if (enterpriseWd != null) {
                         Enterprise enterprise = enterpriseDao.selectById(enterpriseWd.getEnterpriseUsci());
-                        if (enterprise != null){
-                            topologicalEnterpriseWd.setIndustrycode(enterprise.getIndustryCode());
+                        if (enterprise != null) {
+                            topologicalEnterpriseWd.setIndustryCode(enterprise.getIndustryCode());
                             topologicalEnterpriseWd.setRegisteredCapital(enterprise.getRegisteredCapital());
                             topologicalEnterpriseWd.setEnterpriseScale(enterprise.getEnterpriseScale());
                         }
@@ -273,26 +327,123 @@ public class AnalyseWdServiceImpl implements AnalyseWdService {
                     topologicalEnterpriseWds.add(topologicalEnterpriseWd);
                 }
 
+            }
 
+            //TODO 门店分类
+            for (int i = 0; i < anly.size(); i++) {
+                TopologicalStoreWdStatisticsCategory storeWdStatisticsCategory = new TopologicalStoreWdStatisticsCategory();
+                storeWdStatisticsCategory.setCenterWdId(wdInfo.getWdId());
+                storeWdStatisticsCategory.setRadius(anly.get(i));
+                HashMap<String, HashMap<String, Integer>> stringHashMapHashMap = storeCategory[i];
+                for (String s : stringHashMapHashMap.keySet()) {
+                    storeWdStatisticsCategory.setBigManageTypeCode(s.substring(0, 2) + "0000");
+                    storeWdStatisticsCategory.setMidManageTypeCode(s);
+
+                    HashMap<String, Integer> hashMap = stringHashMapHashMap.get(s);
+                    StringBuilder stringBuilder = new StringBuilder();
+                    for (String s1 : hashMap.keySet()) {
+                        stringBuilder.append(s1);
+                        stringBuilder.append(":");
+                        stringBuilder.append(hashMap.get(s1));
+                        stringBuilder.append(";");
+                    }
+                    storeWdStatisticsCategory.setSubCategoryCodeStatistics(stringBuilder.toString());
+                    storeWdStatisticsCategory.setAnalyseTime(now);
+                    storeWdStatisticsCategoryList.add(storeWdStatisticsCategory);
+                }
             }
 
-            //保存网点拓扑
-            wdTopologicalDao.insertList(wdTopologicalList);
+            //TODO 楼宇分类
+            for (int i = 0; i < anly.size(); i++) {
+                TopologicalBuildWdStatisticsCategory buildWdStatisticsCategory = new TopologicalBuildWdStatisticsCategory();
+                buildWdStatisticsCategory.setCenterWdId(wdInfo.getWdId());
+                buildWdStatisticsCategory.setRadius(anly.get(i));
 
-            //保存拓扑门店信息
-            topologicalStoreWdDao.insertList(topologicalStoreWds);
-            topologicalHouseWdDao.insertList(topologicalHouseWds);
-            topologicalBuildWdDao.insertList(topologicalBuildingWds);
-            topologicalEnterpriseWdDao.insertList(topologicalEnterpriseWds);
+                HashMap<String, Integer> hashMap = buildCategory[i];
+                StringBuilder stringBuilder = new StringBuilder();
+                for (String s : hashMap.keySet()) {
+                    stringBuilder.append(s + ":" + hashMap.get(s) + ";");
+                }
+                buildWdStatisticsCategory.setPropertyTypeStatistics(stringBuilder.toString());
+                buildWdStatisticsCategory.setAnalyseTime(now);
+                buildWdStatisticsCategoryList.add(buildWdStatisticsCategory);
+            }
 
-            //TODO 门店分类
-//            for(int i=0;i<anly.size();i++){
-//                TopologicalStoreWdStatisticsCategory storeWdStatisticsCategory = new TopologicalStoreWdStatisticsCategory();
-//                storeWdStatisticsCategory.setRadius(String.valueOf(anly.get(i)));
-//                storeWdStatisticsCategory.setBigManageTypeCode();
-//                storeCategory[i]
-//            }
+            //TODO 社区关键数据
+            for (int i = 0; i < anly.size(); i++) {
+                TopologicalHouseWdStatisticsData houseWdStatisticsData = new TopologicalHouseWdStatisticsData();
+                houseWdStatisticsData.setCenterWdId(wdInfo.getWdId());
+                houseWdStatisticsData.setRadius(anly.get(i));
+                HashMap<String, Double> houseDatum = houseData[i];
+                double houseWdCount = houseDatum.get("houseWdCount");
+                double totalHouseholds = houseDatum.get("totalHouseholds");
+                double totalPeopleCount = houseDatum.get("totalPeopleCount");
+                double totalRent = houseDatum.get("totalRent");
+                houseWdStatisticsData.setHouseWdCount((int) houseWdCount);
+                houseWdStatisticsData.setTotalHouseholds((int) totalHouseholds);
+                houseWdStatisticsData.setTotalPeopleCount((int) totalPeopleCount);
+                if(houseWdCount != 0.0)
+                    houseWdStatisticsData.setAverageRent(totalRent / houseWdCount);
+                else
+                    houseWdStatisticsData.setAverageRent(0.0);
+
+                houseWdStatisticsData.setAnalyseTime(now);
+                houseWdStatisticsDataList.add(houseWdStatisticsData);
+            }
+
+            //TODO 网点拓扑信息
+            for (int i = 0; i < anly.size(); i++) {
+                WdTopologicalInfo wdTopologicalInfo = new WdTopologicalInfo();
+                wdTopologicalInfo.setCenterWdId(wdInfo.getWdId());
+                wdTopologicalInfo.setCenterWdName(wdInfo.getWdName());
+                wdTopologicalInfo.setCenterWdTypeCode(wdInfo.getWdTypeCode());
+                wdTopologicalInfo.setTypeCodeBy(wdInfo.getTypeCodeBy());
+                wdTopologicalInfo.setLat(wdInfo.getLat());
+                wdTopologicalInfo.setLng(wdInfo.getLng());
+                wdTopologicalInfo.setRadius(anly.get(i));
+                wdTopologicalInfo.setAddrCode(wdInfo.getAddrCode());
+                wdTopologicalInfo.setAddrInfo(wdInfo.getAddrInfo());
+                wdTopologicalInfo.setGeoHash(wdInfo.getGeoHash());
+                wdTopologicalInfo.setAnalyseTime(now);
+
+                HashMap<String, Integer> wdTopologicalInfoHash1 = wdTopologicalInfoHash[i];
+                StringBuilder stringBuilder = new StringBuilder();
+                for (String s : wdTopologicalInfoHash1.keySet()) {
+                    stringBuilder.append(s + ":" + wdTopologicalInfoHash1.get(s) + ";");
+                }
+                wdTopologicalInfo.setTag(stringBuilder.toString());
+                wdTopologicalInfoList.add(wdTopologicalInfo);
+            }
+
+            System.out.println("完成------");
+
+
+            //4.导入数据库
+            if (topologicalStoreWds.isEmpty())
+                continue;
+
+            wdTopologicalDao.insertList(wdTopologicals);//保存网点拓扑
+
+            //4.1 保存拓扑信息
+            if (!topologicalStoreWds.isEmpty())
+                topologicalStoreWdDao.insertList(topologicalStoreWds);
+            if (!topologicalHouseWds.isEmpty())
+                topologicalHouseWdDao.insertList(topologicalHouseWds);
+            if (!topologicalBuildingWds.isEmpty())
+                topologicalBuildWdDao.insertList(topologicalBuildingWds);
+            if (!topologicalEnterpriseWds.isEmpty()){
+                topologicalEnterpriseWdDao.insertList(topologicalEnterpriseWds);
+            }
 
+            //4.2 保存其他相关统计信息
+            if (!houseWdStatisticsDataList.isEmpty())
+                houseWdStatisticsDataDao.insertList(houseWdStatisticsDataList);
+            if (!storeWdStatisticsCategoryList.isEmpty())
+                storeWdStatisticsCategoryDao.insertList(storeWdStatisticsCategoryList);
+            if (!buildWdStatisticsCategoryList.isEmpty())
+                buildWdStatisticsCategoryDao.insertList(buildWdStatisticsCategoryList);
+            if (!wdTopologicalInfoList.isEmpty())
+                wdTopologicalInfoDao.insertList(wdTopologicalInfoList);
 
         }
     }

+ 3 - 3
benyun-core/src/main/java/com/benyun/core/service/impl/ChannelMapServiceImpl.java

@@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.benyun.core.dao.AddrCategoryDao;
 import com.benyun.core.dao.WdInfoDao;
 import com.benyun.core.entity.AddrCategory;
-import com.benyun.core.entity.WdCount;
-import com.benyun.core.entity.WdCountBody;
+import com.benyun.core.entity.bo.WdCount;
+import com.benyun.core.entity.bo.WdCountBody;
 import com.benyun.core.entity.WdInfo;
 import com.benyun.core.service.ChannelMapService;
 import com.github.pagehelper.PageHelper;
@@ -14,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
@@ -137,6 +136,7 @@ public class ChannelMapServiceImpl implements ChannelMapService {
         return wdCount;
     }
 
+    //TODO 需要优化
     @Override
     public PageInfo<WdInfo> list(String[] channel, String rankType, String searchText, String orderby, String[] addrCode, int pageNum, int pageSize) {
         //1.根据不同级别得到地区码

+ 29 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/ManageTypeServiceImpl.java

@@ -0,0 +1,29 @@
+package com.benyun.core.service.impl;
+
+import com.benyun.core.dao.ManageTypeDao;
+import com.benyun.core.entity.ManageType;
+import com.benyun.core.service.ManageTypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+@Service
+@Transactional
+public class ManageTypeServiceImpl implements ManageTypeService {
+    @Autowired
+    ManageTypeDao manageTypeDao;
+    @Override
+    public void writeData(List<ManageType> list) {
+        for (ManageType manageType : list) {
+            manageTypeDao.insert(manageType);
+        }
+
+    }
+
+    @Override
+    public List<ManageType> getData() {
+        return manageTypeDao.selectList(null);
+    }
+}

+ 70 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalBuildWdSereviceImpl.java

@@ -0,0 +1,70 @@
+package com.benyun.core.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.benyun.core.dao.TopologicalBuildWdDao;
+import com.benyun.core.dao.TopologicalBuildWdStatisticsCategoryDao;
+import com.benyun.core.entity.TopologicalBuildWdStatisticsCategory;
+import com.benyun.core.entity.TopologicalBuildingWd;
+import com.benyun.core.entity.TopologicalStoreWd;
+import com.benyun.core.entity.TopologicalStoreWdStatisticsCategory;
+import com.benyun.core.entity.bo.BuildWdCategoryCount;
+import com.benyun.core.entity.bo.StoreWdCategoryCount;
+import com.benyun.core.entity.bo.StoreWdCategoryCountBody;
+import com.benyun.core.entity.vo.TopologicalWdAceeptVo;
+import com.benyun.core.service.TopologicalBuildWdSerevice;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+@Transactional
+public class TopologicalBuildWdSereviceImpl implements TopologicalBuildWdSerevice {
+
+    @Autowired
+    TopologicalBuildWdDao topologicalBuildWdDao;
+
+    @Autowired
+    TopologicalBuildWdStatisticsCategoryDao topologicalBuildWdStatisticsCategoryDao;
+
+    @Override
+    public List<BuildWdCategoryCount> buildingLevel(TopologicalWdAceeptVo topologicalWdAceeptVo) {
+        QueryWrapper<TopologicalBuildWdStatisticsCategory> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("center_wd_id",topologicalWdAceeptVo.getCenterWdId());
+        queryWrapper.and(wrapper -> {
+            wrapper.eq("radius",topologicalWdAceeptVo.getRadius());
+        });
+
+        List<BuildWdCategoryCount> list = new ArrayList<>();
+        TopologicalBuildWdStatisticsCategory topologicalBuildWdStatisticsCategory = topologicalBuildWdStatisticsCategoryDao.selectOne(queryWrapper);
+        String propertyTypeStatistics = topologicalBuildWdStatisticsCategory.getPropertyTypeStatistics();
+        int total = 0;
+        for (String s : propertyTypeStatistics.split(";")) {
+            BuildWdCategoryCount buildWdCategoryCount = new BuildWdCategoryCount();
+            String[] split = s.split(":");
+            if (split.length !=2)
+                continue;
+            buildWdCategoryCount.setName(split[1]);
+            buildWdCategoryCount.setCount(Integer.parseInt(split[1]));
+            total+=buildWdCategoryCount.getCount();
+            list.add(buildWdCategoryCount);
+        }
+        for (BuildWdCategoryCount buildWdCategoryCount : list) {
+            buildWdCategoryCount.setRadio(buildWdCategoryCount.getCount()/total);
+        }
+        return list;
+    }
+
+    @Override
+    public PageInfo<TopologicalBuildingWd> list(TopologicalWdAceeptVo topologicalWdAceeptVo) {
+        PageHelper.startPage(topologicalWdAceeptVo.getPageNum(), topologicalWdAceeptVo.getPageSize());
+        List<TopologicalBuildingWd> topologicalStoreWds = topologicalBuildWdDao.list(topologicalWdAceeptVo.getCenterWdId(), Integer.valueOf(topologicalWdAceeptVo.getRadius()));
+        PageInfo<TopologicalBuildingWd> pageInfo = new  PageInfo<>(topologicalStoreWds);
+
+        return pageInfo;
+    }
+}

+ 42 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalCommonServiceImpl.java

@@ -0,0 +1,42 @@
+package com.benyun.core.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.benyun.core.dao.WdInfoDao;
+import com.benyun.core.entity.TopologicalStoreWd;
+import com.benyun.core.entity.WdInfo;
+import com.benyun.core.service.TopologicalCommonService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.lang.reflect.Array;
+import java.util.Arrays;
+import java.util.List;
+
+@Service
+public class TopologicalCommonServiceImpl implements TopologicalCommonService {
+    @Autowired
+    WdInfoDao wdInfoDao;
+
+    @Override
+    public List<WdInfo> prefixSearch(String searchText) {
+        QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.likeRight("wd_name",searchText);
+        queryWrapper.and(wdInfoQueryWrapper -> {
+            wdInfoQueryWrapper.in("wd_type_code", Arrays.asList("1","2","3","5"));
+        });
+
+        PageHelper.startPage(1,8);
+        List<WdInfo> wdInfos = wdInfoDao.selectList(queryWrapper);
+        PageInfo<WdInfo> pageInfo = new PageInfo<>(wdInfos);
+        return pageInfo.getList();
+    }
+
+    @Override
+    public void search(String searchText, int radius) {
+
+    }
+
+
+}

+ 29 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalEnterpriseWdServiceImpl.java

@@ -0,0 +1,29 @@
+package com.benyun.core.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.benyun.core.dao.TopologicalEnterpriseWdDao;
+import com.benyun.core.entity.TopologicalEnterpriseWd;
+import com.benyun.core.entity.TopologicalStoreWd;
+import com.benyun.core.entity.vo.TopologicalWdAceeptVo;
+import com.benyun.core.service.TopologicalEnterpriseWdService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class TopologicalEnterpriseWdServiceImpl implements TopologicalEnterpriseWdService {
+    @Autowired
+    TopologicalEnterpriseWdDao topologicalEnterpriseWdDao;
+    @Override
+    public PageInfo<TopologicalEnterpriseWd> list(TopologicalWdAceeptVo topologicalWdAceeptVo) {
+
+        PageHelper.startPage(topologicalWdAceeptVo.getPageNum(), topologicalWdAceeptVo.getPageSize());
+        List<TopologicalEnterpriseWd> topologicalStoreWds = topologicalEnterpriseWdDao.list(topologicalWdAceeptVo.getCenterWdId(), Integer.valueOf(topologicalWdAceeptVo.getRadius()));
+        PageInfo<TopologicalEnterpriseWd> pageInfo = new PageInfo<>(topologicalStoreWds);
+
+        return pageInfo;
+    }
+}

+ 43 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalHouseServiceWdImpl.java

@@ -0,0 +1,43 @@
+package com.benyun.core.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.benyun.core.dao.TopologicalHouseWdDao;
+import com.benyun.core.dao.TopologicalHouseWdStatisticsDataDao;
+import com.benyun.core.entity.TopologicalHouseWd;
+import com.benyun.core.entity.TopologicalHouseWdStatisticsData;
+import com.benyun.core.entity.TopologicalStoreWd;
+import com.benyun.core.entity.vo.TopologicalWdAceeptVo;
+import com.benyun.core.service.TopologicalHouseWdService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class TopologicalHouseServiceWdImpl implements TopologicalHouseWdService {
+    @Autowired
+    TopologicalHouseWdDao topologicalHouseWdDao;
+
+    @Autowired
+    TopologicalHouseWdStatisticsDataDao topologicalHouseWdStatisticsDataDao;
+
+    @Override
+    public PageInfo<TopologicalHouseWd> list(TopologicalWdAceeptVo topologicalWdAceeptVo) {
+        PageHelper.startPage(topologicalWdAceeptVo.getPageNum(), topologicalWdAceeptVo.getPageSize());
+        List<TopologicalHouseWd> topologicalStoreWds = topologicalHouseWdDao.list(topologicalWdAceeptVo.getCenterWdId(), Integer.valueOf(topologicalWdAceeptVo.getRadius()));
+        PageInfo<TopologicalHouseWd> pageInfo = new PageInfo<>(topologicalStoreWds);
+        return pageInfo;
+    }
+
+    @Override
+    public TopologicalHouseWdStatisticsData info(TopologicalWdAceeptVo topologicalWdAceeptVo) {
+        QueryWrapper<TopologicalHouseWdStatisticsData> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("center_wd_id",topologicalWdAceeptVo.getCenterWdId()).and(topologicalHouseWdStatisticsDataQueryWrapper -> {
+            topologicalHouseWdStatisticsDataQueryWrapper.eq("radius",Integer.valueOf(topologicalWdAceeptVo.getRadius()));
+        });
+        TopologicalHouseWdStatisticsData topologicalHouseWdStatisticsData = topologicalHouseWdStatisticsDataDao.selectOne(queryWrapper);
+        return topologicalHouseWdStatisticsData;
+    }
+}

+ 89 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalStoreWdServiceImpl.java

@@ -0,0 +1,89 @@
+package com.benyun.core.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.benyun.core.dao.TopologicalStoreWdDao;
+import com.benyun.core.dao.TopologicalStoreWdStatisticsCategoryDao;
+import com.benyun.core.entity.TopologicalStoreWd;
+import com.benyun.core.entity.TopologicalStoreWdStatisticsCategory;
+import com.benyun.core.entity.WdInfo;
+import com.benyun.core.entity.bo.StoreWdCategoryCount;
+import com.benyun.core.entity.bo.StoreWdCategoryCountBody;
+import com.benyun.core.entity.vo.TopologicalWdAceeptVo;
+import com.benyun.core.service.TopologicalStoreWdService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+@Service
+public class TopologicalStoreWdServiceImpl implements TopologicalStoreWdService {
+
+    @Autowired
+    TopologicalStoreWdDao topologicalStoreWdDao;
+
+    @Autowired
+    TopologicalStoreWdStatisticsCategoryDao storeWdStatisticsCategoryDao;
+
+    @Autowired
+    @Qualifier("ManageType")
+    HashMap<String,String> manageType;
+
+    @Override
+    public PageInfo<TopologicalStoreWd> list(TopologicalWdAceeptVo topologicalWdAceeptVo) {
+        PageHelper.startPage(topologicalWdAceeptVo.getPageNum(), topologicalWdAceeptVo.getPageSize());
+        List<TopologicalStoreWd> topologicalStoreWds = topologicalStoreWdDao.list(topologicalWdAceeptVo.getCenterWdId(), Integer.valueOf(topologicalWdAceeptVo.getRadius()));
+        PageInfo<TopologicalStoreWd> pageInfo = new PageInfo<>(topologicalStoreWds);
+        return pageInfo;
+    }
+
+    //TODO 需要优化
+    @Override
+    public List<StoreWdCategoryCountBody> category(TopologicalWdAceeptVo topologicalWdAceeptVo) {
+
+        List<StoreWdCategoryCountBody> storeWdCategoryCountBodyList = new ArrayList<>();
+        List<StoreWdCategoryCount> storeWdCategoryCounts = new ArrayList<>();
+
+        int index1 = 0;
+        List<TopologicalStoreWdStatisticsCategory> statisticsCategories = storeWdStatisticsCategoryDao.category(topologicalWdAceeptVo.getCenterWdId(),Integer.valueOf(topologicalWdAceeptVo.getRadius()));
+        for (TopologicalStoreWdStatisticsCategory statisticsCategory : statisticsCategories) {
+            StoreWdCategoryCountBody storeWdCategoryCountBody = new StoreWdCategoryCountBody();
+            storeWdCategoryCountBody.setName(manageType.get(statisticsCategory.getMidManageTypeCode()));
+            storeWdCategoryCountBody.setManage_type_code(statisticsCategory.getMidManageTypeCode());
+
+            //拆分
+            int index2 = 0;
+            String subCategoryCodeStatistics = statisticsCategory.getSubCategoryCodeStatistics();
+            for (String s : subCategoryCodeStatistics.split(";")) {
+                StoreWdCategoryCount storeWdCategoryCount = new StoreWdCategoryCount();
+                String[] split = s.split(":");
+                if (split.length !=2)
+                    continue;
+                storeWdCategoryCount.setName(manageType.get(split[0]));
+                storeWdCategoryCount.setCount(Integer.parseInt(split[1]));
+                index2+=storeWdCategoryCount.getCount();
+                storeWdCategoryCounts.add(storeWdCategoryCount);
+            }
+            storeWdCategoryCountBody.setCount(index2);
+
+            //计算radio
+            for (StoreWdCategoryCount storeWdCategoryCount : storeWdCategoryCounts) {
+                storeWdCategoryCount.setRadio(storeWdCategoryCount.getCount()/index2);
+            }
+
+            index1+=index2;
+            storeWdCategoryCountBodyList.add(storeWdCategoryCountBody);
+        }
+
+        //计算radio
+        for (StoreWdCategoryCountBody storeWdCategoryCountBody : storeWdCategoryCountBodyList) {
+            storeWdCategoryCountBody.setRadio(storeWdCategoryCountBody.getCount()/index1);
+        }
+
+        return storeWdCategoryCountBodyList;
+    }
+}

+ 2 - 3
benyun-core/src/main/java/com/benyun/core/service/impl/WdTopologicalServiceImpl.java

@@ -15,11 +15,10 @@ public class WdTopologicalServiceImpl implements WdTopologicalService {
     @Autowired
     WdTopologicalDao wdTopologicalDao;
 
+
     @Override
     public void insertList(List<WdTopological> list) {
-        for (WdTopological wdTopological : list) {
-            wdTopologicalDao.insertWdTopological(wdTopological);
-        }
+
     }
 
     @Override

+ 4 - 0
benyun-core/src/main/java/com/benyun/core/valida/TopologicalWdGroup.java

@@ -0,0 +1,4 @@
+package com.benyun.core.valida;
+
+public interface TopologicalWdGroup {
+}

+ 4 - 0
benyun-core/src/main/java/com/benyun/core/valida/TopologicalWdListGroup.java

@@ -0,0 +1,4 @@
+package com.benyun.core.valida;
+
+public interface TopologicalWdListGroup {
+}

+ 12 - 3
benyun-core/src/main/resources/application-dev.yaml

@@ -18,7 +18,7 @@ spring:
           driverClassName: com.mysql.cj.jdbc.Driver
           # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
           # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
-          url: jdbc:mysql://127.0.0.1:3306/bailian-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
+          url: jdbc:mysql://127.0.0.1:3306/ddt?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
           username: root
           password: Aa@1230
         # 从库数据源
@@ -26,7 +26,7 @@ spring:
           lazy: true
           type: ${spring.datasource.type}
           driverClassName: com.mysql.cj.jdbc.Driver
-          url: jdbc:mysql://127.0.0.1:3306/bailian-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
+          url: jdbc:mysql://127.0.0.1:3306/ddt?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
           username: root
           password: Aa@1230
       #        oracle:
@@ -72,7 +72,7 @@ spring:
       ds1:
         type: com.zaxxer.hikari.HikariDataSource
         driver-class-name: com.mysql.cj.jdbc.Driver
-        jdbcUrl: jdbc:mysql://127.0.0.1:3306/bailian-ai?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
+        jdbcUrl: jdbc:mysql://127.0.0.1:3306/ddt?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
         username: root
         password: Aa@1230
     sharding:
@@ -113,6 +113,15 @@ spring:
             standard:
               sharding-column: center_wd_id
               precise-algorithm-class-name: com.benyun.core.utils.sharding.ConsistenceHashAlgorithm
+        bl_topological_enterprise_wd_list:
+          actual-data-nodes: ds1.bl_topological_enterprise_wd_list_$->{1..5}
+          key-generator:
+            column: center_wd_id
+            type: SNOWFLAKE
+          table-strategy:
+            standard:
+              sharding-column: center_wd_id
+              precise-algorithm-class-name: com.benyun.core.utils.sharding.ConsistenceHashAlgorithm
   redis: #redis配置
     host: 127.0.0.1  #redis服务地址
     database: 11

+ 5 - 1
benyun-core/src/main/resources/mapper/TopologicalBuildWdDao.xml

@@ -5,8 +5,12 @@
     <insert id="insertList">
         insert into bl_topological_building_wd_list values
         <foreach collection="topologicalBuildingWds"  separator="," item="item">
-            (#{item.centerWdId}},#{item.radius},#{item.aroundWdId},#{item.aroundWdName},#{item.aroundWdTypeCode},#{item.distance},#{item.addrCode},#{item.addrCodeInfo},#{item.addrInfo},#{item.rent},#{item.buildType},#{item.propertyType},#{item.analyseTime})
+            (#{item.centerWdId},#{item.radius},#{item.aroundWdId},#{item.aroundWdName},#{item.aroundWdTypeCode},#{item.distance},#{item.addrCode},#{item.addrCodeInfo},#{item.addrInfo},#{item.rent},#{item.buildType},#{item.propertyType},#{item.analyseTime})
         </foreach>
     </insert>
+
+    <select id="list" resultType="com.benyun.core.entity.TopologicalBuildingWd">
+        select * from bl_topological_building_wd_list where center_wd_id = #{centerWdId} and  #{radius} >= radius
+    </select>
 </mapper>
 

+ 12 - 0
benyun-core/src/main/resources/mapper/TopologicalBuildWdStatisticsCategoryDao.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.benyun.core.dao.TopologicalBuildWdStatisticsCategoryDao">
+    <insert id="insertList">
+        insert into bl_topological_build_wd_statistics_category values
+        <foreach collection="topologicalBuildWdStatisticsCategoryList"  separator="," item="item">
+            (#{item.centerWdId},#{item.radius},#{item.propertyTypeStatistics},#{item.analyseTime})
+        </foreach>
+    </insert>
+</mapper>
+

+ 6 - 1
benyun-core/src/main/resources/mapper/TopologicalEnterpriseWdDao.xml

@@ -5,7 +5,12 @@
     <insert id="insertList">
         insert into bl_topological_enterprise_wd_list values
         <foreach collection="topologicalEnterpriseWds"  separator="," item="item">
-            (#{item.centerWdId}},#{item.radius},#{item.aroundWdId},#{item.aroundWdName},#{item.aroundWdTypeCode},#{item.distance},#{item.addrCode},#{item.addrCodeInfo},#{item.addrInfo},#{item.industryCode},#{item.registeredCapital},#{item.enterpriseScale},#{item.analyseTime})
+            (#{item.centerWdId},#{item.radius},#{item.aroundWdId},#{item.aroundWdName},#{item.aroundWdTypeCode},#{item.distance},#{item.addrCode},#{item.addrCodeInfo},#{item.addrInfo},#{item.industryCode},#{item.registeredCapital},#{item.enterpriseScale},#{item.analyseTime})
         </foreach>
     </insert>
+
+    <select id="list" resultType="com.benyun.core.entity.TopologicalEnterpriseWd">
+        select * from bl_topological_enterprise_wd_list where center_wd_id = #{centerWdId} and  #{radius} >= radius
+    </select>
+
 </mapper>

+ 6 - 1
benyun-core/src/main/resources/mapper/TopologicalHouseWdDao.xml

@@ -5,7 +5,12 @@
     <insert id="insertList">
         insert into bl_topological_house_wd_list values
         <foreach collection="topologicalHouseWds"  separator="," item="item">
-            (#{item.centerWdId}},#{item.radius},#{item.aroundWdId},#{item.aroundWdName},#{item.aroundWdTypeCode},#{item.distance},#{item.addrCode},#{item.addrCodeInfo},#{item.addrInfo},#{item.rent},#{item.propertyType},#{item.households},#{item.peopleCount},#{item.analyseTime})
+            (#{item.centerWdId},#{item.radius},#{item.aroundWdId},#{item.aroundWdName},#{item.aroundWdTypeCode},#{item.distance},#{item.addrCode},#{item.addrCodeInfo},#{item.addrInfo},#{item.rent},#{item.propertyType},#{item.households},#{item.peopleCount},#{item.analyseTime})
         </foreach>
     </insert>
+
+    <select id="list" resultType="com.benyun.core.entity.TopologicalHouseWd">
+        select * from bl_topological_house_wd_list where center_wd_id = #{centerWdId} and  #{radius} >= radius
+    </select>
+
 </mapper>

+ 12 - 0
benyun-core/src/main/resources/mapper/TopologicalHouseWdStatisticsDataDao.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.benyun.core.dao.TopologicalHouseWdStatisticsDataDao">
+    <insert id="insertList">
+        insert into bl_topological_house_wd_statistics_data values
+        <foreach collection="topologicalHouseWdStatisticsDataList"  separator="," item="item">
+            (#{item.centerWdId},#{item.radius},#{item.houseWdCount},#{item.totalHouseholds},#{item.totalPeopleCount},#{item.averageRent},#{item.analyseTime})
+        </foreach>
+    </insert>
+</mapper>
+

+ 7 - 1
benyun-core/src/main/resources/mapper/TopologicalStoreWdDao.xml

@@ -5,7 +5,13 @@
     <insert id="insertList">
         insert into bl_topological_store_wd_list values
         <foreach collection="topologicalStoreWds"  separator="," item="item">
-            (#{item.centerWdId}},#{item.radius},#{item.aroundWdId},#{item.aroundWdName},#{item.aroundWdTypeCode},#{item.distance},#{item.addrCode},#{item.addrCodeInfo},#{item.addrInfo},#{item.industryCode},#{item.manageTypeCode},#{item.analyseTime})
+            (#{item.centerWdId},#{item.radius},#{item.aroundWdId},#{item.aroundWdName},#{item.aroundWdTypeCode},#{item.distance},#{item.addrCode},#{item.addrCodeInfo},#{item.addrInfo},#{item.industryCode},#{item.manageTypeCode},#{item.analyseTime},#{item.brandId})
         </foreach>
     </insert>
+
+    <select id="list" resultType="com.benyun.core.entity.TopologicalStoreWd">
+        select * from bl_topological_store_wd_list where center_wd_id = #{centerWdId} and  #{radius} >= radius
+    </select>
+
+
 </mapper>

+ 16 - 0
benyun-core/src/main/resources/mapper/TopologicalStoreWdStatisticsCategoryDao.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.benyun.core.dao.TopologicalStoreWdStatisticsCategoryDao">
+    <insert id="insertList">
+        insert into bl_topological_store_wd_statistics_category values
+        <foreach collection="topologicalStoreWdStatisticsCategoryList"  separator="," item="item">
+            (#{item.centerWdId},#{item.radius},#{item.houseWdCount},#{item.bigManageTypeCode},#{item.midManageTypeCode},#{item.subCategoryCodeStatistics},#{item.averageRent},#{item.analyseTime})
+        </foreach>
+    </insert>
+
+    <select id="category" resultType="com.benyun.core.entity.TopologicalStoreWdStatisticsCategory">
+        select * from bl_topological_store_wd_statistics_category where center_wd_id = #{centerWdId} and  #{radius} >= radius
+    </select>
+</mapper>
+

+ 12 - 0
benyun-core/src/main/resources/mapper/WdTopologicalInfoDao.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.benyun.core.dao.WdTopologicalInfoDao">
+    <insert id="insertList">
+        insert into bl_wd_topological_info values
+        <foreach collection="wdTopologicalInfoList"  separator="," item="item">
+            (#{item.centerWdId},#{item.centerWdName},#{item.centerWdTypeCode},#{item.typeCodeBy},#{item.radius},#{item.addrCode},#{item.addrCodeInfo},#{item.addrInfo},#{item.lat},#{item.lng},#{item.geoHash},#{item.tag},#{item.analyseTime})
+        </foreach>
+    </insert>
+</mapper>
+

+ 16 - 0
benyun-core/src/test/java/com/benyun/core/service/AnalyseWdServiceImplTest.java

@@ -0,0 +1,16 @@
+package com.benyun.core.service;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+public class AnalyseWdServiceImplTest {
+    @Autowired
+    AnalyseWdService analyseWdService;
+
+    @Test
+    public void analys(){
+        analyseWdService.analyse();
+    }
+}

+ 2 - 3
benyun-core/src/test/java/com/benyun/core/service/ChannelMapServiceImplTest.java

@@ -1,9 +1,8 @@
 package com.benyun.core.service;
 
-import com.benyun.core.entity.WdCount;
-import com.benyun.core.entity.WdCountBody;
+import com.benyun.core.entity.bo.WdCount;
+import com.benyun.core.entity.bo.WdCountBody;
 import com.benyun.core.entity.WdInfo;
-import com.benyun.core.utils.HashUtil;
 import com.github.pagehelper.PageInfo;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;