Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
2b05f439
Commit
2b05f439
authored
Jun 22, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] add custom service
parent
f7d31266
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
3 deletions
+52
-3
AtmsExceptionHandler.java
...ava/pwc/taxtech/atms/controller/AtmsExceptionHandler.java
+37
-0
CustomsInvoiceController.java
...pwc/taxtech/atms/controller/CustomsInvoiceController.java
+8
-0
CustomerServiceImpl.java
...va/pwc/taxtech/atms/service/impl/CustomerServiceImpl.java
+1
-3
CustomsInvoiceService.java
...a/pwc/taxtech/atms/vat/service/CustomsInvoiceService.java
+3
-0
CustomsInvoiceServiceImpl.java
...tech/atms/vat/service/impl/CustomsInvoiceServiceImpl.java
+3
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/AtmsExceptionHandler.java
0 → 100644
View file @
2b05f439
package
pwc
.
taxtech
.
atms
.
controller
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
;
import
pwc.taxtech.atms.exception.ApplicationException
;
import
pwc.taxtech.atms.exception.ServiceException
;
@ControllerAdvice
public
class
AtmsExceptionHandler
extends
ResponseEntityExceptionHandler
{
@ExceptionHandler
(
value
=
{
ApplicationException
.
class
,
ServiceException
.
class
})
protected
ResponseEntity
<
Object
>
handleExceptions
(
Exception
ex
)
throws
ServiceException
{
logger
.
error
(
"Rest Exception!"
,
ex
);
if
(
ex
instanceof
ApplicationException
)
{
return
handleApplicationException
((
ApplicationException
)
ex
);
}
else
if
(
ex
instanceof
ServiceException
)
{
return
handleServiceException
((
ServiceException
)
ex
);
}
else
{
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
build
();
}
}
private
ResponseEntity
<
Object
>
handleApplicationException
(
ApplicationException
ex
)
{
throw
ex
;
}
private
ResponseEntity
<
Object
>
handleServiceException
(
ServiceException
ex
)
throws
ServiceException
{
throw
ex
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/CustomsInvoiceController.java
View file @
2b05f439
...
...
@@ -5,6 +5,8 @@ import org.apache.commons.lang3.StringUtils;
import
org.apache.http.HttpStatus
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
...
@@ -16,6 +18,7 @@ import pwc.taxtech.atms.dto.vatdto.CustomsInvoiceDto;
import
pwc.taxtech.atms.dto.vatdto.CustomsInvoiceFilter
;
import
pwc.taxtech.atms.dto.vatdto.JsonCustomsInvoice
;
import
pwc.taxtech.atms.dto.vatdto.JsonCustomsInvoiceDto
;
import
pwc.taxtech.atms.exception.ApplicationException
;
import
pwc.taxtech.atms.thirdparty.ExcelUtil
;
import
pwc.taxtech.atms.vat.service.CustomsInvoiceService
;
...
...
@@ -50,6 +53,11 @@ public class CustomsInvoiceController {
return
convertCustomsInvoiceDataToJson
(
fromPeriod
,
toPeriod
,
filter
,
paging
);
}
@RequestMapping
(
value
=
"GetCustomsInvoicesByPeriodId/{periodId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseEntity
getCustomsInvoicesByPeriodId
(
@PathVariable
Integer
periodId
)
{
return
ResponseEntity
.
ok
().
body
(
customsInvoiceService
.
getCustomsInvoicesByPeriodId
(
periodId
));
}
@RequestMapping
(
value
=
"ExportQueryData/get"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
void
exportQueryData
(
@RequestParam
String
criteria
,
HttpServletResponse
response
)
{
CustomsInvoiceFilter
filter
=
new
CustomsInvoiceFilter
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/CustomerServiceImpl.java
View file @
2b05f439
...
...
@@ -19,9 +19,7 @@ import org.springframework.util.Assert;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
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.CommonConstants
;
import
pwc.taxtech.atms.common.CommonUtils
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/CustomsInvoiceService.java
View file @
2b05f439
package
pwc
.
taxtech
.
atms
.
vat
.
service
;
import
org.springframework.http.ResponseEntity
;
import
pwc.taxtech.atms.dto.vatdto.CustomsInvoiceDto
;
import
java.util.List
;
...
...
@@ -12,4 +13,6 @@ public interface CustomsInvoiceService {
* @return
*/
List
<
CustomsInvoiceDto
>
getCustomsInvoicesByPeriodIds
(
int
fromPeriod
,
int
toPeriod
);
List
<
CustomsInvoiceDto
>
getCustomsInvoicesByPeriodId
(
Integer
periodId
);
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/CustomsInvoiceServiceImpl.java
View file @
2b05f439
...
...
@@ -42,6 +42,9 @@ public class CustomsInvoiceServiceImpl extends VatAbstractService implements Cus
@Override
public
List
<
CustomsInvoiceDto
>
getCustomsInvoicesByPeriodId
(
Integer
periodId
)
{
CustomsInvoiceExample
example
=
new
CustomsInvoiceExample
();
// example.createCriteria().andPeriodIdEqualTo(periodId)
return
null
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment