Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
A
Afrishop refactored project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Whispa
Afrishop refactored project
Commits
9c05d239
提交
9c05d239
authored
12月 15, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update activity
上级
93491ab3
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
9 行删除
+17
-9
ActivityController.java
...m/example/afrishop_v3/controllers/ActivityController.java
+5
-5
TbCfOrder.java
src/main/java/com/example/afrishop_v3/models/TbCfOrder.java
+12
-4
没有找到文件。
src/main/java/com/example/afrishop_v3/controllers/ActivityController.java
浏览文件 @
9c05d239
...
@@ -150,7 +150,7 @@ public class ActivityController {
...
@@ -150,7 +150,7 @@ public class ActivityController {
Optional
<
TbCfCartRecordR
>
byId
=
cartRecordRRepository
.
findById
(
cartId
);
Optional
<
TbCfCartRecordR
>
byId
=
cartRecordRRepository
.
findById
(
cartId
);
if
(
byId
.
isPresent
())
{
if
(
byId
.
isPresent
())
{
TbCfCartRecordR
cart
=
byId
.
get
();
TbCfCartRecordR
cart
=
byId
.
get
();
itemPrice
=
itemPrice
.
add
(
cart
.
getItemPrice
());
itemPrice
=
itemPrice
.
add
(
cart
.
getItemPrice
()
.
multiply
(
new
BigDecimal
(
cart
.
getItemNum
()))
);
itemCount
+=
cart
.
getItemNum
();
itemCount
+=
cart
.
getItemNum
();
// String itemId = cart.getItemId();
// String itemId = cart.getItemId();
// activity = checkActivity(itemId);
// activity = checkActivity(itemId);
...
@@ -183,10 +183,10 @@ public class ActivityController {
...
@@ -183,10 +183,10 @@ public class ActivityController {
if
(
itemPrice
.
compareTo
(
threshold
)
<
0
)
{
if
(
itemPrice
.
compareTo
(
threshold
)
<
0
)
{
lessAmount
=
threshold
.
subtract
(
itemPrice
);
lessAmount
=
threshold
.
subtract
(
itemPrice
);
map
.
put
(
"message"
,
"Spend "
+
lessAmount
+
" more to Enjoy "
+
msg
+
" off!"
);
map
.
put
(
"message"
,
"Spend "
+
lessAmount
+
" more to Enjoy "
+
msg
+
" off
!"
);
break
;
break
;
}
else
{
}
else
{
map
.
put
(
"message"
,
"Congrats, you've got "
+
msg
+
" off!"
);
map
.
put
(
"message"
,
"Congrats, you've got "
+
msg
+
" off
!"
);
}
}
}
}
}
else
if
(
"3"
.
equals
(
type
))
{
}
else
if
(
"3"
.
equals
(
type
))
{
...
@@ -195,10 +195,10 @@ public class ActivityController {
...
@@ -195,10 +195,10 @@ public class ActivityController {
double
value
=
con
.
getValue
();
double
value
=
con
.
getValue
();
discount
=
String
.
valueOf
(
value
);
discount
=
String
.
valueOf
(
value
);
if
(
itemCount
<
key
)
{
if
(
itemCount
<
key
)
{
map
.
put
(
"message"
,
"Buy "
+
key
+
" more item to Enjoy "
+
discount
+
"% off
!"
);
map
.
put
(
"message"
,
"Buy "
+
(
key
-
itemCount
)
+
" more item to Enjoy "
+
discount
+
"% off
!"
);
break
;
break
;
}
else
{
}
else
{
map
.
put
(
"message"
,
"Congrats, you've got "
+
discount
+
"% off!"
);
map
.
put
(
"message"
,
"Congrats, you've got "
+
discount
+
"% off
!"
);
}
}
}
}
}
}
...
...
src/main/java/com/example/afrishop_v3/models/TbCfOrder.java
浏览文件 @
9c05d239
...
@@ -208,6 +208,14 @@ public class TbCfOrder {
...
@@ -208,6 +208,14 @@ public class TbCfOrder {
this
.
orderTime
=
new
Date
();
this
.
orderTime
=
new
Date
();
}
}
public
BigDecimal
getReduceAmount
()
{
return
this
.
reduceAmount
==
null
?
BigDecimal
.
ZERO
:
reduceAmount
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
public
void
setReduceAmount
(
BigDecimal
reduceAmount
)
{
this
.
reduceAmount
=
reduceAmount
;
}
public
void
setCommentCount
(
Integer
commentCount
)
{
public
void
setCommentCount
(
Integer
commentCount
)
{
this
.
commentCount
=
commentCount
;
this
.
commentCount
=
commentCount
;
...
@@ -739,7 +747,7 @@ public class TbCfOrder {
...
@@ -739,7 +747,7 @@ public class TbCfOrder {
* 获取:商品总价
* 获取:商品总价
*/
*/
public
BigDecimal
getItemsPrice
()
{
public
BigDecimal
getItemsPrice
()
{
return
itemsPrice
==
null
?
BigDecimal
.
ZERO
:
itemsPrice
.
setScale
(
2
,
RoundingMode
.
CEILING
);
return
itemsPrice
==
null
?
BigDecimal
.
ZERO
:
itemsPrice
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
}
}
/**
/**
...
@@ -753,7 +761,7 @@ public class TbCfOrder {
...
@@ -753,7 +761,7 @@ public class TbCfOrder {
* 获取:总价
* 获取:总价
*/
*/
public
BigDecimal
getTotalPrice
()
{
public
BigDecimal
getTotalPrice
()
{
return
totalPrice
==
null
?
BigDecimal
.
ZERO
:
totalPrice
.
setScale
(
2
,
RoundingMode
.
CEILING
);
return
totalPrice
==
null
?
BigDecimal
.
ZERO
:
totalPrice
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
}
}
/**
/**
...
@@ -767,7 +775,7 @@ public class TbCfOrder {
...
@@ -767,7 +775,7 @@ public class TbCfOrder {
* 获取:实际付款
* 获取:实际付款
*/
*/
public
BigDecimal
getRealityPay
()
{
public
BigDecimal
getRealityPay
()
{
return
realityPay
==
null
?
BigDecimal
.
ZERO
:
realityPay
.
setScale
(
2
,
RoundingMode
.
CEILING
);
return
realityPay
==
null
?
BigDecimal
.
ZERO
:
realityPay
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
}
}
/**
/**
...
@@ -814,7 +822,7 @@ public class TbCfOrder {
...
@@ -814,7 +822,7 @@ public class TbCfOrder {
* 获取:快递费
* 获取:快递费
*/
*/
public
BigDecimal
getExpressCost
()
{
public
BigDecimal
getExpressCost
()
{
return
expressCost
==
null
?
BigDecimal
.
ZERO
:
expressCost
.
setScale
(
2
,
RoundingMode
.
CEILING
);
return
expressCost
==
null
?
BigDecimal
.
ZERO
:
expressCost
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
}
}
/**
/**
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论