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
87e23541
Commit
87e23541
authored
Aug 14, 2021
by
hanghang.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
满减购物车提示语
parent
6bae514b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
11 deletions
+50
-11
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullPromotionService.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/FullSharingService.java
+48
-9
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullPromotionService.java
View file @
87e23541
...
@@ -282,7 +282,7 @@ public class FullPromotionService implements IPromotionService {
...
@@ -282,7 +282,7 @@ public class FullPromotionService implements IPromotionService {
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_11
.
getCode
(),
activityResponseDto
.
getActivityType
())
||
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_12
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_11
.
getCode
(),
activityResponseDto
.
getActivityType
())
||
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_12
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
if
(
activityPrompt
.
getAlreadyDiscountAmount
()
==
null
||
activityPrompt
.
getAlreadyDiscountAmount
()
==
0
)
{
if
(
activityPrompt
.
getAlreadyDiscountAmount
()
==
null
||
activityPrompt
.
getAlreadyDiscountAmount
()
==
0
)
{
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activity
Prompt
.
getPreferential
Type
())){
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activity
ResponseDto
.
getCoupon
Type
())){
// 满足 X 元/件 减 Y 元 还差 Z元
// 满足 X 元/件 减 Y 元 还差 Z元
satisfyList
.
setTipType
(
ActivityPromptEnum
.
TipTypeEnum
.
ELEVEN
.
getCode
());
satisfyList
.
setTipType
(
ActivityPromptEnum
.
TipTypeEnum
.
ELEVEN
.
getCode
());
satisfyList
.
setSatisfy
(
activityPrompt
.
getThresholdQuantity
().
toString
());
satisfyList
.
setSatisfy
(
activityPrompt
.
getThresholdQuantity
().
toString
());
...
@@ -305,7 +305,7 @@ public class FullPromotionService implements IPromotionService {
...
@@ -305,7 +305,7 @@ public class FullPromotionService implements IPromotionService {
}
else
{
}
else
{
toDiscountAmout
=
activityPrompt
.
getDiscountAmout
();
toDiscountAmout
=
activityPrompt
.
getDiscountAmout
();
}
}
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activity
Prompt
.
getPreferential
Type
())){
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activity
ResponseDto
.
getCoupon
Type
())){
//已减 X 元 再买 Y 元 减 Z 元
//已减 X 元 再买 Y 元 减 Z 元
satisfyList
.
setTipType
(
ActivityPromptEnum
.
TipTypeEnum
.
TWELVE
.
getCode
());
satisfyList
.
setTipType
(
ActivityPromptEnum
.
TipTypeEnum
.
TWELVE
.
getCode
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
).
toString
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/FullSharingService.java
View file @
87e23541
...
@@ -11,6 +11,7 @@ import cn.freemud.entities.vo.ActivityList;
...
@@ -11,6 +11,7 @@ import cn.freemud.entities.vo.ActivityList;
import
cn.freemud.entities.vo.ActivityTip
;
import
cn.freemud.entities.vo.ActivityTip
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.ShoppingCartGoodsResponseVo
;
import
cn.freemud.entities.vo.ShoppingCartGoodsResponseVo
;
import
cn.freemud.enums.ActivityPromptEnum
;
import
cn.freemud.enums.ActivityTypeEnum
;
import
cn.freemud.enums.ActivityTypeEnum
;
import
cn.freemud.enums.GiftTypeEnum
;
import
cn.freemud.enums.GiftTypeEnum
;
import
cn.freemud.service.ActivityService
;
import
cn.freemud.service.ActivityService
;
...
@@ -233,6 +234,27 @@ public class FullSharingService {
...
@@ -233,6 +234,27 @@ public class FullSharingService {
}
}
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
()))
{
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
())){
// todo
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> "
)
.
append
(
"最高减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getMaxMoney
()
*
1.00
/
100
))
.
append
(
"</span> 元"
);
//满足 x 元 减 Y 元 ,最高 减 Z元
ActivityList
notInShopping
=
new
ActivityList
();
notInShopping
.
setTipType
(
15
);
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
{
// todo
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\">"
)
...
@@ -249,27 +271,44 @@ public class FullSharingService {
...
@@ -249,27 +271,44 @@ public class FullSharingService {
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setMaxDeduct
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getMaxMoney
()
*
1.00
/
100
).
toString
());
notInShopping
.
setMaxDeduct
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getMaxMoney
()
*
1.00
/
100
).
toString
());
activityList
.
add
(
notInShopping
);
activityList
.
add
(
notInShopping
);
}
}
}
else
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_12
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
else
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
--)
{
for
(
int
i
=
len
-
1
;
i
>=
0
;
i
--)
{
benefitBeanDto
=
benefitBeanDtos
.
get
(
i
);
benefitBeanDto
=
benefitBeanDtos
.
get
(
i
);
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
))
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
.
append
(
benefitBeanDto
.
getBenefitNumber
())
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span>件 减 <span style=\"color:#fa5555\">"
)
.
append
(
"</span> 元"
);
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元"
);
}
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> 元"
);
}
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
--)
{
benefitBeanDto
=
benefitBeanDtos
.
get
(
j
);
benefitBeanDto
=
benefitBeanDtos
.
get
(
j
);
ActivityList
notInShopping
=
new
ActivityList
();
ActivityList
notInShopping
=
new
ActivityList
();
notInShopping
.
setTipType
(
2
);
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
notInShopping
.
setSatisfy
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setTipType
(
16
);
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setSatisfy
(
benefitBeanDto
.
getBenefitNumber
().
toString
());
activityList
.
add
(
notInShopping
);
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
}
else
{
notInShopping
.
setTipType
(
2
);
notInShopping
.
setSatisfy
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
}
activityList
.
add
(
notInShopping
);
}
}
}
}
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_230
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_230
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
...
...
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