Commit 269461ff authored by neo's avatar neo

[DEL] delete template group service interface

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