Commit 0a050f4a authored by neo's avatar neo

[DEL] delete organization structrue service interface

parent 819be5cb
package pwc.taxtech.atms.controller; package pwc.taxtech.atms.controller;
import java.util.List; import io.swagger.annotations.ApiImplicitParam;
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;
...@@ -11,15 +10,13 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -11,15 +10,13 @@ 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.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import pwc.taxtech.atms.dto.IdModel; import pwc.taxtech.atms.dto.IdModel;
import pwc.taxtech.atms.dto.OrganizationStructureDto; import pwc.taxtech.atms.dto.OrganizationStructureDto;
import pwc.taxtech.atms.dto.OrganizationStructureInputDto; import pwc.taxtech.atms.dto.OrganizationStructureInputDto;
import pwc.taxtech.atms.service.OrganizationStructureService; import pwc.taxtech.atms.service.impl.OrganizationStructureServiceImpl;
import java.util.List;
/** @see PwC.Tax.Tech.Atms.WebApi.Controllers.OrganizationStructureController.cs */
@RestController @RestController
@RequestMapping("/api/v1/organizationstructure") @RequestMapping("/api/v1/organizationstructure")
public class OrganizationStructureController { public class OrganizationStructureController {
...@@ -27,18 +24,19 @@ public class OrganizationStructureController { ...@@ -27,18 +24,19 @@ public class OrganizationStructureController {
private static Logger logger = LoggerFactory.getLogger(OrganizationStructureController.class); private static Logger logger = LoggerFactory.getLogger(OrganizationStructureController.class);
@Autowired @Autowired
private OrganizationStructureService organizationStructureService; private OrganizationStructureServiceImpl organizationStructureService;
@ApiOperation(value = "主数据机构层级查询") @ApiOperation(value = "主数据机构层级查询")
@RequestMapping(value = "/getlist", method = RequestMethod.GET) @RequestMapping(value = "/getlist", method = RequestMethod.GET)
public @ResponseBody List<OrganizationStructureDto> getOrganizationStructures() { public @ResponseBody
List<OrganizationStructureDto> getOrganizationStructures() {
logger.debug("OrganizationStructureController /getlist"); logger.debug("OrganizationStructureController /getlist");
return organizationStructureService.getOrganizationStructures(); return organizationStructureService.getOrganizationStructures();
} }
@ApiOperation(value = "主数据机构层级增加") @ApiOperation(value = "主数据机构层级增加")
// @ApiImplicitParam(name = "organizationStructureDtoList", value = "organizationStructureDto List", required = true, dataType = "List<OrganizationStructureDto>") // @ApiImplicitParam(name = "organizationStructureDtoList", value = "organizationStructureDto List", required = true, dataType = "List<OrganizationStructureDto>")
@RequestMapping(value= "/add", method = RequestMethod.POST) @RequestMapping(value = "/add", method = RequestMethod.POST)
public void addOrganizationStructures(@RequestBody List<OrganizationStructureInputDto> organizationStructureDtoList) { public void addOrganizationStructures(@RequestBody List<OrganizationStructureInputDto> organizationStructureDtoList) {
logger.debug("OrganizationStructureController /add"); logger.debug("OrganizationStructureController /add");
organizationStructureService.addOrganizationStructures(organizationStructureDtoList); organizationStructureService.addOrganizationStructures(organizationStructureDtoList);
...@@ -46,8 +44,9 @@ public class OrganizationStructureController { ...@@ -46,8 +44,9 @@ public class OrganizationStructureController {
@ApiOperation(value = "主数据机构层级删除") @ApiOperation(value = "主数据机构层级删除")
@ApiImplicitParam(name = "idModel", value = "idModel", required = true, dataType = "IdModel") @ApiImplicitParam(name = "idModel", value = "idModel", required = true, dataType = "IdModel")
@RequestMapping(value= "/delete", method = RequestMethod.POST) @RequestMapping(value = "/delete", method = RequestMethod.POST)
public @ResponseBody Integer deleteOrganizationStructure(@RequestBody IdModel idModel) { public @ResponseBody
Integer deleteOrganizationStructure(@RequestBody IdModel idModel) {
logger.debug("OrganizationStructureController /delete"); logger.debug("OrganizationStructureController /delete");
return organizationStructureService.deleteOrganizationStructure(idModel); return organizationStructureService.deleteOrganizationStructure(idModel);
} }
...@@ -55,7 +54,8 @@ public class OrganizationStructureController { ...@@ -55,7 +54,8 @@ public class OrganizationStructureController {
@ApiOperation(value = "主数据机构层级修改") @ApiOperation(value = "主数据机构层级修改")
// @ApiImplicitParam(name = "organizationStructureDtoList", value = "organizationStructureDto List", required = true, dataType = "List<OrganizationStructureDto>") // @ApiImplicitParam(name = "organizationStructureDtoList", value = "organizationStructureDto List", required = true, dataType = "List<OrganizationStructureDto>")
@RequestMapping(method = RequestMethod.PUT) @RequestMapping(method = RequestMethod.PUT)
public @ResponseBody Boolean updateOrganizationStructure(@RequestBody List<OrganizationStructureInputDto> organizationStructureDtoList) { public @ResponseBody
Boolean updateOrganizationStructure(@RequestBody List<OrganizationStructureInputDto> organizationStructureDtoList) {
logger.debug("OrganizationStructureController update"); logger.debug("OrganizationStructureController update");
return organizationStructureService.updateOrganizationStructures(organizationStructureDtoList); return organizationStructureService.updateOrganizationStructures(organizationStructureDtoList);
} }
......
package pwc.taxtech.atms.service;
import java.util.List;
import pwc.taxtech.atms.dto.IdModel;
import pwc.taxtech.atms.dto.OrganizationStructureDto;
import pwc.taxtech.atms.dto.OrganizationStructureInputDto;
public interface OrganizationStructureService {
List<OrganizationStructureDto> getOrganizationStructures();
void addOrganizationStructures(List<OrganizationStructureInputDto> organizationStructureList);
Integer deleteOrganizationStructure(IdModel idModel);
Boolean updateOrganizationStructures(List<OrganizationStructureInputDto> organizationStructureDtoList);
}
package pwc.taxtech.atms.service.impl; package pwc.taxtech.atms.service.impl;
import java.util.ArrayList; import com.alibaba.fastjson.JSON;
import java.util.Date;
import java.util.List;
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;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import com.alibaba.fastjson.JSON;
import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.common.AuthUserHelper; import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.common.CommonConstants; import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
...@@ -27,13 +20,16 @@ import pwc.taxtech.atms.dto.OrganizationStructureInputDto; ...@@ -27,13 +20,16 @@ import pwc.taxtech.atms.dto.OrganizationStructureInputDto;
import pwc.taxtech.atms.dto.UpdateLogParams; import pwc.taxtech.atms.dto.UpdateLogParams;
import pwc.taxtech.atms.entity.OrganizationStructure; import pwc.taxtech.atms.entity.OrganizationStructure;
import pwc.taxtech.atms.entity.OrganizationStructureExample; import pwc.taxtech.atms.entity.OrganizationStructureExample;
import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.service.OperationLogService; import pwc.taxtech.atms.service.OperationLogService;
import pwc.taxtech.atms.service.OrganizationService; import pwc.taxtech.atms.service.OrganizationService;
import pwc.taxtech.atms.service.OrganizationStructureService;
/** @see PwC.Tax.Tech.Atms.Admin.Application.Services.Impl.OrganizationStructureService.cs */ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service @Service
public class OrganizationStructureServiceImpl implements OrganizationStructureService { public class OrganizationStructureServiceImpl {
private static final Logger logger = LoggerFactory.getLogger(OrganizationStructureServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(OrganizationStructureServiceImpl.class);
...@@ -49,7 +45,6 @@ public class OrganizationStructureServiceImpl implements OrganizationStructureSe ...@@ -49,7 +45,6 @@ public class OrganizationStructureServiceImpl implements OrganizationStructureSe
@Autowired @Autowired
private AuthUserHelper authUserHelper; private AuthUserHelper authUserHelper;
@Override
public List<OrganizationStructureDto> getOrganizationStructures() { public List<OrganizationStructureDto> getOrganizationStructures() {
logger.debug("OrganizationStructureService getOrganizationStructures"); logger.debug("OrganizationStructureService getOrganizationStructures");
OrganizationStructureExample organizationStructureExample = new OrganizationStructureExample(); OrganizationStructureExample organizationStructureExample = new OrganizationStructureExample();
...@@ -59,7 +54,6 @@ public class OrganizationStructureServiceImpl implements OrganizationStructureSe ...@@ -59,7 +54,6 @@ public class OrganizationStructureServiceImpl implements OrganizationStructureSe
return rotateOrganizationStructureList(organizationStructureList); return rotateOrganizationStructureList(organizationStructureList);
} }
@Override
public void addOrganizationStructures(List<OrganizationStructureInputDto> organizationStructureDtoList) { public void addOrganizationStructures(List<OrganizationStructureInputDto> organizationStructureDtoList) {
logger.debug("OrganizationStructureService addOrganizationStructure"); logger.debug("OrganizationStructureService addOrganizationStructure");
logger.debug("organization structure to add: {}", JSON.toJSONString(organizationStructureDtoList, true)); logger.debug("organization structure to add: {}", JSON.toJSONString(organizationStructureDtoList, true));
...@@ -93,7 +87,6 @@ public class OrganizationStructureServiceImpl implements OrganizationStructureSe ...@@ -93,7 +87,6 @@ public class OrganizationStructureServiceImpl implements OrganizationStructureSe
operationLogDto.setLogType(OperateLogType.OperationLogBasicData.value()); operationLogDto.setLogType(OperateLogType.OperationLogBasicData.value());
} }
@Override
public Integer deleteOrganizationStructure(IdModel idModel) { public Integer deleteOrganizationStructure(IdModel idModel) {
logger.debug("OrganizationStructureService deleteOrganizationStructure"); logger.debug("OrganizationStructureService deleteOrganizationStructure");
logger.debug("organization structure to delete, id: {}", JSON.toJSONString(idModel, true)); logger.debug("organization structure to delete, id: {}", JSON.toJSONString(idModel, true));
...@@ -118,7 +111,6 @@ public class OrganizationStructureServiceImpl implements OrganizationStructureSe ...@@ -118,7 +111,6 @@ public class OrganizationStructureServiceImpl implements OrganizationStructureSe
return result; return result;
} }
@Override
public Boolean updateOrganizationStructures(List<OrganizationStructureInputDto> organizationStructureDtoList) { public Boolean updateOrganizationStructures(List<OrganizationStructureInputDto> organizationStructureDtoList) {
logger.debug("OrganizationStructureService updateOrganizationStructures"); logger.debug("OrganizationStructureService updateOrganizationStructures");
logger.debug("organization structure to update: {}", JSON.toJSONString(organizationStructureDtoList, true)); logger.debug("organization structure to update: {}", JSON.toJSONString(organizationStructureDtoList, true));
...@@ -159,7 +151,7 @@ public class OrganizationStructureServiceImpl implements OrganizationStructureSe ...@@ -159,7 +151,7 @@ public class OrganizationStructureServiceImpl implements OrganizationStructureSe
organizationStructureMapper.updateByPrimaryKey(organizationStructure); organizationStructureMapper.updateByPrimaryKey(organizationStructure);
//add operation log //add operation log
if(isStatusChangeOperation) { if (isStatusChangeOperation) {
UpdateLogParams updateLogParams = new UpdateLogParams(); UpdateLogParams updateLogParams = new UpdateLogParams();
updateLogParams.setOperationObject(originOrganizationStructure.getName()); updateLogParams.setOperationObject(originOrganizationStructure.getName());
updateLogParams.setOriginalState(originOrganizationStructure); updateLogParams.setOriginalState(originOrganizationStructure);
......
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