فهرست منبع

准备将benyun-core整合rouyi框架

JensionDzero 1 سال پیش
والد
کامیت
df9f8ac64d
24فایلهای تغییر یافته به همراه540 افزوده شده و 118 حذف شده
  1. 1 1
      .run/bailian-admin.run.xml
  2. 2 2
      benyun-core/src/main/java/com/benyun/core/config/QuartzConfig.java
  3. 3 2
      benyun-core/src/main/java/com/benyun/core/constant/RedisContant.java
  4. 26 26
      benyun-core/src/main/java/com/benyun/core/controller/ChannelAnalyseController.java
  5. 21 4
      benyun-core/src/main/java/com/benyun/core/controller/ChannelMapController.java
  6. 3 0
      benyun-core/src/main/java/com/benyun/core/dao/WdInfoDao.java
  7. 35 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BuildWdInfoBo.java
  8. 35 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/EnterpriseWdInfoBo.java
  9. 35 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/HouseWdInfoBo.java
  10. 36 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/StoreWdInfoBo.java
  11. 35 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/TrafficWdInfoBo.java
  12. 2 3
      benyun-core/src/main/java/com/benyun/core/init/BenyunCoreInit.java
  13. 2 0
      benyun-core/src/main/java/com/benyun/core/service/ChannelMapService.java
  14. 4 2
      benyun-core/src/main/java/com/benyun/core/service/impl/ChannelAnalyseServiceImpl.java
  15. 78 15
      benyun-core/src/main/java/com/benyun/core/service/impl/ChannelMapServiceImpl.java
  16. 115 20
      benyun-core/src/main/java/com/benyun/core/utils/WdRedisStoreage.java
  17. 3 3
      benyun-core/src/main/resources/application-prod.yaml
  18. 62 0
      benyun-core/src/test/java/com/benyun/core/BenyunCoreApplicationTests.java
  19. 2 2
      ruoyi-admin/src/main/resources/application-dev.yml
  20. 35 33
      ruoyi-admin/src/main/resources/application-prod.yml
  21. 1 1
      ruoyi-ui/src/router/index.js
  22. 2 2
      ruoyi-ui/src/views/index.vue
  23. 1 1
      ruoyi-ui/src/views/login.vue
  24. 1 1
      ruoyi-ui/src/views/register.vue

+ 1 - 1
.run/bailian-admin.run.xml

@@ -1,5 +1,5 @@
 <component name="ProjectRunConfigurationManager">
-  <configuration default="false" name="bailian-admin" type="docker-deploy" factoryName="dockerfile" server-name="192.168.0.14">
+  <configuration default="false" name="bailian-admin" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
     <deployment type="dockerfile">
       <settings>
         <option name="imageTag" value="bailian-admin:4.8.0" />

+ 2 - 2
benyun-core/src/main/java/com/benyun/core/config/QuartzConfig.java

@@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration;
 * 定时器:分析网点数据
 * */
 @Slf4j
