Browse Source

Merge branch 'master' into lcy

云殇忆 1 year ago
parent
commit
ae4cdf1934
22 changed files with 276 additions and 66 deletions
  1. 1 1
      ruoyi-admin/Dockerfile
  2. 5 0
      ruoyi-admin/pom.xml
  3. 1 1
      ruoyi-admin/src/main/resources/application.yml
  4. 5 1
      ruoyi-demo/src/main/java/com/ruoyi/demo/constant/RedisContant.java
  5. 3 2
      ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TopologicalBuildWdController.java
  6. 28 1
      ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TopologicalEnterpriseWdController.java
  7. 13 2
      ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TopologicalHouseWdController.java
  8. 53 13
      ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TopologicalStoreWdController.java
  9. 18 0
      ruoyi-demo/src/main/java/com/ruoyi/demo/entity/bo/HeatMapBo.java
  10. 0 3
      ruoyi-demo/src/main/java/com/ruoyi/demo/entity/bo/WdTopologicalInfoBo.java
  11. 3 0
      ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/StoreWdDao.java
  12. 9 0
      ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/WdInfoDao.java
  13. 2 1
      ruoyi-demo/src/main/java/com/ruoyi/demo/service/TopologicalBuildWdSerevice.java
  14. 2 0
      ruoyi-demo/src/main/java/com/ruoyi/demo/service/TopologicalEnterpriseWdService.java
  15. 2 1
      ruoyi-demo/src/main/java/com/ruoyi/demo/service/TopologicalHouseWdService.java
  16. 3 0
      ruoyi-demo/src/main/java/com/ruoyi/demo/service/TopologicalStoreWdService.java
  17. 11 18
      ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TopologicalBuildWdSereviceImpl.java
  18. 52 0
      ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TopologicalEnterpriseWdServiceImpl.java
  19. 10 22
      ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TopologicalHouseServiceWdImpl.java
  20. 30 0
      ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TopologicalStoreWdServiceImpl.java
  21. 12 0
      ruoyi-demo/src/main/resources/mapper/demo/StoreWdDaoMapper.xml
  22. 13 0
      ruoyi-demo/src/main/resources/mapper/demo/WdInfoDaoMapper.xml

+ 1 - 1
ruoyi-admin/Dockerfile

@@ -20,4 +20,4 @@ ENTRYPOINT ["java", \
             # 应用名称 如果想区分集群节点监控 改成不同的名称即可
 #            "-Dskywalking.agent.service_name=ruoyi-server", \
 #            "-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \
-            "-Xmx10240m","-jar", "ruoyi-admin-plus.jar"]
+            "-jar", "ruoyi-admin-plus.jar"]

+ 5 - 0
ruoyi-admin/pom.xml

@@ -17,6 +17,11 @@
 
     <dependencies>
 
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+
         <!-- spring-boot-devtools -->
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 1 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -106,7 +106,7 @@ sa-token:
   timeout: 86400
   # 多端不同 token 有效期 可查看 LoginHelper.loginByDevice 方法自定义
   # token最低活跃时间 (指定时间无操作就过期) 单位: 秒
-  active-timeout: 1800
+  active-timeout: 86400
   # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
   is-concurrent: true
   # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)

+ 5 - 1
ruoyi-demo/src/main/java/com/ruoyi/demo/constant/RedisContant.java

