Commit da07108e authored by neo's avatar neo

[DEL] delete template service interface

parent 8e57f0ba
...@@ -6,7 +6,13 @@ import org.slf4j.Logger; ...@@ -6,7 +6,13 @@ 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 pwc.taxtech.atms.common.ftp.FtpService; import pwc.taxtech.atms.common.ftp.FtpService;
import pwc.taxtech.atms.common.util.MyAsserts; import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.dpo.TemplateUniqDto; import pwc.taxtech.atms.dpo.TemplateUniqDto;
...@@ -20,10 +26,16 @@ import pwc.taxtech.atms.entity.Template; ...@@ -20,10 +26,16 @@ import pwc.taxtech.atms.entity.Template;
import pwc.taxtech.atms.exception.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.exception.BadParameterException; import pwc.taxtech.atms.exception.BadParameterException;
import pwc.taxtech.atms.exception.NotFoundException; import pwc.taxtech.atms.exception.NotFoundException;
import pwc.taxtech.atms.service.TemplateService; import pwc.taxtech.atms.service.impl.TemplateServiceImpl;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
...@@ -34,14 +46,14 @@ public class TemplateController extends BaseController { ...@@ -34,14 +46,14 @@ public class TemplateController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(TemplateController.class); private static final Logger logger = LoggerFactory.getLogger(TemplateController.class);
@Autowired @Autowired
TemplateService templateService; TemplateServiceImpl templateService;
@Autowired @Autowired
FtpService ftpService; FtpService ftpService;
@RequestMapping(value = "get", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "get", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody public @ResponseBody
List<TemplateDto> get(@RequestParam(name="templateGroupID") Long templateGroupId, @RequestParam(name="reportType") String reportType) { List<TemplateDto> get(@RequestParam(name = "templateGroupID") Long templateGroupId, @RequestParam(name = "reportType") String reportType) {
if (!isParamValid(templateGroupId)) { if (!isParamValid(templateGroupId)) {
return Collections.emptyList(); return Collections.emptyList();
} }
...@@ -56,7 +68,7 @@ public class TemplateController extends BaseController { ...@@ -56,7 +68,7 @@ public class TemplateController extends BaseController {
@RequestMapping(value = "getTemplateJson", method = RequestMethod.POST, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) @RequestMapping(value = "getTemplateJson", method = RequestMethod.POST, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public @ResponseBody public @ResponseBody
void getTemplateBlob(@RequestParam(name="templateID") Long templateId, HttpServletResponse response) throws URISyntaxException { void getTemplateBlob(@RequestParam(name = "templateID") Long templateId, HttpServletResponse response) throws URISyntaxException {
MyAsserts.assertTrue(isParamValid(templateId), new BadParameterException()); MyAsserts.assertTrue(isParamValid(templateId), new BadParameterException());
String filePath; String filePath;
File templateFile; File templateFile;
...@@ -158,7 +170,7 @@ public class TemplateController extends BaseController { ...@@ -158,7 +170,7 @@ public class TemplateController extends BaseController {
@RequestMapping(value = "getGroupTemplateByGroupID", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "getGroupTemplateByGroupID", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody public @ResponseBody
OperationResultDto<List<TemplateByGroupDto>> getGroupTemplateByGroupId(@RequestParam(name="templateGroupID") Long templateGroupId, @RequestParam(name="projectID") String projectId) { OperationResultDto<List<TemplateByGroupDto>> getGroupTemplateByGroupId(@RequestParam(name = "templateGroupID") Long templateGroupId, @RequestParam(name = "projectID") String projectId) {
OperationResultDto resultDto = new OperationResultDto(); OperationResultDto resultDto = new OperationResultDto();
if (templateGroupId == null || templateGroupId.equals("undefined") || StringUtils.isBlank(projectId) || projectId.equals("undefined")) { if (templateGroupId == null || templateGroupId.equals("undefined") || StringUtils.isBlank(projectId) || projectId.equals("undefined")) {
resultDto.setResult(false); resultDto.setResult(false);
......
package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dpo.TemplateUniqDto;
import pwc.taxtech.atms.dto.CellBriefDto;
import pwc.taxtech.atms.dto.DeleteTemplateParam;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.TemplateDto;
import pwc.taxtech.atms.dto.UpateNameParam;
import pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto;
import pwc.taxtech.atms.entity.Template;
import java.util.List;
public interface TemplateService {
/**
* @return 模板DTO 列表
*/
List<TemplateDto> get(Long templateGroupId, Integer reportType);
String getTemplatePath(Long templateId);
Template getTemplateById(Long templateId);
List<TemplateUniqDto> getTemplateUniqList(String serviceTypeId, Integer payTaxType, Integer reportType, String industryIds);
OperationResultDto<Object> updateTemplateName(UpateNameParam param);
OperationResultDto<String> deleteTemplate(DeleteTemplateParam param);
OperationResultDto setRowColName(Long id,List<CellBriefDto> cellInfo);
OperationResultDto<List<TemplateByGroupDto>> getByGroupId(Long templateGroupId, String projectId);
}
...@@ -23,7 +23,6 @@ import pwc.taxtech.atms.entity.Template; ...@@ -23,7 +23,6 @@ import pwc.taxtech.atms.entity.Template;
import pwc.taxtech.atms.entity.TemplateExample; 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.service.TemplateService;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
...@@ -36,9 +35,8 @@ import java.util.stream.Collectors; ...@@ -36,9 +35,8 @@ import java.util.stream.Collectors;
import static java.util.stream.Collectors.groupingBy; import static java.util.stream.Collectors.groupingBy;
@Service @Service
public class TemplateServiceImpl extends AbstractService implements TemplateService { public class TemplateServiceImpl extends AbstractService {
@Override
public List<TemplateDto> get(Long templateGroupId, Integer reportType) { public List<TemplateDto> get(Long templateGroupId, Integer reportType) {
TemplateExample example = new TemplateExample(); TemplateExample example = new TemplateExample();
...@@ -62,7 +60,6 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ ...@@ -62,7 +60,6 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
return templateDtos; return templateDtos;
} }
@Override
public String getTemplatePath(Long templateId) { public String getTemplatePath(Long templateId) {
String result = ""; String result = "";
Template template = templateMapper.selectByPrimaryKey(templateId); Template template = templateMapper.selectByPrimaryKey(templateId);
...@@ -78,12 +75,10 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ ...@@ -78,12 +75,10 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
return result; return result;
} }
@Override
public Template getTemplateById(Long templateId) { public Template getTemplateById(Long templateId) {
return templateMapper.selectByPrimaryKey(templateId); return templateMapper.selectByPrimaryKey(templateId);
} }
@Override
public List<TemplateUniqDto> getTemplateUniqList(String serviceTypeId, Integer payTaxType, Integer reportType, String industryIds) { public List<TemplateUniqDto> getTemplateUniqList(String serviceTypeId, Integer payTaxType, Integer reportType, String industryIds) {
Map<String, Object> map = new HashMap<>(4); Map<String, Object> map = new HashMap<>(4);
...@@ -146,7 +141,6 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ ...@@ -146,7 +141,6 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
return result; return result;
} }
@Override
public OperationResultDto<Object> updateTemplateName(UpateNameParam param) { public OperationResultDto<Object> updateTemplateName(UpateNameParam param) {
OperationResultDto<Object> result = new OperationResultDto<>(); OperationResultDto<Object> result = new OperationResultDto<>();
...@@ -180,7 +174,6 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ ...@@ -180,7 +174,6 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
return result; return result;
} }
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public OperationResultDto<String> deleteTemplate(DeleteTemplateParam param) { public OperationResultDto<String> deleteTemplate(DeleteTemplateParam param) {
OperationResultDto<String> result = new OperationResultDto<>(); OperationResultDto<String> result = new OperationResultDto<>();
...@@ -212,7 +205,6 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ ...@@ -212,7 +205,6 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
return result; return result;
} }
@Override
public OperationResultDto setRowColName(Long id, List<CellBriefDto> cellInfo) { public OperationResultDto setRowColName(Long id, List<CellBriefDto> cellInfo) {
OperationResultDto result = new OperationResultDto(); OperationResultDto result = new OperationResultDto();
CellTemplateExample example = new CellTemplateExample(); CellTemplateExample example = new CellTemplateExample();
...@@ -243,7 +235,6 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ ...@@ -243,7 +235,6 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
return result; return result;
} }
@Override
public OperationResultDto<List<TemplateByGroupDto>> getByGroupId(Long templateGroupId, String projectId) { public OperationResultDto<List<TemplateByGroupDto>> getByGroupId(Long templateGroupId, String projectId) {
OperationResultDto result = new OperationResultDto(); OperationResultDto result = new OperationResultDto();
// Long bspl = getVatTemplateGroup(projectId); // Long bspl = getVatTemplateGroup(projectId);
......
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