Commit cbd872cb authored by neo's avatar neo

[DEL] delete business unit service interface

parent bad48a9d
package pwc.taxtech.atms.controller; package pwc.taxtech.atms.controller;
import java.util.List; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -10,14 +9,15 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -10,14 +9,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
import pwc.taxtech.atms.dto.BusinessUnitDto; import pwc.taxtech.atms.dto.BusinessUnitDto;
import pwc.taxtech.atms.dto.BusinessUnitInputDto; import pwc.taxtech.atms.dto.BusinessUnitInputDto;
import pwc.taxtech.atms.dto.IdModel; import pwc.taxtech.atms.dto.IdModel;
import pwc.taxtech.atms.service.BusinessUnitService; import pwc.taxtech.atms.service.impl.BusinessUnitServiceImpl;
import java.util.List;
/** @see PwC.Tax.Tech.Atms.WebApi\Controllers\BusinessUnitController.cs */ /**
*/
@RestController @RestController
@RequestMapping("/api/v1/businessunit") @RequestMapping("/api/v1/businessunit")
public class BusinessUnitController { public class BusinessUnitController {
...@@ -25,11 +25,12 @@ public class BusinessUnitController { ...@@ -25,11 +25,12 @@ public class BusinessUnitController {
private static Logger logger = LoggerFactory.getLogger(BusinessUnitController.class); private static Logger logger = LoggerFactory.getLogger(BusinessUnitController.class);
@Autowired @Autowired
private BusinessUnitService businessUnitService; private BusinessUnitServiceImpl businessUnitService;
@ApiOperation(value = "主数据事业部查询", notes = "返回所有事业部数据") @ApiOperation(value = "主数据事业部查询", notes = "返回所有事业部数据")
@RequestMapping(value = "/getlist", method = RequestMethod.GET) @RequestMapping(value = "/getlist", method = RequestMethod.GET)
public @ResponseBody List<BusinessUnitDto> getBusinessUnits() { public @ResponseBody
List<BusinessUnitDto> getBusinessUnits() {
logger.debug("BusinessUnitController getBusinessUnits"); logger.debug("BusinessUnitController getBusinessUnits");
return businessUnitService.getBusinessUnits(); return businessUnitService.getBusinessUnits();
} }
...@@ -43,14 +44,16 @@ public class BusinessUnitController { ...@@ -43,14 +44,16 @@ public class BusinessUnitController {
@ApiOperation(value = "主数据事业部删除", notes = "根据给定的id删除一条事业部数据") @ApiOperation(value = "主数据事业部删除", notes = "根据给定的id删除一条事业部数据")
@RequestMapping(value = "/delete", method = RequestMethod.POST) @RequestMapping(value = "/delete", method = RequestMethod.POST)
public @ResponseBody Integer deleteBusinessUnit(@RequestBody IdModel idModel) { public @ResponseBody
Integer deleteBusinessUnit(@RequestBody IdModel idModel) {
logger.debug("BusinessUnitController deleteBusinessUnit"); logger.debug("BusinessUnitController deleteBusinessUnit");
return businessUnitService.deleteBusinessUnit(idModel); return businessUnitService.deleteBusinessUnit(idModel);
} }
@ApiOperation(value = "主数据事业部修改", notes = "根据Request Body的信息修改一个或多个事业部数据") @ApiOperation(value = "主数据事业部修改", notes = "根据Request Body的信息修改一个或多个事业部数据")
@RequestMapping(method = RequestMethod.PUT) @RequestMapping(method = RequestMethod.PUT)
public @ResponseBody Boolean updateBusinessUnits(@RequestBody List<BusinessUnitDto> businessUnitDtoList) { public @ResponseBody
Boolean updateBusinessUnits(@RequestBody List<BusinessUnitDto> businessUnitDtoList) {
logger.debug("BusinessUnitController updateBusinessUnit"); logger.debug("BusinessUnitController updateBusinessUnit");
return businessUnitService.updateBusinessUnits(businessUnitDtoList); return businessUnitService.updateBusinessUnits(businessUnitDtoList);
} }
......
package pwc.taxtech.atms.service;
import java.util.List;
import pwc.taxtech.atms.dto.BusinessUnitDto;
import pwc.taxtech.atms.dto.BusinessUnitInputDto;
import pwc.taxtech.atms.dto.IdModel;
import pwc.taxtech.atms.entity.BusinessUnit;
public interface BusinessUnitService {
List<BusinessUnitDto> getBusinessUnits();
void addBusinessUnits(List<BusinessUnitInputDto> businessUnitDtoList);
Integer deleteBusinessUnit(IdModel idModel);
Boolean updateBusinessUnits(List<BusinessUnitDto> businessUnitDtoList);
List<BusinessUnit> findByNameAndIsActive(String name, Boolean isActive);
List<BusinessUnit> findByIsActiveTrue();
}
...@@ -22,7 +22,6 @@ import pwc.taxtech.atms.entity.BusinessUnit; ...@@ -22,7 +22,6 @@ import pwc.taxtech.atms.entity.BusinessUnit;
import pwc.taxtech.atms.entity.BusinessUnitExample; import pwc.taxtech.atms.entity.BusinessUnitExample;
import pwc.taxtech.atms.entity.BusinessUnitExample.Criteria; import pwc.taxtech.atms.entity.BusinessUnitExample.Criteria;
import pwc.taxtech.atms.exception.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.service.BusinessUnitService;
import pwc.taxtech.atms.service.OperationLogService; import pwc.taxtech.atms.service.OperationLogService;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -32,7 +31,7 @@ import java.util.List; ...@@ -32,7 +31,7 @@ import java.util.List;
/** /**
*/ */
@Service @Service
public class BusinessUnitServiceImpl implements BusinessUnitService { public class BusinessUnitServiceImpl {
private static final Logger logger = LoggerFactory.getLogger(BusinessUnitServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(BusinessUnitServiceImpl.class);
...@@ -48,7 +47,6 @@ public class BusinessUnitServiceImpl implements BusinessUnitService { ...@@ -48,7 +47,6 @@ public class BusinessUnitServiceImpl implements BusinessUnitService {
@Autowired @Autowired
private AuthUserHelper authUserHelper; private AuthUserHelper authUserHelper;
@Override
public List<BusinessUnitDto> getBusinessUnits() { public List<BusinessUnitDto> getBusinessUnits() {
logger.debug("BusinessUnitServiceImpl getBusinessUnits"); logger.debug("BusinessUnitServiceImpl getBusinessUnits");
BusinessUnitExample businessUnitExample = new BusinessUnitExample(); BusinessUnitExample businessUnitExample = new BusinessUnitExample();
...@@ -58,7 +56,6 @@ public class BusinessUnitServiceImpl implements BusinessUnitService { ...@@ -58,7 +56,6 @@ public class BusinessUnitServiceImpl implements BusinessUnitService {
} }
@Transactional @Transactional
@Override
public void addBusinessUnits(List<BusinessUnitInputDto> businessUnitDtoList) { public void addBusinessUnits(List<BusinessUnitInputDto> businessUnitDtoList) {
logger.debug("BusinessUnitServiceImpl addBusinessUnits"); logger.debug("BusinessUnitServiceImpl addBusinessUnits");
if (businessUnitDtoList.isEmpty()) { if (businessUnitDtoList.isEmpty()) {
...@@ -86,7 +83,6 @@ public class BusinessUnitServiceImpl implements BusinessUnitService { ...@@ -86,7 +83,6 @@ public class BusinessUnitServiceImpl implements BusinessUnitService {
} }
@Transactional @Transactional
@Override
public Integer deleteBusinessUnit(IdModel idModel) { public Integer deleteBusinessUnit(IdModel idModel) {
logger.debug("BusinessUnitServiceImpl deleteBusinessUnit"); logger.debug("BusinessUnitServiceImpl deleteBusinessUnit");
...@@ -113,7 +109,6 @@ public class BusinessUnitServiceImpl implements BusinessUnitService { ...@@ -113,7 +109,6 @@ public class BusinessUnitServiceImpl implements BusinessUnitService {
} }
@Transactional @Transactional
@Override
public Boolean updateBusinessUnits(List<BusinessUnitDto> businessUnitDtoList) { public Boolean updateBusinessUnits(List<BusinessUnitDto> businessUnitDtoList) {
logger.debug("BusinessUnitServiceImpl updateBusinessUnits"); logger.debug("BusinessUnitServiceImpl updateBusinessUnits");
...@@ -203,7 +198,6 @@ public class BusinessUnitServiceImpl implements BusinessUnitService { ...@@ -203,7 +198,6 @@ public class BusinessUnitServiceImpl implements BusinessUnitService {
return businessUnit; return businessUnit;
} }
@Override
public List<BusinessUnit> findByNameAndIsActive(String name, Boolean isActive) { public List<BusinessUnit> findByNameAndIsActive(String name, Boolean isActive) {
logger.debug("This is a method similar to JPA which find business units by name and isActive"); logger.debug("This is a method similar to JPA which find business units by name and isActive");
BusinessUnitExample example = new BusinessUnitExample(); BusinessUnitExample example = new BusinessUnitExample();
...@@ -214,7 +208,6 @@ public class BusinessUnitServiceImpl implements BusinessUnitService { ...@@ -214,7 +208,6 @@ public class BusinessUnitServiceImpl implements BusinessUnitService {
return businessUnitMapper.selectByExample(example); return businessUnitMapper.selectByExample(example);
} }
@Override
public List<BusinessUnit> findByIsActiveTrue() { public List<BusinessUnit> findByIsActiveTrue() {
BusinessUnitExample example = new BusinessUnitExample(); BusinessUnitExample example = new BusinessUnitExample();
example.createCriteria().andIsActiveEqualTo(true); example.createCriteria().andIsActiveEqualTo(true);
......
...@@ -27,7 +27,6 @@ import pwc.taxtech.atms.dto.dimension.DimensionTypeEnum; ...@@ -27,7 +27,6 @@ import pwc.taxtech.atms.dto.dimension.DimensionTypeEnum;
import pwc.taxtech.atms.dto.dimension.DimensionValueDto; import pwc.taxtech.atms.dto.dimension.DimensionValueDto;
import pwc.taxtech.atms.dto.navtree.DevTreeDto; import pwc.taxtech.atms.dto.navtree.DevTreeDto;
import pwc.taxtech.atms.entity.*; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.service.BusinessUnitService;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
...@@ -48,7 +47,7 @@ import static java.util.stream.Collectors.toList; ...@@ -48,7 +47,7 @@ import static java.util.stream.Collectors.toList;
public class DimensionServiceImpl extends AbstractService { public class DimensionServiceImpl extends AbstractService {
@Autowired @Autowired
private BusinessUnitService businessUnitService; private BusinessUnitServiceImpl businessUnitService;
@Autowired @Autowired
private StatisticAttributeServiceImpl statisticAttributeService; private StatisticAttributeServiceImpl statisticAttributeService;
......
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