Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-finance
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-platform-finance
Commits
030ae06d
Commit
030ae06d
authored
Aug 15, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
cd5babc7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
86 deletions
+7
-86
FinanceException.java
...main/java/com/gic/finance/exception/FinanceException.java
+0
-27
InvoiceManageController.java
...m/gic/finance/web/controller/InvoiceManageController.java
+2
-2
TransferAccountsApprovalController.java
...ce/web/controller/TransferAccountsApprovalController.java
+2
-2
GlobalExceptionHandler.java
...com/gic/finance/web/exception/GlobalExceptionHandler.java
+3
-3
ResultControllerUtils.java
...java/com/gic/finance/web/utils/ResultControllerUtils.java
+0
-52
No files found.
gic-platform-finance-api/src/main/java/com/gic/finance/exception/FinanceException.java
deleted
100644 → 0
View file @
cd5babc7
package
com
.
gic
.
finance
.
exception
;
import
com.gic.api.base.commons.ServiceResponse
;
/**
* 转账审批异常类
* @ClassName: FinanceException
* @Description:
* @author guojuxing
* @date 2019/8/9 5:09 PM
*/
public
class
FinanceException
extends
RuntimeException
{
private
String
errorCode
;
public
FinanceException
(
String
errorCode
,
String
message
)
{
super
(
message
);
this
.
errorCode
=
errorCode
;
}
public
FinanceException
(
ServiceResponse
serviceResponse
)
{
super
(
serviceResponse
.
getMessage
());
this
.
errorCode
=
serviceResponse
.
getCode
();
}
public
String
getErrorCode
()
{
return
errorCode
;
}
}
gic-platform-finance-web/src/main/java/com/gic/finance/web/controller/InvoiceManageController.java
View file @
030ae06d
...
...
@@ -7,10 +7,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.finance.dto.InvoiceManageDTO
;
import
com.gic.finance.qo.InvoiceManageListQueryQO
;
import
com.gic.finance.service.InvoiceManageApiService
;
import
com.gic.finance.web.utils.ResultControllerUtils
;
import
com.gic.finance.web.vo.InvoiceManageListVO
;
/**
...
...
@@ -81,7 +81,7 @@ public class InvoiceManageController {
@RequestMapping
(
"/list-invoice"
)
public
RestResponse
listInvoice
(
InvoiceManageListQueryQO
params
)
{
return
ResultControllerUtils
.
commonResult
(
return
ResultControllerUtils
.
common
Page
Result
(
invoiceManageApiService
.
listInvoiceManage
(
params
),
InvoiceManageListVO
.
class
);
}
...
...
gic-platform-finance-web/src/main/java/com/gic/finance/web/controller/TransferAccountsApprovalController.java
View file @
030ae06d
...
...
@@ -7,10 +7,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.finance.dto.TransferAccountsApprovalDTO
;
import
com.gic.finance.qo.TransferListQueryQO
;
import
com.gic.finance.service.TransferAccountsApprovalApiService
;
import
com.gic.finance.web.utils.ResultControllerUtils
;
import
com.gic.finance.web.vo.TransferApprovalListVO
;
/**
...
...
@@ -60,7 +60,7 @@ public class TransferAccountsApprovalController {
@RequestMapping
(
"/list-approval"
)
public
RestResponse
listTransferAccountsApproval
(
TransferListQueryQO
params
)
{
return
ResultControllerUtils
.
commonResult
(
return
ResultControllerUtils
.
common
Page
Result
(
transferAccountsApprovalApiService
.
listTransferAccountsApproval
(
params
),
TransferApprovalListVO
.
class
);
}
}
gic-platform-finance-web/src/main/java/com/gic/finance/web/exception/GlobalExceptionHandler.java
View file @
030ae06d
...
...
@@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.
finance.exception.Finance
Exception
;
import
com.gic.
enterprise.exception.Common
Exception
;
import
com.gic.store.exception.StoreException
;
/**
...
...
@@ -91,8 +91,8 @@ public class GlobalExceptionHandler {
return
getRestResponse
(
e
.
getErrorCode
(),
e
.
getMessage
());
}
@ResponseBody
@ExceptionHandler
(
Finance
Exception
.
class
)
public
RestResponse
customException
(
Finance
Exception
e
)
{
@ExceptionHandler
(
Common
Exception
.
class
)
public
RestResponse
customException
(
Common
Exception
e
)
{
return
getRestResponse
(
e
.
getErrorCode
(),
e
.
getMessage
());
}
...
...
gic-platform-finance-web/src/main/java/com/gic/finance/web/utils/ResultControllerUtils.java
deleted
100644 → 0
View file @
cd5babc7
package
com
.
gic
.
finance
.
web
.
utils
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.finance.exception.FinanceException
;
/**
* controller统一返回工具类
* @ClassName: ResultControllerUtils
* @Description:
* @author guojuxing
* @date 2019/8/9 5:12 PM
*/
public
class
ResultControllerUtils
{
/**
* 统一返回成功结果
* @Title: commonResult
* @Description:
* @author guojuxing
* @param response
* @return java.lang.Object
*/
public
static
RestResponse
commonResult
(
ServiceResponse
response
)
{
if
(
response
.
isSuccess
())
{
return
RestResponse
.
success
(
response
.
getResult
());
}
else
{
throw
new
FinanceException
(
response
);
}
}
/**
* 统一返回成功结果(分页DTO转为VO)
* @Title: commonResultOfListVO
* @Description:
* @author guojuxing
* @param response
* @param clazz
* @return com.gic.commons.webapi.reponse.RestResponse
*/
public
static
RestResponse
commonResult
(
ServiceResponse
response
,
Class
<?>
clazz
)
{
if
(
response
.
isSuccess
())
{
Page
page
=
(
Page
)
response
.
getResult
();
page
.
setResult
(
EntityUtil
.
changeEntityListNew
(
clazz
,
page
.
getResult
()));
return
RestResponse
.
success
(
page
);
}
else
{
throw
new
FinanceException
(
response
);
}
}
}
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