-//@Configuration
+@Configuration
 public class QuartzConfig {
     // 创建一个封装Job对象的类型JobDetall,并放入Spring容器中
     @Bean
@@ -31,7 +31,7 @@ public class QuartzConfig {
 
 
         //定义Cron表达式
-        CronScheduleBuilder cron  = CronScheduleBuilder.cronSchedule("0 30 3 13 9 ? ");
+        CronScheduleBuilder cron  = CronScheduleBuilder.cronSchedule("0 50 8 14 9 ? ");
 
         return TriggerBuilder
             .newTrigger()

+ 3 - 2
benyun-core/src/main/java/com/benyun/core/constant/RedisContant.java

@@ -50,7 +50,8 @@ public class RedisContant {
     public static String WD_TAG = "wd_tag";
     public static int WD_TAG_TIME = 60*8;
 
-    public static String WD_POINT = "wd_point";  //保存网点的经纬度坐标
-    public static int WD_POINT_TIME = 60*8;
+
+    public static String BRAND_GEOLABEL = "brand_geolabel";
+    public static int BRAND_GEOLABEL_TIME = 60*8;
 
 }

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

@@ -63,32 +63,32 @@ public class ChannelAnalyseController {
         return R.ok(brandPageInfo);
     }
 
-    @RequestMapping("/tagAnalyse")
-    public R tagAnalyse(ChannelMapAceeptVo channelMapAceeptVo){
-        int page = channelMapAceeptVo.getPageNum();
-        channelMapAceeptVo.setPageNum(0);
-        String md5 = channelMapAceeptVo.getHash();
-
-        //2.查看redis中是否存在有缓存
-        HashMap<String, Object> result = new HashMap<>();
-        HashMap<String,Object> wdCount = (HashMap<String,Object>) redisTemplate.boundHashOps(RedisContant.CHANNEL_ANALYSE_TAG_ANLYSE).get(md5);
-        if (wdCount != null) {
-            result.put("data",(List<TagAnalyse>) wdCount.get(page + ""));
-            result.put("pages",(int)wdCount.get("pages"));
-            result.put("total",(int)wdCount.get("total"));
-            return R.ok(result);
-        }
-        HashMap<String, Object> hashMap = channelAnalyseService.tagAnalyse(channelMapAceeptVo);
-
-        //4.保存到redis中
-        redisTemplate.boundHashOps(RedisContant.CHANNEL_ANALYSE_TAG_ANLYSE).put(md5,hashMap);
-        redisTemplate.expire(RedisContant.CHANNEL_ANALYSE_TAG_ANLYSE,RedisContant.CHANNEL_ANALYSE_TAG_ANLYSE_TIME, TimeUnit.MINUTES); //30分钟
-
-        result.put("data",(List<TagAnalyse>) hashMap.get(page + ""));
-        result.put("pages",(int)hashMap.get("pages"));
-        result.put("total",(int)hashMap.get("total"));
-        return R.ok(result);
-    }
+//    @RequestMapping("/tagAnalyse")
+//    public R tagAnalyse(ChannelMapAceeptVo channelMapAceeptVo){
+//        int page = channelMapAceeptVo.getPageNum();
+//        channelMapAceeptVo.setPageNum(0);
+//        String md5 = channelMapAceeptVo.getHash();
+//
+//        //2.查看redis中是否存在有缓存
+//        HashMap<String, Object> result = new HashMap<>();
+//        HashMap<String,Object> wdCount = (HashMap<String,Object>) redisTemplate.boundHashOps(RedisContant.CHANNEL_ANALYSE_TAG_ANLYSE).get(md5);
+//        if (wdCount != null) {
+//            result.put("data",(List<TagAnalyse>) wdCount.get(page + ""));
+//            result.put("pages",(int)wdCount.get("pages"));
+//            result.put("total",(int)wdCount.get("total"));
+//            return R.ok(result);
+//        }
+//        HashMap<String, Object> hashMap = channelAnalyseService.tagAnalyse(channelMapAceeptVo);
+//
+//        //4.保存到redis中
+//        redisTemplate.boundHashOps(RedisContant.CHANNEL_ANALYSE_TAG_ANLYSE).put(md5,hashMap);
+//        redisTemplate.expire(RedisContant.CHANNEL_ANALYSE_TAG_ANLYSE,RedisContant.CHANNEL_ANALYSE_TAG_ANLYSE_TIME, TimeUnit.MINUTES); //30分钟
+//
+//        result.put("data",(List<TagAnalyse>) hashMap.get(page + ""));
+//        result.put("pages",(int)hashMap.get("pages"));
+//        result.put("total",(int)hashMap.get("total"));
+//        return R.ok(result);
+//    }
 
 //    @RequestMapping("/businessAnalyse")
 //    public R businessAnalyse(ChannelMapAceeptVo channelMapAceeptVo){

+ 21 - 4
benyun-core/src/main/java/com/benyun/core/controller/ChannelMapController.java

@@ -3,12 +3,11 @@ package com.benyun.core.controller;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.benyun.core.constant.RedisContant;
 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.*;
+import com.benyun.core.entity.bo.*;
 import com.benyun.core.entity.vo.ChannelMapAceeptVo;
 import com.benyun.core.service.ChannelMapService;
+import com.benyun.core.service.WdInfoService;
 import com.benyun.core.valida.ChannelAreaGroup;
 import com.benyun.core.valida.ChannelListGroup;
 import com.benyun.core.valida.ChannelPointGroup;
@@ -17,6 +16,7 @@ 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.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -130,4 +130,21 @@ public class ChannelMapController {
         }
     }
 
+    @GetMapping("/getWdInfo")
+    public R getWdInfo(String wdId){
+        WdInfo wdInfo = channelMapService.getWdInfo(wdId);
+        if("1".equals(wdInfo.getWdTypeCode())){
+            return R.ok((StoreWdInfoBo)wdInfo);
+        }else if("2".equals(wdInfo.getWdTypeCode())){
+            return R.ok((HouseWdInfoBo)wdInfo);
+        }else if("3".equals(wdInfo.getWdTypeCode())){
+            return R.ok((BuildWdInfoBo)wdInfo);
+        }else if("4".equals(wdInfo.getWdTypeCode())){
+            return R.ok((TrafficWdInfoBo)wdInfo);
+        }else if("5".equals(wdInfo.getWdTypeCode())){
+            return R.ok((EnterpriseWdInfoBo)wdInfo);
+        }
+        return R.ok(wdInfo);
+    }
+
 }

+ 3 - 0
benyun-core/src/main/java/com/benyun/core/dao/WdInfoDao.java

@@ -3,8 +3,11 @@ package com.benyun.core.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.benyun.core.entity.WdInfo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.context.annotation.Lazy;
 
+import java.util.List;
+
 @Mapper
 public interface WdInfoDao extends BaseMapper<WdInfo> {
 }

+ 35 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BuildWdInfoBo.java

@@ -0,0 +1,35 @@
+package com.benyun.core.entity.bo;
+
+import com.benyun.core.entity.BuildWd;
+import com.benyun.core.entity.WdInfo;
+import lombok.Data;
+
+@Data
+public class BuildWdInfoBo extends WdInfo {
+    private BuildWd buildWd;
+
+    public BuildWdInfoBo(WdInfo wdInfo) {
+        setWdId(wdInfo.getWdId());
+        setAddrInfo(wdInfo.getAddrInfo());
+        setAudit(wdInfo.getAudit());
+        setTypeNameBy(wdInfo.getTypeNameBy());
+        setAddrCode(wdInfo.getAddrCode());
+        setCollectPerson(wdInfo.getCollectPerson());
+        setTypeNameBy(wdInfo.getTypeNameBy());
+        setCollectTime(wdInfo.getCollectTime());
+        setCollectUserId(wdInfo.getCollectUserId());
+        setCreateDate(wdInfo.getCreateDate());
+        setEnterTime(wdInfo.getEnterTime());
+        setLat(wdInfo.getLat());
+        setLng(wdInfo.getLng());
+        setRent(wdInfo.getRent());
+        setTypeCodeBy(wdInfo.getTypeCodeBy());
+        setWdImg(wdInfo.getWdImg());
+        setWdName(wdInfo.getWdName());
+        setWdTypeCode(wdInfo.getWdTypeCode());
+    }
+
+    public BuildWdInfoBo() {
+
+    }
+}

+ 35 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/EnterpriseWdInfoBo.java

@@ -0,0 +1,35 @@
+package com.benyun.core.entity.bo;
+
+import com.benyun.core.entity.EnterpriseWd;
+import com.benyun.core.entity.WdInfo;
+import lombok.Data;
+
+@Data
+public class EnterpriseWdInfoBo extends WdInfo {
+    private EnterpriseWd enterpriseWd;
+
+    public EnterpriseWdInfoBo(WdInfo wdInfo) {
+        setWdId(wdInfo.getWdId());
+        setAddrInfo(wdInfo.getAddrInfo());
+        setAudit(wdInfo.getAudit());
+        setTypeNameBy(wdInfo.getTypeNameBy());
+        setAddrCode(wdInfo.getAddrCode());
+        setCollectPerson(wdInfo.getCollectPerson());
+        setTypeNameBy(wdInfo.getTypeNameBy());
+        setCollectTime(wdInfo.getCollectTime());
+        setCollectUserId(wdInfo.getCollectUserId());
+        setCreateDate(wdInfo.getCreateDate());
+        setEnterTime(wdInfo.getEnterTime());
+        setLat(wdInfo.getLat());
+        setLng(wdInfo.getLng());
+        setRent(wdInfo.getRent());
+        setTypeCodeBy(wdInfo.getTypeCodeBy());
+        setWdImg(wdInfo.getWdImg());
+        setWdName(wdInfo.getWdName());
+        setWdTypeCode(wdInfo.getWdTypeCode());
+    }
+
+    public EnterpriseWdInfoBo() {
+
+    }
+}

+ 35 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/HouseWdInfoBo.java

@@ -0,0 +1,35 @@
+package com.benyun.core.entity.bo;
+
+import com.benyun.core.entity.HouseWd;
+import com.benyun.core.entity.WdInfo;
+import lombok.Data;
+
+@Data
+public class HouseWdInfoBo extends WdInfo {
+    private HouseWd houseWd;
+
+    public HouseWdInfoBo(WdInfo wdInfo) {
+        setWdId(wdInfo.getWdId());
+        setAddrInfo(wdInfo.getAddrInfo());
+        setAudit(wdInfo.getAudit());
+        setTypeNameBy(wdInfo.getTypeNameBy());
+        setAddrCode(wdInfo.getAddrCode());
+        setCollectPerson(wdInfo.getCollectPerson());
+        setTypeNameBy(wdInfo.getTypeNameBy());
+        setCollectTime(wdInfo.getCollectTime());
+        setCollectUserId(wdInfo.getCollectUserId());
+        setCreateDate(wdInfo.getCreateDate());
+        setEnterTime(wdInfo.getEnterTime());
+        setLat(wdInfo.getLat());
+        setLng(wdInfo.getLng());
+        setRent(wdInfo.getRent());
+        setTypeCodeBy(wdInfo.getTypeCodeBy());
+        setWdImg(wdInfo.getWdImg());
+        setWdName(wdInfo.getWdName());
+        setWdTypeCode(wdInfo.getWdTypeCode());
+    }
+
+    public HouseWdInfoBo() {
+
+    }
+}

+ 36 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/StoreWdInfoBo.java

@@ -0,0 +1,36 @@
+package com.benyun.core.entity.bo;
+
+import com.benyun.core.entity.StoreWd;
+import com.benyun.core.entity.WdInfo;
+import lombok.Data;
+
+
+@Data
+public class StoreWdInfoBo extends WdInfo {
+    private StoreWd storeWd;
+
+    public StoreWdInfoBo(WdInfo wdInfo) {
+        setWdId(wdInfo.getWdId());
+        setAddrInfo(wdInfo.getAddrInfo());
+        setAudit(wdInfo.getAudit());
+        setTypeNameBy(wdInfo.getTypeNameBy());
+        setAddrCode(wdInfo.getAddrCode());
+        setCollectPerson(wdInfo.getCollectPerson());
+        setTypeNameBy(wdInfo.getTypeNameBy());
+        setCollectTime(wdInfo.getCollectTime());
+        setCollectUserId(wdInfo.getCollectUserId());
+        setCreateDate(wdInfo.getCreateDate());
+        setEnterTime(wdInfo.getEnterTime());
+        setLat(wdInfo.getLat());
+        setLng(wdInfo.getLng());
+        setRent(wdInfo.getRent());
+        setTypeCodeBy(wdInfo.getTypeCodeBy());
+        setWdImg(wdInfo.getWdImg());
+        setWdName(wdInfo.getWdName());
+        setWdTypeCode(wdInfo.getWdTypeCode());
+    }
+
+    public StoreWdInfoBo() {
+
+    }
+}

