Commit bad48a9d authored by neo's avatar neo

[DEL] delete area service interface

parent 9ab96cbf
package pwc.taxtech.atms.controller;
import java.util.List;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -11,11 +10,11 @@ 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.AreaDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.service.AreaService;
import pwc.taxtech.atms.service.impl.AreaServiceImpl;
import java.util.List;
@RestController
@RequestMapping("/api/v1/area/")
......@@ -24,25 +23,28 @@ public class AreaController {
private static Logger logger = LoggerFactory.getLogger(AreaController.class);
@Autowired
private AreaService areaService;
private AreaServiceImpl areaService;
@ApiOperation(value = "Active or Deactive the specific area.")
@RequestMapping(value = "isactive", method = RequestMethod.POST)
public @ResponseBody OperationResultDto<List<String>> setIsActive(@RequestBody AreaDto areaDto) {
public @ResponseBody
OperationResultDto<List<String>> setIsActive(@RequestBody AreaDto areaDto) {
logger.info("/api/v1/area/isactive");
return areaService.setIsActive(areaDto);
}
@ApiOperation(value = "Get area list")
@RequestMapping(value = "getAreaList", method = RequestMethod.GET)
public @ResponseBody List<AreaDto> getAreaList(@RequestParam(defaultValue = "1") int type) {
public @ResponseBody
List<AreaDto> getAreaList(@RequestParam(defaultValue = "1") int type) {
logger.info("/api/v1/area/getAreaList");
return areaService.getAreaList(type);
}
@ApiOperation(value = "Get Tree")
@RequestMapping(value = "tree", method = RequestMethod.GET)
public @ResponseBody List<AreaDto> getAreaTree(@RequestParam(name = "type") int type) {
public @ResponseBody
List<AreaDto> getAreaTree(@RequestParam(name = "type") int type) {
logger.info("/api/v1/area/tree");
return areaService.getAreaTree(type);
}
......
package pwc.taxtech.atms.service;
import java.util.List;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.arearegion.AreaRegionDto;
import pwc.taxtech.atms.dto.arearegion.AreaRegionInfo;
import pwc.taxtech.atms.entity.AreaRegion;
public interface AreaRegionService {
/**
* Find areaRegion by area
*
* @param areaId
* @return List<AreaRegion>
*/
List<AreaRegion> findAreaRegionsByArea(String areaId);
/**
* Adds the region and area model
*
* @param areaRegionInfo
* @return OperationResultDto
*/
OperationResultDto add(AreaRegionInfo areaRegionInfo);
/**
* Update the region and area model
*
* @param areaRegionInfo
* @return OperationResultDto
*/
OperationResultDto update(AreaRegionInfo areaRegionInfo);
List<AreaRegionDto> getCities(String parentId);
List<AreaRegionDto> getProvinces();
}
package pwc.taxtech.atms.service;
import java.util.List;
import pwc.taxtech.atms.dto.AreaDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.entity.Area;
public interface AreaService {
/**
* Find Top level areas (parentId == null)
*
* @return List<Area>
*/
List<Area> findTopAreas();
/**
* Find only next level sub Areas By ParentId
*
* @param parentId
* @return
*/
List<Area> getSubAreaListIngoreActive(String parentId);
/**
* Find all sub areas by parentId
*
* @param parentId
* @return
*/
List<Area> getAllSubAreas(String parentId);
/**
* Set the area and its sub areas active or inactive
*
* @param AreaDto
* model
* @return
*/
OperationResultDto<List<String>> setIsActive(AreaDto model);
/**
* Get Area list
*
* @param type:0
* 取启用的数据; type:1 取全部数据(默认)
* @return List<AreaDto>
*/
List<AreaDto> getAreaList(int type);
/**
* Get Area tree
*
* @param type:0
* 取启用的数据; type:1 取全部数据(默认)
* @return List<AreaDto>
*/
List<AreaDto> getAreaTree(int type);
}
......@@ -24,7 +24,6 @@ import pwc.taxtech.atms.entity.AreaExample;
import pwc.taxtech.atms.entity.AreaExample.Criteria;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.service.AreaService;
import pwc.taxtech.atms.service.OperationLogService;
import java.util.ArrayList;
......@@ -33,7 +32,7 @@ import java.util.List;
import java.util.stream.Collectors;
@Service
public class AreaServiceImpl implements AreaService {
public class AreaServiceImpl {
@Autowired
private AreaMapper areaMapper;
......@@ -51,7 +50,6 @@ public class AreaServiceImpl implements AreaService {
*
* @see pwc.taxtech.atms.service.AreaService#findTopAreas()
*/
@Override
public List<Area> findTopAreas() {
// AreaExample areaExample = new AreaExample();
......@@ -68,7 +66,6 @@ public class AreaServiceImpl implements AreaService {
*
* @see pwc.taxtech.atms.service.AreaService#getSubAreaListIngoreActive()
*/
@Override
public List<Area> getSubAreaListIngoreActive(String parentId) {
AreaExample areaExample = new AreaExample();
Criteria criteria = areaExample.createCriteria();
......@@ -85,7 +82,6 @@ public class AreaServiceImpl implements AreaService {
* .AreaDto, java.lang.String)
*/
@Transactional
@Override
public OperationResultDto<List<String>> setIsActive(AreaDto areaDto) {
logger.info("Area: Set isactive. Area id: " + areaDto.getId() + ", to status: " + areaDto.getIsActive());
......@@ -172,7 +168,6 @@ public class AreaServiceImpl implements AreaService {
*
* @see pwc.taxtech.atms.service.AreaService#getAllSubAreas(java.lang.String)
*/
@Override
public List<Area> getAllSubAreas(String areaId) {
List<Area> tempList = getSubAreaListIngoreActive(areaId);
......@@ -192,7 +187,6 @@ public class AreaServiceImpl implements AreaService {
*
* @see pwc.taxtech.atms.service.AreaService#getAreaList(int)
*/
@Override
public List<AreaDto> getAreaList(int type) {
List<Area> areaList = new ArrayList<>();
......@@ -221,7 +215,6 @@ public class AreaServiceImpl implements AreaService {
return areaDtoList;
}
@Override
public List<AreaDto> getAreaTree(int type) {
List<AreaDto> treeList = new ArrayList<AreaDto>();
List<AreaDto> areaList = getAreaList(type);
......
......@@ -18,7 +18,6 @@ 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.AreaService;
import java.util.ArrayList;
import java.util.List;
......@@ -33,7 +32,7 @@ import static pwc.taxtech.atms.common.CommonUtils.getUUID;
public class RegionServiceImpl extends AbstractService {
@Autowired
private AreaService areaService;
private AreaServiceImpl areaService;
@Autowired
private AreaRegionServiceImpl areaRegionService;
......
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