Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
asset-distribution
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data-spider
asset-distribution
Commits
e2641314
Commit
e2641314
authored
Dec 30, 2020
by
hyuk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资方配置审批列表排序更改
parent
17c77c4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
37 deletions
+39
-37
ApprovalLogServiceImpl.java
...ibution/service/approval/impl/ApprovalLogServiceImpl.java
+32
-36
ApprovalLog.java
...up/asset/distribution/service/jpa/entity/ApprovalLog.java
+7
-1
No files found.
src/main/java/com/quantgroup/asset/distribution/service/approval/impl/ApprovalLogServiceImpl.java
View file @
e2641314
...
...
@@ -12,12 +12,10 @@ import javax.persistence.criteria.*;
import
com.quantgroup.asset.distribution.service.funding.IFundModuleChannelFundConfigNewService
;
import
com.quantgroup.asset.distribution.service.jpa.entity.FundModuleChannelFundConfigNew
;
import
org.apache.commons.lang3.StringUtils
;
import
org.hibernate.jpa.criteria.predicate.InPredicate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -26,9 +24,7 @@ import com.quantgroup.asset.distribution.enums.funding.AuditStatusEnum;
import
com.quantgroup.asset.distribution.enums.funding.AuditTargetEnum
;
import
com.quantgroup.asset.distribution.enums.funding.AuditTypeEnum
;
import
com.quantgroup.asset.distribution.service.approval.IApprovalLogService
;
import
com.quantgroup.asset.distribution.service.funding.IFundModuleChannelFundConfigService
;
import
com.quantgroup.asset.distribution.service.jpa.entity.ApprovalLog
;
import
com.quantgroup.asset.distribution.service.jpa.entity.FundModuleChannelFundConfig
;
import
com.quantgroup.asset.distribution.service.jpa.repository.IApprovalLogRepository
;
import
com.quantgroup.asset.distribution.util.DateUtil
;
...
...
@@ -63,39 +59,39 @@ public class ApprovalLogServiceImpl implements IApprovalLogService{
Integer
pageSize
)
{
// 分页条件
Pageable
pageable
=
new
PageRequest
(
pageNum
<
0
?
0
:
pageNum
,
pageSize
);
Specification
<
ApprovalLog
>
specification
=
new
Specification
<
ApprovalLog
>()
{
@Override
public
Predicate
toPredicate
(
Root
<
ApprovalLog
>
root
,
CriteriaQuery
<?>
query
,
CriteriaBuilder
cb
)
{
List
<
Predicate
>
predicatesAnd
=
new
ArrayList
<>();
List
<
Predicate
>
predicatesOr
=
new
ArrayList
<>();
predicatesAnd
.
add
(
cb
.
equal
(
root
.
get
(
"enable"
),
true
));
if
(
auditStatus
!=
null
){
predicatesAnd
.
add
(
cb
.
equal
(
root
.
get
(
"auditStatus"
),
auditStatus
));
}
if
(
auditType
!=
null
){
predicatesAnd
.
add
(
cb
.
equal
(
root
.
get
(
"auditType"
),
auditType
));
}
if
(
auditTarget
!=
null
){
predicatesAnd
.
add
(
cb
.
equal
(
root
.
get
(
"auditTarget"
),
auditTarget
));
}
if
(
StringUtils
.
isNotEmpty
(
applyStartTime
)){
predicatesAnd
.
add
(
cb
.
greaterThanOrEqualTo
(
root
.
get
(
"applyTime"
).
as
(
Timestamp
.
class
),
Timestamp
.
valueOf
(
applyStartTime
)));
}
if
(
StringUtils
.
isNotEmpty
(
applyEndTime
)){
predicatesAnd
.
add
(
cb
.
lessThan
(
root
.
get
(
"applyTime"
).
as
(
Timestamp
.
class
),
Timestamp
.
valueOf
(
applyEndTime
)));
}
if
(
StringUtils
.
isNotEmpty
(
targetName
)){
predicatesAnd
.
add
(
cb
.
like
(
root
.
get
(
"targetName"
),
"%"
+
targetName
+
"%"
));
}
if
(
StringUtils
.
isNotEmpty
(
user
))
{
predicatesOr
.
add
(
cb
.
equal
(
root
.
get
(
"proposer"
),
user
));
predicatesOr
.
add
(
cb
.
equal
(
root
.
get
(
"auditor"
),
user
));
}
List
<
Order
>
orderList
=
new
ArrayList
<>();
orderList
.
add
(
cb
.
asc
(
root
.
get
(
"auditStatus"
)));
return
query
.
where
(
cb
.
and
(
predicatesAnd
.
toArray
(
new
Predicate
[
predicatesAnd
.
size
()])),
cb
.
or
(
predicatesOr
.
toArray
(
new
Predicate
[
predicatesOr
.
size
()])))
.
orderBy
(
orderList
).
getRestriction
();
Specification
<
ApprovalLog
>
specification
=
(
root
,
query
,
cb
)
->
{
List
<
Predicate
>
predicatesAnd
=
new
ArrayList
<>();
List
<
Predicate
>
predicatesOr
=
new
ArrayList
<>();
predicatesAnd
.
add
(
cb
.
equal
(
root
.
get
(
"enable"
),
true
));
if
(
auditStatus
!=
null
){
predicatesAnd
.
add
(
cb
.
equal
(
root
.
get
(
"auditStatus"
),
auditStatus
));
}
if
(
auditType
!=
null
){
predicatesAnd
.
add
(
cb
.
equal
(
root
.
get
(
"auditType"
),
auditType
));
}
if
(
auditTarget
!=
null
){
predicatesAnd
.
add
(
cb
.
equal
(
root
.
get
(
"auditTarget"
),
auditTarget
));
}
if
(
StringUtils
.
isNotEmpty
(
applyStartTime
)){
predicatesAnd
.
add
(
cb
.
greaterThanOrEqualTo
(
root
.
get
(
"applyTime"
).
as
(
Timestamp
.
class
),
Timestamp
.
valueOf
(
applyStartTime
)));
}
if
(
StringUtils
.
isNotEmpty
(
applyEndTime
)){
predicatesAnd
.
add
(
cb
.
lessThan
(
root
.
get
(
"applyTime"
).
as
(
Timestamp
.
class
),
Timestamp
.
valueOf
(
applyEndTime
)));
}
if
(
StringUtils
.
isNotEmpty
(
targetName
)){
predicatesAnd
.
add
(
cb
.
like
(
root
.
get
(
"targetName"
),
"%"
+
targetName
+
"%"
));
}
if
(
StringUtils
.
isNotEmpty
(
user
))
{
predicatesOr
.
add
(
cb
.
equal
(
root
.
get
(
"proposer"
),
user
));
predicatesOr
.
add
(
cb
.
equal
(
root
.
get
(
"auditor"
),
user
));
}
List
<
Order
>
orderList
=
new
ArrayList
<>();
orderList
.
add
(
cb
.
asc
(
root
.
get
(
"auditStatus"
)));
orderList
.
add
(
cb
.
desc
(
root
.
get
(
"createdAt"
)));
return
query
.
where
(
cb
.
and
(
predicatesAnd
.
toArray
(
new
Predicate
[
0
])),
cb
.
or
(
predicatesOr
.
toArray
(
new
Predicate
[
0
])))
.
orderBy
(
orderList
).
getRestriction
();
};
Page
<
ApprovalLog
>
channelFundConfigs
=
approvalLogRepository
.
findAll
(
specification
,
pageable
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
...
...
src/main/java/com/quantgroup/asset/distribution/service/jpa/entity/ApprovalLog.java
View file @
e2641314
...
...
@@ -54,7 +54,13 @@ public class ApprovalLog implements Serializable{
@Column
(
name
=
"audit_time"
)
private
String
auditTime
;
/**
* 0-待审批
* 1-审批通过
* 2-审批拒绝
* 3-撤销
*/
@Column
(
name
=
"audit_status"
)
private
Integer
auditStatus
;
...
...
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