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
a760f939
Commit
a760f939
authored
Aug 15, 2021
by
hanghang.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
满减购物车提示语
parent
87e23541
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
269 additions
and
7 deletions
+269
-7
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/BenefitBeanBO.java
+2
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/CalculationDiscountBO.java
+9
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractAddGoodsService.java
+37
-1
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractApportionService.java
+2
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/MessageServiceImpl.java
+70
-2
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/ActivityCalculationDiscountResponseDto.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/calculate/CalculationSharingDiscountResponseDto.java
+12
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullSubtractionActivityServiceImpl.java
+35
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/FullSharingService.java
+38
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/FullPromotionCalculation.java
+63
-1
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/BenefitBeanBO.java
View file @
a760f939
...
...
@@ -16,6 +16,8 @@ public class BenefitBeanBO implements Comparable<BenefitBeanBO>{
* 优惠门槛(分)
*/
private
Integer
thresholdAmount
;
private
Integer
benefitNumber
;
/**
* 优惠金额(分)
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/CalculationDiscountBO.java
View file @
a760f939
...
...
@@ -118,7 +118,16 @@ public class CalculationDiscountBO {
private
Long
totalAmount
;
private
Long
alreadyDiscountAmount
;
private
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
SendGoods
>
sendGoods
;
/**
* 门槛件数
*/
private
Integer
thresholdQuantity
;
private
Integer
totalQuantity
;
/**
* 门槛启用金额 满足多少钱,参与件数活动
*/
private
Integer
invokeAmount
;
}
@Data
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractAddGoodsService.java
View file @
a760f939
...
...
@@ -609,6 +609,23 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
CalculationDiscountBO
.
CalculationDiscountResult
.
ActivityPrompt
activityPrompt
=
activityPrompts
.
get
(
0
);
if
(
activityPrompt
.
getAlreadyDiscountAmount
()
==
null
||
activityPrompt
.
getAlreadyDiscountAmount
()
==
0
)
{
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
activityPrompt
.
getThresholdQuantity
())
.
append
(
"</span>件 减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
))
.
append
(
"</span> "
)
.
append
(
"还差 <span style=\"color:#fa5555\">"
)
.
append
(
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())
.
append
(
"</span> 件"
);
// 满足 X 元 减 Y 元 还差 Z元
satisfyList
.
setTipType
(
12
);
satisfyList
.
setSatisfy
(
activityPrompt
.
getThresholdQuantity
().
toString
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
).
toString
());
satisfyList
.
setMissing
((
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())+
""
);
satisfyList
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
}
else
{
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
...
...
@@ -622,6 +639,8 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
satisfyList
.
setSatisfy
(
WebUtil
.
formatAmount
(
activityPrompt
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
).
toString
());
satisfyList
.
setMissing
(
WebUtil
.
formatAmount
((
activityPrompt
.
getThresholdAmount
()
-
activityPrompt
.
getTotalAmount
())
*
1.00
/
100
).
toString
());
}
}
else
{
Long
toDiscountAmout
;
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_11
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
...
...
@@ -629,7 +648,21 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
}
else
{
toDiscountAmout
=
activityPrompt
.
getDiscountAmout
();
}
//已减 X 元 再买 Y 元 减 Z 元
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
messageBuilder
.
append
(
"已减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元 再买 <span style=\"color:#fa5555\">"
)
.
append
(
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())
.
append
(
"</span> 件减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
))
.
append
(
"</span> 元"
);
satisfyList
.
setTipType
(
12
);
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setAgainBuy
((
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())+
""
);
satisfyList
.
setAgianDeduct
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
).
toString
());
satisfyList
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
}
else
{
messageBuilder
.
append
(
"已减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元 再买 <span style=\"color:#fa5555\">"
)
...
...
@@ -641,6 +674,9 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setAgainBuy
(
WebUtil
.
formatAmount
((
activityPrompt
.
getThresholdAmount
()
-
activityPrompt
.
getTotalAmount
())
*
1.00
/
100
).
toString
());
satisfyList
.
setAgianDeduct
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
).
toString
());
}
//已减 X 元 再买 Y 元 减 Z 元
}
result
.
add
(
satisfyList
);
return
result
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractApportionService.java
View file @
a760f939
...
...
@@ -1169,6 +1169,8 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
ArrayList
<
ActivityList
>
activityList
=
new
ArrayList
<>();
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_11
.
getCode
(),
activityBO
.
getActivityType
()))
{
messageBuilder
.
append
(
"每满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/MessageServiceImpl.java
View file @
a760f939
...
...
@@ -7,6 +7,7 @@ import cn.freemud.demo.service.MessageService;
import
cn.freemud.entities.dto.BenefitBeanDto
;
import
cn.freemud.entities.dto.calculate.CalculationSharingDiscountResponseDto
;
import
cn.freemud.entities.vo.ActivityList
;
import
cn.freemud.enums.ActivityPromptEnum
;
import
cn.freemud.enums.ActivityTypeEnum
;
import
cn.freemud.enums.GiftTypeEnum
;
import
cn.freemud.utils.WebUtil
;
...
...
@@ -56,9 +57,11 @@ public class MessageServiceImpl implements MessageService {
ArrayList
<
ActivityList
>
activityList
=
new
ArrayList
<>();
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_11
.
getCode
(),
activityBO
.
getActivityType
()))
{
ActivityList
notInShopping
=
new
ActivityList
();
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityBO
.
getCouponType
()))
{
messageBuilder
.
append
(
"每满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
"</span>
减 <span style=\"color:#fa5555\">"
)
.
append
(
"</span>件
减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> "
)
.
append
(
"最高减 <span style=\"color:#fa5555\">"
)
...
...
@@ -66,11 +69,26 @@ public class MessageServiceImpl implements MessageService {
.
append
(
"</span> 元"
);
//满足 x 元 减 Y 元 ,最高 减 Z元
ActivityList
notInShopping
=
new
ActivityList
();
notInShopping
.
setTipType
(
13
);
notInShopping
.
setSatisfy
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setMaxDeduct
(
WebUtil
.
formatAmount
(
activityBO
.
getMaxMoney
()
*
1.00
/
100
).
toString
());
notInShopping
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityBO
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
}
else
{
messageBuilder
.
append
(
"每满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> "
)
.
append
(
"最高减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityBO
.
getMaxMoney
()
*
1.00
/
100
))
.
append
(
"</span> 元"
);
//满足 x 元 减 Y 元 ,最高 减 Z元
notInShopping
.
setTipType
(
1
);
notInShopping
.
setSatisfy
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setMaxDeduct
(
WebUtil
.
formatAmount
(
activityBO
.
getMaxMoney
()
*
1.00
/
100
).
toString
());
}
activityList
.
add
(
notInShopping
);
}
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_12
.
getCode
(),
activityBO
.
getActivityType
()))
{
...
...
@@ -78,20 +96,36 @@ public class MessageServiceImpl implements MessageService {
// // 购物车中无商品或者存在与满减互斥的活动
for
(
int
i
=
len
-
1
;
i
>=
0
;
i
--)
{
benefitBeanBO
=
benefitBeanBOList
.
get
(
i
);
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityBO
.
getCouponType
()))
{
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
benefitBeanBO
.
getBenefitNumber
())
.
append
(
"</span>件 减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元"
);
}
else
{
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元"
);
}
if
(
i
>
0
)
messageBuilder
.
append
(
","
);
}
// 阶梯满减:满足 X 元 减 Y 元,
for
(
int
j
=
len
-
1
;
j
>=
0
;
j
--)
{
benefitBeanBO
=
benefitBeanBOList
.
get
(
j
);
ActivityList
notInShopping
=
new
ActivityList
();
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityBO
.
getCouponType
()))
{
notInShopping
.
setTipType
(
14
);
notInShopping
.
setSatisfy
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityBO
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
}
else
{
notInShopping
.
setTipType
(
2
);
notInShopping
.
setSatisfy
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
notInShopping
.
setDeduct
(
WebUtil
.
formatAmount
(
benefitBeanBO
.
getDiscountAmount
()
*
1.00
/
100
).
toString
());
}
activityList
.
add
(
notInShopping
);
}
}
...
...
@@ -138,6 +172,23 @@ public class MessageServiceImpl implements MessageService {
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
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
activityPrompt
.
getThresholdQuantity
())
.
append
(
"</span>件 减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
))
.
append
(
"</span> "
)
.
append
(
"还差 <span style=\"color:#fa5555\">"
)
.
append
((
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())
+
""
)
.
append
(
"</span> 件"
);
// 满足 X 元 减 Y 元 还差 Z元
satisfyList
.
setTipType
(
ActivityPromptEnum
.
TipTypeEnum
.
ELEVEN
.
getCode
());
satisfyList
.
setSatisfy
(
activityPrompt
.
getThresholdQuantity
().
toString
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
).
toString
());
satisfyList
.
setMissing
(
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
()
+
""
);
satisfyList
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
}
else
{
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
...
...
@@ -151,6 +202,7 @@ public class MessageServiceImpl implements MessageService {
satisfyList
.
setSatisfy
(
WebUtil
.
formatAmount
(
activityPrompt
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
).
toString
());
satisfyList
.
setMissing
(
WebUtil
.
formatAmount
((
activityPrompt
.
getThresholdAmount
()
-
activityPrompt
.
getTotalAmount
())
*
1.00
/
100
).
toString
());
}
}
else
{
Long
toDiscountAmout
;
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_11
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
...
...
@@ -159,6 +211,20 @@ public class MessageServiceImpl implements MessageService {
toDiscountAmout
=
activityPrompt
.
getDiscountAmout
();
}
//已减 X 元 再买 Y 元 减 Z 元
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
messageBuilder
.
append
(
"已减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元 再买 <span style=\"color:#fa5555\">"
)
.
append
(
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())
.
append
(
"</span> 件减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
))
.
append
(
"</span> 元"
);
satisfyList
.
setTipType
(
ActivityPromptEnum
.
TipTypeEnum
.
TWELVE
.
getCode
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setAgainBuy
((
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())
+
""
);
satisfyList
.
setAgianDeduct
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
).
toString
());
satisfyList
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
}
else
{
messageBuilder
.
append
(
"已减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元 再买 <span style=\"color:#fa5555\">"
)
...
...
@@ -171,6 +237,8 @@ public class MessageServiceImpl implements MessageService {
satisfyList
.
setAgainBuy
(
WebUtil
.
formatAmount
((
activityPrompt
.
getThresholdAmount
()
-
activityPrompt
.
getTotalAmount
())
*
1.00
/
100
).
toString
());
satisfyList
.
setAgianDeduct
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
).
toString
());
}
}
}
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_230
.
getCode
(),
activityResponseDto
.
getActivityType
())
&&
CollectionUtils
.
isNotEmpty
(
activityPrompt
.
getSendGoods
()))
{
satisfyList
.
setTipType
(
10
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/ActivityCalculationDiscountResponseDto.java
View file @
a760f939
...
...
@@ -189,6 +189,7 @@ public class ActivityCalculationDiscountResponseDto {
* 门槛启用金额 满足多少钱,参与件数活动
*/
private
Integer
invokeAmount
;
}
@Data
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/calculate/CalculationSharingDiscountResponseDto.java
View file @
a760f939
...
...
@@ -121,6 +121,18 @@ public class CalculationSharingDiscountResponseDto {
private
Long
alreadyDiscountAmount
;
private
Integer
activitySubType
;
private
List
<
SendGoods
>
sendGoods
;
/**
* 门槛件数
*/
private
Integer
thresholdQuantity
;
private
Integer
totalQuantity
;
/**
* 门槛启用金额 满足多少钱,参与件数活动
*/
private
Integer
invokeAmount
;
}
@Data
public
static
class
SendGoods
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullSubtractionActivityServiceImpl.java
View file @
a760f939
...
...
@@ -197,6 +197,24 @@ public class FullSubtractionActivityServiceImpl {
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
ActivityPrompt
activityPrompt
=
activityPrompts
.
get
(
0
);
ActivityList
satisfyList
=
new
ActivityList
();
if
(
activityPrompt
.
getAlreadyDiscountAmount
()
==
null
||
activityPrompt
.
getAlreadyDiscountAmount
()
==
0
)
{
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
activityPrompt
.
getThresholdQuantity
().
toString
())
.
append
(
"</span>件 减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
))
.
append
(
"</span> "
)
.
append
(
"还差 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
((
activityPrompt
.
getThresholdAmount
()
-
activityPrompt
.
getTotalAmount
())
*
1.00
/
100
))
.
append
(
"</span> 元"
);
// 满足 X 元 减 Y 元 还差 Z元
satisfyList
.
setTipType
(
11
);
satisfyList
.
setSatisfy
(
activityPrompt
.
getThresholdQuantity
().
toString
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
).
toString
());
satisfyList
.
setMissing
(
WebUtil
.
formatAmount
((
activityPrompt
.
getThresholdAmount
()
-
activityPrompt
.
getTotalAmount
())
*
1.00
/
100
).
toString
());
satisfyList
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
}
else
{
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
...
...
@@ -210,7 +228,7 @@ public class FullSubtractionActivityServiceImpl {
satisfyList
.
setSatisfy
(
WebUtil
.
formatAmount
(
activityPrompt
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
).
toString
());
satisfyList
.
setMissing
(
WebUtil
.
formatAmount
((
activityPrompt
.
getThresholdAmount
()
-
activityPrompt
.
getTotalAmount
())
*
1.00
/
100
).
toString
());
}
}
}
else
{
Long
toDiscountAmout
;
//每满减
...
...
@@ -222,7 +240,20 @@ public class FullSubtractionActivityServiceImpl {
}
else
{
toDiscountAmout
=
activityPrompt
.
getDiscountAmout
();
}
//已减 X 元 再买 Y 元 减 Z 元
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
messageBuilder
.
append
(
"已减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 再买 <span style=\"color:#fa5555\">"
)
.
append
(
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())
.
append
(
"</span> 件减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
))
.
append
(
"</span> 元"
);
satisfyList
.
setTipType
(
12
);
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setAgainBuy
((
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())+
""
);
satisfyList
.
setAgianDeduct
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
).
toString
());
satisfyList
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
}
else
{
messageBuilder
.
append
(
"已减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元 再买 <span style=\"color:#fa5555\">"
)
...
...
@@ -235,6 +266,8 @@ public class FullSubtractionActivityServiceImpl {
satisfyList
.
setAgainBuy
(
WebUtil
.
formatAmount
((
activityPrompt
.
getThresholdAmount
()
-
activityPrompt
.
getTotalAmount
())
*
1.00
/
100
).
toString
());
satisfyList
.
setAgianDeduct
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
).
toString
());
}
//已减 X 元 再买 Y 元 减 Z 元
}
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_230
.
getCode
(),
activityResponseDto
.
getActivityType
())
&&
CollectionUtils
.
isNotEmpty
(
activityPrompt
.
getSendGoods
()))
{
satisfyList
.
setTipType
(
10
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/FullSharingService.java
View file @
a760f939
...
...
@@ -252,6 +252,7 @@ public class FullSharingService {
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
);
}
else
{
// todo
...
...
@@ -302,7 +303,7 @@ public class FullSharingService {
notInShopping
.
setTipType
(
16
);
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
()
);
}
else
{
notInShopping
.
setTipType
(
2
);
notInShopping
.
setSatisfy
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
...
...
@@ -353,6 +354,23 @@ public class FullSharingService {
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
ActivityPrompt
activityPrompt
=
activityPrompts
.
get
(
0
);
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
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
activityPrompt
.
getThresholdQuantity
())
.
append
(
"</span>件 减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
))
.
append
(
"</span> "
)
.
append
(
"还差 <span style=\"color:#fa5555\">"
)
.
append
((
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())
)
.
append
(
"</span> 元"
);
// 满足 X 元 减 Y 元 还差 Z元
satisfyList
.
setTipType
(
11
);
satisfyList
.
setSatisfy
(
activityPrompt
.
getThresholdQuantity
().
toString
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
).
toString
());
satisfyList
.
setMissing
((
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())+
""
);
satisfyList
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
}
else
{
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
...
...
@@ -366,6 +384,8 @@ public class FullSharingService {
satisfyList
.
setSatisfy
(
WebUtil
.
formatAmount
(
activityPrompt
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
).
toString
());
satisfyList
.
setMissing
(
WebUtil
.
formatAmount
((
activityPrompt
.
getThresholdAmount
()
-
activityPrompt
.
getTotalAmount
())
*
1.00
/
100
).
toString
());
}
}
else
{
Long
toDiscountAmout
;
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_11
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
...
...
@@ -374,6 +394,21 @@ public class FullSharingService {
toDiscountAmout
=
activityPrompt
.
getDiscountAmout
();
}
//已减 X 元 再买 Y 元 减 Z 元
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
messageBuilder
.
append
(
"已减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元 再买 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
((
activityPrompt
.
getThresholdAmount
()
-
activityPrompt
.
getTotalAmount
())
*
1.00
/
100
))
.
append
(
"</span> 件减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
))
.
append
(
"</span> 元"
);
satisfyList
.
setTipType
(
12
);
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setAgainBuy
((
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())+
""
);
satisfyList
.
setAgianDeduct
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
).
toString
());
satisfyList
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
}
else
{
messageBuilder
.
append
(
"已减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元 再买 <span style=\"color:#fa5555\">"
)
...
...
@@ -385,6 +420,8 @@ public class FullSharingService {
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setAgainBuy
(
WebUtil
.
formatAmount
((
activityPrompt
.
getThresholdAmount
()
-
activityPrompt
.
getTotalAmount
())
*
1.00
/
100
).
toString
());
satisfyList
.
setAgianDeduct
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
).
toString
());
}
}
}
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_230
.
getCode
(),
activityResponseDto
.
getActivityType
())
&&
CollectionUtils
.
isNotEmpty
(
activityPrompt
.
getSendGoods
()))
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/FullPromotionCalculation.java
View file @
a760f939
...
...
@@ -8,6 +8,7 @@ import cn.freemud.entities.dto.activity.ActivityQueryDto;
import
cn.freemud.entities.dto.activity.ActivityQueryResponseDto
;
import
cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto
;
import
cn.freemud.entities.vo.*
;
import
cn.freemud.enums.ActivityPromptEnum
;
import
cn.freemud.enums.ActivityTypeEnum
;
import
cn.freemud.service.ActivityService
;
import
cn.freemud.utils.WebUtil
;
...
...
@@ -136,6 +137,24 @@ public class FullPromotionCalculation {
}
BenefitBeanDto
benefitBeanDto
=
benefitBeanDtos
.
get
(
0
);
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_11
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
cn
.
freemud
.
entities
.
vo
.
ActivityList
notInShopping
=
new
ActivityList
();
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
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元
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
());
notInShopping
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
}
else
{
messageBuilder
.
append
(
"每满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
...
...
@@ -146,11 +165,11 @@ public class FullPromotionCalculation {
.
append
(
"</span> 元"
);
//满足 x 元 减 Y 元 ,最高 减 Z元
cn
.
freemud
.
entities
.
vo
.
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
()))
{
...
...
@@ -169,9 +188,16 @@ public class FullPromotionCalculation {
for
(
int
j
=
len
-
1
;
j
>=
0
;
j
--)
{
benefitBeanDto
=
benefitBeanDtos
.
get
(
j
);
cn
.
freemud
.
entities
.
vo
.
ActivityList
notInShopping
=
new
ActivityList
();
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
notInShopping
.
setTipType
(
16
);
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
());
}
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
);
}
}
...
...
@@ -192,6 +218,23 @@ public class FullPromotionCalculation {
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
ActivityPrompt
activityPrompt
=
activityPrompts
.
get
(
0
);
if
(
activityPrompt
.
getAlreadyDiscountAmount
()
==
null
||
activityPrompt
.
getAlreadyDiscountAmount
()
==
0
)
{
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
activityPrompt
.
getThresholdQuantity
())
.
append
(
"</span>件 减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
))
.
append
(
"</span> "
)
.
append
(
"还差 <span style=\"color:#fa5555\">"
)
.
append
((
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
()))
.
append
(
"</span> 件"
);
// 满足 X 元 减 Y 元 还差 Z元
satisfyList
.
setTipType
(
ActivityPromptEnum
.
TipTypeEnum
.
ELEVEN
.
getCode
());
satisfyList
.
setSatisfy
(
activityPrompt
.
getThresholdQuantity
().
toString
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
).
toString
());
satisfyList
.
setMissing
((
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())
+
""
);
satisfyList
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
}
else
{
messageBuilder
.
append
(
"满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
"</span> 减 <span style=\"color:#fa5555\">"
)
...
...
@@ -205,6 +248,9 @@ public class FullPromotionCalculation {
satisfyList
.
setSatisfy
(
WebUtil
.
formatAmount
(
activityPrompt
.
getThresholdAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getDiscountAmout
()
*
1.00
/
100
).
toString
());
satisfyList
.
setMissing
(
WebUtil
.
formatAmount
((
activityPrompt
.
getThresholdAmount
()
-
activityPrompt
.
getTotalAmount
())
*
1.00
/
100
).
toString
());
}
}
else
{
Long
toDiscountAmout
;
if
(
Objects
.
equals
(
ActivityTypeEnum
.
TYPE_11
.
getCode
(),
activityResponseDto
.
getActivityType
()))
{
...
...
@@ -213,6 +259,21 @@ public class FullPromotionCalculation {
toDiscountAmout
=
activityPrompt
.
getDiscountAmout
();
}
//已减 X 元 再买 Y 元 减 Z 元
if
(
ActivityPromptEnum
.
PreferentialTypeEnum
.
TO_ORDER_ITEM_QUANTITY
.
getCode
().
equals
(
activityResponseDto
.
getCouponType
()))
{
messageBuilder
.
append
(
"已减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元 再买 <span style=\"color:#fa5555\">"
)
.
append
(
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())
.
append
(
"</span> 件减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
))
.
append
(
"</span> 元"
);
satisfyList
.
setTipType
(
ActivityPromptEnum
.
TipTypeEnum
.
TWELVE
.
getCode
());
satisfyList
.
setDeduct
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
).
toString
());
satisfyList
.
setAgainBuy
((
activityPrompt
.
getThresholdQuantity
()
-
activityPrompt
.
getTotalQuantity
())
+
""
);
satisfyList
.
setAgianDeduct
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
).
toString
());
satisfyList
.
setInvokeAmount
(
WebUtil
.
formatAmount
(
activityResponseDto
.
getDelayTimes
()
*
1.00
/
100
).
toString
());
}
else
{
messageBuilder
.
append
(
"已减 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
activityPrompt
.
getAlreadyDiscountAmount
()
*
1.00
/
100
))
.
append
(
"</span> 元 再买 <span style=\"color:#fa5555\">"
)
...
...
@@ -225,6 +286,7 @@ public class FullPromotionCalculation {
satisfyList
.
setAgainBuy
(
WebUtil
.
formatAmount
((
activityPrompt
.
getThresholdAmount
()
-
activityPrompt
.
getTotalAmount
())
*
1.00
/
100
).
toString
());
satisfyList
.
setAgianDeduct
(
WebUtil
.
formatAmount
(
toDiscountAmout
*
1.00
/
100
).
toString
());
}
}
activityList
.
add
(
satisfyList
);
}
...
...
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