Jelajahi Sumber

整合工作台(v1.0)

JensionDzero 1 tahun lalu
induk
melakukan
d76d267603
44 mengubah file dengan 877 tambahan dan 65 penghapusan
  1. 0 1
      benyun-core/Dockerfile
  2. 3 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. 7 6
      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. 8 0
      benyun-core/src/main/java/com/benyun/core/controller/WdInfoController.java
  7. 32 0
      benyun-core/src/main/java/com/benyun/core/controller/WdRecycleController.java
  8. 9 0
      benyun-core/src/main/java/com/benyun/core/dao/TypeByDao.java
  9. 6 1
      benyun-core/src/main/java/com/benyun/core/dao/WdInfoMapper.java
  10. 2 1
      benyun-core/src/main/java/com/benyun/core/entity/TopologicalBuildingWd.java
  11. 20 0
      benyun-core/src/main/java/com/benyun/core/entity/TypeBy.java
  12. 3 0
      benyun-core/src/main/java/com/benyun/core/entity/WdInfo.java
  13. 53 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/WdTopologicalInfoBo.java
  14. 12 0
      benyun-core/src/main/java/com/benyun/core/entity/vo/AddrCategoryBody.java
  15. 46 0
      benyun-core/src/main/java/com/benyun/core/entity/vo/ChannelAnalyseAceeptVo.java
  16. 2 2
      benyun-core/src/main/java/com/benyun/core/entity/vo/ChannelMapAceeptVo.java
  17. 2 4
      benyun-core/src/main/java/com/benyun/core/entity/vo/TopologicalWdAceeptVo.java
  18. 13 0
      benyun-core/src/main/java/com/benyun/core/entity/vo/TypeByBody.java
  19. 77 0
      benyun-core/src/main/java/com/benyun/core/entity/vo/WdInfoVo.java
  20. 51 0
      benyun-core/src/main/java/com/benyun/core/error/BenYunCoreControllerAdver.java
  21. 34 0
      benyun-core/src/main/java/com/benyun/core/error/entity/BenYunCoreCodeEnum.java
  22. 23 1
      benyun-core/src/main/java/com/benyun/core/init/BenyunCoreInit.java
  23. 7 1
      benyun-core/src/main/java/com/benyun/core/service/ChannelAnalyseService.java
  24. 3 1
      benyun-core/src/main/java/com/benyun/core/service/ChannelMapService.java
  25. 12 0
      benyun-core/src/main/java/com/benyun/core/service/CommonService.java
  26. 9 0
      benyun-core/src/main/java/com/benyun/core/service/WdInfoService.java
  27. 15 0
      benyun-core/src/main/java/com/benyun/core/service/WdRecycleService.java
  28. 1 1
      benyun-core/src/main/java/com/benyun/core/service/impl/AnalyseWdServiceImpl.java
  29. 25 3
      benyun-core/src/main/java/com/benyun/core/service/impl/ChannelAnalyseServiceImpl.java
  30. 65 7
      benyun-core/src/main/java/com/benyun/core/service/impl/ChannelMapServiceImpl.java
  31. 135 0
      benyun-core/src/main/java/com/benyun/core/service/impl/CommonServiceImpl.java
  32. 20 0
      benyun-core/src/main/java/com/benyun/core/service/impl/WdInfoServiceImpl.java
  33. 69 0
      benyun-core/src/main/java/com/benyun/core/service/impl/WdRecycleServiceImpl.java
  34. 3 3
      benyun-core/src/main/java/com/benyun/core/utils/SpringUtil.java
  35. 2 2
      benyun-core/src/main/resources/application-prod.yaml
  36. 8 4
      benyun-core/src/main/resources/application.yaml
  37. 18 0
      benyun-core/src/main/resources/mapper/WdInfoMapper.xml
  38. 3 0
      benyun-core/src/test/java/com/benyun/core/BenyunCoreApplicationTests.java
  39. 0 8
      benyun-core/src/test/java/com/benyun/core/service/ChannelAnalyeServiceImpTest.java
  40. 6 2
      benyun-core/src/test/java/com/benyun/core/service/ChannelMapServiceImplTest.java
  41. 0 7
      pom.xml
  42. 2 2
      ruoyi-admin/src/main/resources/application-dev.yml
  43. 5 5
      ruoyi-generator/src/main/resources/generator.yml
  44. 5 0
      ruoyi-ui-vue3/vite.config.js

+ 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
 

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

@@ -30,4 +30,7 @@ public class RedisContant {
     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);
+    }
 }

+ 7 - 6
benyun-core/src/main/java/com/benyun/core/controller/ChannelMapController.java

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.concurrent.TimeUnit;
 
 
@@ -50,24 +51,24 @@ 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){
             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);
+        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")

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

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

+ 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

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

+ 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接口)

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

@@ -11,13 +11,11 @@ import javax.validation.constraints.NotNull;
 @Data
 public class TopologicalWdAceeptVo {
 
-    @NotBlank(groups = {TopologicalWdGroup.class,TopologicalWdListGroup.class})
+    @NotBlank(groups = {TopologicalWdGroup.class,TopologicalWdListGroup.class},message = "请选择中心点")
     String centerWdId;
-    @NotNull(groups = {TopologicalWdGroup.class,TopologicalWdListGroup.class})
+    @NotNull(groups = {TopologicalWdGroup.class,TopologicalWdListGroup.class},message = "半径范围未正确选择")
     int radius;
-    @NotNull(groups = {TopologicalWdListGroup.class})
     int pageNum = 1;
-    @NotNull(groups = {TopologicalWdListGroup.class})
     int pageSize = 10;
 
     public String getHash(){

+ 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")
+    private int show;
+
+    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.show = wdInfo.getShow();
+    }
+
+    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;
+    }
+}

