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,36 +8,36 @@ 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;
@Autowired
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();
return regionService.getRegionAreaTree();
}
@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();
return regionService.getProvinceAndCityTreeList();
}
@SuppressWarnings("rawtypes")
@ApiOperation(value = "根据分区获取分区和行政区域树", notes = "机构管理/卡片/区域/点击区域编辑按钮")
@RequestMapping(value = "getAreRegionTreeByNodeId", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......
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;
......@@ -48,7 +44,7 @@ public class RegionServiceImpl extends AbstractService implements RegionService
/*
* (non-Javadoc)
*
*
* @see pwc.taxtech.atms.service.RegionService#getRegionAreaTree()
*/
public List<DevTreeDto<VMRegionDevTreeData>> getRegionAreaTree() {
......@@ -92,7 +88,7 @@ public class RegionServiceImpl extends AbstractService implements RegionService
/**
* Recursively get area tree
*
*
* @param current
* @return List<DevTreeDto>
*/
......@@ -136,7 +132,7 @@ public class RegionServiceImpl extends AbstractService implements RegionService
/**
* Get the region tree under an area
*
*
* @param area
* @return List<DevTreeDto>
*/
......@@ -189,7 +185,7 @@ public class RegionServiceImpl extends AbstractService implements RegionService
/*
* (non-Javadoc)
*
*
* @see pwc.taxtech.atms.service.RegionService#getProvinceAndCityTreeList()
*/
public List<DevTreeDto<IvhTreeDto<Region>>> getProvinceAndCityTreeList() {
......@@ -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,9 +360,9 @@ 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<RegionShortDto> relationRegionQuery) {
List<DevTreeDto> subWarpList = new ArrayList<>();
// 获取区域
List<Area> subList = areaList.stream().filter(sa -> Objects.equals(sa.getParentId(), current.getId()))
......@@ -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