@@ -27,8 +27,9 @@ public class RedisContant {
 
     public static int TOPOLOGICAL_STORE_WD_PER_CAPITA_CONSUMP_HISTOGRAM_TIME = 60*8;
 
+    public static final String TOPOLOGICAL_STORE_WD_HEAT_MAP = "topological_store_wd_heat_map";
 
-
+    public static final int TOPOLOGICAL_STORE_WD_HEAT_MAP_TIME = 60*8;
     public static String TOPOLOGICAL_BUILD_WD_LIST = "topological_build_wd_list";
     public static int TOPOLOGICAL_BUILD_WD_LIST_TIME = 60*8;
     public static String TOPOLOGICAL_BUILD_WD_CATEGORY= "topological_build_wd_category";
@@ -38,6 +39,9 @@ public class RedisContant {
     public static int TOPOLOGICAL_BUILD_WD_BUILDING_HISTOGRAM_TIME = 60*8;
     public static String TOPOLOGICAL_ENTERPRISE_WD_LIST = "topological_enterprise_wd_list";
     public static int TOPOLOGICAL_ENTERPRISE_WD_LIST_TIME = 60*8;
+
+    public static final String TOPOLOGICAL_ENTERPRISE_WD_LOGISTICS_LIST = "topological_enterprise_wd_lpgistics_list";
+    public static final int TOPOLOGICAL_ENTERPRISE_WD_LOGISTICS_LIST_TIME = 60*8;
     public static String TOPOLOGICAL_HOUSE_WD_LIST = "topological_house_wd_list";
     public static int TOPOLOGICAL_HOUSE_WD_LIST_TIME = 60*8;
     public static String TOPOLOGICAL_HOUSE_WD_INFO = "topological_house_wd_info";

+ 3 - 2
ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TopologicalBuildWdController.java

@@ -1,6 +1,7 @@
 package com.ruoyi.demo.controller;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.demo.constant.RedisContant;
 import com.ruoyi.demo.entity.TopologicalBuildingWd;
@@ -49,12 +50,12 @@ public class TopologicalBuildWdController {
     public R list(@Validated(value = {TopologicalWdListGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
         String md5 = topologicalWdAceeptVo.getHash();
         //2.查看redis中是否存在有缓存
-        HashMap<String,Object>  wdCount = (HashMap<String,Object> )redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_BUILD_WD_LIST).get(md5);
+        Page<TopologicalBuildingWd>  wdCount = (Page<TopologicalBuildingWd>)redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_BUILD_WD_LIST).get(md5);
         if (wdCount != null) {
             return R.ok(wdCount);
         }
 
-        HashMap<String,Object> list = topologicalBuildWdSerevice.list(topologicalWdAceeptVo);
+        Page<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分钟

+ 28 - 1
ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TopologicalEnterpriseWdController.java

@@ -10,6 +10,8 @@ import com.ruoyi.demo.valida.TopologicalWdListGroup;
 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.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -17,6 +19,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 
+/**
+ * 点位评估:周边企业
+ */
 @RestController
 @RequestMapping("/poi/topologicalEnterpriseWd")
 public class TopologicalEnterpriseWdController {
@@ -26,7 +31,12 @@ public class TopologicalEnterpriseWdController {
     @Autowired
     RedisTemplate redisTemplate;
 
-    @RequestMapping("/list")
+    /**
+     * 获取周边企业网点列表
+     * @param topologicalWdAceeptVo
+     * @return
+     */
+    @GetMapping("/list")
     public R list(@Validated(value = {TopologicalWdListGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
         String md5 = topologicalWdAceeptVo.getHash();
         //2.查看redis中是否存在有缓存
@@ -42,4 +52,21 @@ public class TopologicalEnterpriseWdController {
 
         return R.ok(list);
     }
+
+    @GetMapping("/logisticsList")
+    public R logisticsList(@Validated(value = {TopologicalWdListGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
+        String md5 = topologicalWdAceeptVo.getHash();
+        //2.查看redis中是否存在有缓存
+        HashMap<String,Object> wdCount = (HashMap<String,Object>) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_ENTERPRISE_WD_LOGISTICS_LIST).get(md5);
+        if (wdCount != null) {
+            return R.ok(wdCount);
+        }
+
+        HashMap<String,Object> list = topologicalEnterpriseWdService.logisticsList(topologicalWdAceeptVo);
+
+        redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_ENTERPRISE_WD_LOGISTICS_LIST).put(md5,list);
+        redisTemplate.expire(RedisContant.TOPOLOGICAL_ENTERPRISE_WD_LOGISTICS_LIST,RedisContant.TOPOLOGICAL_ENTERPRISE_WD_LOGISTICS_LIST_TIME, TimeUnit.MINUTES);
+
+        return R.ok(list);
+    }
 }

+ 13 - 2
ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TopologicalHouseWdController.java

@@ -1,6 +1,7 @@
 package com.ruoyi.demo.controller;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.demo.constant.RedisContant;
 import com.ruoyi.demo.entity.TopologicalHouseWd;
@@ -28,6 +29,11 @@ public class TopologicalHouseWdController {
     @Autowired
     RedisTemplate redisTemplate;
 
+    /**
+     * 获取小区网点关键信息
+     * @param topologicalWdAceeptVo
+     * @return
+     */
     @RequestMapping("/info")
     public R info(@Validated(value = {TopologicalWdGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
         String md5 = topologicalWdAceeptVo.getHash();
@@ -47,16 +53,21 @@ public class TopologicalHouseWdController {
         return R.ok(info);
     }
 
+    /**
+     * 获取小区网点列表
+     * @param topologicalWdAceeptVo
+     * @return
+     */
     @RequestMapping("/list")
     public R list(@Validated(value = {TopologicalWdListGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
         String md5 = topologicalWdAceeptVo.getHash();
         //2.查看redis中是否存在有缓存
-        HashMap<String, Object> wdCount = (HashMap<String, Object>) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_HOUSE_WD_LIST).get(md5);
+        Page<TopologicalHouseWd> wdCount = (Page<TopologicalHouseWd>) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_HOUSE_WD_LIST).get(md5);
         if (wdCount != null) {
             return R.ok(wdCount);
         }
 
-        HashMap<String, Object> list = topologicalHouseWdService.list(topologicalWdAceeptVo);
+        Page<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分钟

+ 53 - 13
ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TopologicalStoreWdController.java

@@ -4,6 +4,7 @@ package com.ruoyi.demo.controller;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.demo.constant.RedisContant;
 import com.ruoyi.demo.entity.TopologicalStoreWd;
+import com.ruoyi.demo.entity.bo.HeatMapBo;
 import com.ruoyi.demo.entity.bo.Histogram;
 import com.ruoyi.demo.entity.bo.StoreWdCategoryCount;
 import com.ruoyi.demo.entity.vo.TopologicalWdAceeptVo;
@@ -13,6 +14,7 @@ import com.ruoyi.demo.valida.TopologicalWdListGroup;
 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.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -38,7 +40,7 @@ public class TopologicalStoreWdController {
      * @param topologicalWdAceeptVo
      * @return
      */
-    @RequestMapping("/category")
+    @GetMapping("/category")
     public R category(@Validated(value = {TopologicalWdGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
         //1.查看redis中是否存在有缓存
         String md5 = topologicalWdAceeptVo.getHash();
@@ -56,57 +58,95 @@ public class TopologicalStoreWdController {
         return R.ok(category);
     }
 
-    @RequestMapping("/list")
+    /**
+     * 获取周边门店网点列表
+     * @param topologicalWdAceeptVo
+     * @return
+     */
+    @GetMapping("/list")
     public R list(@Validated(value = {TopologicalWdListGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
+        //1.查看redis中是否存在有缓存
         String md5 = topologicalWdAceeptVo.getHash();
-        //2.查看redis中是否存在有缓存
         HashMap<String,Object> wdCount = (HashMap<String,Object>) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_STORE_WD_LIST).get(md5);
         if (wdCount != null) {
             return R.ok(wdCount);
         }
 
-
+        //2.获取数据
         HashMap<String,Object> list = topologicalStoreWdService.list(topologicalWdAceeptVo);
 
+        //3.存储redis
         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);
     }
 
-    @RequestMapping("/storeHistogram")
+    /**
+     * 获取商业网点分类数量统计
+     * @param topologicalWdAceeptVo
+     * @return
+     */
+    @GetMapping("/storeHistogram")
     public R storeHistogram(@Validated(value = {TopologicalWdGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
+        //1.查看redis中是否存在有缓存
         String md5 = topologicalWdAceeptVo.getHash();
-        //2.查看redis中是否存在有缓存
         List<Histogram> wdCount = (List<Histogram>) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_STORE_WD_STORE_HISTOGRAM).get(md5);
         if (wdCount != null) {
             return R.ok(wdCount);
         }
 
-
+        //2.获取数据
         List<Histogram> list = topologicalStoreWdService.storeHistogram(topologicalWdAceeptVo);
 
+        //3.存入redis
         redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_STORE_WD_STORE_HISTOGRAM).put(md5,list);
         redisTemplate.expire(RedisContant.TOPOLOGICAL_STORE_WD_STORE_HISTOGRAM,RedisContant.TOPOLOGICAL_STORE_WD_STORE_HISTOGRAM_TIME, TimeUnit.MINUTES); //30分钟
-
         return R.ok(list);
     }
 
-    @RequestMapping("/perCapitaConsumpHistogram")
+    /**
+     * 获取门店人均消费
+     * @param topologicalWdAceeptVo
+     * @return
+     */
+    @GetMapping("/perCapitaConsumpHistogram")
     public R perCapitaConsumpHistogram(@Validated(value = {TopologicalWdGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
+        //1.查看redis中是否存在有缓存
         String md5 = topologicalWdAceeptVo.getHash();
-        //2.查看redis中是否存在有缓存
         List<Histogram> wdCount = (List<Histogram>) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_STORE_WD_PER_CAPITA_CONSUMP_HISTOGRAM).get(md5);
         if (wdCount != null) {
             return R.ok(wdCount);
         }
 
-
+        //2.获取数据
         List<Histogram> list = topologicalStoreWdService.perCapitaConsumpHistogram(topologicalWdAceeptVo);
 
+        //存入redis
         redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_STORE_WD_PER_CAPITA_CONSUMP_HISTOGRAM).put(md5,list);
         redisTemplate.expire(RedisContant.TOPOLOGICAL_STORE_WD_PER_CAPITA_CONSUMP_HISTOGRAM,RedisContant.TOPOLOGICAL_STORE_WD_PER_CAPITA_CONSUMP_HISTOGRAM_TIME, TimeUnit.MINUTES); //30分钟
-
         return R.ok(list);
     }
+
+    /**
+     * 获取门店人均消费
+     * @param topologicalWdAceeptVo
+     * @return
+     */
+    @GetMapping("/heatMap")
+    public R heatMap(@Validated(value = {TopologicalWdGroup.class}) TopologicalWdAceeptVo topologicalWdAceeptVo){
+        //1.查看redis中是否存在有缓存
+        String md5 = topologicalWdAceeptVo.getHash();
+        List<HeatMapBo> wdCount = (List<HeatMapBo>) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_STORE_WD_HEAT_MAP).get(md5);
+        if (wdCount != null) {
+            return R.ok(wdCount);
+        }
+
+        //2.获取数据
+        List<HeatMapBo> heatMapBos = topologicalStoreWdService.heatMap(topologicalWdAceeptVo);
+
+        //存入redis
+        redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_STORE_WD_HEAT_MAP).put(md5,heatMapBos);
+        redisTemplate.expire(RedisContant.TOPOLOGICAL_STORE_WD_HEAT_MAP,RedisContant.TOPOLOGICAL_STORE_WD_HEAT_MAP_TIME, TimeUnit.MINUTES); //30分钟
+        return R.ok(heatMapBos);
+    }
 }

+ 18 - 0
ruoyi-demo/src/main/java/com/ruoyi/demo/entity/bo/HeatMapBo.java

@@ -0,0 +1,18 @@
+package com.ruoyi.demo.entity.bo;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+public class HeatMapBo {
+    private double[] coord;
+    private double elevation;
+
+    public HeatMapBo(double lng,double lat,double indexScore){
+        coord = new double[2];
+        this.coord[0] = lng;
+        this.coord[1] = lat;
+        this.elevation = indexScore;
+    }
+}

+ 0 - 3
ruoyi-demo/src/main/java/com/ruoyi/demo/entity/bo/WdTopologicalInfoBo.java

@@ -21,7 +21,6 @@ public class WdTopologicalInfoBo implements Serializable {
 
     private String typeCodeBy;
 
-    private int radius;
     private String addrCode;
     private String addrCodeInfo;
     private String addrInfo;
@@ -45,7 +44,6 @@ public class WdTopologicalInfoBo implements Serializable {
         this.lat = wdInfo.getLat();
         this.lng = wdInfo.getLng();
         this.geoHash = wdInfo.getGeoHash();
-        this.radius = 1000;
     }
 
     public WdTopologicalInfoBo() {
@@ -61,6 +59,5 @@ public class WdTopologicalInfoBo implements Serializable {
         this.lat = wdInfo.getLat();
         this.lng = wdInfo.getLng();
         this.geoHash = wdInfo.getGeoHash();
-        this.radius = 1000;
     }
 }

+ 3 - 0
ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/StoreWdDao.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.ruoyi.demo.entity.StoreWd;
 import com.ruoyi.demo.entity.WdInfo;
+import com.ruoyi.demo.entity.bo.HeatMapBo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -19,4 +20,6 @@ public interface StoreWdDao extends BaseMapper<StoreWd> {
     List<StoreWd> category(@Param(Constants.WRAPPER) QueryWrapper<WdInfo> queryWrapper);
 
     List<StoreWd> businessStatusAnalyse(@Param(Constants.WRAPPER) QueryWrapper<WdInfo> queryWrapper);
+
+    List<HeatMapBo> heatMap(@Param(Constants.WRAPPER) QueryWrapper<WdInfo> queryWrapper);
 }

+ 9 - 0
ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/WdInfoDao.java

@@ -1,9 +1,18 @@
 package com.ruoyi.demo.mapper;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.demo.entity.TopologicalBuildingWd;
+import com.ruoyi.demo.entity.TopologicalHouseWd;
 import com.ruoyi.demo.entity.WdInfo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 @Mapper
 public interface WdInfoDao extends BaseMapper<WdInfo> {
+    Page<TopologicalBuildingWd> selectTopologicalBuildWdList(Page<WdInfo> page, @Param(Constants.WRAPPER) QueryWrapper<WdInfo> queryWrapper);
+
+    Page<TopologicalHouseWd> selectTopologicalHouseList(Page<WdInfo> page,@Param(Constants.WRAPPER) QueryWrapper<WdInfo> queryWrapper);
 }

+ 2 - 1
ruoyi-demo/src/main/java/com/ruoyi/demo/service/TopologicalBuildWdSerevice.java

@@ -1,6 +1,7 @@
 package com.ruoyi.demo.service;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.demo.entity.TopologicalBuildingWd;
 import com.ruoyi.demo.entity.bo.BuildWdCategoryCount;
 import com.ruoyi.demo.entity.bo.Histogram;
@@ -11,7 +12,7 @@ import java.util.List;
 
 public interface TopologicalBuildWdSerevice {
     public List<BuildWdCategoryCount> buildingLevel(TopologicalWdAceeptVo topologicalWdAceeptVo);
-    public HashMap<String,Object> list(TopologicalWdAceeptVo topologicalWdAceeptVo);
+    public Page<TopologicalBuildingWd> list(TopologicalWdAceeptVo topologicalWdAceeptVo);
 
     List<Histogram> buildingHistogram(TopologicalWdAceeptVo topologicalWdAceeptVo);
 }

+ 2 - 0
ruoyi-demo/src/main/java/com/ruoyi/demo/service/TopologicalEnterpriseWdService.java

@@ -9,4 +9,6 @@ import java.util.List;
 
 public interface TopologicalEnterpriseWdService {
     public HashMap<String,Object> list(TopologicalWdAceeptVo topologicalWdAceeptVo);
+
+    HashMap<String, Object> logisticsList(TopologicalWdAceeptVo topologicalWdAceeptVo);
 }

+ 2 - 1
ruoyi-demo/src/main/java/com/ruoyi/demo/service/TopologicalHouseWdService.java

@@ -1,6 +1,7 @@
 package com.ruoyi.demo.service;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.demo.entity.TopologicalHouseWd;
 import com.ruoyi.demo.entity.TopologicalHouseWdStatisticsData;
 import com.ruoyi.demo.entity.vo.TopologicalWdAceeptVo;
@@ -9,7 +10,7 @@ import java.util.HashMap;
 import java.util.List;
 
 public interface TopologicalHouseWdService {
-    public HashMap<String,Object> list(TopologicalWdAceeptVo topologicalWdAceeptVo);
+    public Page<TopologicalHouseWd> list(TopologicalWdAceeptVo topologicalWdAceeptVo);
 
     public TopologicalHouseWdStatisticsData info(TopologicalWdAceeptVo topologicalWdAceeptVo);
 }

+ 3 - 0
ruoyi-demo/src/main/java/com/ruoyi/demo/service/TopologicalStoreWdService.java

@@ -2,6 +2,7 @@ package com.ruoyi.demo.service;
 
 
 import com.ruoyi.demo.entity.TopologicalStoreWd;
+import com.ruoyi.demo.entity.bo.HeatMapBo;
 import com.ruoyi.demo.entity.bo.Histogram;
 import com.ruoyi.demo.entity.bo.StoreWdCategoryCount;
 import com.ruoyi.demo.entity.vo.TopologicalWdAceeptVo;
@@ -17,4 +18,6 @@ public interface TopologicalStoreWdService {
     List<Histogram> storeHistogram(TopologicalWdAceeptVo topologicalWdAceeptVo);
 
     List<Histogram> perCapitaConsumpHistogram(TopologicalWdAceeptVo topologicalWdAceeptVo);
+
+    List<HeatMapBo>  heatMap(TopologicalWdAceeptVo topologicalWdAceeptVo);
 }

+ 11 - 18
ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TopologicalBuildWdSereviceImpl.java

@@ -86,7 +86,7 @@ public class TopologicalBuildWdSereviceImpl implements TopologicalBuildWdSerevic
      * @return
      */
     @Override
-    public HashMap<String,Object>  list(TopologicalWdAceeptVo topologicalWdAceeptVo) {
+    public Page<TopologicalBuildingWd>  list(TopologicalWdAceeptVo topologicalWdAceeptVo) {
         List<String> aroundWdId = new ArrayList<>();
         HashMap<String,Double> wdDistMap = new HashMap<>();
 
@@ -94,40 +94,30 @@ public class TopologicalBuildWdSereviceImpl implements TopologicalBuildWdSerevic
         getAroundWdIdList(topologicalWdAceeptVo,aroundWdId,wdDistMap);
         if (aroundWdId.isEmpty()){
             //没有周边网点
-            HashMap<String,Object> result = new HashMap();
-            Page<WdInfo> page = new Page<>(topologicalWdAceeptVo.getPageNum(),topologicalWdAceeptVo.getPageSize());
-            result.put("page",page);
-            result.put("data",new ArrayList<>());
-            return result;
+            Page<TopologicalBuildingWd> page = new Page<>(topologicalWdAceeptVo.getPageNum(),topologicalWdAceeptVo.getPageSize());
+            return page;
         }
 
         //2.分页查找网点信息
         QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("wd_type_code","3");
         queryWrapper.and(wdInfoQueryWrapper -> {
-            wdInfoQueryWrapper.in("wd_id", aroundWdId);
+            wdInfoQueryWrapper.in("ddt_wd_info.wd_id", aroundWdId);
         });
 
         Page<WdInfo> page = new Page<>(topologicalWdAceeptVo.getPageNum(),topologicalWdAceeptVo.getPageSize());
-        Page<WdInfo> page1 = wdInfoDao.selectPage(page, queryWrapper);
+        Page<TopologicalBuildingWd> page1 = wdInfoDao.selectTopologicalBuildWdList(page, queryWrapper);
 
 
         //3.组装结果集
-        List<TopologicalBuildingWd> list = new ArrayList<>();  //返回结果集
-        for (WdInfo wdInfo : page1.getRecords()) {
-            TopologicalBuildingWd topologicalBuildingWd = new TopologicalBuildingWd(wdInfo);
+        for (TopologicalBuildingWd topologicalBuildingWd : page1.getRecords()) {
             //topologicalBuildingWd.setAddrCodeInfo(initMapUtil.getInitAddrCodeMap(topologicalBuildingWd.getAddrCode()));
-            BigDecimal bigDecimal = new BigDecimal(wdDistMap.get(wdInfo.getWdId()));
+            BigDecimal bigDecimal = new BigDecimal(wdDistMap.get(topologicalBuildingWd.getAroundWdId()));
             topologicalBuildingWd.setDistance(bigDecimal.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());
-            list.add(topologicalBuildingWd);
         }
 
         //5.返回结果
-        HashMap<String,Object> result = new HashMap();
-        page1.setRecords(null);
-        result.put("page",page1);
-        result.put("data",list);
-        return result;
+        return page1;
     }
 
     /**
@@ -150,6 +140,9 @@ public class TopologicalBuildWdSereviceImpl implements TopologicalBuildWdSerevic
         queryWrapper.and(queryWrapper2 -> {
             queryWrapper2.eq("wd_type_code","3");
         });
+        queryWrapper.and(queryWrapper2 -> {
+            queryWrapper2.in("wd_id",aroundWdId);
+        });
         queryWrapper.and(queryWrapper2 -> {
             queryWrapper2.isNotNull("type_code_by");
         });

+ 52 - 0
ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TopologicalEnterpriseWdServiceImpl.java

@@ -87,6 +87,58 @@ public class TopologicalEnterpriseWdServiceImpl implements TopologicalEnterprise
         return result;
     }
 
+    /**
+     * 获取周边物流园
+     * @param topologicalWdAceeptVo
+     * @return
+     */
+    @Override
+    public HashMap<String, Object> logisticsList(TopologicalWdAceeptVo topologicalWdAceeptVo) {
+        List<String> aroundWdId = new ArrayList<>();
+        HashMap<String,Double> wdDistMap = new HashMap<>();
+
+        //1.根据经纬度 找到 周边网点Id 及 距离
+        getAroundWdIdList(topologicalWdAceeptVo,aroundWdId,wdDistMap);
+        if (aroundWdId.isEmpty()){
+            //没有周边网点
+            HashMap<String,Object> result = new HashMap();
+            Page<WdInfo> page = new Page<>(topologicalWdAceeptVo.getPageNum(),topologicalWdAceeptVo.getPageSize());
+            result.put("page",page);
+            result.put("data",new ArrayList<>());
+            return result;
+        }
+
+        //2.分页获取周边企业物流园网点信息
+        QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("wd_type_code","5");
+        queryWrapper.and(wdInfoQueryWrapper -> {
+            wdInfoQueryWrapper.in("wd_id", aroundWdId);
+        });
+        queryWrapper.and(wdInfoQueryWrapper -> {
+            wdInfoQueryWrapper.like("wd_name","物流");
+        });
+        Page<WdInfo> page = new Page<>(topologicalWdAceeptVo.getPageNum(),topologicalWdAceeptVo.getPageSize());
+        Page<WdInfo> page1 = wdInfoDao.selectPage(page, queryWrapper);
+
+
+        //3.组装结果集
+        List<TopologicalEnterpriseWd> list = new ArrayList<>();  //返回结果集
+        for (WdInfo wdInfo : page1.getRecords()) {
+            TopologicalEnterpriseWd topologicalEnterpriseWd = new TopologicalEnterpriseWd(wdInfo);
+            //topologicalEnterpriseWd.setAddrCodeInfo(initMapUtil.getInitAddrCodeMap(topologicalEnterpriseWd.getAddrCode()));
+            BigDecimal bigDecimal = new BigDecimal(wdDistMap.get(wdInfo.getWdId()));
+            topologicalEnterpriseWd.setDistance(bigDecimal.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());
+            list.add(topologicalEnterpriseWd);
+        }
+
+        //4.返回结果
+        HashMap<String,Object> result = new HashMap();
+        page1.setRecords(null);
+        result.put("page",page1);
+        result.put("data",list);
+        return result;
+    }
+
     /**
      * 根据坐标获取周边网点Id
      * @param topologicalWdAceeptVo

+ 10 - 22
ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TopologicalHouseServiceWdImpl.java

@@ -50,7 +50,7 @@ public class TopologicalHouseServiceWdImpl implements TopologicalHouseWdService
      * @return
      */
     @Override
-    public HashMap<String,Object> list(TopologicalWdAceeptVo topologicalWdAceeptVo) {
+    public Page<TopologicalHouseWd> list(TopologicalWdAceeptVo topologicalWdAceeptVo) {
         List<String> aroundWdId = new ArrayList<>();
         HashMap<String,Double> wdDistMap = new HashMap<>();
 
@@ -58,41 +58,29 @@ public class TopologicalHouseServiceWdImpl implements TopologicalHouseWdService
         getAroundWdIdList(topologicalWdAceeptVo,aroundWdId,wdDistMap);
         if (aroundWdId.isEmpty()){
             //没有周边网点
-            HashMap<String,Object> result = new HashMap();
-            Page<WdInfo> page = new Page<>(topologicalWdAceeptVo.getPageNum(),topologicalWdAceeptVo.getPageSize());
-            result.put("page",page);
-            result.put("data",new ArrayList<>());
-            return result;
+            Page<TopologicalHouseWd> page = new Page<>(topologicalWdAceeptVo.getPageNum(),topologicalWdAceeptVo.getPageSize());
+            return page;
         }
 
         //2.分页查找网点信息
         QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("wd_type_code", "2");
-        if (!aroundWdId.isEmpty()) {
-            queryWrapper.and(wdInfoQueryWrapper -> {
-                wdInfoQueryWrapper.in("wd_id", aroundWdId);
-            });
-        }
+        queryWrapper.and(wdInfoQueryWrapper -> {
+            wdInfoQueryWrapper.in("ddt_wd_info.wd_id", aroundWdId);
+        });
         Page<WdInfo> page = new Page<>(topologicalWdAceeptVo.getPageNum(),topologicalWdAceeptVo.getPageSize());
-        Page<WdInfo> page1 = wdInfoDao.selectPage(page, queryWrapper);
+        Page<TopologicalHouseWd> page1 = wdInfoDao.selectTopologicalHouseList(page, queryWrapper);
 
 
         //3.组装结果集
-        List<TopologicalHouseWd> list = new ArrayList<>();  //返回结果集
-        for (WdInfo wdInfo : page1.getRecords()) {
-            TopologicalHouseWd topologicalHouseWd = new TopologicalHouseWd(wdInfo);
+        for (TopologicalHouseWd topologicalHouseWd : page1.getRecords()) {
             //topologicalHouseWd.setAddrCodeInfo(initMapUtil.getInitAddrCodeMap(topologicalHouseWd.getAddrCode()));
-            BigDecimal bigDecimal = new BigDecimal(wdDistMap.get(wdInfo.getWdId()));
+            BigDecimal bigDecimal = new BigDecimal(wdDistMap.get(topologicalHouseWd.getAroundWdId()));
             topologicalHouseWd.setDistance(bigDecimal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
-            list.add(topologicalHouseWd);
         }
 
         //4.返回结果
-        HashMap<String,Object> result = new HashMap();
-        page1.setRecords(null);
-        result.put("page",page1);
-        result.put("data",list);
-        return result;
+        return page1;
     }
 
     /**

+ 30 - 0
ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TopologicalStoreWdServiceImpl.java

@@ -8,6 +8,7 @@ import com.ruoyi.demo.entity.ManageType;
 import com.ruoyi.demo.entity.StoreWd;
 import com.ruoyi.demo.entity.TopologicalStoreWd;
 import com.ruoyi.demo.entity.WdInfo;
+import com.ruoyi.demo.entity.bo.HeatMapBo;
 import com.ruoyi.demo.entity.bo.Histogram;
 import com.ruoyi.demo.entity.bo.StoreWdCategoryCount;
 import com.ruoyi.demo.entity.bo.StoreWdCategoryCountBody;
@@ -192,6 +193,7 @@ public class TopologicalStoreWdServiceImpl implements TopologicalStoreWdService
         //2.获取符合的门店网点分类统计信息
         QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
         queryWrapper.select("type_code_by","count(*) as audit");
+        queryWrapper.in("wd_id", aroundWdId);
         queryWrapper.and(queryWrapper2 -> {
             queryWrapper2.eq("wd_type_code","1");
         });
@@ -249,6 +251,7 @@ public class TopologicalStoreWdServiceImpl implements TopologicalStoreWdService
         //2.获取符合条件的网点信息
         QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
         queryWrapper.select("wd_id");
+        queryWrapper.in("wd_id", aroundWdId);
         queryWrapper.and(queryWrapper2 -> {
             queryWrapper2.eq("wd_type_code","1");
         });
@@ -290,6 +293,33 @@ public class TopologicalStoreWdServiceImpl implements TopologicalStoreWdService
         return list;
     }
 
+    /**
+     * 获取网点周边热力图
+     * @param topologicalWdAceeptVo
+     * @return
+     */
+    @Override
+    public List<HeatMapBo>  heatMap(TopologicalWdAceeptVo topologicalWdAceeptVo) {
+        List<String> aroundWdId = new ArrayList<>();
+
+        //1.根据经纬度 找到 周边网点Id 及 距离
+        getAroundWdIdList(topologicalWdAceeptVo,aroundWdId,null);
+        if (aroundWdId.isEmpty())
+            return new ArrayList<>();
+
+        //2.获取符合条件的网点信息
+        QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("wd_type_code","1");
+        queryWrapper.and(wdInfoQueryWrapper -> {
+            wdInfoQueryWrapper.in("ddt_wd_info.wd_id", aroundWdId);
+        });
+        queryWrapper.and(wdInfoQueryWrapper -> {
+            wdInfoQueryWrapper.isNotNull("index_score");
+        });
+        List<HeatMapBo> heatMapBos = storeWdDao.heatMap(queryWrapper);
+        return heatMapBos;
+    }
+
     /**
      * 根据坐标获取周边网点Id
      * @param topologicalWdAceeptVo

+ 12 - 0
ruoyi-demo/src/main/resources/mapper/demo/StoreWdDaoMapper.xml

@@ -2,6 +2,14 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
 <mapper namespace="com.ruoyi.demo.mapper.StoreWdDao">
+    <resultMap id="heatBo" type="com.ruoyi.demo.entity.bo.HeatMapBo">
+        <constructor>
+            <arg column="lng" javaType="_double"></arg>
+            <arg column="lat" javaType="_double"></arg>
+            <arg column="index_score" javaType="_double"></arg>
+        </constructor>
+    </resultMap>
+
     <select id="perCapitaConsumpAnalyse" resultType="com.ruoyi.demo.entity.StoreWd">
         select per_capita_consumption from ddt_store_wd where per_capita_consumption is not null and wd_id in (select ${ew.sqlSelect} from ddt_wd_info ${ew.customSqlSegment})
     </select>
@@ -16,4 +24,8 @@
     <select id="businessStatusAnalyse" resultType="com.ruoyi.demo.entity.StoreWd">
         select business_status,count(*) as comment_count from ddt_store_wd where wd_id in (select ${ew.sqlSelect} from ddt_wd_info ${ew.customSqlSegment}) group by business_status
     </select>
+
+    <select id="heatMap" resultMap="heatBo">
+        select lat,lng,index_score  from ddt_wd_info left join ddt_store_wd on ddt_wd_info.wd_id = ddt_store_wd.wd_id ${ew.customSqlSegment}
+    </select>
 </mapper>

+ 13 - 0
ruoyi-demo/src/main/resources/mapper/demo/WdInfoDaoMapper.xml

@@ -0,0 +1,13 @@
+<?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.ruoyi.demo.mapper.WdInfoDao">
+    <select id="selectTopologicalBuildWdList" resultType="com.ruoyi.demo.entity.TopologicalBuildingWd">
+        select ddt_wd_info.wd_id as around_wd_id,wd_name,wd_type_code,addr_code,addr_info,rent,build_type,property_type,lat,lng from ddt_wd_info left join ddt_build_wd on ddt_wd_info.wd_id = ddt_build_wd.wd_id ${ew.customSqlSegment}
+    </select>
+
+    <select id="selectTopologicalHouseList" resultType="com.ruoyi.demo.entity.TopologicalHouseWd">
+        select ddt_wd_info.wd_id as around_wd_id,wd_name,wd_type_code,addr_code,addr_info,rent,households,people_count,property_type,lat,lng from ddt_wd_info left join ddt_house_wd on ddt_wd_info.wd_id = ddt_house_wd.wd_id ${ew.customSqlSegment}
+    </select>
+</mapper>
+