Browse Source

Merge branch 'master' into lcy

云殇忆 1 year ago
parent
commit
7efc44b3b0
100 changed files with 2329 additions and 181 deletions
  1. 0 1
      benyun-core/Dockerfile
  2. 24 0
      benyun-core/src/main/java/com/benyun/core/constant/RedisContant.java
  3. 29 3
      benyun-core/src/main/java/com/benyun/core/controller/ChannelAnalyseController.java
  4. 47 11
      benyun-core/src/main/java/com/benyun/core/controller/ChannelMapController.java
  5. 32 0
      benyun-core/src/main/java/com/benyun/core/controller/CommonController.java
  6. 64 0
      benyun-core/src/main/java/com/benyun/core/controller/TopologicalBuildWdController.java
  7. 31 0
      benyun-core/src/main/java/com/benyun/core/controller/TopologicalCommonController.java
  8. 44 0
      benyun-core/src/main/java/com/benyun/core/controller/TopologicalEnterpriseWdController.java
  9. 65 0
      benyun-core/src/main/java/com/benyun/core/controller/TopologicalHouseWdController.java
  10. 66 0
      benyun-core/src/main/java/com/benyun/core/controller/TopologicalStoreWdController.java
  11. 8 0
      benyun-core/src/main/java/com/benyun/core/controller/WdInfoController.java
  12. 32 0
      benyun-core/src/main/java/com/benyun/core/controller/WdRecycleController.java
  13. 9 0
      benyun-core/src/main/java/com/benyun/core/dao/ManageTypeDao.java
  14. 4 1
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalBuildWdDao.java
  15. 14 0
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalBuildWdStatisticsCategoryDao.java
  16. 5 1
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalEnterpriseWdDao.java
  17. 5 1
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalHouseWdDao.java
  18. 14 0
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalHouseWdStatisticsDataDao.java
  19. 6 1
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalStoreWdDao.java
  20. 15 0
      benyun-core/src/main/java/com/benyun/core/dao/TopologicalStoreWdStatisticsCategoryDao.java
  21. 9 0
      benyun-core/src/main/java/com/benyun/core/dao/TypeByDao.java
  22. 6 1
      benyun-core/src/main/java/com/benyun/core/dao/WdInfoMapper.java
  23. 2 1
      benyun-core/src/main/java/com/benyun/core/dao/WdTopologicalDao.java
  24. 14 0
      benyun-core/src/main/java/com/benyun/core/dao/WdTopologicalInfoDao.java
  25. 2 1
      benyun-core/src/main/java/com/benyun/core/entity/AttentionPool.java
  26. 2 1
      benyun-core/src/main/java/com/benyun/core/entity/BuildWd.java
  27. 2 1
      benyun-core/src/main/java/com/benyun/core/entity/EnterpriseWd.java
  28. 2 1
      benyun-core/src/main/java/com/benyun/core/entity/HouseWd.java
  29. 20 0
      benyun-core/src/main/java/com/benyun/core/entity/ManageType.java
  30. 1 0
      benyun-core/src/main/java/com/benyun/core/entity/StoreWd.java
  31. 1 1
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalBuildWdStatisticsCategory.java
  32. 3 3
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalBuildingWd.java
  33. 1 1
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalEnterpriseWd.java
  34. 2 1
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalHouseWd.java
  35. 1 1
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalHouseWdStatisticsData.java
  36. 3 0
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalStoreWd.java
  37. 1 1
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalStoreWdStatisticsCategory.java
  38. 20 0
      benyun-core/src/main/java/com/benyun/core/entity/TypeBy.java
  39. 3 0
      benyun-core/src/main/java/com/benyun/core/entity/WdInfo.java
  40. 15 10
      benyun-core/src/main/java/com/benyun/core/entity/WdTopologicalInfo.java
  41. 10 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BuildWdCategoryCount.java
  42. 16 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/StoreWdCategoryCount.java
  43. 12 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/StoreWdCategoryCountBody.java
  44. 1 1
      benyun-core/src/main/java/com/benyun/core/entity/bo/WdCount.java
  45. 1 1
      benyun-core/src/main/java/com/benyun/core/entity/bo/WdCountBody.java
  46. 53 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/WdTopologicalInfoBo.java
  47. 12 0
      benyun-core/src/main/java/com/benyun/core/entity/vo/AddrCategoryBody.java
  48. 46 0
      benyun-core/src/main/java/com/benyun/core/entity/vo/ChannelAnalyseAceeptVo.java
  49. 2 2
      benyun-core/src/main/java/com/benyun/core/entity/vo/ChannelMapAceeptVo.java
  50. 32 0
      benyun-core/src/main/java/com/benyun/core/entity/vo/TopologicalWdAceeptVo.java
  51. 13 0
      benyun-core/src/main/java/com/benyun/core/entity/vo/TypeByBody.java
  52. 77 0
      benyun-core/src/main/java/com/benyun/core/entity/vo/WdInfoVo.java
  53. 51 0
      benyun-core/src/main/java/com/benyun/core/error/BenYunCoreControllerAdver.java
  54. 34 0
      benyun-core/src/main/java/com/benyun/core/error/entity/BenYunCoreCodeEnum.java
  55. 37 3
      benyun-core/src/main/java/com/benyun/core/init/BenyunCoreInit.java
  56. 7 1
      benyun-core/src/main/java/com/benyun/core/service/ChannelAnalyseService.java
  57. 4 3
      benyun-core/src/main/java/com/benyun/core/service/ChannelMapService.java
  58. 12 0
      benyun-core/src/main/java/com/benyun/core/service/CommonService.java
  59. 11 0
      benyun-core/src/main/java/com/benyun/core/service/ManageTypeService.java
  60. 13 0
      benyun-core/src/main/java/com/benyun/core/service/TopologicalBuildWdSerevice.java
  61. 10 0
      benyun-core/src/main/java/com/benyun/core/service/TopologicalCommonService.java
  62. 9 0
      benyun-core/src/main/java/com/benyun/core/service/TopologicalEnterpriseWdService.java
  63. 16 0
      benyun-core/src/main/java/com/benyun/core/service/TopologicalHouseWdService.java
  64. 15 0
      benyun-core/src/main/java/com/benyun/core/service/TopologicalStoreWdService.java
  65. 9 0
      benyun-core/src/main/java/com/benyun/core/service/WdInfoService.java
  66. 15 0
      benyun-core/src/main/java/com/benyun/core/service/WdRecycleService.java
  67. 229 78
      benyun-core/src/main/java/com/benyun/core/service/impl/AnalyseWdServiceImpl.java
  68. 25 3
      benyun-core/src/main/java/com/benyun/core/service/impl/ChannelAnalyseServiceImpl.java
  69. 73 10
      benyun-core/src/main/java/com/benyun/core/service/impl/ChannelMapServiceImpl.java
  70. 135 0
      benyun-core/src/main/java/com/benyun/core/service/impl/CommonServiceImpl.java
  71. 29 0
      benyun-core/src/main/java/com/benyun/core/service/impl/ManageTypeServiceImpl.java
  72. 70 0
      benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalBuildWdSereviceImpl.java
  73. 42 0
      benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalCommonServiceImpl.java
  74. 29 0
      benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalEnterpriseWdServiceImpl.java
  75. 43 0
      benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalHouseServiceWdImpl.java
  76. 89 0
      benyun-core/src/main/java/com/benyun/core/service/impl/TopologicalStoreWdServiceImpl.java
  77. 20 0
      benyun-core/src/main/java/com/benyun/core/service/impl/WdInfoServiceImpl.java
  78. 69 0
      benyun-core/src/main/java/com/benyun/core/service/impl/WdRecycleServiceImpl.java
  79. 2 3
      benyun-core/src/main/java/com/benyun/core/service/impl/WdTopologicalServiceImpl.java
  80. 3 3
      benyun-core/src/main/java/com/benyun/core/utils/SpringUtil.java
  81. 4 0
      benyun-core/src/main/java/com/benyun/core/valida/TopologicalWdGroup.java
  82. 4 0
      benyun-core/src/main/java/com/benyun/core/valida/TopologicalWdListGroup.java
  83. 12 3
      benyun-core/src/main/resources/application-dev.yaml
  84. 181 0
      benyun-core/src/main/resources/application-prod.yaml
  85. 5 1
      benyun-core/src/main/resources/application.yaml
  86. 5 1
      benyun-core/src/main/resources/mapper/TopologicalBuildWdDao.xml
  87. 12 0
      benyun-core/src/main/resources/mapper/TopologicalBuildWdStatisticsCategoryDao.xml
  88. 6 1
      benyun-core/src/main/resources/mapper/TopologicalEnterpriseWdDao.xml
  89. 6 1
      benyun-core/src/main/resources/mapper/TopologicalHouseWdDao.xml
  90. 12 0
      benyun-core/src/main/resources/mapper/TopologicalHouseWdStatisticsDataDao.xml
  91. 7 1
      benyun-core/src/main/resources/mapper/TopologicalStoreWdDao.xml
  92. 16 0
      benyun-core/src/main/resources/mapper/TopologicalStoreWdStatisticsCategoryDao.xml
  93. 18 0
      benyun-core/src/main/resources/mapper/WdInfoMapper.xml
  94. 12 0
      benyun-core/src/main/resources/mapper/WdTopologicalInfoDao.xml
  95. 3 0
      benyun-core/src/test/java/com/benyun/core/BenyunCoreApplicationTests.java
  96. 16 0
      benyun-core/src/test/java/com/benyun/core/service/AnalyseWdServiceImplTest.java
  97. 0 8
      benyun-core/src/test/java/com/benyun/core/service/ChannelAnalyeServiceImpTest.java
  98. 8 5
      benyun-core/src/test/java/com/benyun/core/service/ChannelMapServiceImplTest.java
  99. 0 7
      pom.xml
  100. 2 2
      ruoyi-admin/src/main/resources/application-dev.yml

