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
668a2af3
Commit
668a2af3
authored
Jul 28, 2021
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benefitBeanDtos.get(0)报错修改,判断benefitBeanDtos集合不为空
parent
bf8799ba
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
16 deletions
+22
-16
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullPromotionService.java
+7
-4
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullSubtractionActivityServiceImpl.java
+0
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/FullSharingService.java
+8
-8
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/FullPromotionCalculation.java
+7
-4
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullPromotionService.java
View file @
668a2af3
...
@@ -77,9 +77,8 @@ public class FullPromotionService implements IPromotionService {
...
@@ -77,9 +77,8 @@ public class FullPromotionService implements IPromotionService {
if
(
calculationDiscountResult
==
null
)
{
if
(
calculationDiscountResult
==
null
)
{
// 因为没有促销活动的计算信息,所以没有加入购物车内
// 因为没有促销活动的计算信息,所以没有加入购物车内
List
<
BenefitBeanDto
>
benefitBeanDtos
=
activityResponseDto
.
getBenefits
();
List
<
BenefitBeanDto
>
benefitBeanDtos
=
activityResponseDto
.
getBenefits
();
BenefitBeanDto
benefitBeanDto
=
benefitBeanDtos
.
get
(
0
);
//调用没有加入购物车的提示语的方法
//调用没有加入购物车的提示语的方法
setMessageNotInShoppingCart
(
messageBuilder
,
activityResponseDto
,
benefitBeanDtos
,
benefitBeanDto
,
activityList
);
setMessageNotInShoppingCart
(
messageBuilder
,
activityResponseDto
,
benefitBeanDtos
,
activityList
);
}
}
else
{
else
{
//促销返回满减提示语
//促销返回满减提示语
...
@@ -134,8 +133,13 @@ public class FullPromotionService implements IPromotionService {
...
@@ -134,8 +133,13 @@ public class FullPromotionService implements IPromotionService {
}
}
//设置没有加入购物车的提示语
//设置没有加入购物车的提示语
private
void
setMessageNotInShoppingCart
(
StringBuilder
messageBuilder
,
ActivityResponseDto
activityResponseDto
,
List
<
BenefitBeanDto
>
benefitBeanDtos
,
BenefitBeanDto
benefitBeanDto
,
private
void
setMessageNotInShoppingCart
(
StringBuilder
messageBuilder
,
ActivityResponseDto
activityResponseDto
,
List
<
BenefitBeanDto
>
benefitBeanDtos
,
ArrayList
<
ActivityList
>
activityList
)
{
ArrayList
<
ActivityList
>
activityList
)
{
if
(
CollectionUtils
.
isEmpty
(
benefitBeanDtos
)){
return
;
}
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\">"
)
messageBuilder
.
append
(
"每满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
))
...
@@ -189,7 +193,6 @@ public class FullPromotionService implements IPromotionService {
...
@@ -189,7 +193,6 @@ public class FullPromotionService implements IPromotionService {
else
if
(
GiftTypeEnum
.
TYPE_2
.
getType
().
equals
(
activityResponseDto
.
getActivitySubType
()))
{
else
if
(
GiftTypeEnum
.
TYPE_2
.
getType
().
equals
(
activityResponseDto
.
getActivitySubType
()))
{
notInShopping
.
setTipType
(
7
);
notInShopping
.
setTipType
(
7
);
}
}
//int len = benefitBeanDto.getSendGoodsList().size();
Collections
.
sort
(
benefitBeanDtos
);
Collections
.
sort
(
benefitBeanDtos
);
BenefitBeanDto
dto
=
benefitBeanDtos
.
get
(
0
);
BenefitBeanDto
dto
=
benefitBeanDtos
.
get
(
0
);
int
len
=
dto
.
getSendGoodsList
().
size
();
int
len
=
dto
.
getSendGoodsList
().
size
();
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullSubtractionActivityServiceImpl.java
View file @
668a2af3
This diff is collapsed.
Click to expand it.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/FullSharingService.java
View file @
668a2af3
...
@@ -79,9 +79,8 @@ public class FullSharingService {
...
@@ -79,9 +79,8 @@ public class FullSharingService {
ArrayList
<
ActivityList
>
activityList
=
new
ArrayList
<>();
ArrayList
<
ActivityList
>
activityList
=
new
ArrayList
<>();
List
<
BenefitBeanDto
>
benefitBeanDtos
=
activityResponseDto
.
getBenefits
();
List
<
BenefitBeanDto
>
benefitBeanDtos
=
activityResponseDto
.
getBenefits
();
BenefitBeanDto
benefitBeanDto
=
benefitBeanDtos
.
get
(
0
);
//调用没有加入购物车的提示语的方法
//调用没有加入购物车的提示语的方法
setMessageNotInShoppingCart
(
messageBuilder
,
activityResponseDto
,
benefitBeanDtos
,
benefitBeanDto
,
activityList
);
setMessageNotInShoppingCart
(
messageBuilder
,
activityResponseDto
,
benefitBeanDtos
,
activityList
);
promotionMessageDto
.
setPromotionMessage
(
messageBuilder
.
toString
());
promotionMessageDto
.
setPromotionMessage
(
messageBuilder
.
toString
());
ActivityTip
activityTip
=
new
ActivityTip
();
ActivityTip
activityTip
=
new
ActivityTip
();
...
@@ -189,9 +188,8 @@ public class FullSharingService {
...
@@ -189,9 +188,8 @@ public class FullSharingService {
*/
*/
if
(
null
==
discountResult
)
{
if
(
null
==
discountResult
)
{
List
<
BenefitBeanDto
>
benefitBeanDtos
=
activityResponseDto
.
getBenefits
();
List
<
BenefitBeanDto
>
benefitBeanDtos
=
activityResponseDto
.
getBenefits
();
BenefitBeanDto
benefitBeanDto
=
benefitBeanDtos
.
get
(
0
);
//调用没有加入购物车的提示语的方法
//调用没有加入购物车的提示语的方法
setMessageNotInShoppingCart
(
messageBuilder
,
activityResponseDto
,
benefitBeanDtos
,
benefitBeanDto
,
activityList
);
setMessageNotInShoppingCart
(
messageBuilder
,
activityResponseDto
,
benefitBeanDtos
,
activityList
);
}
}
//促销返回满减提示语
//促销返回满减提示语
else
{
else
{
...
@@ -226,12 +224,14 @@ public class FullSharingService {
...
@@ -226,12 +224,14 @@ public class FullSharingService {
* @param messageBuilder
* @param messageBuilder
* @param activityResponseDto
* @param activityResponseDto
* @param benefitBeanDtos
* @param benefitBeanDtos
* @param benefitBeanDto
* @param activityList
* @param activityList
*/
*/
private
void
setMessageNotInShoppingCart
(
StringBuilder
messageBuilder
,
ActivityResponseDto
activityResponseDto
,
List
<
BenefitBeanDto
>
benefitBeanDtos
,
BenefitBeanDto
benefitBeanDto
,
private
void
setMessageNotInShoppingCart
(
StringBuilder
messageBuilder
,
ActivityResponseDto
activityResponseDto
,
ArrayList
<
ActivityList
>
activityList
)
{
List
<
BenefitBeanDto
>
benefitBeanDtos
,
ArrayList
<
ActivityList
>
activityList
)
{
if
(
CollectionUtils
.
isEmpty
(
benefitBeanDtos
)){
return
;
}
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\">"
)
messageBuilder
.
append
(
"每满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
))
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/FullPromotionCalculation.java
View file @
668a2af3
...
@@ -70,9 +70,8 @@ public class FullPromotionCalculation {
...
@@ -70,9 +70,8 @@ public class FullPromotionCalculation {
if
(
calculationDiscountResult
==
null
)
{
if
(
calculationDiscountResult
==
null
)
{
// 因为没有促销活动的计算信息,所以没有加入购物车内
// 因为没有促销活动的计算信息,所以没有加入购物车内
List
<
BenefitBeanDto
>
benefitBeanDtos
=
activityResponseDto
.
getBenefits
();
List
<
BenefitBeanDto
>
benefitBeanDtos
=
activityResponseDto
.
getBenefits
();
BenefitBeanDto
benefitBeanDto
=
benefitBeanDtos
.
get
(
0
);
//调用没有加入购物车的提示语的方法
//调用没有加入购物车的提示语的方法
setMessageNotInShoppingCart
(
messageBuilder
,
activityResponseDto
,
benefitBeanDtos
,
benefitBeanDto
,
activityList
);
setMessageNotInShoppingCart
(
messageBuilder
,
activityResponseDto
,
benefitBeanDtos
,
activityList
);
}
else
{
}
else
{
//促销返回满减提示语
//促销返回满减提示语
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
ActivityPrompt
>
activityPrompts
=
calculationDiscountResult
.
getActivityPrompts
();
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
ActivityPrompt
>
activityPrompts
=
calculationDiscountResult
.
getActivityPrompts
();
...
@@ -130,8 +129,12 @@ public class FullPromotionCalculation {
...
@@ -130,8 +129,12 @@ public class FullPromotionCalculation {
//设置没有加入购物车的提示语
//设置没有加入购物车的提示语
private
void
setMessageNotInShoppingCart
(
StringBuilder
messageBuilder
,
ActivityResponseDto
activityResponseDto
,
List
<
BenefitBeanDto
>
benefitBeanDtos
,
BenefitBeanDto
benefitBeanDto
,
private
void
setMessageNotInShoppingCart
(
StringBuilder
messageBuilder
,
ActivityResponseDto
activityResponseDto
,
ArrayList
<
ActivityList
>
activityList
)
{
List
<
BenefitBeanDto
>
benefitBeanDtos
,
ArrayList
<
ActivityList
>
activityList
)
{
if
(
CollectionUtils
.
isEmpty
(
benefitBeanDtos
)){
return
;
}
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\">"
)
messageBuilder
.
append
(
"每满 <span style=\"color:#fa5555\">"
)
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
))
.
append
(
WebUtil
.
formatAmount
(
benefitBeanDto
.
getThresholdAmount
()
*
1.00
/
100
))
...
...
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