Commit d51f521f authored by neo's avatar neo

[DEL] delete region service interface

parent 6c2fad8b
package pwc.taxtech.atms.controller;
import java.util.List;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -9,23 +8,23 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
import pwc.taxtech.atms.dto.VMRegionDevTreeData;
import pwc.taxtech.atms.dto.navtree.DevTreeDto;
import pwc.taxtech.atms.dto.navtree.IvhTreeDto;
import pwc.taxtech.atms.entity.Region;
import pwc.taxtech.atms.service.RegionService;
import pwc.taxtech.atms.service.impl.RegionServiceImpl;
import java.util.List;
@RestController
@RequestMapping("/api/v1/region")
public class RegionController {
@Autowired
private RegionService regionService;
private RegionServiceImpl regionService;
@ApiOperation(value = "getSettingRegionTree", notes = "生成区域及省市树形结构")
@RequestMapping(value = { "/getSettingRegionTree" }, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = {"/getSettingRegionTree"}, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public List<DevTreeDto<VMRegionDevTreeData>> getSettingRegionTree() {
return regionService.getRegionAreaTree();
......@@ -33,7 +32,7 @@ public class RegionController {
@ApiOperation(value = "getProvinceAndCityTreeList", notes = "生成省市树形结构")
@RequestMapping(value = { "/getProvinceAndCityTreeList" }, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = {"/getProvinceAndCityTreeList"}, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public List<DevTreeDto<IvhTreeDto<Region>>> getProvinceAndCityTreeList() {
return regionService.getProvinceAndCityTreeList();
......
package pwc.taxtech.atms.service;
import java.util.List;
import pwc.taxtech.atms.dto.VMRegionDevTreeData;
import pwc.taxtech.atms.dto.navtree.DevTreeDto;
import pwc.taxtech.atms.dto.navtree.IvhTreeDto;
import pwc.taxtech.atms.entity.Region;
public interface RegionService {
/**
* Generate Area and Region Tree
* @return List<DevTreeDto>
*/
public List<DevTreeDto<VMRegionDevTreeData>> getRegionAreaTree();
/**
* Generate Region and City Tree
* @return
*/
public List<DevTreeDto<IvhTreeDto<Region>>> getProvinceAndCityTreeList();
@SuppressWarnings("rawtypes")
List<DevTreeDto> getAreaRegionTreeByNodeId(String areaId);
}
package pwc.taxtech.atms.service.impl;
import static java.util.Comparator.comparing;
import static java.util.Comparator.naturalOrder;
import static java.util.Comparator.nullsLast;
import static java.util.stream.Collectors.toList;
import static pwc.taxtech.atms.common.CommonUtils.copyProperties;
import static pwc.taxtech.atms.common.CommonUtils.getUUID;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.apache.commons.lang3.BooleanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.SortUtils;
......@@ -30,12 +17,21 @@ import pwc.taxtech.atms.entity.AreaRegion;
import pwc.taxtech.atms.entity.AreaRegionExample;
import pwc.taxtech.atms.entity.Region;
import pwc.taxtech.atms.entity.RegionExample;
import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.service.AreaRegionService;
import pwc.taxtech.atms.service.AreaService;
import pwc.taxtech.atms.service.RegionService;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import static java.util.Comparator.*;
import static java.util.stream.Collectors.toList;
import static pwc.taxtech.atms.common.CommonUtils.copyProperties;
import static pwc.taxtech.atms.common.CommonUtils.getUUID;
@Service
public class RegionServiceImpl extends AbstractService implements RegionService {
public class RegionServiceImpl extends AbstractService {
@Autowired
private AreaService areaService;
......@@ -268,8 +264,7 @@ public class RegionServiceImpl extends AbstractService implements RegionService
return devTree;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SuppressWarnings({"rawtypes", "unchecked"})
public List<DevTreeDto> getAreaRegionTreeByNodeId(String areaId) {
Area toNode = areaMapper.selectByPrimaryKey(areaId);
Region regionInfo = null;
......@@ -365,7 +360,7 @@ public class RegionServiceImpl extends AbstractService implements RegionService
/**
* 获取当前节点的子节点(必须是自定义的区域或者是城市及以上的区域)
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
@SuppressWarnings({"rawtypes", "unchecked"})
private List<DevTreeDto> getAreaRegionChildrenList(RegionShortDto current, List<Area> areaList,
List<RegionShortDto> relationRegionQuery) {
List<DevTreeDto> subWarpList = new ArrayList<>();
......@@ -435,7 +430,7 @@ public class RegionServiceImpl extends AbstractService implements RegionService
return subWarpList;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SuppressWarnings({"rawtypes", "unchecked"})
private List<DevTreeDto> getNavTreeDtoList(RegionShortDto currentNode, List<RegionShortDto> list) {
List<RegionShortDto> subList = list.stream().filter(sa -> Objects.equals(sa.getParentId(), currentNode.getId()))
.collect(toList());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment