Commit 269461ff authored by neo's avatar neo

[DEL] delete template group service interface

parent da07108e
...@@ -7,14 +7,20 @@ import org.slf4j.Logger; ...@@ -7,14 +7,20 @@ 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.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
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 org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.ftp.FtpService; import pwc.taxtech.atms.common.ftp.FtpService;
import pwc.taxtech.atms.common.message.ErrorMessage; import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.TemplateGroupDto; import pwc.taxtech.atms.dto.TemplateGroupDto;
import pwc.taxtech.atms.exception.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.service.TemplateGroupService; import pwc.taxtech.atms.service.impl.TemplateGroupServiceImpl;
import java.util.List; import java.util.List;
...@@ -24,7 +30,7 @@ public class TemplateGroupController { ...@@ -24,7 +30,7 @@ public class TemplateGroupController {
private static final Logger logger = LoggerFactory.getLogger(TemplateGroupController.class); private static final Logger logger = LoggerFactory.getLogger(TemplateGroupController.class);
@Autowired @Autowired
TemplateGroupService templateGroupService; TemplateGroupServiceImpl templateGroupService;
@Autowired @Autowired
FtpService ftpService; FtpService ftpService;
......
package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dto.OperationResultDto;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.dto.TemplateGroupDto;
import java.util.List;
public interface TemplateGroupService {
List<TemplateGroupDto> get();
List<TemplateGroupDto> get(int serviceTypeId, Integer taxPayType, String industryId);
OperationResultDto<Object> updateTemplateGroupName(TemplateGroupDto templateGroupDto);
OperationResultDto<Object> deleteTemplateGroup(TemplateGroupDto templateGroupDto);
List<String> getSheetNameList(MultipartFile file);
void importTemplateGroupExcelFile(MultipartFile file, TemplateGroupDto templateGroupDto) throws ServiceException;
void importTemplateExcelFile(MultipartFile file, Long templateGroupId,
String reportType, String sheetList) throws ServiceException;
void addTemplateGroup(TemplateGroupDto templateGroupDto) throws ServiceException;
}
...@@ -39,7 +39,6 @@ import pwc.taxtech.atms.entity.TemplateExample; ...@@ -39,7 +39,6 @@ import pwc.taxtech.atms.entity.TemplateExample;
import pwc.taxtech.atms.entity.TemplateGroup; import pwc.taxtech.atms.entity.TemplateGroup;
import pwc.taxtech.atms.entity.TemplateGroupExample; import pwc.taxtech.atms.entity.TemplateGroupExample;
import pwc.taxtech.atms.exception.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.service.TemplateGroupService;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
...@@ -53,7 +52,7 @@ import java.util.Optional; ...@@ -53,7 +52,7 @@ import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
public class TemplateGroupServiceImpl extends AbstractService implements TemplateGroupService { public class TemplateGroupServiceImpl extends AbstractService {
@Autowired @Autowired
private FTPFileSystemServiceImpl fileSystemService; private FTPFileSystemServiceImpl fileSystemService;
@Autowired @Autowired
...@@ -74,7 +73,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat ...@@ -74,7 +73,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat
private CellTemplateConfigDao cellTemplateConfigDao; private CellTemplateConfigDao cellTemplateConfigDao;
@Override
public List<TemplateGroupDto> get() { public List<TemplateGroupDto> get() {
List<TemplateGroup> templateGroups = templateGroupMapper.selectByExample(new TemplateGroupExample()); List<TemplateGroup> templateGroups = templateGroupMapper.selectByExample(new TemplateGroupExample());
List<TemplateGroupDto> templateGroupDtos = new ArrayList<>(); List<TemplateGroupDto> templateGroupDtos = new ArrayList<>();
...@@ -86,7 +84,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat ...@@ -86,7 +84,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat
return templateGroupDtos; return templateGroupDtos;
} }
@Override
public List<TemplateGroupDto> get(int serviceTypeId, Integer taxPayType, String industryId) { public List<TemplateGroupDto> get(int serviceTypeId, Integer taxPayType, String industryId) {
TemplateGroupExample example = new TemplateGroupExample(); TemplateGroupExample example = new TemplateGroupExample();
...@@ -108,7 +105,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat ...@@ -108,7 +105,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat
return templateGroupDtos; return templateGroupDtos;
} }
@Override
public OperationResultDto<Object> updateTemplateGroupName(TemplateGroupDto templateGroupDto) { public OperationResultDto<Object> updateTemplateGroupName(TemplateGroupDto templateGroupDto) {
TemplateGroup entity = templateGroupMapper.selectByPrimaryKey(Long.parseLong(templateGroupDto.getId())); TemplateGroup entity = templateGroupMapper.selectByPrimaryKey(Long.parseLong(templateGroupDto.getId()));
TemplateGroupExample example = new TemplateGroupExample(); TemplateGroupExample example = new TemplateGroupExample();
...@@ -126,7 +122,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat ...@@ -126,7 +122,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat
return result; return result;
} }
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public OperationResultDto<Object> deleteTemplateGroup(TemplateGroupDto templateGroupDto) { public OperationResultDto<Object> deleteTemplateGroup(TemplateGroupDto templateGroupDto) {
OperationResultDto<Object> result = new OperationResultDto<>(); OperationResultDto<Object> result = new OperationResultDto<>();
...@@ -178,7 +173,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat ...@@ -178,7 +173,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat
static final String ORGANIZATION_USED_TEMPLATE_GROUP = "OrganizationUsedTemplateGroup"; static final String ORGANIZATION_USED_TEMPLATE_GROUP = "OrganizationUsedTemplateGroup";
} }
@Override
public List<String> getSheetNameList(MultipartFile file) { public List<String> getSheetNameList(MultipartFile file) {
try { try {
Workbook workbook = WorkbookFactory.create(file.getInputStream()); Workbook workbook = WorkbookFactory.create(file.getInputStream());
...@@ -194,7 +188,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat ...@@ -194,7 +188,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat
} }
@Transactional @Transactional
@Override
public void importTemplateGroupExcelFile(MultipartFile file, TemplateGroupDto templateGroupDto) throws ServiceException { public void importTemplateGroupExcelFile(MultipartFile file, TemplateGroupDto templateGroupDto) throws ServiceException {
List<String> sheetNameList = templateGroupDto.getSheetNameList(); List<String> sheetNameList = templateGroupDto.getSheetNameList();
if (CollectionUtils.isEmpty(sheetNameList)) { if (CollectionUtils.isEmpty(sheetNameList)) {
...@@ -300,7 +293,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat ...@@ -300,7 +293,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat
} }
@Transactional @Transactional
@Override
public void importTemplateExcelFile(MultipartFile file, Long templateGroupId, String reportType, String sheetList) throws ServiceException { public void importTemplateExcelFile(MultipartFile file, Long templateGroupId, String reportType, String sheetList) throws ServiceException {
if (null == file) { if (null == file) {
throw new ServiceException(ErrorMessage.NoFile); throw new ServiceException(ErrorMessage.NoFile);
...@@ -390,7 +382,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat ...@@ -390,7 +382,6 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat
} }
@Transactional @Transactional
@Override
public void addTemplateGroup(TemplateGroupDto templateGroupDto) throws ServiceException { public void addTemplateGroup(TemplateGroupDto templateGroupDto) throws ServiceException {
List<TemplateGroup> groupList = templateGroupDao.getByGroupName(templateGroupDto.getName()); List<TemplateGroup> groupList = templateGroupDao.getByGroupName(templateGroupDto.getName());
if (CollectionUtils.isNotEmpty(groupList)) { if (CollectionUtils.isNotEmpty(groupList)) {
......
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