+ 0 - 1
benyun-core/Dockerfile

@@ -10,7 +10,6 @@ WORKDIR /saas/modules/integral
 
 #ENV SERVER_PORT=9210
 #
-EXPOSE 8000
 
 ADD ./target/benyun-core-4.8.0.jar ./app.jar
 

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

@@ -9,4 +9,28 @@ 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;
+
+    public static String CHANNEL_ANALYSE_CITYTIER = "channel_analyse_cityiter";
+    public static int CHANNEL_ANALYSE_CITYTIER_TIME = 30;
 }

+ 29 - 3
benyun-core/src/main/java/com/benyun/core/controller/ChannelAnalyseController.java

@@ -1,12 +1,19 @@
 package com.benyun.core.controller;
 
+import com.benyun.core.constant.RedisContant;
+import com.benyun.core.entity.Brand;
+import com.benyun.core.entity.bo.WdCount;
+import com.benyun.core.entity.vo.ChannelAnalyseAceeptVo;
 import com.benyun.core.service.ChannelAnalyseService;
+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.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.HashMap;
+import java.util.concurrent.TimeUnit;
 
 @RestController
 @RequestMapping("/channelAnalyse")
@@ -14,11 +21,30 @@ public class ChannelAnalyseController {
 
     @Autowired
     ChannelAnalyseService channelAnalyseService;
+    @Autowired
+    RedisTemplate redisTemplate;
 
-    //TODO 未加入到redis
     @RequestMapping("/cityTier")
-    public R cityTier(String searchText){
-        HashMap hashMap = channelAnalyseService.cityTier(searchText);
+    public R cityTier(ChannelAnalyseAceeptVo channelAnalyseAceeptVo){
+        String md5 = channelAnalyseAceeptVo.getHash();
+
+        //2.查看redis中是否存在有缓存
+        HashMap wdCount = (HashMap) redisTemplate.boundHashOps(RedisContant.CHANNEL_ANALYSE_CITYTIER).get(md5);
+        if (wdCount != null) {
+            return R.ok(wdCount);
+        }
+
+        HashMap hashMap = channelAnalyseService.cityTier(channelAnalyseAceeptVo);
+
+        //4.保存到redis中
+        redisTemplate.boundHashOps(RedisContant.CHANNEL_ANALYSE_CITYTIER).put(md5,hashMap);
+        redisTemplate.expire(RedisContant.CHANNEL_ANALYSE_CITYTIER,RedisContant.CHANNEL_ANALYSE_CITYTIER_TIME, TimeUnit.MINUTES); //30分钟
         return R.ok(hashMap);
     }
+
+    @RequestMapping("/brandList")
+    public R brandList(ChannelAnalyseAceeptVo channelAnalyseAceeptVo){
+        PageInfo<Brand> brandPageInfo = channelAnalyseService.brandList(channelAnalyseAceeptVo);
+        return R.ok(brandPageInfo);
+    }
 }

+ 47 - 11
benyun-core/src/main/java/com/benyun/core/controller/ChannelMapController.java

@@ -1,12 +1,14 @@
 package com.benyun.core.controller;
 
-import com.benyun.core.constant.ChannelMapContant;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.benyun.core.constant.RedisContant;
-import com.benyun.core.entity.WdCount;
+import com.benyun.core.dao.AttentionPoolDao;
+import com.benyun.core.entity.AttentionPool;
+import com.benyun.core.entity.bo.WdCount;
 import com.benyun.core.entity.WdInfo;
+import com.benyun.core.entity.bo.WdTopologicalInfoBo;
 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,10 +20,11 @@ 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.HashMap;
+import java.util.List;
 import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
 
 
 @RestController
@@ -33,6 +36,9 @@ public class ChannelMapController {
     @Autowired
     private RedisTemplate redisTemplate;
 
+    @Autowired
+    AttentionPoolDao attentionPoolDao;
+
     @RequestMapping("/getArea")
     public R area(@Validated(value={ChannelAreaGroup.class}) ChannelMapAceeptVo channel) {
         String md5 = channel.getHash();
@@ -54,24 +60,30 @@ public class ChannelMapController {
         return R.ok(area);
     }
 
-    //TODO 这里还需要思考返回来的是什么数据
+
     @RequestMapping("/list")
     public R list(@Validated(value={ChannelListGroup.class}) ChannelMapAceeptVo channel){
 
         String md5 = channel.getHash();
-        PageInfo<WdInfo> pageInfo = (PageInfo<WdInfo>) redisTemplate.boundHashOps(RedisContant.CHANNEL_MAP_LIST).get(md5);
+        HashMap pageInfo = (HashMap) redisTemplate.boundHashOps(RedisContant.CHANNEL_MAP_LIST).get(md5);
         if(pageInfo != null){
+            List<WdTopologicalInfoBo> data = (List<WdTopologicalInfoBo>) pageInfo.get("data");
+            attention(data);
+            pageInfo.put("data",data);
             return R.ok(pageInfo);
         }
 
-        PageInfo<WdInfo> list = channelMapService.list(channel.getChannel(), channel.getRankType(), channel.getSearchText(), channel.getOrderby(), channel.getAddrCode(), channel.getPageNum(), channel.getPageSize());
-        if(list == null)
+        HashMap hashMap = channelMapService.list(channel.getChannel(), channel.getRankType(), channel.getSearchText(), channel.getOrderby(), channel.getAddrCode(), channel.getPageNum(), channel.getPageSize());
+        if(hashMap == null)
             return R.fail("请求参数错误");
 
         //4.保存到redis中
-        redisTemplate.boundHashOps(RedisContant.CHANNEL_MAP_LIST).put(md5,list);
+        List<WdTopologicalInfoBo> data = (List<WdTopologicalInfoBo>) hashMap.get("data");
+        attention(data);
+        hashMap.put("data",data);
+        redisTemplate.boundHashOps(RedisContant.CHANNEL_MAP_LIST).put(md5,hashMap);
         redisTemplate.expire(RedisContant.CHANNEL_MAP_LIST,RedisContant.CHANNEL_MAP_LIST_TIME, TimeUnit.MINUTES); //30分钟
-        return R.ok(list);
+        return R.ok(hashMap);
     }
 
     @RequestMapping("/point")
@@ -92,4 +104,28 @@ public class ChannelMapController {
         return R.ok(point);
     }
 
+    //Todo 标记网点关注
+    public void attention(List<WdTopologicalInfoBo> wdTopologicalInfoBos){
+        List<String> collect = wdTopologicalInfoBos.stream().map(wdTopologicalInfoBo -> {
+            return wdTopologicalInfoBo.getCenterWdId();
+        }).collect(Collectors.toList());
+
+        //标志是否关注
+        QueryWrapper<AttentionPool> queryWrapper1 = new QueryWrapper<>();
+        queryWrapper1.select("wd_id");
+        queryWrapper1.in("wd_id",collect);
+        List<AttentionPool> attentionPools = attentionPoolDao.selectList(queryWrapper1);
+        List<String> collect1 = attentionPools.stream().map(attentionPool -> {
+            return attentionPool.getWdId();
+        }).collect(Collectors.toList());
+
+        for (WdTopologicalInfoBo wdTopologicalInfoBo : wdTopologicalInfoBos) {
+            boolean contains = collect1.contains(wdTopologicalInfoBo.getCenterWdId());
+            if (contains)
+                wdTopologicalInfoBo.setAttention(1);
+            else
+                wdTopologicalInfoBo.setAttention(0);
+        }
+    }
+
 }

+ 32 - 0
benyun-core/src/main/java/com/benyun/core/controller/CommonController.java

@@ -0,0 +1,32 @@
+package com.benyun.core.controller;
+
+import com.benyun.core.entity.vo.AddrCategoryBody;
+import com.benyun.core.entity.vo.TypeByBody;
+import com.benyun.core.service.CommonService;
+import com.ruoyi.common.core.domain.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/common")
+public class CommonController {
+    @Autowired
+    CommonService commonService;
+    //获取网点标签
+    @GetMapping("/tag")
+    public R tag(){
+        List<TypeByBody> tag = commonService.tag();
+        return R.ok(tag);
+    }
+
+    //获取网点标签
+    @GetMapping("/addrCodeMap")
+    public R addrCodeMap(){
+        List<AddrCategoryBody> addrCategoryBodies = commonService.addrCodeMap();
+        return R.ok(addrCategoryBodies);
+    }
+}

+ 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);
+    }
+}