+ 23 - 1
benyun-core/src/main/java/com/benyun/core/init/BenyunCoreInit.java

@@ -1,8 +1,10 @@
 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;
@@ -19,6 +21,9 @@ public class BenyunCoreInit {
     @Autowired
     ManageTypeService manageTypeService;
 
+    @Autowired
+    TypeByDao byDao;
+
     @Bean("cityTierMap")
     public HashMap getCityTierMap(){
         HashMap<String, String> hashMap = new HashMap<>();
@@ -42,7 +47,24 @@ public class BenyunCoreInit {
             if(!datum.getMidCategory().equals(""))
                 hashMap.put(datum.getMidCategory(),datum.getManageTypeCode());
         }
-        System.out.println(hashMap);
+        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);
+
 }

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

@@ -1,14 +1,16 @@
 package com.benyun.core.service;
 
+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();
+
+}

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

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

@@ -93,7 +93,7 @@ public class AnalyseWdServiceImpl implements AnalyseWdService {
             HashMap<String, HashMap<String, Integer>>[] storeCategory = new HashMap[anly.size()];  //经营分类统计:<中类,<小类,数量>>
             HashMap<String, Double>[] houseData = new HashMap[anly.size()];  //小区分析统计:key:totalHouseholds、totalPeopleCount、totalRent
             HashMap<String, Integer>[] buildCategory = new HashMap[anly.size()];   //楼宇网点分析统计,key:甲类、乙类...
-            HashMap<String, Integer>[] wdTopologicalInfoHash = new HashMap[anly.size()];
+            HashMap<String, Integer>[] wdTopologicalInfoHash = new HashMap[anly.size()];  //分类tag:key:byCode value:数量
 
 
             for (int i = 0; i < anly.size(); i++) {

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

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

@@ -3,19 +3,26 @@ 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.WdInfoDao;
+import com.benyun.core.dao.WdTopologicalInfoDao;
 import com.benyun.core.entity.AddrCategory;
+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.Collections;
+import java.util.HashMap;
 import java.util.List;
+import java.util.stream.Collectors;
 
 @Service
 public class ChannelMapServiceImpl implements ChannelMapService {
@@ -26,6 +33,17 @@ 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;
+
     @Override
     public WdCount area(List<String> channel, String rankType, String searchText, String[] addrCode) {
         long start = System.currentTimeMillis();
@@ -138,7 +156,7 @@ public class ChannelMapServiceImpl implements ChannelMapService {
 
     //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 +183,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 +192,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<String> id = new ArrayList<>();
+
+        //组装
+        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;
+    }
+}

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

+ 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

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

@@ -168,8 +168,8 @@ spring:
 #mybatis-plus配置
 mybatis-plus:
   mapper-locations: classpath:/mapper/**/*.xml  #告诉mybatis数据库映射文件mapper.xml的位置
-  #  configuration:
-  #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl  #显示sql日志
+#  configuration:
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl  #显示sql日志
   global-config:
     db-config:
       id-type: auto

+ 8 - 4
benyun-core/src/main/resources/application.yaml

@@ -10,7 +10,7 @@ server:
 # 数据源配置
 spring:
   profiles:
-    active: prod
+    active: dev
   application:
     name: bailian-ai #当前服务的名称
 
@@ -19,11 +19,15 @@ spring:
 #mybatis-plus配置
 mybatis-plus:
   mapper-locations: classpath:/mapper/**/*.xml  #告诉mybatis数据库映射文件mapper.xml的位置
-#  configuration:
-#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl  #显示sql日志
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl  #显示sql日志
   global-config:
     db-config:
-      id-type: auto
+      id-type: ASSIGN_ID
+      logic-delete-field: show # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2)
+      logic-delete-value: 1 # 逻辑已删除值(默认为 1)
+      logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
+
 
 
 #分页配置

+ 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="show != null">
+                and ddt_wd_info.show = #{show}
+            </if>
+        </where>
+    </select>
 </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);
     }
 
 }

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

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

@@ -1,14 +1,17 @@
 package com.benyun.core.service;
 
+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.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
@@ -66,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

+ 5 - 5
ruoyi-generator/src/main/resources/generator.yml

@@ -1,10 +1,10 @@
 # 代码生成
-gen: 
+gen:
   # 作者
-  author: ruoyi
+  author: gybi
   # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
-  packageName: com.ruoyi.system
+  packageName: com.benyun.core
   # 自动去除表前缀,默认是false
-  autoRemovePre: false
+  autoRemovePre: true
   # 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
-  tablePrefix: sys_
+  tablePrefix: ddt_,bl_

+ 5 - 0
ruoyi-ui-vue3/vite.config.js

@@ -29,6 +29,11 @@ export default defineConfig(({ mode, command }) => {
       open: true,
       proxy: {
         // https://cn.vitejs.dev/config/#server-proxy
+        '/dev-api/bailianAi':{
+          target: 'http://localhost:8000',
+          changeOrigin: true,
+          rewrite: (p) => p.replace(/^\/dev-api/, '')
+        },
         '/dev-api': {
           target: 'http://localhost:8080',
           changeOrigin: true,