|
|
@@ -1,19 +1,18 @@
|
|
|
package io.renren.modules.qmjz.service.impl;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-
|
|
|
import io.renren.common.exception.RRException;
|
|
|
import io.renren.common.utils.R;
|
|
|
import io.renren.modules.qmjz.entity.Region;
|
|
|
import io.renren.modules.qmjz.mapper.RegionMapper;
|
|
|
import io.renren.modules.qmjz.service.RegionService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements RegionService{
|
|
|
|
|
|
@@ -51,6 +50,12 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
|
|
|
return region;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public R cityList(Map<String, Object> params) {
|
|
|
+ List<Region> regions = baseMapper.selectList(new LambdaQueryWrapper<Region>().eq(Region::getPid, params.get("id")));
|
|
|
+ return R.ok().put("data", regions);
|
|
|
+ }
|
|
|
+
|
|
|
private List<Region> translateTree(List<Region> regionList, Long pid) {
|
|
|
// 递归
|
|
|
List<Region> root = regionList.stream()
|