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
7d9d1705
Commit
7d9d1705
authored
Aug 23, 2021
by
hanghang.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
满减购物车提示语
parent
250d90e2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
8 deletions
+33
-8
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/ActivityCalculationDiscountResponseDto.java
+5
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ActivityList.java
+3
-0
shopping-cart-application-service/src/main/java/cn/freemud/enums/ActivityPromptEnum.java
+3
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullPromotionService.java
+19
-6
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullSubtractionActivityServiceImpl.java
+3
-0
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/ActivityCalculationDiscountResponseDto.java
View file @
7d9d1705
...
...
@@ -184,6 +184,11 @@ public class ActivityCalculationDiscountResponseDto {
* 门槛件数
*/
private
Integer
thresholdQuantity
;
/**
* 门槛启用金额 满足多少钱,参与件数活动
*/
private
Integer
invokeAmount
;
}
@Data
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ActivityList.java
View file @
7d9d1705
...
...
@@ -61,6 +61,9 @@ public class ActivityList {
private
List
<
McCafeSendGoods
>
mcCafeSendGoodsList
;
//满足多少 参与活动
private
String
invokeAmount
;
@Data
public
static
class
SendGoods
{
private
Integer
qty
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/enums/ActivityPromptEnum.java
View file @
7d9d1705
...
...
@@ -88,9 +88,10 @@ public class ActivityPromptEnum {
EIGHT
(
8
,
""
),
TEN
(
10
,
""
),
ELEVEN
(
11
,
"满足 X 件 减 Y 元 还差 Z元"
),
ELEVEN
(
11
,
"
购买in 元以上的商品可参与
满足 X 件 减 Y 元 还差 Z元"
),
TWELVE
(
12
,
"已减 X 元 再买 Y 件 减 Z 元"
),
THIRTEEN
(
13
,
"购买in 元以上的商品可参与 满足 X 件 减 Y 元 还差 Z元"
),
FOURTEEN
(
14
,
"已减 X 元 再买 Y 件 减 Z 元"
),
FIFTEEN
(
15
,
"每满 : 每满 x 件 减 Y 元 ,最高 减 Z元"
),
SIXTEEN
(
16
,
"每满 : 每满 x 件 减 Y 元 ,最高 减 Z元"
),
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullPromotionService.java
View file @
7d9d1705
...
...
@@ -146,8 +146,11 @@ public class FullPromotionService implements IPromotionService {
//此处的getCouponType == getPreferentialType 优惠类型
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
messageBuilder
.
append
(
"每满 <span style=\"color:#fa5555\">"
)
messageBuilder
.
append
(
"购买 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
)
)
.
append
(
" 元以上的商品可参与 <span style=\"color:#fa5555\">"
)
.
append
(
"每满 <span style=\"color:#fa5555\">"
)
.
append
(
benefitBeanDto
.
getBenefitNumber
())
.
append
(
"</span>件 减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
))
...
...
@@ -158,11 +161,11 @@ public class FullPromotionService implements IPromotionService {
//满足 x 元 减 Y 元 ,最高 减 Z元
ActivityList
notInShopping
=
new
ActivityList
();
notInShopping
.
setTipType
(
13
);
notInShopping
.
setTipType
(
ActivityPromptEnum
.
TipTypeEnum
.
THIRTEEN
.
getCode
()
);
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
);
notInShopping
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
activityList
.
add
(
notInShopping
);
}
else
{
messageBuilder
.
append
(
"每满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
))
...
...
@@ -188,7 +191,14 @@ public class FullPromotionService implements IPromotionService {
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\">"
)
messageBuilder
.
append
(
"购买 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
)
)
.
append
(
" 元以上的商品可参与 <span style=\"color:#fa5555\">"
)
.
append
(
"购买 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
)
)
.
append
(
" 元以上的商品可参与 <span style=\"color:#fa5555\">"
)
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
benefitBeanDto
.
getBenefitNumber
())
.
append
(
"</span> 件减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
))
...
...
@@ -199,9 +209,10 @@ public class FullPromotionService implements IPromotionService {
for
(
int
j
=
len
-
1
;
j
>=
0
;
j
--)
{
benefitBeanDto
=
benefitBeanDtos
.
get
(
j
);
cn
.
freemud
.
entities
.
vo
.
ActivityList
notInShopping
=
new
ActivityList
();
notInShopping
.
setTipType
(
14
);
notInShopping
.
setTipType
(
ActivityPromptEnum
.
TipTypeEnum
.
FOURTEEN
.
getCode
()
);
notInShopping
.
setSatisfy
(
benefitBeanDto
.
getBenefitNumber
().
toString
());
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
activityList
.
add
(
notInShopping
);
}
}
else
{
...
...
@@ -277,6 +288,7 @@ public class FullPromotionService implements IPromotionService {
satisfyList
.
setSatisfy
(
activityPrompt
.
getThresholdQuantity
().
toString
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
).
toString
());
satisfyList
.
setMissing
(
String
.
valueOf
(
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
()));
satisfyList
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityPrompt
.
getInvokeAmount
()
*
1.00
/
100
).
toString
());
}
else
{
// 满足 X 元 减 Y 元 还差 Z元
satisfyList
.
setTipType
(
ActivityPromptEnum
.
TipTypeEnum
.
THREE
.
getCode
());
...
...
@@ -299,6 +311,7 @@ public class FullPromotionService implements IPromotionService {
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setAgainBuy
(
String
.
valueOf
(
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
()));
satisfyList
.
setAgianDeduct
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
).
toString
());
satisfyList
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityPrompt
.
getInvokeAmount
()
*
1.00
/
100
).
toString
());
}
else
{
//已减 X 元 再买 Y 元 减 Z 元
satisfyList
.
setTipType
(
ActivityPromptEnum
.
TipTypeEnum
.
FOUR
.
getCode
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullSubtractionActivityServiceImpl.java
View file @
7d9d1705
...
...
@@ -88,6 +88,7 @@ public class FullSubtractionActivityServiceImpl {
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
());
notInShopping
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
activityList
.
add
(
notInShopping
);
arrayList
.
add
(
notInShopping
);
}
else
{
...
...
@@ -140,6 +141,8 @@ public class FullSubtractionActivityServiceImpl {
notInShopping
.
setTipType
(
ActivityPromptEnum
.
TipTypeEnum
.
SIXTEEN
.
getCode
());
notInShopping
.
setSatisfy
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getBenefitNumber
()
*
1.00
/
100
).
toString
());
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
activityList
.
add
(
notInShopping
);
arrayList
.
add
(
notInShopping
);
}
else
{
...
...
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