Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
oms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
oms-ci-test
Commits
0edd5af3
提交
0edd5af3
authored
9月 13, 2023
作者:
zhenjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
商城订单优化
上级
8aa668f9
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
41 行增加
和
39 行删除
+41
-39
UserAppApi.java
src/main/java/com/mmc/oms/feign/UserAppApi.java
+1
-1
UavOrderServiceImpl.java
...ava/com/mmc/oms/service/uav/impl/UavOrderServiceImpl.java
+38
-36
UavOrderDao.xml
src/main/resources/mapper/uav/UavOrderDao.xml
+2
-2
没有找到文件。
src/main/java/com/mmc/oms/feign/UserAppApi.java
浏览文件 @
0edd5af3
...
@@ -53,7 +53,7 @@ public interface UserAppApi {
...
@@ -53,7 +53,7 @@ public interface UserAppApi {
* @param userAccountId
* @param userAccountId
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/user
app/user
-account/feignGetUserSimpleInfo"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/user-account/feignGetUserSimpleInfo"
,
method
=
RequestMethod
.
GET
)
public
UserAccountSimpleDTO
feignGetUserSimpleInfo
(
@RequestParam
Integer
userAccountId
,
@RequestHeader
(
"token"
)
String
token
);
public
UserAccountSimpleDTO
feignGetUserSimpleInfo
(
@RequestParam
Integer
userAccountId
,
@RequestHeader
(
"token"
)
String
token
);
}
}
src/main/java/com/mmc/oms/service/uav/impl/UavOrderServiceImpl.java
浏览文件 @
0edd5af3
...
@@ -125,49 +125,51 @@ public class UavOrderServiceImpl implements UavOrderService {
...
@@ -125,49 +125,51 @@ public class UavOrderServiceImpl implements UavOrderService {
// 校验云享金、钱包余额是否足够抵扣
// 校验云享金、钱包余额是否足够抵扣
BigDecimal
shareAmount
=
BigDecimal
.
ZERO
;
BigDecimal
shareAmount
=
BigDecimal
.
ZERO
;
BigDecimal
salaryAmount
=
BigDecimal
.
ZERO
;
BigDecimal
salaryAmount
=
BigDecimal
.
ZERO
;
ResultBody
<
PayWalletDTO
>
payResInfo
=
userAppApi
.
getCurrentUserPayWalletInfo
(
currentAccount
.
getToken
());
if
(!
payResInfo
.
getCode
().
equals
(
ResultEnum
.
SUCCESS
.
getResultCode
())
||
payResInfo
.
getResult
()
==
null
){
return
payResInfo
;
}
PayWalletDTO
payWalletDTO
=
payResInfo
.
getResult
();
if
(
param
.
getDeductShareAmount
().
equals
(
1
)){
if
(
otherAmount
.
compareTo
(
payWalletDTO
.
getCashAmt
())
>=
0
)
{
// 抵扣云享金小于等于订单总额时,直接使用云享金
shareAmount
=
payWalletDTO
.
getCashAmt
();
}
else
{
// 余额超过订单金额时,订单总额使用余额支付
shareAmount
=
otherAmount
;
}
}
otherAmount
=
otherAmount
.
subtract
(
shareAmount
);
Integer
statusCode
=
null
;
Integer
statusCode
=
null
;
// 支付完成
// 正常订单可以抵扣云享金和余额、意向订单不能扣
if
(
otherAmount
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
){
if
(
param
.
getOrderType
().
equals
(
UavOrderType
.
PAY
.
getCode
())){
statusCode
=
UavOrderStatus
.
WAITING_DELIVER_GOODS
.
getCode
();
ResultBody
<
PayWalletDTO
>
payResInfo
=
userAppApi
.
getCurrentUserPayWalletInfo
(
currentAccount
.
getToken
());
}
else
{
if
(!
payResInfo
.
getCode
().
equals
(
ResultEnum
.
SUCCESS
.
getResultCode
())
||
payResInfo
.
getResult
()
==
null
){
if
(
param
.
getDeductSalaryAmount
().
equals
(
1
)){
return
payResInfo
;
if
(
otherAmount
.
compareTo
(
payWalletDTO
.
getSalaryAmt
())
>=
0
)
{
}
// 抵扣余额小于等于订单总额时,直接使用余额
PayWalletDTO
payWalletDTO
=
payResInfo
.
getResult
();
salaryAmount
=
payWalletDTO
.
getSalaryAmt
();
if
(
param
.
getDeductShareAmount
().
equals
(
1
)){
if
(
otherAmount
.
compareTo
(
payWalletDTO
.
getCashAmt
())
>=
0
)
{
// 抵扣云享金小于等于订单总额时,直接使用云享金
shareAmount
=
payWalletDTO
.
getCashAmt
();
}
else
{
}
else
{
// 余额超过订单金额时,订单总额使用余额支付
// 余额超过订单金额时,订单总额使用余额支付
s
alary
Amount
=
otherAmount
;
s
hare
Amount
=
otherAmount
;
}
}
}
}
otherAmount
=
otherAmount
.
subtract
(
salaryAmount
);
otherAmount
=
otherAmount
.
subtract
(
shareAmount
);
if
(
otherAmount
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
// 支付完成
if
(
otherAmount
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
){
statusCode
=
UavOrderStatus
.
WAITING_DELIVER_GOODS
.
getCode
();
statusCode
=
UavOrderStatus
.
WAITING_DELIVER_GOODS
.
getCode
();
}
else
{
if
(
param
.
getDeductSalaryAmount
().
equals
(
1
)){
if
(
otherAmount
.
compareTo
(
payWalletDTO
.
getSalaryAmt
())
>=
0
)
{
// 抵扣余额小于等于订单总额时,直接使用余额
salaryAmount
=
payWalletDTO
.
getSalaryAmt
();
}
else
{
// 余额超过订单金额时,订单总额使用余额支付
salaryAmount
=
otherAmount
;
}
}
otherAmount
=
otherAmount
.
subtract
(
salaryAmount
);
if
(
otherAmount
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
statusCode
=
UavOrderStatus
.
WAITING_DELIVER_GOODS
.
getCode
();
}
}
PayUavWalletVO
payUavWalletVO
=
new
PayUavWalletVO
();
payUavWalletVO
.
setCashAmount
(
shareAmount
);
payUavWalletVO
.
setSalaryAmount
(
salaryAmount
);
payUavWalletVO
.
setOrderStatus
(
100
);
payUavWalletVO
.
setUserAccountId
(
currentAccount
.
getUserAccountId
());
ResultBody
resultBody
=
userAppApi
.
feignPayUavWallet
(
payUavWalletVO
,
currentAccount
.
getToken
());
if
(!
resultBody
.
getCode
().
equals
(
ResultEnum
.
SUCCESS
.
getResultCode
())){
return
resultBody
;
}
}
}
PayUavWalletVO
payUavWalletVO
=
new
PayUavWalletVO
();
payUavWalletVO
.
setCashAmount
(
shareAmount
);
payUavWalletVO
.
setSalaryAmount
(
salaryAmount
);
payUavWalletVO
.
setOrderStatus
(
100
);
payUavWalletVO
.
setUserAccountId
(
currentAccount
.
getUserAccountId
());
ResultBody
resultBody
=
userAppApi
.
feignPayUavWallet
(
payUavWalletVO
,
currentAccount
.
getToken
());
if
(!
resultBody
.
getCode
().
equals
(
ResultEnum
.
SUCCESS
.
getResultCode
())){
return
resultBody
;
}
}
// 添加总订单表
// 添加总订单表
UavOrderDO
uavOrderDO
=
new
UavOrderDO
();
UavOrderDO
uavOrderDO
=
new
UavOrderDO
();
...
...
src/main/resources/mapper/uav/UavOrderDao.xml
浏览文件 @
0edd5af3
...
@@ -177,7 +177,7 @@
...
@@ -177,7 +177,7 @@
select count(*) from uav_order
select count(*) from uav_order
where 1 = 1
where 1 = 1
<if
test=
"keyword != null"
>
<if
test=
"keyword != null"
>
and order_no = #{
orderNo
}
and order_no = #{
keyword
}
</if>
</if>
<if
test=
"uid != null"
>
<if
test=
"uid != null"
>
and user_account_id = #{uid}
and user_account_id = #{uid}
...
@@ -205,7 +205,7 @@
...
@@ -205,7 +205,7 @@
uav_order uo
uav_order uo
where 1 = 1
where 1 = 1
<if
test=
"keyword != null"
>
<if
test=
"keyword != null"
>
and uo.order_no = #{
orderNo
}
and uo.order_no = #{
keyword
}
</if>
</if>
<if
test=
"uid != null"
>
<if
test=
"uid != null"
>
and uo.user_account_id = #{uid}
and uo.user_account_id = #{uid}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论