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
deb4133a
Commit
deb4133a
authored
Jun 16, 2020
by
xiaoer.li@freemud.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/feature/1.9.26_积分抵扣规则,新增是否与促销和优惠券同享'
parents
1abd1213
5f610259
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
4 deletions
+46
-4
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/user/GetUserScoreUserDetailResponse.java
+7
-2
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartCustomerScoreVo.java
+4
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CustomerScoreService.java
+35
-2
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/user/GetUserScoreUserDetailResponse.java
View file @
deb4133a
...
...
@@ -32,8 +32,7 @@ public class GetUserScoreUserDetailResponse {
private
Integer
reducePriceLimit
;
private
Integer
getReduceScoreLimit
;
/**
* 积分抵扣状态
* 1积分可用 2积分不足 3 积分抵扣开关禁用
* 积分抵扣状态 1积分可用 2积分不足 3 积分抵扣开关禁用 4、订单金额不满足开启积分抵现要求
*/
private
Integer
scoreState
;
/**
...
...
@@ -41,6 +40,11 @@ public class GetUserScoreUserDetailResponse {
* 例如10积分抵扣5元为 10:5
*/
private
String
scoreReduceRate
;
/**
* 是否可优惠同享{0所有订单均可抵扣,1仅限原价订单才可抵扣(享受了促销活动、或使用了优惠券,不能进行积分抵扣)
*/
private
Integer
overlayOffers
;
}
}
\ No newline at end of file
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartCustomerScoreVo.java
View file @
deb4133a
...
...
@@ -22,4 +22,8 @@ public class ShoppingCartCustomerScoreVo {
private
Integer
reduceAmount
;
private
Integer
useScore
;
private
String
customerScorePrompt
;
/**
* 是否可优惠同享{0所有订单均可抵扣,1仅限原价订单才可抵扣(享受了促销活动、或使用了优惠券,不能进行积分抵扣)
*/
private
Integer
overlayOffers
;
}
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CustomerScoreService.java
View file @
deb4133a
...
...
@@ -9,16 +9,19 @@ import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import
cn.freemud.entities.dto.user.GetUserScoreUseDetailRequest
;
import
cn.freemud.entities.dto.user.GetUserScoreUserDetailResponse
;
import
cn.freemud.entities.vo.*
;
import
cn.freemud.enums.ActivityTypeEnum
;
import
cn.freemud.service.IPromotionService
;
import
cn.freemud.service.thirdparty.CustomScoreClient
;
import
cn.freemud.utils.LogUtil
;
import
com.freemud.application.sdk.api.constant.FMStatusCode
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
org.apache.commons.lang.ObjectUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.Collections
;
import
java.util.List
;
/**
...
...
@@ -65,9 +68,36 @@ public class CustomerScoreService implements IPromotionService {
customerScoreVo
.
setCurrentScore
(
getValue
(
userScoreUseDetail
.
getResult
().
getCurrentScore
()));
customerScoreVo
.
setReduceAmount
(
getValue
(
userScoreUseDetail
.
getResult
().
getReduceAmount
()));
customerScoreVo
.
setReducePriceLimit
(
getValue
(
userScoreUseDetail
.
getResult
().
getReducePriceLimit
()));
customerScoreVo
.
setScoreReduceState
(
userScoreUseDetail
.
getResult
().
getScoreState
());
customerScoreVo
.
setOverlayOffers
(
userScoreUseDetail
.
getResult
().
getOverlayOffers
());
customerScoreVo
.
setScoreReduceState
(
getValue
(
userScoreUseDetail
.
getResult
().
getScoreState
()));
// 是否可优惠同享{0所有订单均可抵扣,1仅限原价订单才可抵扣(享受了促销活动、或使用了优惠券,不能进行积分抵扣
if
(
getValue
(
userScoreUseDetail
.
getResult
().
getOverlayOffers
())
==
0
)
{
customerScoreVo
.
setScoreReduceState
(
getValue
(
userScoreUseDetail
.
getResult
().
getScoreState
()));
}
else
{
if
(
StringUtils
.
isNotBlank
(
shoppingCartInfoRequestVo
.
getCouponCode
())
||
(
calculationDiscountResult
!=
null
&&
calculationDiscountResult
.
getTotalDiscountAmount
().
intValue
()
>
0
)
||
(
calculationDiscountResult
!=
null
&&
!
CollectionUtils
.
isEmpty
(
calculationDiscountResult
.
getDiscounts
())))
{
int
type81
=
0
;
for
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Discount
discount
:
calculationDiscountResult
.
getDiscounts
())
{
if
(
ActivityTypeEnum
.
TYPE_81
.
getCode
().
equals
(
discount
.
getType
()))
{
type81
=
1
;
break
;
}
}
//积分抵扣开关禁用 过滤换购
if
(
type81
==
0
||
(
type81
==
1
&&
!
CollectionUtils
.
isEmpty
(
shoppingCartInfoRequestVo
.
getSendGoods
()))
||
(
type81
==
1
&&
calculationDiscountResult
.
getDiscounts
().
size
()
>
1
))
{
customerScoreVo
.
setScoreReduceState
(
5
);
userScoreUseDetail
.
getResult
().
setScoreState
(
5
);
discountAmount
=
0
;
customerScoreVo
.
setReduceAmount
(
0
);
}
}
}
customerScoreVo
.
setUseScore
(
getValue
(
userScoreUseDetail
.
getResult
().
getUseScore
()));
String
msg
=
""
;
// 积分抵扣状态 1积分可用 2积分不足 3 积分抵扣开关禁用 4、订单金额不满足开启积分抵现要求
switch
(
userScoreUseDetail
.
getResult
().
getScoreState
())
{
case
1
:
msg
=
String
.
format
(
"共%s积分,可用%s积分抵¥%s"
,
getValue
(
userScoreUseDetail
.
getResult
().
getCurrentScore
()),
getValue
(
userScoreUseDetail
.
getResult
().
getUseScore
()),
((
double
)
userScoreUseDetail
.
getResult
().
getReduceAmount
())
/
100
);
...
...
@@ -76,6 +106,9 @@ public class CustomerScoreService implements IPromotionService {
String
[]
split
=
userScoreUseDetail
.
getResult
().
getScoreReduceRate
().
split
(
":"
);
msg
=
String
.
format
(
"共%s积分,每%s积分可抵¥%s"
,
getValue
(
userScoreUseDetail
.
getResult
().
getCurrentScore
()),
split
[
0
],
split
[
1
]);
break
;
case
5
:
msg
=
"已享受优惠,无法再参与积分抵扣"
;
break
;
case
4
:
msg
=
String
.
format
(
"共%s积分,订单满¥%s可开启积分抵现"
,
getValue
(
userScoreUseDetail
.
getResult
().
getCurrentScore
()),
((
double
)
userScoreUseDetail
.
getResult
().
getReducePriceLimit
())
/
100
);
break
;
...
...
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