Commit 5e886e22 authored by neo's avatar neo

[DEV] change commont excetion to one package

parent a368d36d
...@@ -17,6 +17,7 @@ import org.springframework.util.StringUtils; ...@@ -17,6 +17,7 @@ import org.springframework.util.StringUtils;
import pwc.taxtech.atms.dao.UserMapper; import pwc.taxtech.atms.dao.UserMapper;
import pwc.taxtech.atms.entitiy.User; import pwc.taxtech.atms.entitiy.User;
import pwc.taxtech.atms.exception.ApplicationException;
@Component @Component
public class AuthUserHelperImpl implements AuditorAware<String>, AuthUserHelper { public class AuthUserHelperImpl implements AuditorAware<String>, AuthUserHelper {
......
...@@ -9,7 +9,7 @@ import org.apache.commons.pool2.PooledObjectFactory; ...@@ -9,7 +9,7 @@ import org.apache.commons.pool2.PooledObjectFactory;
import org.apache.commons.pool2.impl.DefaultPooledObject; import org.apache.commons.pool2.impl.DefaultPooledObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.common.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import java.io.IOException; import java.io.IOException;
......
...@@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.commons.CommonsMultipartFile; import org.springframework.web.multipart.commons.CommonsMultipartFile;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import pwc.taxtech.atms.common.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.common.CommonConstants; import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.message.ErrorMessage; import pwc.taxtech.atms.common.message.ErrorMessage;
......
...@@ -6,7 +6,6 @@ import java.io.FileInputStream; ...@@ -6,7 +6,6 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.Collections;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -29,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -29,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.commons.CommonsMultipartFile; import org.springframework.web.multipart.commons.CommonsMultipartFile;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import pwc.taxtech.atms.common.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.message.ErrorMessage; import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.constant.EnterpriseAccountConstant; import pwc.taxtech.atms.constant.EnterpriseAccountConstant;
......
...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.controller; ...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.controller;
import org.apache.http.HttpStatus; import org.apache.http.HttpStatus;
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.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.dto.PagingResultDto; import pwc.taxtech.atms.dto.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.*; import pwc.taxtech.atms.dto.vatdto.*;
...@@ -49,6 +50,11 @@ public class InputInvoiceImportController { ...@@ -49,6 +50,11 @@ public class InputInvoiceImportController {
} }
@RequestMapping(value = "getInputInvoiceList/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity getInputInvoiceList(Integer period) {
return ResponseEntity.ok().body(inputInvoiceDataImportService.getInputInvoiceList(period));
}
private int getDownloadFilePath(InputInvoicePreviewQueryParam paras, OutputStream outputStream) { private int getDownloadFilePath(InputInvoicePreviewQueryParam paras, OutputStream outputStream) {
List<InputVATInvoiceDto> list = inputInvoiceDataImportService.getInputInvoiceTreeViewData(paras).getList(); List<InputVATInvoiceDto> list = inputInvoiceDataImportService.getInputInvoiceTreeViewData(paras).getList();
if (list.size() == 0) { if (list.size() == 0) {
......
...@@ -7,7 +7,7 @@ import org.slf4j.LoggerFactory; ...@@ -7,7 +7,7 @@ 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.*;
import pwc.taxtech.atms.common.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.common.ftp.FTPClientPool; import pwc.taxtech.atms.common.ftp.FTPClientPool;
import pwc.taxtech.atms.dto.*; import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.entitiy.Template; import pwc.taxtech.atms.entitiy.Template;
......
...@@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -9,7 +9,7 @@ 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.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.common.ftp.FTPClientPool; import pwc.taxtech.atms.common.ftp.FTPClientPool;
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;
......
package pwc.taxtech.atms.common; package pwc.taxtech.atms.exception;
public class ApplicationException extends RuntimeException { public class ApplicationException extends RuntimeException {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package pwc.taxtech.atms.common; package pwc.taxtech.atms.exception;
public class ServiceException extends Exception { public class ServiceException extends Exception {
public ServiceException() { public ServiceException() {
......
package pwc.taxtech.atms.service; package pwc.taxtech.atms.service;
import pwc.taxtech.atms.common.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.dto.stdaccount.StandardAccountDto; import pwc.taxtech.atms.dto.stdaccount.StandardAccountDto;
import pwc.taxtech.atms.dto.stdaccount.StdAccountFancyTreeDto; import pwc.taxtech.atms.dto.stdaccount.StdAccountFancyTreeDto;
......
...@@ -2,7 +2,7 @@ package pwc.taxtech.atms.service; ...@@ -2,7 +2,7 @@ package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.dto.TemplateGroupDto; import pwc.taxtech.atms.dto.TemplateGroupDto;
import java.util.List; import java.util.List;
......
...@@ -6,14 +6,13 @@ import java.util.List; ...@@ -6,14 +6,13 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.nutz.lang.Strings;
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.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import pwc.taxtech.atms.common.ApplicationException; 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;
......
...@@ -11,7 +11,7 @@ import org.springframework.stereotype.Service; ...@@ -11,7 +11,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import pwc.taxtech.atms.common.ApplicationException; 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;
......
...@@ -15,7 +15,7 @@ import org.slf4j.LoggerFactory; ...@@ -15,7 +15,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import pwc.taxtech.atms.common.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.common.CommonConstants; import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
......
...@@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -10,7 +10,7 @@ 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 pwc.taxtech.atms.common.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.common.CommonConstants; import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.dao.MenuMapper; import pwc.taxtech.atms.dao.MenuMapper;
......
...@@ -16,7 +16,7 @@ import org.springframework.stereotype.Service; ...@@ -16,7 +16,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import pwc.taxtech.atms.common.ApplicationException; 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;
......
...@@ -39,7 +39,7 @@ import org.springframework.stereotype.Service; ...@@ -39,7 +39,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import pwc.taxtech.atms.common.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.common.CommonConstants; import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.OperateLogType; import pwc.taxtech.atms.common.OperateLogType;
......
...@@ -12,7 +12,7 @@ import org.springframework.util.StringUtils; ...@@ -12,7 +12,7 @@ import org.springframework.util.StringUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import pwc.taxtech.atms.common.ApplicationException; 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;
......
...@@ -15,7 +15,7 @@ import org.apache.commons.lang3.BooleanUtils; ...@@ -15,7 +15,7 @@ import org.apache.commons.lang3.BooleanUtils;
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 pwc.taxtech.atms.common.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.common.CommonConstants; import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.SortUtils; import pwc.taxtech.atms.common.SortUtils;
......
...@@ -20,7 +20,7 @@ import org.nutz.lang.Strings; ...@@ -20,7 +20,7 @@ import org.nutz.lang.Strings;
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 pwc.taxtech.atms.common.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.common.CommonConstants; import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.OperateLogType; import pwc.taxtech.atms.common.OperateLogType;
......
...@@ -6,7 +6,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -6,7 +6,7 @@ import org.apache.commons.lang3.StringUtils;
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 pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.constant.ActiveStatus; import pwc.taxtech.atms.constant.ActiveStatus;
import pwc.taxtech.atms.constant.StandAccountConstant; import pwc.taxtech.atms.constant.StandAccountConstant;
import pwc.taxtech.atms.constant.enums.StdAccountEnum; import pwc.taxtech.atms.constant.enums.StdAccountEnum;
......
...@@ -13,7 +13,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -13,7 +13,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.POIUtil; import pwc.taxtech.atms.common.POIUtil;
import pwc.taxtech.atms.common.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.common.message.ErrorMessage; import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.common.message.TemplateMessage; import pwc.taxtech.atms.common.message.TemplateMessage;
import pwc.taxtech.atms.constant.enums.TemplateGroupType; import pwc.taxtech.atms.constant.enums.TemplateGroupType;
......
...@@ -6,7 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -6,7 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import pwc.taxtech.atms.common.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.common.CommonConstants; import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.OperateLogType; import pwc.taxtech.atms.common.OperateLogType;
......
...@@ -21,6 +21,7 @@ import pwc.taxtech.atms.dto.permission.*; ...@@ -21,6 +21,7 @@ import pwc.taxtech.atms.dto.permission.*;
import pwc.taxtech.atms.dto.user.*; import pwc.taxtech.atms.dto.user.*;
import pwc.taxtech.atms.entitiy.*; import pwc.taxtech.atms.entitiy.*;
import pwc.taxtech.atms.entitiy.UserRoleExample.Criteria; import pwc.taxtech.atms.entitiy.UserRoleExample.Criteria;
import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.security.AtmsPasswordEncoder; import pwc.taxtech.atms.security.AtmsPasswordEncoder;
import pwc.taxtech.atms.security.JwtUtil; import pwc.taxtech.atms.security.JwtUtil;
import pwc.taxtech.atms.security.LdapAuthenticationProvider; import pwc.taxtech.atms.security.LdapAuthenticationProvider;
......
...@@ -11,4 +11,6 @@ public interface InputInvoiceDataImportService { ...@@ -11,4 +11,6 @@ public interface InputInvoiceDataImportService {
PagingResultDto<InputVATInvoiceDto> getInputInvoiceTreeViewData(InputInvoicePreviewQueryParam paras); PagingResultDto<InputVATInvoiceDto> getInputInvoiceTreeViewData(InputInvoicePreviewQueryParam paras);
List<InputVATInvoiceItemDto> getInputInvoiceItemTreeViewData(String id); List<InputVATInvoiceItemDto> getInputInvoiceItemTreeViewData(String id);
List<InputVATInvoiceDto> getInputInvoiceList(Integer period);
} }
...@@ -39,4 +39,9 @@ public class CustomsInvoiceServiceImpl extends VatAbstractService implements Cus ...@@ -39,4 +39,9 @@ public class CustomsInvoiceServiceImpl extends VatAbstractService implements Cus
return result; return result;
} }
@Override
public List<CustomsInvoiceDto> getCustomsInvoicesByPeriodId(Integer periodId) {
return null;
}
} }
...@@ -2,17 +2,21 @@ package pwc.taxtech.atms.vat.service.impl; ...@@ -2,17 +2,21 @@ package pwc.taxtech.atms.vat.service.impl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.dto.FieldsMapper;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.PagingResultDto; import pwc.taxtech.atms.dto.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.InputInvoicePreviewQueryParam; import pwc.taxtech.atms.dto.vatdto.InputInvoicePreviewQueryParam;
import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto; import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto;
import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceItemDto; import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceItemDto;
import pwc.taxtech.atms.dto.vatdto.QueryOutputDto; import pwc.taxtech.atms.dto.vatdto.QueryOutputDto;
import pwc.taxtech.atms.vat.entity.InputVATInvoice;
import pwc.taxtech.atms.vat.entity.InputVATInvoiceExample;
import pwc.taxtech.atms.vat.entity.InputVATInvoiceItem; import pwc.taxtech.atms.vat.entity.InputVATInvoiceItem;
import pwc.taxtech.atms.vat.entity.InputVATInvoiceItemExample; import pwc.taxtech.atms.vat.entity.InputVATInvoiceItemExample;
import pwc.taxtech.atms.vat.service.InputInvoiceDataImportService; import pwc.taxtech.atms.vat.service.InputInvoiceDataImportService;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.List; import java.util.List;
@Service @Service
...@@ -51,4 +55,29 @@ public class InputInvoiceDataImportServiceImpl extends VatAbstractService implem ...@@ -51,4 +55,29 @@ public class InputInvoiceDataImportServiceImpl extends VatAbstractService implem
}); });
return result; return result;
} }
@Override
public List<InputVATInvoiceDto> getInputInvoiceList(Integer period) {
InputVATInvoiceExample inputVATInvoiceExample = new InputVATInvoiceExample();
inputVATInvoiceExample.createCriteria().andPeriodIDEqualTo(period.intValue());
List<InputVATInvoice> inputVatEntity =inputVATInvoiceMapper.selectByExample(inputVATInvoiceExample);
inputVatEntity.sort(Comparator.comparing(InputVATInvoice::getInvoiceNumber));
inputVatEntity.sort(Comparator.comparing(InputVATInvoice::getCreateTime));
List<InputVATInvoiceDto> result = new ArrayList<>(inputVatEntity.size());
inputVatEntity.forEach(m->{
InputVATInvoiceDto dto=new InputVATInvoiceDto();
try {
FieldsMapper.map(m,dto);
} catch (ClassNotFoundException e) {
e.printStackTrace();//TODO:should be fixed with exception filter (neo)
} catch (IllegalAccessException e) {
e.printStackTrace();
}
result.add(dto);
});
return result;
}
} }
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