|
@@ -1,7 +1,6 @@
|
|
|
package com.ydtech.modules.admin.service.impl;
|
|
package com.ydtech.modules.admin.service.impl;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ydtech.modules.admin.dao.SysDeptMapper;
|
|
import com.ydtech.modules.admin.dao.SysDeptMapper;
|
|
|
import com.ydtech.modules.admin.dao.SysPcAddressMapper;
|
|
import com.ydtech.modules.admin.dao.SysPcAddressMapper;
|
|
@@ -11,12 +10,9 @@ import com.ydtech.modules.admin.model.dto.*;
|
|
|
import com.ydtech.modules.admin.model.po.SysPcAddressHistory;
|
|
import com.ydtech.modules.admin.model.po.SysPcAddressHistory;
|
|
|
import com.ydtech.modules.admin.model.po.SysPcAddress;
|
|
import com.ydtech.modules.admin.model.po.SysPcAddress;
|
|
|
import com.ydtech.modules.admin.model.vo.RegionInfoVo;
|
|
import com.ydtech.modules.admin.model.vo.RegionInfoVo;
|
|
|
-import com.ydtech.modules.admin.model.vo.SysDeptTreeVo;
|
|
|
|
|
import com.ydtech.modules.admin.service.GeoService;
|
|
import com.ydtech.modules.admin.service.GeoService;
|
|
|
import com.ydtech.modules.admin.service.SysPcAddressHistoryService;
|
|
import com.ydtech.modules.admin.service.SysPcAddressHistoryService;
|
|
|
import com.ydtech.modules.admin.service.SysPcAddressService;
|
|
import com.ydtech.modules.admin.service.SysPcAddressService;
|
|
|
-import com.ydtech.modules.admin.service.SysUserService;
|
|
|
|
|
-import com.ydtech.modules.order.entity.BasePageResult;
|
|
|
|
|
import com.ydtech.utils.StringUtils;
|
|
import com.ydtech.utils.StringUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -118,26 +114,51 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
|
|
|
List<RegionInfoVo> regionInfoVos = new ArrayList<>();
|
|
List<RegionInfoVo> regionInfoVos = new ArrayList<>();
|
|
|
//全部:0 渠道:1 代理:2
|
|
//全部:0 渠道:1 代理:2
|
|
|
if (type == 0){
|
|
if (type == 0){
|
|
|
- RegionInfoVo regionInfoVo = new RegionInfoVo();
|
|
|
|
|
List<SysPcAddress> list = list();
|
|
List<SysPcAddress> list = list();
|
|
|
Map<String, List<SysPcAddress>> map = list.stream().collect(Collectors.groupingBy(SysPcAddress::getDistrict));
|
|
Map<String, List<SysPcAddress>> map = list.stream().collect(Collectors.groupingBy(SysPcAddress::getDistrict));
|
|
|
|
|
|
|
|
-// map.forEach();
|
|
|
|
|
-// for (Map.Entry<String, List<String>> entry : map.entrySet()) {
|
|
|
|
|
-// String key = entry.getKey();
|
|
|
|
|
-// List<String> list = entry.getValue();
|
|
|
|
|
-// int listSize = list.size();
|
|
|
|
|
-// System.out.println("Key: " + key + ", List size: " + listSize);
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ for (Map.Entry<String, List<SysPcAddress>> entry : map.entrySet()) {
|
|
|
|
|
+ RegionInfoVo regionInfoVo = new RegionInfoVo();
|
|
|
|
|
+ String key = entry.getKey();
|
|
|
|
|
+ List<SysPcAddress> list1 = entry.getValue();
|
|
|
|
|
+ int listSize = list1.size();
|
|
|
|
|
+ System.out.println("Key: " + key + ", List size: " + listSize);
|
|
|
|
|
+ regionInfoVo.setDistrictName(key);
|
|
|
|
|
+ regionInfoVo.setNumber(list1.size());
|
|
|
|
|
+ regionInfoVos.add(regionInfoVo);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}else if (type == 1) {
|
|
}else if (type == 1) {
|
|
|
List<SysPcAddress> sysPcAddresses = sysPcAddressMapper.selectList(new LambdaQueryWrapper<SysPcAddress>().eq(SysPcAddress::getSource, 1));
|
|
List<SysPcAddress> sysPcAddresses = sysPcAddressMapper.selectList(new LambdaQueryWrapper<SysPcAddress>().eq(SysPcAddress::getSource, 1));
|
|
|
|
|
+ Map<String, List<SysPcAddress>> map = sysPcAddresses.stream().collect(Collectors.groupingBy(SysPcAddress::getDistrict));
|
|
|
|
|
+
|
|
|
|
|
+ for (Map.Entry<String, List<SysPcAddress>> entry : map.entrySet()) {
|
|
|
|
|
+ RegionInfoVo regionInfoVo = new RegionInfoVo();
|
|
|
|
|
+ String key = entry.getKey();
|
|
|
|
|
+ List<SysPcAddress> list1 = entry.getValue();
|
|
|
|
|
+ int listSize = list1.size();
|
|
|
|
|
+ System.out.println("Key: " + key + ", List size: " + listSize);
|
|
|
|
|
+ regionInfoVo.setDistrictName(key);
|
|
|
|
|
+ regionInfoVo.setNumber(list1.size());
|
|
|
|
|
+ regionInfoVos.add(regionInfoVo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}else if (type == 2){
|
|
}else if (type == 2){
|
|
|
|
|
|
|
|
List<SysPcAddress> sysPcAddresses = sysPcAddressMapper.selectList(new LambdaQueryWrapper<SysPcAddress>().eq(SysPcAddress::getSource, 2));
|
|
List<SysPcAddress> sysPcAddresses = sysPcAddressMapper.selectList(new LambdaQueryWrapper<SysPcAddress>().eq(SysPcAddress::getSource, 2));
|
|
|
-
|
|
|
|
|
|
|
+ Map<String, List<SysPcAddress>> map = sysPcAddresses.stream().collect(Collectors.groupingBy(SysPcAddress::getDistrict));
|
|
|
|
|
+
|
|
|
|
|
+ for (Map.Entry<String, List<SysPcAddress>> entry : map.entrySet()) {
|
|
|
|
|
+ RegionInfoVo regionInfoVo = new RegionInfoVo();
|
|
|
|
|
+ String key = entry.getKey();
|
|
|
|
|
+ List<SysPcAddress> list1 = entry.getValue();
|
|
|
|
|
+ int listSize = list1.size();
|
|
|
|
|
+ System.out.println("Key: " + key + ", List size: " + listSize);
|
|
|
|
|
+ regionInfoVo.setDistrictName(key);
|
|
|
|
|
+ regionInfoVo.setNumber(list1.size());
|
|
|
|
|
+ regionInfoVos.add(regionInfoVo);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|