JensionDzero 1 년 전
부모
커밋
d6dbffa6c6

+ 4 - 4
ruoyi-demo/src/main/java/com/ruoyi/demo/controller/ChannelMapController.java

@@ -54,10 +54,10 @@ public class ChannelMapController {
         //1.查看redis中是否存在有缓存
         channel.setRankType("province");
         String md5 = channel.getHash();
-//        WdCount wdCount = (WdCount) redisTemplate.boundHashOps(RedisContant.CHANNEL_MAP_AREA).get(md5);
-//        if (wdCount != null) {
-//            return R.ok(wdCount);
-//        }
+        WdCount wdCount = (WdCount) redisTemplate.boundHashOps(RedisContant.CHANNEL_MAP_AREA).get(md5);
+        if (wdCount != null) {
+            return R.ok(wdCount);
+        }
 
         //2.查询结果
         WdCount area = channelMapService.areaProvince(channel);

+ 1 - 1
ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/ChannelAnalyseServiceImpl.java

@@ -669,7 +669,7 @@ public class ChannelAnalyseServiceImpl implements ChannelAnalyseService {
         //2.找到所有完整的区码
         QueryWrapper<AddrCategory> queryWrapper1 = new QueryWrapper<>();
         queryWrapper1.select("addr_code");
-        queryWrapper1.ne("district", "");
+        queryWrapper1.eq("type", "zone");
         queryWrapper1.and(addrCategoryQueryWrapper -> {
             for (String s : addrCodeList) {
                 addrCategoryQueryWrapper.likeRight("addr_code", s).or();

+ 2 - 10
ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/ChannelMapServiceImpl.java

@@ -855,7 +855,7 @@ public class ChannelMapServiceImpl implements ChannelMapService {
 
         //2.找到所有完整的区码
         QueryWrapper<AddrCategory> queryWrapper1 = new QueryWrapper<>();
-        queryWrapper1.ne("district", "");
+        queryWrapper1.eq("type", "zone");
         queryWrapper1.and(addrCategoryQueryWrapper -> {
             for (String s : addrCodeList) {
                 addrCategoryQueryWrapper.likeRight("addr_code", s).or();
@@ -895,15 +895,7 @@ public class ChannelMapServiceImpl implements ChannelMapService {
 
         //2.找到所有需要封装的 地区信息
         QueryWrapper<AddrCategory> queryWrapper = new QueryWrapper<>();
-        if ("province".equals(rankType)) {
-            queryWrapper.eq("city", "");
-        } else if ("city".equals(rankType)) {
-            queryWrapper.eq("district", "").and(addrCategoryQueryWrapper -> {
-                addrCategoryQueryWrapper.ne("city", "");
-            });
-        } else if ("zone".equals(rankType)) {
-            queryWrapper.ne("district", "");
-        }
+        queryWrapper.eq("type", rankType);
         queryWrapper.and(addrCategoryQueryWrapper -> {
             for (String s : addrCodeList) {
                 addrCategoryQueryWrapper.likeRight("addr_code", s).or();