+ 8 - 0
benyun-core/src/main/java/com/benyun/core/controller/WdInfoController.java

@@ -1,7 +1,11 @@
 package com.benyun.core.controller;
 
+import com.benyun.core.entity.WdInfo;
 import com.benyun.core.entity.vo.BrandListQueryBody;
+import com.benyun.core.entity.vo.TypeByBody;
+import com.benyun.core.entity.vo.WdInfoVo;
 import com.benyun.core.service.WdInfoService;
+import com.github.pagehelper.PageInfo;
 import com.ruoyi.common.core.domain.R;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,6 +14,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.HashMap;
 import java.util.List;
 
 @Validated
@@ -41,4 +46,7 @@ public class WdInfoController {
     public R total(){
         return R.ok(wdInfoService.searchWdTotal());
     }
+
+
+
 }

+ 32 - 0
benyun-core/src/main/java/com/benyun/core/controller/WdRecycleController.java

@@ -0,0 +1,32 @@
+package com.benyun.core.controller;
+
+import com.benyun.core.entity.vo.TypeByBody;
+import com.benyun.core.entity.vo.WdInfoVo;
+import com.benyun.core.service.WdRecycleService;
+import com.ruoyi.common.core.domain.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+
+@RestController
+@RequestMapping("/recycle/wd")
+public class WdRecycleController {
+
+    @Autowired
+    WdRecycleService wdRecycleService;
+
+
+    //获取网点回收站列表
+    @GetMapping("/list")
+    public R list(WdInfoVo wdInfoVo){
+        HashMap<String, Object> list = wdRecycleService.list(wdInfoVo);
+        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);
+}

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

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

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

@@ -1,14 +1,19 @@
 package com.benyun.core.dao;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.benyun.core.entity.WdInfo;
 import com.benyun.core.entity.bo.WdAddrTypeDistribution;
