Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-dj-strategy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1d753edf
authored
Jun 29, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 客户消费力标签当获取两个值都是0的时候不入库
1 parent
ac580393
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/CustomerTagProfileService.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/CustomerTagProfileService.java
View file @
1d753ed
...
@@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
...
@@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -476,21 +477,24 @@ public class CustomerTagProfileService {
...
@@ -476,21 +477,24 @@ public class CustomerTagProfileService {
BigDecimal
lowerPrice
=
carSeriesDetail
.
getLowerPrice
();
BigDecimal
lowerPrice
=
carSeriesDetail
.
getLowerPrice
();
BigDecimal
higherPrice
=
carSeriesDetail
.
getHigherPrice
();
BigDecimal
higherPrice
=
carSeriesDetail
.
getHigherPrice
();
if
(
lowerPrice
==
null
&&
higherPrice
==
null
)
{
// 两个价格都无效(null或0)时返回null
boolean
lowerInvalid
=
lowerPrice
==
null
||
lowerPrice
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
;
boolean
higherInvalid
=
higherPrice
==
null
||
higherPrice
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
;
if
(
lowerInvalid
&&
higherInvalid
)
{
return
null
;
return
null
;
}
}
//
如果只有一个
价格,使用该价格
//
只有一个有效
价格,使用该价格
if
(
lower
Price
==
null
)
{
if
(
lower
Invalid
)
{
return
higherPrice
.
multiply
(
new
BigDecimal
(
"10000"
));
return
higherPrice
.
multiply
(
new
BigDecimal
(
"10000"
));
}
}
if
(
higher
Price
==
null
)
{
if
(
higher
Invalid
)
{
return
lowerPrice
.
multiply
(
new
BigDecimal
(
"10000"
));
return
lowerPrice
.
multiply
(
new
BigDecimal
(
"10000"
));
}
}
//
计算平均价格:((lowerPrice + higherPrice) / 2) * 10000
//
两个价格都有效,计算平均价格
return
lowerPrice
.
add
(
higherPrice
)
return
lowerPrice
.
add
(
higherPrice
)
.
divide
(
new
BigDecimal
(
"2"
),
2
,
BigDecimal
.
ROUND_
HALF_UP
)
.
divide
(
new
BigDecimal
(
"2"
),
2
,
RoundingMode
.
HALF_UP
)
.
multiply
(
new
BigDecimal
(
"10000"
));
.
multiply
(
new
BigDecimal
(
"10000"
));
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment