Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
fffc253f
Commit
fffc253f
authored
Aug 05, 2021
by
hanghang.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
促销满减活动提示语优化
parent
4382fc9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
17 deletions
+65
-17
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/BenefitBeanDto.java
+2
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullPromotionService.java
+63
-17
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/BenefitBeanDto.java
View file @
fffc253f
...
@@ -17,6 +17,8 @@ public class BenefitBeanDto implements Comparable<BenefitBeanDto>{
...
@@ -17,6 +17,8 @@ public class BenefitBeanDto implements Comparable<BenefitBeanDto>{
* 优惠门槛(分)
* 优惠门槛(分)
*/
*/
private
Integer
thresholdAmount
;
private
Integer
thresholdAmount
;
private
Integer
benefitNumber
;
/**
/**
* 优惠金额(分)
* 优惠金额(分)
*/
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullPromotionService.java
View file @
fffc253f
...
@@ -142,34 +142,79 @@ public class FullPromotionService implements IPromotionService {
...
@@ -142,34 +142,79 @@ public class FullPromotionService implements IPromotionService {
}
}
BenefitBeanDto
benefitBeanDto
=
benefitBeanDtos
.
get
(
0
);
BenefitBeanDto
benefitBeanDto
=
benefitBeanDtos
.
get
(
0
);
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_11
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_11
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
messageBuilder
.
append
(
"每满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> "
)
.
append
(
"最高减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getMaxMoney
()
*
1.00
/
100
))
.
append
(
"</span> 元"
);
//满足 x 元 减 Y 元 ,最高 减 Z元
//此处的getCouponType == getPreferentialType 优惠类型
ActivityList
notInShopping
=
new
ActivityList
();
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
notInShopping
.
setTipType
(
1
);
notInShopping
.
setSatisfy
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
messageBuilder
.
append
(
"每满 <span style=\"color:#fa5555\">"
)
notInShopping
.
setMaxDeduct
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getMaxMoney
()
*
1.00
/
100
).
toString
());
.
append
(
benefitBeanDto
.
getBenefitNumber
())
activityList
.
add
(
notInShopping
);
.
append
(
"</span>件 减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> "
)
.
append
(
"元 最高减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getMaxMoney
()
*
1.00
/
100
))
.
append
(
"</span> 元"
);
//满足 x 元 减 Y 元 ,最高 减 Z元
ActivityList
notInShopping
=
new
ActivityList
();
notInShopping
.
setTipType
(
13
);
notInShopping
.
setSatisfy
(
benefitBeanDto
.
getBenefitNumber
().
toString
());
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setMaxDeduct
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getMaxMoney
()
*
1.00
/
100
).
toString
());
activityList
.
add
(
notInShopping
);
}
else
{
messageBuilder
.
append
(
"每满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> "
)
.
append
(
"最高减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getMaxMoney
()
*
1.00
/
100
))
.
append
(
"</span> 元"
);
//满足 x 元 减 Y 元 ,最高 减 Z元
ActivityList
notInShopping
=
new
ActivityList
();
notInShopping
.
setTipType
(
1
);
notInShopping
.
setSatisfy
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setMaxDeduct
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getMaxMoney
()
*
1.00
/
100
).
toString
());
activityList
.
add
(
notInShopping
);
}
}
}
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_12
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_12
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
int
len
=
benefitBeanDtos
.
size
();
int
len
=
benefitBeanDtos
.
size
();
// // 购物车中无商品或者存在与满减互斥的活动
// // 购物车中无商品或者存在与满减互斥的活动
for
(
int
i
=
len
-
1
;
i
>=
0
;
i
--)
{
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
for
(
int
i
=
len
-
1
;
i
>=
0
;
i
--)
{
benefitBeanDto
=
benefitBeanDtos
.
get
(
i
);
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
benefitBeanDto
.
getBenefitNumber
())
.
append
(
"</span> 件减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元"
);
if
(
i
>
0
)
{
messageBuilder
.
append
(
","
);}
}
// 阶梯满减:满足 X 元 减 Y 元,
for
(
int
j
=
len
-
1
;
j
>=
0
;
j
--)
{
benefitBeanDto
=
benefitBeanDtos
.
get
(
j
);
cn
.
freemud
.
entities
.
vo
.
ActivityList
notInShopping
=
new
ActivityList
();
notInShopping
.
setTipType
(
14
);
notInShopping
.
setSatisfy
(
benefitBeanDto
.
getBenefitNumber
().
toString
());
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
activityList
.
add
(
notInShopping
);
}
}
else
{
for
(
int
i
=
len
-
1
;
i
>=
0
;
i
--)
{
benefitBeanDto
=
benefitBeanDtos
.
get
(
i
);
benefitBeanDto
=
benefitBeanDtos
.
get
(
i
);
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
))
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元"
);
.
append
(
"</span> 元"
);
if
(
i
>
0
)
messageBuilder
.
append
(
","
);
if
(
i
>
0
)
{
messageBuilder
.
append
(
","
);
}
}
}
// 阶梯满减:满足 X 元 减 Y 元,
// 阶梯满减:满足 X 元 减 Y 元,
for
(
int
j
=
len
-
1
;
j
>=
0
;
j
--)
{
for
(
int
j
=
len
-
1
;
j
>=
0
;
j
--)
{
...
@@ -180,6 +225,7 @@ public class FullPromotionService implements IPromotionService {
...
@@ -180,6 +225,7 @@ public class FullPromotionService implements IPromotionService {
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
activityList
.
add
(
notInShopping
);
activityList
.
add
(
notInShopping
);
}
}
}
}
}
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_230
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_230
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
ActivityList
notInShopping
=
new
ActivityList
();
ActivityList
notInShopping
=
new
ActivityList
();
...
...
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