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
5b558fcd
Commit
5b558fcd
authored
Jul 20, 2021
by
王世昌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
富有对接 折扣券改为使用折扣比计算
parent
582d5f15
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/GetMemberInfoResponseVo.java
+4
-4
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+8
-2
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/GetMemberInfoResponseVo.java
View file @
5b558fcd
...
@@ -3,6 +3,7 @@ package cn.freemud.entities.dto;
...
@@ -3,6 +3,7 @@ package cn.freemud.entities.dto;
import
lombok.Data
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
@Data
@Data
...
@@ -63,11 +64,10 @@ public class GetMemberInfoResponseVo {
...
@@ -63,11 +64,10 @@ public class GetMemberInfoResponseVo {
*/
*/
private
Integer
discountAmount
;
private
Integer
discountAmount
;
/**
/**(千分比)
* 折扣 (千分比)
* 6.5代表的是6.5折
* 500代表的是千分之500
*/
*/
private
Integer
discount
;
private
BigDecimal
discount
;
/**
/**
* 状态:-1:未激活 0:可用(剔除过期) 1:已使用 2:部分使用 3:取消 6:已过期(根据生失效日期) 99:未知(目前暂不支持)
* 状态:-1:未激活 0:可用(剔除过期) 1:已使用 2:部分使用 3:取消 6:已过期(根据生失效日期) 99:未知(目前暂不支持)
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
5b558fcd
...
@@ -1296,10 +1296,16 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -1296,10 +1296,16 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
coupon
.
setCouponName
(
each
.
getCouponName
());
coupon
.
setCouponName
(
each
.
getCouponName
());
// 折扣券使用折扣字段
// 折扣券使用折扣字段
if
(
Objects
.
equals
(
each
.
getCouponType
(),
CouponTypeEnum
.
TYPE_3
.
getCode
())){
if
(
Objects
.
equals
(
each
.
getCouponType
(),
CouponTypeEnum
.
TYPE_3
.
getCode
())){
coupon
.
setDiscount
(
Integer
.
valueOf
(
each
.
getDiscountAmount
()));
int
discountAmount
=
Integer
.
parseInt
(
Optional
.
ofNullable
(
each
.
getDiscountAmount
()).
orElse
(
"0"
));
BigDecimal
discount
=
BigDecimal
.
ZERO
;
// 转换千分比为小数
if
(
discountAmount
!=
0
){
discount
=
new
BigDecimal
(
discountAmount
).
divide
(
BigDecimal
.
valueOf
(
100
),
1
,
BigDecimal
.
ROUND_DOWN
);
}
coupon
.
setDiscount
(
discount
);
coupon
.
setDiscountAmount
(
0
);
coupon
.
setDiscountAmount
(
0
);
}
else
{
}
else
{
coupon
.
setDiscount
(
0
);
coupon
.
setDiscount
(
BigDecimal
.
ZERO
);
coupon
.
setDiscountAmount
(
Integer
.
valueOf
(
each
.
getDiscountAmount
()));
coupon
.
setDiscountAmount
(
Integer
.
valueOf
(
each
.
getDiscountAmount
()));
}
}
coupon
.
setCouponLimit
(
null
);
coupon
.
setCouponLimit
(
null
);
...
...
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