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
e040f306
Commit
e040f306
authored
Aug 30, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打款户拖拽排序接口
parent
e0cf4b82
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
0 deletions
+77
-0
PayAccountService.java
.../main/java/com/gic/finance/service/PayAccountService.java
+11
-0
PayAccountServiceImpl.java
...a/com/gic/finance/service/impl/PayAccountServiceImpl.java
+34
-0
PayAccountApiServiceImpl.java
.../finance/service/outer/impl/PayAccountApiServiceImpl.java
+13
-0
TransferAccountsApprovalApiServiceImpl.java
...ce/outer/impl/TransferAccountsApprovalApiServiceImpl.java
+6
-0
CashWithdrawalController.java
.../gic/finance/web/controller/CashWithdrawalController.java
+13
-0
No files found.
gic-platform-finance-service/src/main/java/com/gic/finance/service/PayAccountService.java
View file @
e040f306
...
@@ -45,6 +45,17 @@ public interface PayAccountService {
...
@@ -45,6 +45,17 @@ public interface PayAccountService {
TabPayAccount
getById
(
Integer
id
);
TabPayAccount
getById
(
Integer
id
);
/**
/**
* 拖拽排序
* @Title: setSort
* @Description:
* @author guojuxing
* @param record
* @param sortValue
* @return void
*/
void
setSort
(
TabPayAccount
record
,
Integer
sortValue
);
/**
* 查询排序值最大的,即排在最末
* 查询排序值最大的,即排在最末
* @Title: getTheMaxSort
* @Title: getTheMaxSort
* @Description:
* @Description:
...
...
gic-platform-finance-service/src/main/java/com/gic/finance/service/impl/PayAccountServiceImpl.java
View file @
e040f306
...
@@ -39,6 +39,33 @@ public class PayAccountServiceImpl implements PayAccountService {
...
@@ -39,6 +39,33 @@ public class PayAccountServiceImpl implements PayAccountService {
}
}
@Override
@Override
public
void
setSort
(
TabPayAccount
record
,
Integer
sortValue
)
{
List
<
TabPayAccount
>
list
=
tabPayAccountMapper
.
listPayAccount
();
Integer
fromSortValue
=
record
.
getSort
();
if
(
fromSortValue
>
sortValue
)
{
//向上拖拽
for
(
int
i
=
0
,
length
=
list
.
size
();
i
<
length
;
i
++)
{
TabPayAccount
temp
=
list
.
get
(
i
);
//如果大于sortValue,都需要降低排序值,往后推
boolean
isNeedDown
=
temp
.
getSort
()
>=
sortValue
&&
temp
.
getSort
()
<
fromSortValue
;
if
(
isNeedDown
)
{
updateSort
(
list
.
get
(
i
+
1
).
getSort
(),
temp
.
getPayAccountId
());
}
}
}
else
if
(
fromSortValue
<
sortValue
)
{
//向下拖拽
for
(
int
i
=
0
,
length
=
list
.
size
();
i
<
length
;
i
++)
{
TabPayAccount
temp
=
list
.
get
(
i
);
boolean
isNeedUp
=
temp
.
getSort
()
<=
sortValue
&&
temp
.
getSort
()
>
fromSortValue
;
if
(
isNeedUp
)
{
updateSort
(
list
.
get
(
i
-
1
).
getSort
(),
temp
.
getPayAccountId
());
}
}
}
updateSort
(
sortValue
,
record
.
getPayAccountId
());
}
@Override
public
int
getTheMaxSort
()
{
public
int
getTheMaxSort
()
{
return
tabPayAccountMapper
.
getMaxSort
();
return
tabPayAccountMapper
.
getMaxSort
();
}
}
...
@@ -57,4 +84,11 @@ public class PayAccountServiceImpl implements PayAccountService {
...
@@ -57,4 +84,11 @@ public class PayAccountServiceImpl implements PayAccountService {
public
TabPayAccount
getNextOfSort
(
Integer
sort
)
{
public
TabPayAccount
getNextOfSort
(
Integer
sort
)
{
return
null
;
return
null
;
}
}
private
void
updateSort
(
Integer
sort
,
Integer
id
)
{
TabPayAccount
record
=
new
TabPayAccount
();
record
.
setPayAccountId
(
id
);
record
.
setSort
(
sort
);
tabPayAccountMapper
.
updateByPrimaryKeySelective
(
record
);
}
}
}
gic-platform-finance-service/src/main/java/com/gic/finance/service/outer/impl/PayAccountApiServiceImpl.java
View file @
e040f306
...
@@ -64,6 +64,19 @@ public class PayAccountApiServiceImpl implements PayAccountApiService {
...
@@ -64,6 +64,19 @@ public class PayAccountApiServiceImpl implements PayAccountApiService {
}
}
@Override
@Override
public
ServiceResponse
<
Void
>
setSort
(
Integer
id
,
Integer
sort
)
{
TabPayAccount
tab
=
payAccountService
.
getById
(
id
);
if
(
tab
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"参数有误,无此记录"
);
}
if
(
sort
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"排序值不能为空"
);
}
payAccountService
.
setSort
(
tab
,
sort
);
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Void
>
upSort
(
Integer
id
)
{
public
ServiceResponse
<
Void
>
upSort
(
Integer
id
)
{
TabPayAccount
tab
=
payAccountService
.
getById
(
id
);
TabPayAccount
tab
=
payAccountService
.
getById
(
id
);
if
(
tab
==
null
)
{
if
(
tab
==
null
)
{
...
...
gic-platform-finance-service/src/main/java/com/gic/finance/service/outer/impl/TransferAccountsApprovalApiServiceImpl.java
View file @
e040f306
...
@@ -167,6 +167,9 @@ public class TransferAccountsApprovalApiServiceImpl implements TransferAccountsA
...
@@ -167,6 +167,9 @@ public class TransferAccountsApprovalApiServiceImpl implements TransferAccountsA
if
(
tab
==
null
)
{
if
(
tab
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"订单流水号有误"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"订单流水号有误"
);
}
}
if
(
tab
.
getApprovalStatus
().
intValue
()
!=
TransferAccountApprovalStatusEnum
.
TO_BE_APPROVED
.
getCode
())
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"此订单已审核,不能取消"
);
}
updateCancelApproval
(
tab
.
getTransferApprovalId
());
updateCancelApproval
(
tab
.
getTransferApprovalId
());
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
();
}
}
...
@@ -177,6 +180,9 @@ public class TransferAccountsApprovalApiServiceImpl implements TransferAccountsA
...
@@ -177,6 +180,9 @@ public class TransferAccountsApprovalApiServiceImpl implements TransferAccountsA
if
(
tab
==
null
)
{
if
(
tab
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"转账审批主键有误"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"转账审批主键有误"
);
}
}
if
(
tab
.
getApprovalStatus
().
intValue
()
!=
TransferAccountApprovalStatusEnum
.
TO_BE_APPROVED
.
getCode
())
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"此订单已审核,不能取消"
);
}
updateCancelApproval
(
transferApprovalId
);
updateCancelApproval
(
transferApprovalId
);
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
();
}
}
...
...
gic-platform-finance-web/src/main/java/com/gic/finance/web/controller/CashWithdrawalController.java
View file @
e040f306
...
@@ -69,6 +69,19 @@ public class CashWithdrawalController {
...
@@ -69,6 +69,19 @@ public class CashWithdrawalController {
return
ResultControllerUtils
.
commonResult
(
payAccountApiService
.
upSort
(
id
));
return
ResultControllerUtils
.
commonResult
(
payAccountApiService
.
upSort
(
id
));
}
}
/**
* 拖拽排序
* @Title: setSort
* @Description:
* @author guojuxing
* @param id
* @return com.gic.commons.webapi.reponse.RestResponse
*/
@RequestMapping
(
"/set-sort"
)
public
RestResponse
setSort
(
Integer
id
,
Integer
sortValue
)
{
return
ResultControllerUtils
.
commonResult
(
payAccountApiService
.
setSort
(
id
,
sortValue
));
}
@RequestMapping
(
"/delete-pay-account"
)
@RequestMapping
(
"/delete-pay-account"
)
public
RestResponse
deletePayAccount
(
Integer
id
)
{
public
RestResponse
deletePayAccount
(
Integer
id
)
{
return
ResultControllerUtils
.
commonResult
(
payAccountApiService
.
delete
(
id
));
return
ResultControllerUtils
.
commonResult
(
payAccountApiService
.
delete
(
id
));
...
...
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