+ 35 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/TrafficWdInfoBo.java

@@ -0,0 +1,35 @@
+package com.benyun.core.entity.bo;
+
+import com.benyun.core.entity.TrafficWd;
+import com.benyun.core.entity.WdInfo;
+import lombok.Data;
+
+@Data
+public class TrafficWdInfoBo extends WdInfo {
+    private TrafficWd trafficWd;
+
+    public TrafficWdInfoBo(WdInfo wdInfo) {
+        setWdId(wdInfo.getWdId());
+        setAddrInfo(wdInfo.getAddrInfo());
+        setAudit(wdInfo.getAudit());
+        setTypeNameBy(wdInfo.getTypeNameBy());
+        setAddrCode(wdInfo.getAddrCode());
+        setCollectPerson(wdInfo.getCollectPerson());
+        setTypeNameBy(wdInfo.getTypeNameBy());
+        setCollectTime(wdInfo.getCollectTime());
+        setCollectUserId(wdInfo.getCollectUserId());
+        setCreateDate(wdInfo.getCreateDate());
+        setEnterTime(wdInfo.getEnterTime());
+        setLat(wdInfo.getLat());
+        setLng(wdInfo.getLng());
+        setRent(wdInfo.getRent());
+        setTypeCodeBy(wdInfo.getTypeCodeBy());
+        setWdImg(wdInfo.getWdImg());
+        setWdName(wdInfo.getWdName());
+        setWdTypeCode(wdInfo.getWdTypeCode());
+    }
+
+    public TrafficWdInfoBo() {
+
+    }
+}

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

@@ -15,8 +15,7 @@ import org.springframework.context.annotation.Configuration;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
+import java.util.concurrent.*;
 
 @Configuration
 public class BenyunCoreInit {
@@ -31,7 +30,7 @@ public class BenyunCoreInit {
 
     @Bean("executor")
     public ExecutorService getExecutor(){
-        return Executors.newFixedThreadPool(2);
+        return Executors.newFixedThreadPool(10);
     }
 
     /**

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

@@ -14,4 +14,6 @@ public interface ChannelMapService {
     public HashMap list(ChannelMapAceeptVo channel);
 
     public PageInfo<WdInfo> point(String[] channel, String searchText, String[] addrCode, int pageNum, int pageSize);
+
+    WdInfo getWdInfo(String wdId);
 }

+ 4 - 2
benyun-core/src/main/java/com/benyun/core/service/impl/ChannelAnalyseServiceImpl.java

@@ -203,8 +203,10 @@ public class ChannelAnalyseServiceImpl implements ChannelAnalyseService {
                     tierCode.addAll(list);
                 }
             }
-            queryWrapper.and(wdInfoQueryWrapper -> {
-                wdInfoQueryWrapper.in("addr_code",tierCode);
+            queryWrapper.and(originWdInfoQueryWrapper -> {
+                for (String s : tierCode) {
+                    originWdInfoQueryWrapper.likeRight("addr_code", s).or();
+                }
             });
         }
 

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

@@ -2,17 +2,9 @@ package com.benyun.core.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.benyun.core.constant.RedisContant;
-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.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.dao.*;
+import com.benyun.core.entity.*;
+import com.benyun.core.entity.bo.*;
 import com.benyun.core.entity.vo.ChannelMapAceeptVo;
 import com.benyun.core.entity.vo.WdInfoVo;
 import com.benyun.core.service.ChannelMapService;
@@ -68,6 +60,22 @@ public class ChannelMapServiceImpl implements ChannelMapService {
     @Autowired
     WdRedisStoreage wdRedisStoreage;
 
+    @Autowired
+    StoreWdDao storeWdDao;
+
+    @Autowired
+    HouseWdDao houseWdDao;
+
+    @Autowired
+    BuildWdDao buildWdDao;
+
+    @Autowired
+    TrafficWdDao trafficWdDao;
+
+    @Autowired
+    EnterpriseWdDao enterpriseWdDao;
+
+
     @Override
     public WdCount area(ChannelMapAceeptVo channelMapAceeptVo) {
         //1.根据不同级别得到 需要封装的 地区码
@@ -143,6 +151,7 @@ public class ChannelMapServiceImpl implements ChannelMapService {
         //4.组装条件构造器找到网点信息网点
         //2.1 渠道、地区分类
         QueryWrapper<WdInfo> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.select("addr_code","count(*) as audit");
         queryWrapper2.in("wd_type_code", channelMapAceeptVo.getChannel()).and(originWdInfoQueryWrapper -> {
             for (String s : addrCodeList) {
                 originWdInfoQueryWrapper.likeRight("addr_code", s).or();
@@ -175,13 +184,13 @@ public class ChannelMapServiceImpl implements ChannelMapService {
         List<WdInfo> wdInfos = wdInfoDao.selectList(queryWrapper2);
         for (WdInfo wdInfo : wdInfos) {
             if("province".equals(channelMapAceeptVo.getRankType())){
-                statistics.put(wdInfo.getAddrCode().substring(0,2),statistics.get(wdInfo.getAddrCode().substring(0,2))+1);
+                statistics.put(wdInfo.getAddrCode().substring(0,2),statistics.get(wdInfo.getAddrCode().substring(0,2))+wdInfo.getAudit());
             } else if ("city".equals(channelMapAceeptVo.getRankType())) {
-                statistics.put(wdInfo.getAddrCode().substring(0,4),statistics.get(wdInfo.getAddrCode().substring(0,4))+1);
+                statistics.put(wdInfo.getAddrCode().substring(0,4),statistics.get(wdInfo.getAddrCode().substring(0,4))+wdInfo.getAudit());
             } else if ("zone".equals(channelMapAceeptVo.getRankType())) {
-                statistics.put(wdInfo.getAddrCode().substring(0,6),statistics.get(wdInfo.getAddrCode().substring(0,6))+1);
+                statistics.put(wdInfo.getAddrCode().substring(0,6),statistics.get(wdInfo.getAddrCode().substring(0,6))+wdInfo.getAudit());
             }
-            total++;
+            total+=+wdInfo.getAudit();
         }
 
 
@@ -262,6 +271,60 @@ public class ChannelMapServiceImpl implements ChannelMapService {
         return PageInfo;
     }
 
+    @Override
+    public WdInfo getWdInfo(String wdId) {
+        QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("wd_id",wdId);
+
+        WdInfo wdInfo = wdInfoDao.selectOne(queryWrapper);
+        if(wdInfo == null)
+            return wdInfo;
+
+        if("1".equals(wdInfo.getWdTypeCode())){
+            QueryWrapper<StoreWd> queryWrapper1 = new QueryWrapper<>();
+            queryWrapper1.eq("wd_id",wdId);
+            StoreWd storeWd = storeWdDao.selectOne(queryWrapper1);
+            StoreWdInfoBo storeWdInfoBo = new StoreWdInfoBo(wdInfo);
+            storeWdInfoBo.setStoreWd(storeWd);
+            storeWdInfoBo.setAddrCode(addrCodeMap.get(storeWdInfoBo.getAddrCode()));
+            return storeWdInfoBo;
+        }else if("2".equals(wdInfo.getWdTypeCode())){
+            QueryWrapper<HouseWd> queryWrapper1 = new QueryWrapper<>();
+            queryWrapper1.eq("wd_id",wdId);
+            HouseWd houseWd = houseWdDao.selectOne(queryWrapper1);
+            HouseWdInfoBo houseWdInfoBo = new HouseWdInfoBo(wdInfo);
+            houseWdInfoBo.setHouseWd(houseWd);
+            houseWdInfoBo.setAddrCode(addrCodeMap.get(houseWdInfoBo.getAddrCode()));
+            return houseWdInfoBo;
+        }else if("3".equals(wdInfo.getWdTypeCode())){
+            QueryWrapper<BuildWd> queryWrapper1 = new QueryWrapper<>();
+            queryWrapper1.eq("wd_id",wdId);
+            BuildWd buildWd = buildWdDao.selectOne(queryWrapper1);
+            BuildWdInfoBo buildWdInfoBo = new BuildWdInfoBo(wdInfo);
+            buildWdInfoBo.setBuildWd(buildWd);
+            buildWdInfoBo.setAddrCode(addrCodeMap.get(buildWdInfoBo.getAddrCode()));
+            return buildWdInfoBo;
+        }else if("4".equals(wdInfo.getWdTypeCode())){
+            QueryWrapper<TrafficWd> queryWrapper1 = new QueryWrapper<>();
+            queryWrapper1.eq("wd_id",wdId);
+            TrafficWd trafficWd = trafficWdDao.selectOne(queryWrapper1);
+            TrafficWdInfoBo trafficWdInfoBo = new TrafficWdInfoBo(wdInfo);
+            trafficWdInfoBo.setTrafficWd(trafficWd);
+            trafficWdInfoBo.setAddrCode(addrCodeMap.get(trafficWdInfoBo.getAddrCode()));
+            return trafficWdInfoBo;
+        }else if("5".equals(wdInfo.getWdTypeCode())){
+            QueryWrapper<EnterpriseWd> queryWrapper1 = new QueryWrapper<>();
+            queryWrapper1.eq("wd_id",wdId);
+            EnterpriseWd enterpriseWd = enterpriseWdDao.selectOne(queryWrapper1);
+            EnterpriseWdInfoBo enterpriseWdInfoBo = new EnterpriseWdInfoBo(wdInfo);
+            enterpriseWdInfoBo.setEnterpriseWd(enterpriseWd);
+            enterpriseWdInfoBo.setAddrCode(addrCodeMap.get(enterpriseWdInfoBo.getAddrCode()));
+            return enterpriseWdInfoBo;
+        }
+
+        return wdInfo;
+    }
+
     /**
      * 根据条件获取网点(分页)
      * */

+ 115 - 20
benyun-core/src/main/java/com/benyun/core/utils/WdRedisStoreage.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.benyun.core.constant.RedisContant;
 import com.benyun.core.dao.WdInfoDao;
 import com.benyun.core.entity.WdInfo;
+import com.benyun.core.service.WriteService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.data.geo.Distance;
@@ -16,6 +17,7 @@ import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
@@ -35,13 +37,17 @@ public class WdRedisStoreage {
     private ExecutorService executorService;
 
 
+    @Autowired
+    WriteService writeService;
+
+
     /***
      * 获取中心网点的周边标签
      * @param wdInfo 中心网点信息
      * @return
      */
     public  List<String> getWdTag(WdInfo wdInfo){
-        List<String> tag = (List<String>) redisTemplate.boundHashOps(RedisContant.WD_TAG).get(wdInfo.getWdId());
+        List<String> tag = (List<String>) redisTemplate.boundValueOps(RedisContant.WD_TAG+"_"+wdInfo.getWdId()).get();
         if (tag != null)
             return tag;
 
@@ -84,7 +90,7 @@ public class WdRedisStoreage {
                 }
             }
         });
-        redisTemplate.boundHashOps(RedisContant.WD_TAG).put(wdInfo.getWdId(),tag);
+        redisTemplate.boundValueOps(RedisContant.WD_TAG+"_"+wdInfo.getWdId()).set(tag);
         return tag;
     }
 
@@ -92,29 +98,113 @@ public class WdRedisStoreage {
      * 将网点数据库 导入 redis
      * */
     public void writeWdGeoRedis(){
+        //清重
+        clearSql2();
+
         //将所有网点坐标导入redis
-        //writeWdGeoRedis1();
+        writeWdGeoRedis1();
 
         //给网点打标签并存入redis中
         writeWdGeoRedis2();
     }
 
+    public void clearSql2(){
+        List<String> wdId = new ArrayList<>();
+        List<String> storeId = new ArrayList<>();
+        List<String> houseId = new ArrayList<>();
+        List<String> buildId = new ArrayList<>();
+        List<String> trafficId = new ArrayList<>();
+        List<String> enterpriseId = new ArrayList<>();
+        long start = System.currentTimeMillis();
+
+        try{
+            System.out.println("开始清理");
+
+            QueryWrapper<WdInfo> wdInfoOriginQueryWrapper = new QueryWrapper<>();
+            wdInfoOriginQueryWrapper.select("hash", "count(hash) as audit").groupBy("hash").having("count(hash) >= 2");
+            List<WdInfo> wdInfoOrigins = wdInfoDao.selectList(wdInfoOriginQueryWrapper);
+
+            HashMap<String, Integer> hashMap = new HashMap<>();
+            for (WdInfo wdInfo : wdInfoOrigins) {
+                hashMap.put(wdInfo.getHash(), wdInfo.getAudit());
+            }
+
+
+            HashMap<String,Integer> hashMap1 = new HashMap<>();
+            hashMap1.put("total",1);
+            CompletableFuture<Void> future = null;
+            for (String s : hashMap.keySet()) {
+                future = CompletableFuture.runAsync(()->{
+                    QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("hash",s);
+                    queryWrapper.orderByDesc("collect_time");
+                    queryWrapper.last("limit " + (hashMap.get(s) - 1));
+                    List<WdInfo> wdInfos = wdInfoDao.selectList(queryWrapper);
+                    for (WdInfo wdInfo : wdInfos) {
+                        wdId.add(wdInfo.getWdId());
+
+                        switch (wdInfo.getWdTypeCode()){
+                            case "1":
+                                storeId.add(wdInfo.getWdId());
+                                break;
+                            case "2":
+                                houseId.add(wdInfo.getWdId());
+                                break;
+                            case "3":
+                                buildId.add(wdInfo.getWdId());
+                                break;
+                            case "4":
+                                trafficId.add(wdInfo.getWdId());
+                                break;
+                            case "5":
+                                enterpriseId.add(wdInfo.getWdId());
+                                break;
+                            default:
+                                break;
+                        }
+                    }
+                    System.out.println("进度:"+wdInfoOrigins.size()+"/"+hashMap1.get("total"));
+                    hashMap1.put("total",hashMap1.get("total")+1);
+                },executorService);
+            }
+            future.get();
+        }catch (Exception e){
+            e.printStackTrace();
+        }finally {
+            //删除
+            //writeService.clearSql2(wdId,storeId,houseId,buildId,trafficId,enterpriseId);
+            long end = System.currentTimeMillis();
+            System.out.println("完成清理 "+(end-start)/(1000*60));
+        }
+
+
+    }
+
     private void writeWdGeoRedis1(){
         //1.将网点坐标存入redis中
         long start = System.currentTimeMillis();
         System.out.println("开始将网点坐标存入redis");
-        for (WdInfo wdInfo : wdInfoDao.selectList(null)) {
+        QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.likeRight("collect_time","2023-09-");
+
+        HashMap<String,Integer> hashMap = new HashMap<>();
+        hashMap.put("total",1);
+        CompletableFuture<Void> future = null;
+        List<WdInfo> wdInfos = wdInfoDao.selectList(queryWrapper);
+        for (WdInfo wdInfo : wdInfos) {
             //开启线程
-            CompletableFuture<Void> future = CompletableFuture.runAsync(()->{
+            future = CompletableFuture.runAsync(()->{
                 redisTemplate.boundGeoOps(wdInfo.getAddrCode().substring(0,4)).add(new Point(wdInfo.getLng().doubleValue(),wdInfo.getLat().doubleValue()),wdInfo.getWdId());
+                 System.out.println("进度:"+wdInfos.size()+"/"+hashMap.get("total"));
+                 hashMap.put("total",hashMap.get("total")+1);
             },executorService);
-            try {
-                future.get();
-            } catch (InterruptedException e) {
-                throw new RuntimeException(e);
-            } catch (ExecutionException e) {
-                throw new RuntimeException(e);
-            }
+        }
+        try {
+            future.get();
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        } catch (ExecutionException e) {
+            throw new RuntimeException(e);
         }
         long end = System.currentTimeMillis();
         System.out.println("完成存入 "+(end-start)/(1000*60));
@@ -127,18 +217,23 @@ public class WdRedisStoreage {
         QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
         queryWrapper.in("wd_type_code", Arrays.asList("1","2","3","5"));
         List<WdInfo> wdInfos = wdInfoDao.selectList(queryWrapper);
+        CompletableFuture<Void> future = null;
+        HashMap<String,Integer> hashMap = new HashMap<>();
+        hashMap.put("total",1);
         for (WdInfo wdInfo : wdInfos) {
             //开启线程
-            CompletableFuture<Void> future = CompletableFuture.runAsync(()->{
+            future = CompletableFuture.runAsync(()->{
                 wdTagAnalyse(wdInfo);
+                System.out.println("进度:"+wdInfos.size()+"/"+hashMap.get("total"));
+                hashMap.put("total",hashMap.get("total")+1);
             },executorService);
-            try {
-                future.get();
-            } catch (InterruptedException e) {
-                throw new RuntimeException(e);
-            } catch (ExecutionException e) {
-                throw new RuntimeException(e);
-            }
+        }
+        try {
+            future.get();
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        } catch (ExecutionException e) {
+            throw new RuntimeException(e);
         }
         long end = System.currentTimeMillis();
         System.out.println("完成打标签 "+(end-start)/(1000*60));

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

@@ -175,9 +175,9 @@ 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
+#  global-config:
+#    db-config:
+#      id-type: auto
 
 pagehelper:
   helper-dialect: mysql

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

@@ -1,7 +1,9 @@
 package com.benyun.core;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.benyun.core.dao.WdInfoDao;
 import com.benyun.core.entity.WdInfo;
+import com.benyun.core.service.WriteService;
 import com.benyun.core.utils.WdRedisStoreage;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -11,6 +13,8 @@ import org.springframework.data.geo.Point;
 import org.springframework.data.redis.core.RedisTemplate;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Random;
 import java.util.concurrent.CompletableFuture;
@@ -22,9 +26,67 @@ class BenyunCoreApplicationTests {
     @Autowired
     WdRedisStoreage wdRedisStoreage;
 
+    @Autowired
+    WdInfoDao wdInfoDao;
+
+    @Autowired
+    WriteService writeService;
+
     @Test
     void contextLoads() {
         wdRedisStoreage.writeWdGeoRedis();
     }
 
+//    @Test
+//    public void clearSql2() {
+//        QueryWrapper<WdInfo> wdInfoOriginQueryWrapper = new QueryWrapper<>();
+//        wdInfoOriginQueryWrapper.select("hash", "count(hash) as audit").groupBy("hash").having("count(hash) >= 2");
+//        List<WdInfo> wdInfoOrigins = wdInfoDao.selectList(wdInfoOriginQueryWrapper);
+//
+//        HashMap<String, Integer> hashMap = new HashMap<>();
+//        for (WdInfo wdInfo : wdInfoOrigins) {
+//            hashMap.put(wdInfo.getHash(), wdInfo.getAudit());
+//        }
+//
+//        List<String> wdId = new ArrayList<>();
+//        List<String> storeId = new ArrayList<>();
+//        List<String> houseId = new ArrayList<>();
+//        List<String> buildId = new ArrayList<>();
+//        List<String> trafficId = new ArrayList<>();
+//        List<String> enterpriseId = new ArrayList<>();
+//        int index = 1;
+//        for (String s : hashMap.keySet()) {
+//            QueryWrapper<WdInfo> queryWrapper = new QueryWrapper<>();
+//            queryWrapper.eq("hash",s);
+//            queryWrapper.orderByDesc("collect_time");
+//            queryWrapper.last("limit " + (hashMap.get(s) - 1));
+//            List<WdInfo> wdInfos = wdInfoDao.selectList(queryWrapper);
+//            for (WdInfo wdInfo : wdInfos) {
+//                wdId.add(wdInfo.getWdId());
+//
+//                switch (wdInfo.getWdTypeCode()){
+//                    case "1":
+//                        storeId.add(wdInfo.getWdId());
+//                        break;
+//                    case "2":
+//                        houseId.add(wdInfo.getWdId());
+//                        break;
+//                    case "3":
+//                        buildId.add(wdInfo.getWdId());
+//                        break;
+//                    case "4":
+//                        trafficId.add(wdInfo.getWdId());
+//                        break;
+//                    case "5":
+//                        enterpriseId.add(wdInfo.getWdId());
+//                        break;
+//                }
+//                System.out.println("进度:"+wdInfoOrigins.size()+"/"+index++);
+//            }
+//        }
+//
+//        //删除
+//        writeService.clearSql2(wdId,storeId,houseId,buildId,trafficId,enterpriseId);
+//    }
+
 }

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

@@ -49,7 +49,7 @@ spring:
           driverClassName: com.mysql.cj.jdbc.Driver
           # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
           # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
-          url: jdbc:mysql://localhost:3306/bailian-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
+          url: jdbc:mysql://localhost:3306/bailian-ai-plus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
           username: root
           password: Aa@1230
         # 从库数据源
@@ -57,7 +57,7 @@ spring:
           lazy: true
           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
+          url: jdbc:mysql://localhost:3306/bailian-ai-plus??useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
           username: root
           password: Aa@1230
 #        oracle:

+ 35 - 33
ruoyi-admin/src/main/resources/application-prod.yml

@@ -105,40 +105,42 @@ spring:
 --- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
 spring:
   redis:
-    # 地址
-    host: 192.168.2.64
-    # 端口,默认为6379
-    port: 6379
-    # 数据库索引
-    database: 11
-    # 密码(如没有密码请注释掉)
-    password: "123456"
-    # 连接超时时间
-    timeout: 10s
-    # 是否开启ssl
-    ssl: false
+    cluster:
+      # 集群节点
+      nodes: 192.168.2.99:7001,192.168.2.99:7002,192.168.2.99:7003,192.168.2.99:7004,192.168.2.99:7005,192.168.2.99:7006
+      # 最大重定向次数
+      max-redirects: 5
+    # 密码
+    password: 123456
+    lettuce:
+      pool:
+        min-idle: 0
+        max-active: 8
+        max-wait: -1
+        max-idle: 8
+        enabled: true
 
-redisson:
-  # redis key前缀
-  keyPrefix:
-  # 线程池数量
-  threads: 16
-  # Netty线程池数量
-  nettyThreads: 32
-  # 单节点配置
-  singleServerConfig:
-    # 客户端名称
-    clientName: ${ruoyi.name}
-    # 最小空闲连接数
-    connectionMinimumIdleSize: 32
-    # 连接池大小
-    connectionPoolSize: 64
-    # 连接空闲超时,单位:毫秒
-    idleConnectionTimeout: 10000
-    # 命令等待超时,单位:毫秒
-    timeout: 3000
-    # 发布和订阅连接池大小
-    subscriptionConnectionPoolSize: 50
+#redisson:
+#  # redis key前缀
+#  keyPrefix:
+#  # 线程池数量
+#  threads: 16
+#  # Netty线程池数量
+#  nettyThreads: 32
+#  # 单节点配置
+#  singleServerConfig:
+#    # 客户端名称
+#    clientName: ${ruoyi.name}
+#    # 最小空闲连接数
+#    connectionMinimumIdleSize: 32
+#    # 连接池大小
+#    connectionPoolSize: 64
+#    # 连接空闲超时,单位:毫秒
+#    idleConnectionTimeout: 10000
+#    # 命令等待超时,单位:毫秒
+#    timeout: 3000
+#    # 发布和订阅连接池大小
+#    subscriptionConnectionPoolSize: 50
 
 --- # mail 邮件发送
 mail:

+ 1 - 1
ruoyi-ui/src/router/index.js

@@ -62,7 +62,7 @@ export const constantRoutes = [
     hidden: true
   },
   {
-    path: '',
+    path: '/',
     component: Layout,
     redirect: '/data/wdData',
     children: [

+ 2 - 2
ruoyi-ui/src/views/index.vue

@@ -2,9 +2,9 @@
   <div class="app-container home">
     <!-- <el-row :gutter="20">
       <el-col :sm="24" :lg="12" style="padding-left: 20px">
-        <h2>RuoYi-Vue-Plus后台管理框架</h2>
+        <h2>精准营销 后台管理框架</h2>
         <p>
-          RuoYi-Vue-Plus 是基于 RuoYi-Vue 针对 分布式集群 场景升级(不兼容原框架)
+          精准营销 是基于 RuoYi-Vue 针对 分布式集群 场景升级(不兼容原框架)
           <br/>
           * 前端开发框架 Vue、Element UI<br/>
           * 后端开发框架 Spring Boot<br/>

+ 1 - 1
ruoyi-ui/src/views/login.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="login">
     <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
-      <h3 class="title">RuoYi-Vue-Plus后台管理系统</h3>
+      <h3 class="title">精准营销后台管理系统</h3>
       <el-form-item prop="username">
         <el-input
           v-model="loginForm.username"

+ 1 - 1
ruoyi-ui/src/views/register.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="register">
     <el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
-      <h3 class="title">RuoYi-Vue-Plus后台管理系统</h3>
+      <h3 class="title">精准营销后台管理系统</h3>
       <el-form-item prop="username">
         <el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
           <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />