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
8c928509
Commit
8c928509
authored
Sep 25, 2021
by
王业雄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加模糊查询
parent
98d74518
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
14 deletions
+9
-14
ChannelRouteServiceImpl.java
...tribution/service/route/impl/ChannelRouteServiceImpl.java
+3
-3
FundProductServiceImpl.java
...stribution/service/route/impl/FundProductServiceImpl.java
+5
-10
WhiteListServiceImpl.java
...distribution/service/route/impl/WhiteListServiceImpl.java
+1
-1
No files found.
src/main/java/com/quantgroup/asset/distribution/service/route/impl/ChannelRouteServiceImpl.java
View file @
8c928509
...
@@ -42,13 +42,13 @@ public class ChannelRouteServiceImpl implements IChannelRouteService {
...
@@ -42,13 +42,13 @@ public class ChannelRouteServiceImpl implements IChannelRouteService {
BooleanExpression
booleanExpression
=
Expressions
.
asBoolean
(
true
).
isTrue
();
BooleanExpression
booleanExpression
=
Expressions
.
asBoolean
(
true
).
isTrue
();
if
(
Objects
.
nonNull
(
channelRouteQueryVo
.
getChannelId
())){
if
(
Objects
.
nonNull
(
channelRouteQueryVo
.
getChannelId
())){
booleanExpression
=
booleanExpression
.
and
(
QChannelRuleEntity
.
channelRuleEntity
.
channelId
.
like
(
String
.
valueOf
(
channelRouteQueryVo
.
getChannelId
())
));
booleanExpression
=
booleanExpression
.
and
(
QChannelRuleEntity
.
channelRuleEntity
.
channelId
.
like
(
channelRouteQueryVo
.
getChannelId
()
+
"%"
));
}
}
if
(
Objects
.
nonNull
(
channelRouteQueryVo
.
getFundId
())){
if
(
Objects
.
nonNull
(
channelRouteQueryVo
.
getFundId
())){
booleanExpression
=
booleanExpression
.
and
(
QChannelRuleEntity
.
channelRuleEntity
.
fundId
.
like
(
String
.
valueOf
(
channelRouteQueryVo
.
getFundId
())
));
booleanExpression
=
booleanExpression
.
and
(
QChannelRuleEntity
.
channelRuleEntity
.
fundId
.
like
(
channelRouteQueryVo
.
getFundId
()
+
"%"
));
}
}
if
(!
StringUtils
.
isEmpty
(
channelRouteQueryVo
.
getFundName
())){
if
(!
StringUtils
.
isEmpty
(
channelRouteQueryVo
.
getFundName
())){
booleanExpression
=
booleanExpression
.
and
(
QChannelRuleEntity
.
channelRuleEntity
.
fundName
.
like
(
String
.
valueOf
(
channelRouteQueryVo
.
getFundName
())
));
booleanExpression
=
booleanExpression
.
and
(
QChannelRuleEntity
.
channelRuleEntity
.
fundName
.
like
(
channelRouteQueryVo
.
getFundName
()
+
"%"
));
}
}
if
(
Objects
.
nonNull
(
channelRouteQueryVo
.
getPublishStatus
())){
if
(
Objects
.
nonNull
(
channelRouteQueryVo
.
getPublishStatus
())){
booleanExpression
=
booleanExpression
.
and
(
QChannelRuleEntity
.
channelRuleEntity
.
publishStatus
.
eq
(
channelRouteQueryVo
.
getPublishStatus
()));
booleanExpression
=
booleanExpression
.
and
(
QChannelRuleEntity
.
channelRuleEntity
.
publishStatus
.
eq
(
channelRouteQueryVo
.
getPublishStatus
()));
...
...
src/main/java/com/quantgroup/asset/distribution/service/route/impl/FundProductServiceImpl.java
View file @
8c928509
...
@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSONArray;
...
@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.quantgroup.asset.distribution.config.code.AreaCode
;
import
com.quantgroup.asset.distribution.config.code.AreaCode
;
import
com.quantgroup.asset.distribution.config.code.InitAreaCode
;
import
com.quantgroup.asset.distribution.config.code.InitAreaCode
;
import
com.quantgroup.asset.distribution.constant.CommonConstants
;
import
com.quantgroup.asset.distribution.enums.route.SystemType
;
import
com.quantgroup.asset.distribution.enums.route.SystemType
;
import
com.quantgroup.asset.distribution.model.entity.route.fundproduct.*
;
import
com.quantgroup.asset.distribution.model.entity.route.fundproduct.*
;
import
com.quantgroup.asset.distribution.model.response.GlobalResponse
;
import
com.quantgroup.asset.distribution.model.response.GlobalResponse
;
...
@@ -30,17 +29,12 @@ import org.springframework.data.domain.Sort;
...
@@ -30,17 +29,12 @@ import org.springframework.data.domain.Sort;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
shaded.com.google.common.collect.Lists
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.sql.Timestamp
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.*
;
import
java.util.regex.Matcher
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
@Service
@Service
@Slf4j
@Slf4j
...
@@ -83,14 +77,15 @@ public class FundProductServiceImpl implements IFundProductService {
...
@@ -83,14 +77,15 @@ public class FundProductServiceImpl implements IFundProductService {
//索引 和 每页大小 排序 条件
//索引 和 每页大小 排序 条件
BooleanExpression
booleanExpression
=
Expressions
.
asBoolean
(
true
).
isTrue
();
BooleanExpression
booleanExpression
=
Expressions
.
asBoolean
(
true
).
isTrue
();
log
.
info
(
"fundId={}"
,
fundProductQueryVo
.
getFundId
());
if
(
Objects
.
nonNull
(
fundProductQueryVo
.
getFundId
())){
if
(
Objects
.
nonNull
(
fundProductQueryVo
.
getFundId
())){
booleanExpression
=
booleanExpression
.
and
(
QFundProductEntity
.
fundProductEntity
.
fundId
.
like
(
String
.
valueOf
(
fundProductQueryVo
.
getFundId
())
));
booleanExpression
=
booleanExpression
.
and
(
QFundProductEntity
.
fundProductEntity
.
fundId
.
like
(
fundProductQueryVo
.
getFundId
()
+
"%"
));
}
}
if
(
Objects
.
nonNull
(
fundProductQueryVo
.
getFundProId
())){
if
(
Objects
.
nonNull
(
fundProductQueryVo
.
getFundProId
())){
booleanExpression
=
booleanExpression
.
and
(
QFundProductEntity
.
fundProductEntity
.
fundProId
.
like
(
String
.
valueOf
(
fundProductQueryVo
.
getFundProId
())
));
booleanExpression
=
booleanExpression
.
and
(
QFundProductEntity
.
fundProductEntity
.
fundProId
.
like
(
fundProductQueryVo
.
getFundProId
()
+
"%"
));
}
}
if
(!
StringUtils
.
isEmpty
(
fundProductQueryVo
.
getFundName
())){
if
(!
StringUtils
.
isEmpty
(
fundProductQueryVo
.
getFundName
())){
booleanExpression
=
booleanExpression
.
and
(
QFundProductEntity
.
fundProductEntity
.
fundName
.
like
(
fundProductQueryVo
.
getFundName
()));
booleanExpression
=
booleanExpression
.
and
(
QFundProductEntity
.
fundProductEntity
.
fundName
.
like
(
fundProductQueryVo
.
getFundName
()
+
"%"
));
}
}
if
(!
StringUtils
.
isEmpty
(
fundProductQueryVo
.
getFundType
())){
if
(!
StringUtils
.
isEmpty
(
fundProductQueryVo
.
getFundType
())){
booleanExpression
=
booleanExpression
.
and
(
QFundProductEntity
.
fundProductEntity
.
fundType
.
eq
(
fundProductQueryVo
.
getFundType
()));
booleanExpression
=
booleanExpression
.
and
(
QFundProductEntity
.
fundProductEntity
.
fundType
.
eq
(
fundProductQueryVo
.
getFundType
()));
...
@@ -111,7 +106,7 @@ public class FundProductServiceImpl implements IFundProductService {
...
@@ -111,7 +106,7 @@ public class FundProductServiceImpl implements IFundProductService {
//查询总条数
//查询总条数
long
count
=
fundProductRepository
.
count
(
booleanExpression
);
long
count
=
fundProductRepository
.
count
(
booleanExpression
);
//查询数据
//查询数据
Page
<
FundProductEntity
>
plantPage
=
fundProductRepository
.
findAll
(
booleanExpression
,
new
PageRequest
(
fundProductQueryVo
.
getPageIndex
()-
1
,
fundProductQueryVo
.
getPageSize
(),
new
Sort
(
Sort
.
Direction
.
DESC
,
"
cre
atedAt"
)));
Page
<
FundProductEntity
>
plantPage
=
fundProductRepository
.
findAll
(
booleanExpression
,
new
PageRequest
(
fundProductQueryVo
.
getPageIndex
()-
1
,
fundProductQueryVo
.
getPageSize
(),
new
Sort
(
Sort
.
Direction
.
DESC
,
"
upd
atedAt"
)));
List
<
FundProductEntity
>
fundProductEntities
=
new
ArrayList
<>();
List
<
FundProductEntity
>
fundProductEntities
=
new
ArrayList
<>();
fundProductEntities
=
plantPage
.
getContent
();
fundProductEntities
=
plantPage
.
getContent
();
...
...
src/main/java/com/quantgroup/asset/distribution/service/route/impl/WhiteListServiceImpl.java
View file @
8c928509
...
@@ -43,7 +43,7 @@ public class WhiteListServiceImpl implements IWhiteListService {
...
@@ -43,7 +43,7 @@ public class WhiteListServiceImpl implements IWhiteListService {
booleanExpression
=
booleanExpression
.
and
(
QWhiteListEntity
.
whiteListEntity
.
phone
.
eq
(
String
.
valueOf
(
whiteListQueryVo
.
getPhone
())));
booleanExpression
=
booleanExpression
.
and
(
QWhiteListEntity
.
whiteListEntity
.
phone
.
eq
(
String
.
valueOf
(
whiteListQueryVo
.
getPhone
())));
}
}
if
(!
StringUtils
.
isEmpty
(
whiteListQueryVo
.
getFundName
())){
if
(!
StringUtils
.
isEmpty
(
whiteListQueryVo
.
getFundName
())){
booleanExpression
=
booleanExpression
.
and
(
QWhiteListEntity
.
whiteListEntity
.
fundName
.
like
(
String
.
valueOf
(
whiteListQueryVo
.
getFundName
())
));
booleanExpression
=
booleanExpression
.
and
(
QWhiteListEntity
.
whiteListEntity
.
fundName
.
like
(
whiteListQueryVo
.
getFundName
()
+
"%"
));
}
}
//1.查询条件,2.索引和每页的大小,3.排序根据某个字段进行排序
//1.查询条件,2.索引和每页的大小,3.排序根据某个字段进行排序
...
...
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