Prechádzať zdrojové kódy

Merge branch 'lcy' of http://47.107.53.207:3000/traineeCoder001/Bailian-Al

JensionDzero 1 rok pred
rodič
commit
a9654ac8ea

+ 11 - 2
benyun-core/src/main/java/com/benyun/core/controller/BrandController.java

@@ -1,5 +1,6 @@
 package com.benyun.core.controller;
 
+import com.benyun.core.entity.bo.BrandGeoLabelBo;
 import com.benyun.core.entity.bo.BrandSearch;
 import com.benyun.core.entity.vo.BrandListQueryBody;
 import com.benyun.core.service.BrandService;
@@ -7,6 +8,7 @@ import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.R;
 import lombok.RequiredArgsConstructor;
 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.*;
 
@@ -78,8 +80,8 @@ public class BrandController extends BaseController {
 
 //    获取所有品牌网点数量
     @GetMapping("/total")
-    public R total(){
-        return R.ok(brandService.searchTotal());
+    public R total(Integer pageSize){
+        return R.ok(brandService.searchTotal(pageSize));
     }
 
 //    获取品牌均分分布
@@ -94,4 +96,11 @@ public class BrandController extends BaseController {
         List<String> addrCode = body.getAddrCode();
         return R.ok(brandService.searchAddrDistribution(addrCode));
     }
+
+//    获取品牌地理位置标签分布
+    @GetMapping("/geolabel")
+    public R geolabel(String brandId){
+        List<BrandGeoLabelBo> brandGeoLabelBos = brandService.searchGeoLabel(brandId);
+        return R.ok(brandGeoLabelBos);
+    }
 }

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

@@ -1,11 +1,7 @@
 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;
@@ -15,7 +11,6 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.HashMap;
 import java.util.List;
 
 @Validated

+ 4 - 0
benyun-core/src/main/java/com/benyun/core/dao/CategoryMapper.java

@@ -17,4 +17,8 @@ public interface CategoryMapper {
     List<Category> searchBigManage();
     List<Category> searchMidManageByBig(String bigCategory);
     List<Category> searchSubManageByMid(String midCategory);
+    List<Category> searchBigIndustry();
+    List<Category> searchMidIndustryByBig(String bigCategory);
+    List<Category> searchSubIndustryByMid(String midCategory);
+    Category searchSubIndustryByCode(String industryCode);
 }

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

@@ -5,5 +5,6 @@ import lombok.Data;
 @Data
 public class BrandAddrDistribution {
     private String addrCode;
+    private String addrName;
     private Integer count;
 }

+ 11 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BrandGeoLabelBo.java

@@ -0,0 +1,11 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+@Data
+public class BrandGeoLabelBo {
+    private String code;
+    private String name;
+    private Integer total;
+    private String ratio;
+}

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

@@ -5,6 +5,7 @@ import lombok.Data;
 @Data
 public class BrandProperty {
     private String industryCode;
+    private String industryName;
     private Float perCapitaConsumption;
     private Long commentCount;
     private Float score;

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

@@ -12,6 +12,7 @@ import java.time.LocalDateTime;
 @Data
 public class Info {
     private String addrCode;
+    private String addrName;
     private Float avgScore;
     private Integer count;
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

+ 2 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/WdAddrTypeDistribution.java

@@ -5,6 +5,8 @@ import lombok.Data;
 @Data
 public class WdAddrTypeDistribution {
     private String typeCode;
+    private String typeName;
     private String addrCode;
+    private String addrName;
     private Integer count;
 }

+ 2 - 1
benyun-core/src/main/java/com/benyun/core/service/BrandService.java

@@ -16,7 +16,8 @@ public interface BrandService {
     List<BrandProvinceBo> searchProvinceByBrandId(String brandId);
     BrandDisCloud searchDisCloudByBrandId(String brandId);
     PageInfo<List<BrandSearch>> searchListByMulti(BrandListQueryBody body,String userId);
-    List<BrandTotal> searchTotal();
+    List<BrandTotal> searchTotal(Integer pageSize);
     BStoreData searchAvgScoreByBrandId(String brandId);
     List<BrandAddrDistribution> searchAddrDistribution(List<String> addrCodes);
+    List<BrandGeoLabelBo> searchGeoLabel(String brandId);
 }

+ 1 - 0
benyun-core/src/main/java/com/benyun/core/service/CategoryService.java

@@ -9,4 +9,5 @@ public interface CategoryService {
     List<Category> getTypeByCategory();
     List<Category> getWdTypeCategory();
     List<Category> getManageCategory();
+    List<Category> getIndustryCategory();
 }

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

@@ -13,8 +13,4 @@ public interface WdInfoService {
     List<WdAddrTypeDistribution> searchAddrTypeDistribution(List<String> addrCodes, List<String> typeCodes);
     List<WdAddrTypeDistribution> searchWdTypeDistribution(List<String> addrCodes, List<String> typeCodes);
     List<WdAddrTypeDistribution> searchWdTotal();
-
-
-
-
 }

+ 97 - 6
benyun-core/src/main/java/com/benyun/core/service/impl/BrandServiceImpl.java

@@ -1,5 +1,6 @@
 package com.benyun.core.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.benyun.core.dao.*;
 import com.benyun.core.entity.*;
 import com.benyun.core.entity.bo.*;
@@ -10,10 +11,7 @@ import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Service
 public class BrandServiceImpl implements BrandService {
@@ -31,6 +29,16 @@ public class BrandServiceImpl implements BrandService {
     EnterpriseMapper enterpriseMapper;
     @Autowired
     AttentionPoolDao attentionPoolDao;
+    @Autowired
+    CategoryMapper categoryMapper;
+    @Autowired
+    StoreWdDao storeWdDao;
+    @Autowired
+    WdTopologicalInfoDao wdTopologicalInfoDao;
+    @Autowired
+    TypeByDao typeByDao;
+    @Autowired
+    WdInfoServiceImpl wdInfoService;
 
     @Override
     public List<BrandSearch> searchByLikeName(String text) {
@@ -77,11 +85,17 @@ public class BrandServiceImpl implements BrandService {
         BrandProperty bp = new BrandProperty();
         if (brand != null){
             bp.setIndustryCode(brand.getIndustryCode());
+            if (brand.getIndustryCode() == null || brand.getIndustryCode().equals(""))
+                bp.setIndustryName("");
+            else{
+                Category category = categoryMapper.searchSubIndustryByCode(brand.getIndustryCode());
+                bp.setIndustryName(category.getName());
+            }
             bp.setPerCapitaConsumption(brand.getPerCapitaConsumption());
             bp.setCommentCount(brand.getCommentCount());
             bp.setScore(brand.getScore());
         }else {
-            bp.setIndustryCode("****");
+            bp.setIndustryName("****");
             bp.setPerCapitaConsumption(null);
             bp.setCommentCount(null);
             bp.setScore(null);
@@ -267,18 +281,24 @@ public class BrandServiceImpl implements BrandService {
     }
 
     @Override
-    public List<BrandTotal> searchTotal() {
+    public List<BrandTotal> searchTotal(Integer pageSize) {
         List<BrandStatistics> list = brandStatisticsMapper.searchList();
         if (list.isEmpty())
             return new ArrayList<>();
         List<BrandTotal> tList = new ArrayList<>();
+        if (pageSize == null)
+            pageSize = 10;
+        int index = 0;
         for (BrandStatistics bs : list){
+            if (index >= pageSize)
+                break;
             BrandTotal bt = new BrandTotal();
             bt.setBrandId(bs.getBrandId());
             bt.setBrandName(bs.getBrandName());
             bt.setTotal(bs.getTotal());
             bt.setUpdateTime(bs.getUpdateTime());
             tList.add(bt);
+            index++;
         }
         return tList;
     }
@@ -294,9 +314,11 @@ public class BrandServiceImpl implements BrandService {
         if (zones.isEmpty())
             return null;
         List<Info> infos = new ArrayList<>();
+        wdInfoService.setAddrMap();
         for (BrandZone bz : zones){
             Info info = new Info();
             info.setAddrCode(bz.getAddrCode());
+            info.setAddrName(wdInfoService.addrMap.get(bz.getAddrCode()));
             info.setAvgScore(bz.getAvgScore());
             infos.add(info);
         }
@@ -307,6 +329,75 @@ public class BrandServiceImpl implements BrandService {
     @Override
     public List<BrandAddrDistribution> searchAddrDistribution(List<String> addrCodes) {
         List<BrandAddrDistribution> list = brandZoneMapper.searchByAddrCodeGroup(addrCodes);
+        wdInfoService.setAddrMap();
+        for (BrandAddrDistribution dis : list){
+            dis.setAddrName(wdInfoService.addrMap.get(dis.getAddrCode()));
+        }
         return list;
     }
+
+    @Override
+    public List<BrandGeoLabelBo> searchGeoLabel(String brandId) {
+        List<BrandGeoLabelBo> bos = new ArrayList<>();
+
+        // 查询门店
+        QueryWrapper<StoreWd> storeWdQueryWrapper = new QueryWrapper<>();
+        storeWdQueryWrapper.eq("brand_id",brandId);
+        List<StoreWd> storeWds = storeWdDao.selectList(storeWdQueryWrapper);
+        if (storeWds.size() == 0)
+            return bos;
+
+        // 查询标签
+        int count = storeWds.size(); // 总数,用于做比率
+        QueryWrapper<WdTopologicalInfo> infoQueryWrapper = new QueryWrapper<>();
+        List<String> wdIds = new ArrayList<>();
+        for (StoreWd storeWd : storeWds){
+            wdIds.add(storeWd.getWdId());
+        }
+        infoQueryWrapper.eq("radius",1000).and(info -> {
+            info.in("center_wd_id",wdIds);
+        });
+        List<WdTopologicalInfo> infos = wdTopologicalInfoDao.selectList(infoQueryWrapper);
+        // 统计标签
+        Map<String,Integer> typeMap = new HashMap<>();
+        for (WdTopologicalInfo info : infos){
+            String tag = info.getTag();
+            String[] tags = tag.split(";");
+            for (String t : tags){
+                String[] split = t.split(":");
+                if (split.length < 2)
+                    continue;
+                if (typeMap.get(split[0]) != null){
+                    typeMap.replace(split[0],typeMap.get(split[0])+Integer.parseInt(split[1]));
+                }
+                typeMap.put(split[0],Integer.parseInt(split[1]));
+            }
+        }
+        Set<String> keySet = typeMap.keySet();
+        // 查询标签
+        QueryWrapper<TypeBy> typeByQueryWrapper = new QueryWrapper<>();
+        typeByQueryWrapper.in("type_code_by",keySet).and(typeByQueryWrapper1 -> {
+            typeByQueryWrapper1.ne("mid_category","");
+        }).and(typeByQueryWrapper1 -> {
+            typeByQueryWrapper1.ne("sub_category","");
+        });
+        List<TypeBy> typeByList = typeByDao.selectList(typeByQueryWrapper);
+        // 赋值
+        for (TypeBy typeBy : typeByList){
+            BrandGeoLabelBo bo = new BrandGeoLabelBo();
+            bo.setCode(typeBy.getTypeCodeBy());
+            bo.setTotal(typeMap.get(typeBy.getTypeCodeBy()));
+            if (!typeBy.getSubCategory().equals("")){
+                bo.setName(typeBy.getSubCategory());
+            }else if (!typeBy.getMidCategory().equals("")){
+                bo.setName(typeBy.getMidCategory());
+            }else{
+                bo.setName(typeBy.getBigCategory());
+            }
+            float ratio = (float) bo.getTotal()/count;
+            bo.setRatio((ratio*100) + "%");
+            bos.add(bo);
+        }
+        return bos;
+    }
 }

+ 57 - 12
benyun-core/src/main/java/com/benyun/core/service/impl/CategoryServiceImpl.java

@@ -4,21 +4,28 @@ import com.benyun.core.entity.Category;
 import com.benyun.core.dao.CategoryMapper;
 import com.benyun.core.service.CategoryService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
 
 @Service
 public class CategoryServiceImpl implements CategoryService {
+    public List<Category> addrCategory;
+    public List<Category> typeBy;
+    public List<Category> manageCategory;
+    public List<Category> industryCategory;
     @Autowired
     CategoryMapper categoryMapper;
 
     @Override
     public List<Category> getAddrCategory() {
-        List<Category> provinces = categoryMapper.searchProvince();
-        if (provinces.isEmpty())
+        if (addrCategory != null)
+            return addrCategory;
+        addrCategory = categoryMapper.searchProvince();
+        if (addrCategory.isEmpty())
             return null;
-        for (Category province : provinces){
+        for (Category province : addrCategory){
             province.setType("province");
             List<Category> citys = categoryMapper.searchCityByProvince(province.getName());
             if (citys.isEmpty())
@@ -40,15 +47,17 @@ public class CategoryServiceImpl implements CategoryService {
                 province.setChildren(citys);
             }
         }
-        return provinces;
+        return addrCategory;
     }
 
     @Override
     public List<Category> getTypeByCategory() {
-        List<Category> bigs = categoryMapper.searchBigCategory();
-        if (bigs.isEmpty())
+        if (typeBy != null)
+            return typeBy;
+        typeBy = categoryMapper.searchBigCategory();
+        if (typeBy.isEmpty())
             return null;
-        for (Category big : bigs){
+        for (Category big : typeBy){
             big.setType("bigCategory");
             List<Category> mids = categoryMapper.searchMidCategoryByBig(big.getName());
             if (mids.isEmpty())
@@ -70,7 +79,7 @@ public class CategoryServiceImpl implements CategoryService {
                 big.setChildren(mids);
             }
         }
-        return bigs;
+        return typeBy;
     }
 
     @Override
@@ -80,10 +89,13 @@ public class CategoryServiceImpl implements CategoryService {
 
     @Override
     public List<Category> getManageCategory() {
-        List<Category> bigs = categoryMapper.searchBigManage();
-        if (bigs.isEmpty())
+        if (manageCategory != null){
+            return manageCategory;
+        }
+        manageCategory = categoryMapper.searchBigManage();
+        if (manageCategory.isEmpty())
             return null;
-        for (Category big : bigs){
+        for (Category big : manageCategory){
             big.setType("bigCategory");
             List<Category> mids = categoryMapper.searchMidManageByBig(big.getName());
             if (mids.isEmpty())
@@ -105,6 +117,39 @@ public class CategoryServiceImpl implements CategoryService {
                 big.setChildren(mids);
             }
         }
-        return bigs;
+        return manageCategory;
+    }
+
+    @Override
+    public List<Category> getIndustryCategory() {
+        if (industryCategory != null){
+            return industryCategory;
+        }
+        industryCategory = categoryMapper.searchBigIndustry();
+        if (industryCategory.isEmpty())
+            return null;
+        for (Category big : industryCategory){
+            big.setType("bigCategory");
+            List<Category> mids = categoryMapper.searchMidIndustryByBig(big.getName());
+            if (mids.isEmpty())
+                big.setChildren(null);
+            else {
+                for (Category mid : mids){
+                    mid.setType("midCategory");
+                    List<Category> subs = categoryMapper.searchSubIndustryByMid(mid.getName());
+                    if (subs.isEmpty())
+                        mid.setChildren(null);
+                    else{
+                        for (Category sub : subs){
+                            sub.setType("subCategory");
+                            sub.setChildren(null);
+                        }
+                        mid.setChildren(subs);
+                    }
+                }
+                big.setChildren(mids);
+            }
+        }
+        return industryCategory;
     }
 }

+ 134 - 6
benyun-core/src/main/java/com/benyun/core/service/impl/WdInfoServiceImpl.java

@@ -1,13 +1,18 @@
 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.CategoryMapper;
 import com.benyun.core.dao.TypeByDao;
 import com.benyun.core.dao.WdInfoMapper;
+import com.benyun.core.entity.AddrCategory;
+import com.benyun.core.entity.Category;
 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.CategoryService;
 import com.benyun.core.service.WdInfoService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -16,35 +21,158 @@ import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 
 import java.lang.reflect.Type;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 @Service
 public class WdInfoServiceImpl implements WdInfoService {
+    public Map<String,String> typeMap;
+    public Map<String,String> addrMap;
+    public Map<String,String> wdTypeMap;
     @Autowired
     WdInfoMapper wdInfoMapper;
-
-
-
     @Autowired
     TypeByDao byDao;
+    @Autowired
+    AddrCategoryDao addrCategoryDao;
 
+    public void setTypeMap(){
+        if (typeMap == null){
+            typeMap = new HashMap<>();
+            QueryWrapper<TypeBy> queryWrapper = new QueryWrapper<>();
+            List<TypeBy> typeByList = byDao.selectList(queryWrapper);
+            for (TypeBy by : typeByList){
+                if (!by.getSubCategory().equals(""))
+                    typeMap.put(by.getTypeCodeBy(),by.getSubCategory());
+                else if (!by.getMidCategory().equals(""))
+                    typeMap.put(by.getTypeCodeBy(),by.getMidCategory());
+                else
+                    typeMap.put(by.getTypeCodeBy(),by.getBigCategory());
+            }
+        }
+    }
+    public void setAddrMap(){
+        if (addrMap == null){
+            addrMap = new HashMap<>();
+            QueryWrapper<AddrCategory> queryWrapper = new QueryWrapper<>();
+            List<AddrCategory> addrCategories = addrCategoryDao.selectList(queryWrapper);
+            for (AddrCategory addr : addrCategories){
+                if (!addr.getDistrict().equals(""))
+                    addrMap.put(addr.getAddrCode(),addr.getDistrict());
+                else if (!addr.getCity().equals(""))
+                    addrMap.put(addr.getAddrCode(),addr.getCity());
+                else
+                    addrMap.put(addr.getAddrCode(),addr.getProvince());
+            }
+        }
+    }
+    public void setWdTypeMap(){
+        if (wdTypeMap == null){
+            wdTypeMap = new HashMap<>();
+            wdTypeMap.put("0","基础设施网点");
+            wdTypeMap.put("1","门店网点");
+            wdTypeMap.put("2","小区网点");
+            wdTypeMap.put("3","楼宇网点");
+            wdTypeMap.put("4","交通设施网点");
+            wdTypeMap.put("5","公司网点");
+        }
+    }
+    private List<String> getAllOtherAddrCode(String addrCode){
+        List<String> addrCodes = new ArrayList<>();
+        byte[] bytes = addrCode.getBytes(StandardCharsets.UTF_8);
+        String big = String.valueOf(bytes[0]) + String.valueOf(bytes[1]);
+        String mid = String.valueOf(bytes[2]) + String.valueOf(bytes[3]);
+        String sub = String.valueOf(bytes[4]) + String.valueOf(bytes[5]);
+        if (sub.equals("00")){
+            QueryWrapper<AddrCategory> queryWrapper = new QueryWrapper<>();
+            if (mid.equals("00")){
+                queryWrapper.likeRight("addr_code",big).and(addrCategoryQueryWrapper -> {
+                    addrCategoryQueryWrapper.ne("city","");
+                }).and(addrCategoryQueryWrapper -> {
+                    addrCategoryQueryWrapper.ne("district","");
+                });
+            }else{
+                queryWrapper.likeRight("addr_code",big+mid).and(addrCategoryQueryWrapper -> {
+                    addrCategoryQueryWrapper.ne("city","");
+                }).and(addrCategoryQueryWrapper -> {
+                    addrCategoryQueryWrapper.ne("district","");
+                });
+            }
+            List<AddrCategory> provinces = addrCategoryDao.selectList(queryWrapper);
+            addrCodes.add(provinces.listIterator().next().getAddrCode());
+        }else
+            addrCodes.add(addrCode);
+        return addrCodes;
+    }
+    private List<String> getAllOtherTypeBy(String typeCode){
+        List<String> types = new ArrayList<>();
+        byte[] bytes = typeCode.getBytes(StandardCharsets.UTF_8);
+        String big = String.valueOf(bytes[0]) + String.valueOf(bytes[1]);
+        String mid = String.valueOf(bytes[2]) + String.valueOf(bytes[3]);
+        String sub = String.valueOf(bytes[4]) + String.valueOf(bytes[5]);
+        if (sub.equals("00")){
+            QueryWrapper<TypeBy> queryWrapper = new QueryWrapper<>();
+            if (mid.equals("00")){
+                queryWrapper.likeRight("type_code_by",big).and(addrCategoryQueryWrapper -> {
+                    addrCategoryQueryWrapper.ne("mid_category","");
+                }).and(addrCategoryQueryWrapper -> {
+                    addrCategoryQueryWrapper.ne("sub_category","");
+                });
+            }else{
+                queryWrapper.likeRight("addr_code",big+mid).and(addrCategoryQueryWrapper -> {
+                    addrCategoryQueryWrapper.ne("mid_category","");
+                }).and(addrCategoryQueryWrapper -> {
+                    addrCategoryQueryWrapper.ne("sub_category","");
+                });
+            }
+            List<TypeBy> typeByList = byDao.selectList(queryWrapper);
+            types.add(typeByList.listIterator().next().getTypeCodeBy());
+        }else
+            types.add(typeCode);
+        return types;
+    }
 
     @Override
     public List<WdAddrTypeDistribution> searchAddrTypeDistribution(List<String> addrCodes, List<String> typeCodes) {
-        return wdInfoMapper.searchAddrDisByMulti(addrCodes, typeCodes);
+        List<String> acodes = new ArrayList<>();
+        for (String s : addrCodes){
+            List<String> allOtherAddrCode = getAllOtherAddrCode(s);
+            acodes.addAll(allOtherAddrCode);
+        }
+        List<WdAddrTypeDistribution> list = wdInfoMapper.searchAddrDisByMulti(acodes, typeCodes);
+        setTypeMap();
+        setAddrMap();
+        for (WdAddrTypeDistribution wd : list){
+            wd.setTypeName(typeMap.get(wd.getTypeCode()));
+            wd.setAddrName(addrMap.get(wd.getAddrCode()));
+        }
+        return list;
     }
 
     @Override
     public List<WdAddrTypeDistribution> searchWdTypeDistribution(List<String> addrCodes, List<String> typeCodes) {
-        return wdInfoMapper.searchWdTypeDisByMulti(addrCodes,typeCodes);
+        List<WdAddrTypeDistribution> list = wdInfoMapper.searchWdTypeDisByMulti(addrCodes, typeCodes);
+        setAddrMap();
+        setWdTypeMap();
+        for (WdAddrTypeDistribution wd : list){
+            wd.setAddrName(addrMap.get(wd.getAddrCode()));
+            wd.setTypeName(wdTypeMap.get(wd.getTypeCode()));
+        }
+        return list;
     }
 
     @Override
     public List<WdAddrTypeDistribution> searchWdTotal() {
-        return wdInfoMapper.searchWdTotal();
+        List<WdAddrTypeDistribution> list = wdInfoMapper.searchWdTotal();
+        setWdTypeMap();
+        for (WdAddrTypeDistribution wd : list){
+            wd.setTypeName(wdTypeMap.get(wd.getTypeCode()));
+        }
+        return list;
     }
 
 }

+ 24 - 0
benyun-core/src/main/resources/mapper/CategoryMapper.xml

@@ -43,6 +43,18 @@
         <result property="code" column="wd_type_code"/>
         <result property="name" column="wd_type_name"/>
     </resultMap>
+    <resultMap type="com.benyun.core.entity.Category" id="BigIndustryResult">
+        <result property="code" column="industry_code"/>
+        <result property="name" column="big_category"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.Category" id="MidIndustryResult">
+        <result property="code" column="industry_code"/>
+        <result property="name" column="mid_category"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.Category" id="SubIndustryResult">
+        <result property="code" column="industry_code"/>
+        <result property="name" column="sub_category"/>
+    </resultMap>
     <select id="searchProvince" resultMap="ProvinceResult">
         select * from `ddt_addr_category` where city = ''
     </select>
@@ -73,4 +85,16 @@
     <select id="searchSubManageByMid" resultMap="SubManageResult">
         select * from `ddt_manage_type` where mid_category <![CDATA[<>]]> '' and sub_category <![CDATA[<>]]> '' and mid_category = #{midCategory}
     </select>
+    <select id="searchBigIndustry" resultMap="BigIndustryResult">
+        select * from `ddt_industry_category` where mid_category = ''
+    </select>
+    <select id="searchMidIndustryByBig" resultMap="MidIndustryResult">
+        select * from `ddt_industry_category` where mid_category <![CDATA[<>]]> '' and sub_category = '' and big_category = #{bigCategory}
+    </select>
+    <select id="searchSubIndustryByMid" resultMap="SubIndustryResult">
+        select * from `ddt_industry_category` where mid_category <![CDATA[<>]]> '' and sub_category <![CDATA[<>]]> '' and mid_category = #{midCategory}
+    </select>
+    <select id="searchSubIndustryByCode" resultMap="SubIndustryResult">
+        select * from `ddt_industry_category` where industry_code = #{industryCode}
+    </select>
 </mapper>

+ 1 - 1
benyun-core/src/test/java/com/benyun/core/service/BrandServiceImplTest.java

@@ -97,7 +97,7 @@ public class BrandServiceImplTest {
 
     @Test
     public void searchTotalTest(){
-        System.out.println(brandService.searchTotal());
+        System.out.println(brandService.searchTotal(10));
     }
 
     @Test