+import com.benyun.core.entity.vo.WdInfoVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 @Mapper
-public interface WdInfoMapper {
+public interface WdInfoMapper extends BaseMapper<WdInfo> {
     List<WdAddrTypeDistribution> searchAddrDisByMulti(@Param("addrCodes") List<String> addrCodes,@Param("typeCodes") List<String> typeCodes);
     List<WdAddrTypeDistribution> searchWdTypeDisByMulti(@Param("addrCodes") List<String> addrCodes,@Param("typeCodes") List<String> typeCodes);
     List<WdAddrTypeDistribution> searchWdTotal();
+
+    List<WdInfo> list(WdInfoVo wdInfoVo);
 }

+ 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/AttentionPool.java

@@ -2,13 +2,14 @@ package com.benyun.core.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import lombok.Data;
 
 import java.util.Date;
 
 @Data
 @TableName("bl_attention_pool")
-public class AttentionPool {
+public class AttentionPool{
     @TableField("attention_id")
     private String attentionId;
     @TableField("contact")

+ 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;
+}

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

@@ -34,6 +34,7 @@ public class StoreWd {
     private String businessTime;
     @TableField("telephone")
     private String telephone;
+
     @TableField("contact")
     private String contact;
 }

+ 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;
 

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

@@ -1,6 +1,7 @@
 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;
 
@@ -9,7 +10,7 @@ import java.time.LocalDateTime;
 @Data
 @TableName("bl_topological_building_wd_list")
 public class TopologicalBuildingWd {
-    @TableField("center_wd_id")
+    @TableId("center_wd_id")
     private String centerWdId;
     @TableField("radius")
     private int radius;
@@ -32,8 +33,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;

+ 20 - 0
benyun-core/src/main/java/com/benyun/core/entity/TypeBy.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_type_by")
+public class TypeBy {
+    @TableField("type_code_by")
+    private String typeCodeBy;
+    @TableField("big_category")
+    private String bigCategory;
+    @TableField("mid_category")
+    private String midCategory;
+    @TableField("sub_category")
+    private String subCategory;
+    @TableField("full_info")
+    private String fullInfo;
+}

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

@@ -79,4 +79,7 @@ public class WdInfo {
     private String hash;
     @TableField("geo_hash")
     private String geoHash;
+
+    @TableField("show_delete")
+    private int showDelete;
 }

+ 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;
 

+ 53 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/WdTopologicalInfoBo.java

@@ -0,0 +1,53 @@
+package com.benyun.core.entity.bo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.benyun.core.entity.WdTopologicalInfo;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.HashMap;
+import java.util.List;
+
+@Data
+@TableName("bl_wd_topological_info")
+public class WdTopologicalInfoBo {
+    private String centerWdId;
+    private String centerWdName;
+    private String centerWdTypeCode;
+
+    private String typeCodeBy;
+
+    private int radius;
+    private String addrCode;
+    private String addrCodeInfo;
+    private String addrInfo;
+    private BigDecimal lat;
+    private BigDecimal lng;
+    private String geoHash;
+    private List<String> tag;
+
+    private int attention;
+
+    @TableField("analyse_time")
+    private LocalDateTime analyseTime;
+
+    public WdTopologicalInfoBo(WdTopologicalInfo wdTopologicalInfo) {
+        this.centerWdId = wdTopologicalInfo.getCenterWdId();
+        this.centerWdName = wdTopologicalInfo.getCenterWdName();
+        this.centerWdTypeCode = wdTopologicalInfo.getCenterWdTypeCode();
+        this.typeCodeBy = wdTopologicalInfo.getTypeCodeBy();
+        this.radius = wdTopologicalInfo.getRadius();
+        this.addrCode = wdTopologicalInfo.getAddrCode();
+        this.addrCodeInfo = wdTopologicalInfo.getAddrCodeInfo();
+        this.addrInfo = wdTopologicalInfo.getAddrInfo();
+        this.lat = wdTopologicalInfo.getLat();
+        this.lng = wdTopologicalInfo.getLng();
+        this.geoHash = wdTopologicalInfo.getGeoHash();
+        this.analyseTime = wdTopologicalInfo.getAnalyseTime();
+    }
+
+    public WdTopologicalInfoBo() {
+    }
+}

+ 12 - 0
benyun-core/src/main/java/com/benyun/core/entity/vo/AddrCategoryBody.java

@@ -0,0 +1,12 @@
+package com.benyun.core.entity.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class AddrCategoryBody {
+    private String addrCore;
+    private String addrCoreName;
+    private List<AddrCategoryBody> addrCategoryes;
+}

+ 46 - 0
benyun-core/src/main/java/com/benyun/core/entity/vo/ChannelAnalyseAceeptVo.java

@@ -0,0 +1,46 @@
+package com.benyun.core.entity.vo;
+
+import com.benyun.core.constant.ChannelMapContant;
+import com.benyun.core.utils.HashUtil;
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Autowired;
+
+@Data
+public class ChannelAnalyseAceeptVo {
+    String[] channel;
+
+    String searchText;
+
+    /*
+     * 分页字段(list、point接口)
+     * */
+    int pageNum = 1;
+    int pageSize = 10;
+
+    public String[] getChannel() {
+        if(this.channel == null || this.channel.length == 0){
+            return channel = ChannelMapContant.FULL_CHANNEL;
+        }
+        return channel;
+    }
+
+    public String getHash(){
+        StringBuilder stringBuilder = new StringBuilder();
+
+        //搜索渠道
+        for (String s : getChannel()) {
+            stringBuilder.append(s);
+        }
+        //搜索文本
+        stringBuilder.append(this.searchText);
+
+        stringBuilder.append(pageNum);
+        stringBuilder.append(pageSize);
+
+        //生成Hash
+        String s = stringBuilder.toString();
+        String md5 = HashUtil.hash(s, "MD5");
+
+        return md5;
+    }
+}

+ 2 - 2
benyun-core/src/main/java/com/benyun/core/entity/vo/ChannelMapAceeptVo.java

@@ -24,10 +24,10 @@ public class ChannelMapAceeptVo {
     * 当 rankType = province,city 需要提交省区码编码
     * 当 rankType = zone 需要提交市区码编码
     * */
-    @NotEmpty(groups = {ChannelPointGroup.class})
+    @NotEmpty(groups = {ChannelPointGroup.class},message = "地区码为空")
     String[] addrCode;
 
-    String orderby = "collect_time"; //排序字段,(list接口)
+    String orderby = ""; //排序字段,(list接口)
 
     /*
     * 分页字段(list、point接口)

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

@@ -0,0 +1,32 @@
+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},message = "请选择中心点")
+    String centerWdId;
+    @NotNull(groups = {TopologicalWdGroup.class,TopologicalWdListGroup.class},message = "半径范围未正确选择")
+    int radius;
+    int pageNum = 1;
+    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;
+    }
+}

+ 13 - 0
benyun-core/src/main/java/com/benyun/core/entity/vo/TypeByBody.java

@@ -0,0 +1,13 @@
+package com.benyun.core.entity.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class TypeByBody {
+    public String typeCodeBy;
+    public String typeNameBy;
+    private List<TypeByBody> typeByBodies;
+
+}

+ 77 - 0
benyun-core/src/main/java/com/benyun/core/entity/vo/WdInfoVo.java

@@ -0,0 +1,77 @@
+package com.benyun.core.entity.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.benyun.core.entity.WdInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+@Data
+public class WdInfoVo {
+    private String wdId;
+    private String wdName;
+    private String addrInfo;
+    private String addrCode;
+
+    private String addrCodeInfo;
+    private BigDecimal lat;
+    private BigDecimal lng;
+    private String typeCodeBy;
+    private String typeNameBy;
+
+    private String wdTypeCode;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonSerialize(using = LocalDateTimeSerializer.class)
+    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
+    private LocalDateTime enterTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonSerialize(using = LocalDateTimeSerializer.class)
+    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
+    private LocalDateTime updateTime;
+    private String collectUserId;
+    private String collectPerson;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonSerialize(using = LocalDateTimeSerializer.class)
+    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
+    private LocalDateTime collectTime;
+
+    @TableField("show_delete")
+    private int showDelete;
+
+    int pageNum = 1;
+
+    int pageSize = 10;
+
+    private String orderBy = "collect_time";
+
+    public WdInfoVo(WdInfo wdInfo) {
+        this.wdId = wdInfo.getWdId();
+        this.wdName = wdInfo.getWdName();
+        this.addrInfo = wdInfo.getAddrInfo();
+        this.addrCode = wdInfo.getAddrCode();
+        this.lat = wdInfo.getLat();
+        this.lng = wdInfo.getLng();
+        this.typeCodeBy = wdInfo.getTypeCodeBy();
+        this.typeNameBy = wdInfo.getTypeNameBy();
+        this.wdTypeCode = wdInfo.getWdTypeCode();
+        this.enterTime = wdInfo.getEnterTime();
+        this.updateTime = wdInfo.getUpdateTime();
+        this.collectUserId = wdInfo.getCollectUserId();
+        this.collectPerson = wdInfo.getCollectPerson();
+        this.collectTime = wdInfo.getCollectTime();
+        this.showDelete = wdInfo.getShowDelete();
+    }
+
+    public WdInfoVo() {
+    }
+}

+ 51 - 0
benyun-core/src/main/java/com/benyun/core/error/BenYunCoreControllerAdver.java

@@ -0,0 +1,51 @@
+package com.benyun.core.error;
+
+import com.benyun.core.error.entity.BenYunCoreCodeEnum;
+import com.ruoyi.common.core.domain.R;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.BindException;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.FieldError;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+import java.util.HashMap;
+
+@Slf4j  //lombok的日志记录
+@RestControllerAdvice
+public class BenYunCoreControllerAdver {
+    /*
+     * 精确匹配异常处理
+     * */
+    @ExceptionHandler(value = BindException.class)
+    public R handleVaildException(BindException e){
+        //获取BindingResult
+        BindingResult result = e.getBindingResult();
+
+        //1.创建Map,用于存储错误信息
+        HashMap<String,String> hashMap = new HashMap<>();
+
+        //2.将错误信息放入map
+        FieldError fieldError = result.getFieldErrors().get(0);
+
+
+        //3.返回错误信息
+        return R.fail(400,fieldError.getDefaultMessage());
+    }
+
+    /*
+     * 所有异常处理
+     * */
+    @ExceptionHandler(value = Exception.class)
+    public R handleException(Exception e){
+
+        //记录错误信息
+        log.error(e.getMessage());
+        e.printStackTrace();
+
+
+        return R.fail(BenYunCoreCodeEnum.OTHER_ERROR.getCode(), BenYunCoreCodeEnum.OTHER_ERROR.getMsg());
+    }
+}

+ 34 - 0
benyun-core/src/main/java/com/benyun/core/error/entity/BenYunCoreCodeEnum.java

@@ -0,0 +1,34 @@
+package com.benyun.core.error.entity;
+
+import lombok.Data;
+
+public enum BenYunCoreCodeEnum {
+    OTHER_ERROR(500,"系统出现了未知错误,请您稍后再试~");
+
+    int code;
+    String msg;
+
+    BenYunCoreCodeEnum(int code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    BenYunCoreCodeEnum() {
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

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

@@ -1,7 +1,11 @@
 package com.benyun.core.init;
 
 import com.benyun.core.dao.AddrCategoryDao;
+import com.benyun.core.dao.TypeByDao;
 import com.benyun.core.entity.AddrCategory;
+import com.benyun.core.entity.ManageType;
+import com.benyun.core.entity.TypeBy;
+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 +18,12 @@ public class BenyunCoreInit {
     @Autowired
     AddrCategoryDao addrCategoryDao;
 
+    @Autowired
+    ManageTypeService manageTypeService;
+
+    @Autowired
+    TypeByDao byDao;
+
     @Bean("cityTierMap")
     public HashMap getCityTierMap(){
         HashMap<String, String> hashMap = new HashMap<>();
@@ -27,10 +37,34 @@ 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());
+        }
+        return hashMap;
+    }
+
+    @Bean("addrCodeMap")
+    public HashMap getAddrCodeMap(){
+        HashMap<String,String> hashMap = new HashMap<>();
+        for (AddrCategory addrCode : addrCategoryDao.selectList(null)) {
+            hashMap.put(addrCode.getAddrCode(),addrCode.getAddrInfo());
+        }
+        return hashMap;
+    }
+
+    @Bean("typeByMap")
+    public HashMap getTypeByMap(){
+        HashMap<String,String> hashMap = new HashMap<>();
+        for (TypeBy datum : byDao.selectList(null)) {
+            hashMap.put(datum.getTypeCodeBy(),datum.getFullInfo());
+        }
         return hashMap;
     }
 }

+ 7 - 1
benyun-core/src/main/java/com/benyun/core/service/ChannelAnalyseService.java

@@ -1,11 +1,17 @@
 package com.benyun.core.service;
 
+import com.benyun.core.entity.Brand;
 import com.benyun.core.entity.CityTierBody;
+import com.benyun.core.entity.vo.ChannelAnalyseAceeptVo;
+import com.github.pagehelper.PageInfo;
 import com.ruoyi.common.core.domain.R;
 
 import java.util.HashMap;
 import java.util.List;
 
 public interface ChannelAnalyseService {
-    public HashMap cityTier(String searchText);
+    public HashMap cityTier(ChannelAnalyseAceeptVo channelAnalyseAceeptVo);
+
+    PageInfo<Brand> brandList(ChannelAnalyseAceeptVo channelAnalyseAceeptVo);
+
 }

+ 4 - 3
benyun-core/src/main/java/com/benyun/core/service/ChannelMapService.java

@@ -1,15 +1,16 @@
 package com.benyun.core.service;
 
-import com.benyun.core.entity.WdCount;
-import com.benyun.core.entity.WdCountBody;
+import com.benyun.core.entity.WdTopologicalInfo;
+import com.benyun.core.entity.bo.WdCount;
 import com.benyun.core.entity.WdInfo;
 import com.github.pagehelper.PageInfo;
 
+import java.util.HashMap;
 import java.util.List;
 
 public interface ChannelMapService {
     public WdCount area(List<String> channel, String rankType, String searchText, String[] addrCode);
-    public PageInfo<WdInfo> list(String[] channel, String rankType, String searchText, String orderby, String[] addrCode, int pageNum, int pageSize);
+    public HashMap list(String[] channel, String rankType, String searchText, String orderby, String[] addrCode, int pageNum, int pageSize);
 
     public PageInfo<WdInfo> point(String[] channel, String searchText, String[] addrCode, int pageNum, int pageSize);
 }

+ 12 - 0
benyun-core/src/main/java/com/benyun/core/service/CommonService.java

@@ -0,0 +1,12 @@
+package com.benyun.core.service;
+
+import com.benyun.core.entity.vo.AddrCategoryBody;
+import com.benyun.core.entity.vo.TypeByBody;
+
+import java.util.List;
+
+public interface CommonService {
+    List<AddrCategoryBody> addrCodeMap();
+    List<TypeByBody> tag();
+
+}

+ 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);
+}

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

@@ -1,11 +1,20 @@
 package com.benyun.core.service;
 
+import com.benyun.core.entity.WdInfo;
 import com.benyun.core.entity.bo.WdAddrTypeDistribution;
+import com.benyun.core.entity.vo.TypeByBody;
+import com.benyun.core.entity.vo.WdInfoVo;
+import com.github.pagehelper.PageInfo;
 
+import java.util.HashMap;
 import java.util.List;
 
 public interface WdInfoService {
     List<WdAddrTypeDistribution> searchAddrTypeDistribution(List<String> addrCodes, List<String> typeCodes);
     List<WdAddrTypeDistribution> searchWdTypeDistribution(List<String> addrCodes, List<String> typeCodes);
     List<WdAddrTypeDistribution> searchWdTotal();
+
+
+
+
 }

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

@@ -0,0 +1,15 @@
+package com.benyun.core.service;
+
+import com.benyun.core.entity.AddrCategory;
+import com.benyun.core.entity.vo.AddrCategoryBody;
+import com.benyun.core.entity.vo.TypeByBody;
+import com.benyun.core.entity.vo.WdInfoVo;
+
+import java.util.HashMap;
+import java.util.List;
+
+public interface WdRecycleService {
+
+    HashMap<String, Object> list(WdInfoVo wdInfo);
+
+}

+ 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()];  //分类tag:key:byCode value:数量
 
-            //楼宇网点分析统计
-            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);
 
         }
     }

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

@@ -1,10 +1,16 @@
 package com.benyun.core.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.benyun.core.dao.BrandMapper;
 import com.benyun.core.dao.WdInfoDao;
+import com.benyun.core.entity.Brand;
 import com.benyun.core.entity.CityTierBody;
+import com.benyun.core.entity.TopologicalStoreWd;
 import com.benyun.core.entity.WdInfo;
+import com.benyun.core.entity.vo.ChannelAnalyseAceeptVo;
 import com.benyun.core.service.ChannelAnalyseService;
+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;
@@ -22,8 +28,11 @@ public class ChannelAnalyseServiceImpl implements ChannelAnalyseService {
     @Qualifier("cityTierMap")
     HashMap<String,String> cityTierMap;
 
+    @Autowired
+    BrandMapper brandMapper;
+
     @Override
-    public HashMap cityTier(String searchText) {
+    public HashMap cityTier(ChannelAnalyseAceeptVo channelAnalyseAceeptVo) {
         HashMap<String,Long> result = new HashMap<>();
         result.put("一线",0L);
         result.put("新一线",0L);
@@ -35,8 +44,13 @@ public class ChannelAnalyseServiceImpl implements ChannelAnalyseService {
 
         //1.获取所有符合条件的网点信息
         QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
-        if(searchText != null && !searchText.equals(""))
-            queryWrapper.like("wd_name",searchText);
+        queryWrapper.in("wd_type_code", channelAnalyseAceeptVo.getChannel());
+        if(channelAnalyseAceeptVo.getSearchText() != null && !channelAnalyseAceeptVo.getSearchText().equals("")){
+            queryWrapper.and(wdInfoQueryWrapper -> {
+                wdInfoQueryWrapper.like("wd_name",channelAnalyseAceeptVo.getSearchText());
+            });
+        }
+
         List<WdInfo> wdInfos = wdInfoDao.selectList(queryWrapper);
         System.out.println(wdInfos.size());
         for (WdInfo wdInfo : wdInfos) {
@@ -55,4 +69,12 @@ public class ChannelAnalyseServiceImpl implements ChannelAnalyseService {
 
         return result;
     }
+
+    @Override
+    public PageInfo<Brand> brandList(ChannelAnalyseAceeptVo channelAnalyseAceeptVo) {
+        PageHelper.startPage(channelAnalyseAceeptVo.getPageNum(),channelAnalyseAceeptVo.getPageSize());
+        List<Brand> brands = brandMapper.searchList(channelAnalyseAceeptVo.getSearchText());
+        PageInfo<Brand> pageInfo = new PageInfo<>(brands);
+        return pageInfo;
+    }
 }

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

@@ -2,21 +2,29 @@ package com.benyun.core.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.benyun.core.dao.AddrCategoryDao;
+import com.benyun.core.dao.AttentionPoolDao;
 import com.benyun.core.dao.WdInfoDao;
+import com.benyun.core.dao.WdTopologicalInfoDao;
 import com.benyun.core.entity.AddrCategory;
-import com.benyun.core.entity.WdCount;
-import com.benyun.core.entity.WdCountBody;
+import com.benyun.core.entity.AttentionPool;
+import com.benyun.core.entity.WdTopologicalInfo;
+import com.benyun.core.entity.bo.WdCount;
+import com.benyun.core.entity.bo.WdCountBody;
 import com.benyun.core.entity.WdInfo;
+import com.benyun.core.entity.bo.WdTopologicalInfoBo;
 import com.benyun.core.service.ChannelMapService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.ruoyi.common.core.domain.R;
 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.Arrays;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
+import java.util.stream.Collectors;
 
 @Service
 public class ChannelMapServiceImpl implements ChannelMapService {
@@ -27,6 +35,20 @@ public class ChannelMapServiceImpl implements ChannelMapService {
     @Autowired
     private WdInfoDao originWdInfoDao;
 
+    @Autowired
+    private WdTopologicalInfoDao wdTopologicalInfoDao;
+
+    @Autowired
+    @Qualifier("addrCodeMap")
+    private HashMap<String,String> addrCodeMap;
+
+    @Autowired
+    @Qualifier("typeByMap")
+    private HashMap<String,String> typeByMap;
+
+    @Autowired
+    AttentionPoolDao attentionPoolDao;
+
     @Override
     public WdCount area(List<String> channel, String rankType, String searchText, String[] addrCode) {
         long start = System.currentTimeMillis();
@@ -137,8 +159,9 @@ 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) {
+    public HashMap list(String[] channel, String rankType, String searchText, String orderby, String[] addrCode, int pageNum, int pageSize) {
         //1.根据不同级别得到地区码
         List<String> addrCodeList = new ArrayList<>();
         if ("province".equals(rankType)) {
@@ -165,8 +188,8 @@ public class ChannelMapServiceImpl implements ChannelMapService {
 
 
         //2.根据地区前缀找到所有的网点
-        QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.in("wd_type_code", channel).and(originWdInfoQueryWrapper -> {
+        QueryWrapper<WdTopologicalInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.in("center_wd_type_code", channel).and(originWdInfoQueryWrapper -> {
             for (String s : addrCodeList) {
                 originWdInfoQueryWrapper.likeRight("addr_code", s).or();
             }
@@ -174,17 +197,57 @@ public class ChannelMapServiceImpl implements ChannelMapService {
 
         if (searchText != null && !searchText.trim().equals("")) {
             queryWrapper.and(originWdInfoQueryWrapper -> {
-                originWdInfoQueryWrapper.like("wd_name", searchText);
+                originWdInfoQueryWrapper.like("center_wd_name", searchText);
             });
         }
+
+        queryWrapper.and(wdTopologicalInfoQueryWrapper -> {
+            wdTopologicalInfoQueryWrapper.eq("radius",1000); //1km内算附近
+        });
+
         if (orderby != null && !orderby.trim().equals("")) {
             queryWrapper.orderByDesc(orderby);
         }
 
+        //获取数据
         PageHelper.startPage(pageNum, pageSize);
-        List<WdInfo> originWdInfos = originWdInfoDao.selectList(queryWrapper);
-        PageInfo<WdInfo> PageInfo = new PageInfo<>(originWdInfos);
-        return PageInfo;
+        List<WdTopologicalInfo> originWdInfos = wdTopologicalInfoDao.selectList(queryWrapper);
+        PageInfo<WdTopologicalInfo> PageInfo = new PageInfo<>(originWdInfos);
+
+
+        //组装
+        List<WdTopologicalInfoBo> collect = PageInfo.getList().stream().map(wdTopologicalInfo -> {
+            wdTopologicalInfo.setAddrCodeInfo(addrCodeMap.get(wdTopologicalInfo.getAddrCode()));
+
+            List<String> list = new ArrayList<>();
+            String tag = wdTopologicalInfo.getTag();
+            for (String s : tag.split(";")) {
+                String[] split = s.split(":");
+                if (split != null && split.length == 2) {
+                    String[] split1 = typeByMap.get(split[0]).split(":");
+                    String t = "";
+                    if (split1.length == 3)
+                        t = split1[2];
+                    else if (split1.length == 2)
+                        t = split1[1];
+                    else if (split1.length == 1)
+                        t = split1[0];
+                    list.add(t);
+                }
+            }
+
+            WdTopologicalInfoBo wdTopologicalInfoBo = new WdTopologicalInfoBo(wdTopologicalInfo);
+            wdTopologicalInfoBo.setTag(list);
+            return wdTopologicalInfoBo;
+        }).collect(Collectors.toList());
+
+
+        PageInfo.setList(null);
+        HashMap result = new HashMap();
+        result.put("data",collect);
+        result.put("page",PageInfo);
+
+        return result;
     }
 
     @Override

+ 135 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/CommonServiceImpl.java

@@ -0,0 +1,135 @@
+package com.benyun.core.service.impl;
+
+import com.benyun.core.dao.AddrCategoryDao;
+import com.benyun.core.dao.TypeByDao;
+import com.benyun.core.entity.AddrCategory;
+import com.benyun.core.entity.TypeBy;
+import com.benyun.core.entity.vo.AddrCategoryBody;
+import com.benyun.core.entity.vo.TypeByBody;
+import com.benyun.core.service.CommonService;
+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;
+import java.util.stream.Collectors;
+
+@Service
+public class CommonServiceImpl implements CommonService {
+
+    @Autowired
+    TypeByDao typeByDao;
+
+    @Autowired
+    AddrCategoryDao addrCategoryDao;
+
+    @Override
+    public List<TypeByBody> tag() {
+        List<TypeBy> typeBIES = typeByDao.selectList(null);
+        List<TypeBy> collect = typeBIES.stream().filter(typeBy -> {
+            if (typeBy.getMidCategory() == null || typeBy.getMidCategory().equals(""))
+                return true;
+            return false;
+        }).collect(Collectors.toList());
+
+        List<TypeByBody> typeByBodies = new ArrayList<>();
+        for (TypeBy typeBy : collect) {
+            TypeByBody typeByBody = new TypeByBody();
+            typeByBody.setTypeCodeBy(typeBy.getTypeCodeBy());
+            typeByBody.setTypeNameBy(typeBy.getBigCategory());
+            typeByBody.setTypeByBodies(findChild(typeBIES, typeByBody.getTypeCodeBy(), 2));
+
+            typeByBodies.add(typeByBody);
+        }
+
+        return typeByBodies;
+    }
+
+    public List<TypeByBody> findChild(List<TypeBy> typeBIES, String typeCodeBy, int randType){
+        String substring = typeCodeBy.substring(0, randType);
+        if(randType == 2){
+            List<TypeByBody> list = new ArrayList<>();
+            for (TypeBy typeBY : typeBIES) {
+                if(typeBY.getTypeCodeBy().startsWith(substring)  && (typeBY.getMidCategory() != null && !typeBY.getMidCategory().equals("")) && (typeBY.getSubCategory() == null || typeBY.getSubCategory().equals(""))){
+                    TypeByBody typeByBody = new TypeByBody();
+                    typeByBody.setTypeCodeBy(typeBY.getTypeCodeBy());
+                    typeByBody.setTypeNameBy(typeBY.getMidCategory());
+                    typeByBody.setTypeByBodies(findChild(typeBIES, typeByBody.getTypeCodeBy(), 4));
+
+                    list.add(typeByBody);
+                }
+            }
+            return list;
+        }else if(randType == 4){
+            List<TypeByBody> list = new ArrayList<>();
+            for (TypeBy typeBY : typeBIES) {
+                if(typeBY.getTypeCodeBy().startsWith(substring)  && typeBY.getSubCategory() != null && !typeBY.getSubCategory().equals("")){
+                    TypeByBody typeByBody = new TypeByBody();
+                    typeByBody.setTypeCodeBy(typeBY.getTypeCodeBy());
+                    typeByBody.setTypeNameBy(typeBY.getSubCategory());
+                    typeByBody.setTypeByBodies(null);
+
+                    list.add(typeByBody);
+                }
+            }
+            return list;
+        }
+        return null;
+    }
+
+    @Override
+    public List<AddrCategoryBody> addrCodeMap() {
+        List<AddrCategory> addrCategories = addrCategoryDao.selectList(null);
+        List<AddrCategory> collect = addrCategories.stream().filter(addrCategory -> {
+            if (addrCategory.getCity() == null || addrCategory.getCity().equals(""))
+                return true;
+            return false;
+        }).collect(Collectors.toList());
+
+        List<AddrCategoryBody> addrCategoryBodies = new ArrayList<>();
+        for (AddrCategory addrCategory : collect) {
+            AddrCategoryBody addrCategoryBody = new AddrCategoryBody();
+            addrCategoryBody.setAddrCoreName(addrCategory.getProvince());
+            addrCategoryBody.setAddrCore(addrCategory.getAddrCode());
+            addrCategoryBody.setAddrCategoryes(findChildAddr(addrCategories, addrCategoryBody.getAddrCore(), 2));
+
+            addrCategoryBodies.add(addrCategoryBody);
+        }
+
+        return addrCategoryBodies;
+    }
+
+    public List<AddrCategoryBody> findChildAddr(List<AddrCategory> addrCategories, String addrCore, int randType){
+        String substring = addrCore.substring(0, randType);
+        if(randType == 2){
+            List<AddrCategoryBody> list = new ArrayList<>();
+            for (AddrCategory addrCategory : addrCategories) {
+                if(addrCategory.getAddrCode().startsWith(substring)  && (addrCategory.getCity() != null && !addrCategory.getCity().equals("")) && (addrCategory.getDistrict() == null || addrCategory.getDistrict().equals(""))){
+                    AddrCategoryBody addrCategoryBody = new AddrCategoryBody();
+                    addrCategoryBody.setAddrCoreName(addrCategory.getCity());
+                    addrCategoryBody.setAddrCore(addrCategory.getAddrCode());
+                    addrCategoryBody.setAddrCategoryes(findChildAddr(addrCategories, addrCategoryBody.getAddrCore(), 4));
+
+                    list.add(addrCategoryBody);
+                }
+            }
+            return list;
+        }else if(randType == 4){
+            List<AddrCategoryBody> list = new ArrayList<>();
+            for (AddrCategory addrCategory : addrCategories) {
+                if(addrCategory.getAddrCode().startsWith(substring)  && addrCategory.getDistrict() != null && !addrCategory.getDistrict().equals("")){
+                    AddrCategoryBody addrCategoryBody = new AddrCategoryBody();
+                    addrCategoryBody.setAddrCoreName(addrCategory.getDistrict());
+                    addrCategoryBody.setAddrCore(addrCategory.getAddrCode());
+                    addrCategoryBody.setAddrCategoryes(null);
+
+                    list.add(addrCategoryBody);
+                }
+            }
+            return list;
+        }
+        return null;
+    }
+}

+ 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;
+    }
+}

+ 20 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/WdInfoServiceImpl.java

@@ -1,18 +1,37 @@
 package com.benyun.core.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.benyun.core.dao.TypeByDao;
 import com.benyun.core.dao.WdInfoMapper;
+import com.benyun.core.entity.TypeBy;
+import com.benyun.core.entity.WdInfo;
 import com.benyun.core.entity.bo.WdAddrTypeDistribution;
+import com.benyun.core.entity.vo.TypeByBody;
+import com.benyun.core.entity.vo.WdInfoVo;
 import com.benyun.core.service.WdInfoService;
+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.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.stream.Collectors;
 
 @Service
 public class WdInfoServiceImpl implements WdInfoService {
     @Autowired
     WdInfoMapper wdInfoMapper;
 
+
+
+    @Autowired
+    TypeByDao byDao;
+
+
     @Override
     public List<WdAddrTypeDistribution> searchAddrTypeDistribution(List<String> addrCodes, List<String> typeCodes) {
         return wdInfoMapper.searchAddrDisByMulti(addrCodes, typeCodes);
@@ -27,4 +46,5 @@ public class WdInfoServiceImpl implements WdInfoService {
     public List<WdAddrTypeDistribution> searchWdTotal() {
         return wdInfoMapper.searchWdTotal();
     }
+
 }

+ 69 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/WdRecycleServiceImpl.java

@@ -0,0 +1,69 @@
+package com.benyun.core.service.impl;
+
+import com.benyun.core.dao.TypeByDao;
+import com.benyun.core.dao.WdInfoMapper;
+import com.benyun.core.entity.TypeBy;
+import com.benyun.core.entity.WdInfo;
+import com.benyun.core.entity.vo.AddrCategoryBody;
+import com.benyun.core.entity.vo.TypeByBody;
+import com.benyun.core.entity.vo.WdInfoVo;
+import com.benyun.core.service.WdRecycleService;
+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;
+import java.util.stream.Collectors;
+
+@Service
+public class WdRecycleServiceImpl implements WdRecycleService {
+
+
+
+    @Autowired
+    WdInfoMapper wdInfoMapper;
+
+
+    @Autowired
+    @Qualifier("addrCodeMap")
+    private HashMap<String,String> addrCodeMap;
+
+
+
+    @Override
+    public HashMap<String, Object>  list(WdInfoVo wdInfoVo) {
+
+        PageHelper.startPage(wdInfoVo.getPageNum(), wdInfoVo.getPageSize());
+        PageHelper.orderBy(wdInfoVo.getOrderBy()+" desc");
+        List<WdInfo> wdInfos = wdInfoMapper.list(wdInfoVo);
+        PageInfo<WdInfo> pageInfo = new PageInfo<>(wdInfos);
+
+        List<WdInfoVo> collect = wdInfos.stream().map(wdInfo -> {
+            if(wdInfo.getTypeNameBy() != null){
+                String[] split = wdInfo.getTypeNameBy().split(":");
+                if(split.length == 3)
+                    wdInfo.setTypeNameBy(split[2]);
+                else if(split.length == 2)
+                    wdInfo.setTypeNameBy(split[1]);
+                else
+                    wdInfo.setAddrInfo(wdInfo.getTypeNameBy().replace(":",""));
+            }
+
+            WdInfoVo wdInfoVo1 = new WdInfoVo(wdInfo);
+            wdInfoVo1.setAddrCodeInfo(addrCodeMap.get(wdInfoVo1.getAddrCode()));
+            return wdInfoVo1;
+        }).collect(Collectors.toList());
+
+        HashMap<String, Object> result = new HashMap<>();
+        pageInfo.setList(null);
+        result.put("page",pageInfo);
+        result.put("data",collect);
+        return result;
+    }
+
+
+}

+ 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

+ 3 - 3
benyun-core/src/main/java/com/benyun/core/utils/SpringUtil.java

@@ -16,9 +16,9 @@ public class SpringUtil implements ApplicationContextAware {
             SpringUtil.applicationContext = applicationContext;
         }
 
-        System.out.println("========ApplicationContext配置成功,在普通类可以通过调用SpringUtils.getAppContext()获取applicationContext对象,applicationContext="+SpringUtil.applicationContext+"========");
-
-        System.out.println("---------------------------------------------------------------------");
+//        System.out.println("========ApplicationContext配置成功,在普通类可以通过调用SpringUtils.getAppContext()获取applicationContext对象,applicationContext="+SpringUtil.applicationContext+"========");
+//
+//        System.out.println("---------------------------------------------------------------------");
     }
 
     //获取applicationContext

+ 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

+ 181 - 0
benyun-core/src/main/resources/application-prod.yaml

@@ -0,0 +1,181 @@
+server:
+  port: 8000
+  servlet:
+    context-path: /bailianAi
+    encoding:
+      enabled: true
+      force: true
+      charset: utf-8
+--- # 数据源配置
+#spring:
+#  shardingsphere:
+#    datasource:
+#      names: ds1
+#      ds1:
+#        type: com.alibaba.druid.pool.DruidDataSource
+#        driver-class-name: com.mysql.cj.jdbc.Driver
+#        url: jdbc:mysql://localhost:3306/ddt?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
+#        username: root
+#        password: Aa@1230
+#    sharding:
+#      tables:
+#        bl_wd_topological:
+#          actual-data-nodes: ds1.bl_wd_topological_$->{1..2}
+#          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
+spring:
+  main:
+    allow-bean-definition-overriding: true
+
+  datasource:
+    type: com.zaxxer.hikari.HikariDataSource
+    # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
+    dynamic:
+      # 性能分析插件(有性能损耗 不建议生产环境使用)
+      p6spy: false
+      # 设置默认的数据源或者数据源组,默认值即为 master
+      primary: master
+      # 严格模式 匹配不到数据源则报错
+      strict: true
+      datasource:
+        # 主库数据源
+        master:
+          type: ${spring.datasource.type}
+          driverClassName: com.mysql.cj.jdbc.Driver
+          # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
+          # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
+          url: jdbc:mysql://192.168.2.64:3306/bailian-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
+          username: root
+          password: benyun
+        # 从库数据源
+        slave:
+          lazy: true
+          type: ${spring.datasource.type}
+          driverClassName: com.mysql.cj.jdbc.Driver
+          url: jdbc:mysql://192.168.2.64:3306/bailian-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
+          username: root
+          password: benyun
+      #        oracle:
+      #          type: ${spring.datasource.type}
+      #          driverClassName: oracle.jdbc.OracleDriver
+      #          url: jdbc:oracle:thin:@//localhost:1521/XE
+      #          username: ROOT
+      #          password: root
+      #          hikari:
+      #            connectionTestQuery: SELECT 1 FROM DUAL
+      #        postgres:
+      #          type: ${spring.datasource.type}
+      #          driverClassName: org.postgresql.Driver
+      #          url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
+      #          username: root
+      #          password: root
+      #        sqlserver:
+      #          type: ${spring.datasource.type}
+      #          driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
+      #          url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
+      #          username: SA
+      #          password: root
+      hikari:
+        # 最大连接池数量
+        maxPoolSize: 20
+        # 最小空闲线程数量
+        minIdle: 10
+        # 配置获取连接等待超时的时间
+        connectionTimeout: 30000
+        # 校验超时时间
+        validationTimeout: 5000
+        # 空闲连接存活最大时间,默认10分钟
+        idleTimeout: 600000
+        # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
+        maxLifetime: 1800000
+        # 连接测试query(配置检测连接是否有效)
+        connectionTestQuery: SELECT 1
+        # 多久检查一次连接的活性
+        keepaliveTime: 30000
+  shardingsphere:
+    datasource:
+      names: ds1
+      ds1:
+        type: com.zaxxer.hikari.HikariDataSource
+        driver-class-name: com.mysql.cj.jdbc.Driver
+        jdbcUrl: jdbc:mysql://192.168.2.64:3306/bailian-ai?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
+        username: root
+        password: benyun
+    sharding:
+      tables:
+        bl_wd_topological:
+          actual-data-nodes: ds1.bl_wd_topological_$->{1..10}
+          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
+        bl_topological_store_wd_list:
+          actual-data-nodes: ds1.bl_topological_store_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
+        bl_topological_house_wd_list:
+          actual-data-nodes: ds1.bl_topological_house_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
+        bl_topological_building_wd_list:
+          actual-data-nodes: ds1.bl_topological_building_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
+        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: 192.168.2.64  #redis服务地址
+    database: 11
+    port: 6379       #redis连接端口
+    timeout: 5000ms  #连接超时时间
+    password: "123456"
+    pool:
+      minIdle: 1   #连接池中的最小空闲连接
+      maxIdle: 10  #连接池中的最大空闲连接
+      maxWait: 3   #连接池最大阻塞等待时间(使用负值表示没有限制)
+      maxActive: 8 #连接池最大连接数(使用赋值表示没有限制)
+
+#mybatis-plus配置
+mybatis-plus:
+  mapper-locations: classpath:/mapper/**/*.xml  #告诉mybatis数据库映射文件mapper.xml的位置
+#  configuration:
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl  #显示sql日志
+  global-config:
+    db-config:
+      id-type: auto
+
+pagehelper:
+  helper-dialect: mysql
+  reasonable: true
+  support-methods-arguments: true
+  params: count=countSql

+ 5 - 1
benyun-core/src/main/resources/application.yaml

@@ -23,7 +23,11 @@ mybatis-plus:
 #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl  #显示sql日志
   global-config:
     db-config:
-      id-type: auto
+      id-type: ASSIGN_ID
+      logic-delete-field: show_delete # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2)
+      logic-delete-value: 1 # 逻辑已删除值(默认为 1)
+      logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
+
 
 
 #分页配置

+ 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>
+

+ 18 - 0
benyun-core/src/main/resources/mapper/WdInfoMapper.xml

@@ -75,4 +75,22 @@
             wd_type_code
         ORDER BY count DESC
     </select>
+
+    <select id="list" parameterType="com.benyun.core.entity.vo.WdInfoVo" resultType="com.benyun.core.entity.WdInfo">
+        select * from ddt_wd_info
+        <where>
+            <if test="wdName != null and wdName != ''">
+                and wd_name like concat("%",#{wdName},"%")
+            </if>
+            <if test="typeCodeBy != null and typeCodeBy != ''">
+                and type_code_by = #{typeCodeBy}
+            </if>
+            <if test="addrCode != null and addrCode != ''">
+                and addr_code = #{addrCode}
+            </if>
+            <if test="showDelete != null">
+                and show_delete = #{showDelete}
+            </if>
+        </where>
+    </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>
+

+ 3 - 0
benyun-core/src/test/java/com/benyun/core/BenyunCoreApplicationTests.java

@@ -8,6 +8,9 @@ class BenyunCoreApplicationTests {
 
     @Test
     void contextLoads() {
+        String str = "xx:xx:";
+        String[] split = str.split(":");
+        System.out.println(split.length);
     }
 
 }

+ 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();
+    }
+}

+ 0 - 8
benyun-core/src/test/java/com/benyun/core/service/ChannelAnalyeServiceImpTest.java

@@ -11,12 +11,4 @@ public class ChannelAnalyeServiceImpTest {
     @Autowired
     ChannelAnalyseService channelAnalyseService;
 
-    @Test
-    public void cityTierTest(){
-        String searchText = "蜜雪";
-        HashMap<String,Long> hashMap = channelAnalyseService.cityTier(searchText);
-        for (String o : hashMap.keySet()) {
-            System.out.println(o+" "+hashMap.get(o));
-        }
-    }
 }

+ 8 - 5
benyun-core/src/test/java/com/benyun/core/service/ChannelMapServiceImplTest.java

@@ -1,15 +1,17 @@
 package com.benyun.core.service;
 
-import com.benyun.core.entity.WdCount;
-import com.benyun.core.entity.WdCountBody;
+import com.benyun.core.entity.WdTopologicalInfo;
+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.benyun.core.entity.bo.WdTopologicalInfoBo;
 import com.github.pagehelper.PageInfo;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
 
 @SpringBootTest
@@ -67,8 +69,9 @@ public class ChannelMapServiceImplTest {
         String[] addrCode = new String[]{"450000000000"};
         String rankType = "province";
         String searchText = "蜜";
-        PageInfo<WdInfo> list = channelMapService.list(channel, rankType, searchText, orderby, addrCode, pageNum, pageSize);
-        for (WdInfo originWdInfo : list.getList()) {
+        HashMap hashMap = channelMapService.list(channel, rankType, searchText, orderby, addrCode, pageNum, pageSize);
+        List<WdTopologicalInfoBo> data = (List<WdTopologicalInfoBo>) hashMap.get("data");
+        for (WdTopologicalInfoBo originWdInfo : data) {
             System.out.println("originWdInfo = " + originWdInfo);
         }
     }

+ 0 - 7
pom.xml

@@ -331,13 +331,6 @@
                 <version>${ruoyi-vue-plus.version}</version>
             </dependency>
 
-            <!-- benyun-core -->
-            <dependency>
-                <groupId>com.benyun.core</groupId>
-                <artifactId>benyun-core</artifactId>
-                <version>0.0.1-SNAPSHOT</version>
-            </dependency>
-
 
         </dependencies>
     </dependencyManagement>

+ 2 - 2
ruoyi-admin/src/main/resources/application-dev.yml

@@ -58,8 +58,8 @@ spring:
           type: ${spring.datasource.type}
           driverClassName: com.mysql.cj.jdbc.Driver
           url: jdbc:mysql://localhost:3306/bailian-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
-          username:
-          password:
+          username: root
+          password: Aa@1230
 #        oracle:
 #          type: ${spring.datasource.type}
 #          driverClassName: oracle.jdbc.OracleDriver

Some files were not shown because too many files changed in this diff