Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
f7c6d47f
Commit
f7c6d47f
authored
Nov 04, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改租车拥金
parent
5bfb3ea8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
AppUserSellingWaterBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
+37
-1
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
View file @
f7c6d47f
...
...
@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.admin.entity.AppUserRelation;
import
com.github.wxiaoqi.security.admin.vo.SellingWalletVo
;
import
com.github.wxiaoqi.security.admin.vo.SellingWalletPagVo
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
io.swagger.models.auth.In
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -198,8 +199,43 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
log
.
info
(
"订单完成计算用户拥金----finishOrderWater----id===="
+
id
+
"---commission=="
+
commission
+
"----orderType==="
+
orderType
);
amount
=
amount
.
add
(
commission
);
}
log
.
info
(
"订单完成计算用户拥金----finishOrderWater----orderId===="
+
orderId
+
"---amount=="
+
amount
);
if
(
orderType
==
1
){
List
<
OrderGoodsDTO
>
goodsDTOList
=
orderWaterDTO
.
getGoodsDTOList
();
log
.
info
(
"租车订单完成-----goodsDTOList==="
+
goodsDTOList
);
if
(
CollectionUtils
.
isNotEmpty
(
goodsDTOList
)){
for
(
OrderGoodsDTO
goodsDto
:
goodsDTOList
)
{
//商品id
Integer
goodId
=
goodsDto
.
getGoodId
();
//商品价格
BigDecimal
price
=
goodsDto
.
getPrice
();
AppUserSellingWater
sellingWater
=
new
AppUserSellingWater
();
sellingWater
.
setOrderId
(
orderId
);
sellingWater
.
setGoodId
(
goodId
);
sellingWater
=
selectOne
(
sellingWater
);
if
(
sellingWater
==
null
||
sellingWater
.
getExtract
()==
null
||
sellingWater
.
getExtract
()==
0
)
{
log
.
info
(
"租车订单完成-----sellingWater---不存在或extract---为空"
);
continue
;
}
if
(
price
.
compareTo
(
sellingWater
.
getPrice
())>=
0
){
log
.
info
(
"租车订单完成-----完成价格大于支付价格"
);
continue
;
}
price
=
price
.
subtract
(
sellingWater
.
getPrice
());
Integer
extract
=
sellingWater
.
getExtract
();
log
.
info
(
"租车订单完成-----price====="
+
price
+
"---extract===="
+
extract
);
BigDecimal
commission
=
price
.
multiply
(
new
BigDecimal
(
extract
+
""
)).
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_HALF_UP
);
log
.
info
(
"租车订单完成--------userId==="
+
userId
+
"---commission==="
+
commission
);
sellingWater
.
setWaiting
(
1
);
sellingWater
.
setStatus
(
1
);
sellingWater
.
setCommission
(
commission
);
insertSelective
(
sellingWater
);
log
.
info
(
"租车订单完成计算用户拥成功----payOrderWater--------userId==="
+
userId
);
amount
=
amount
.
subtract
(
commission
);
}
}
}
log
.
info
(
"订单完成计算用户拥金----finishOrderWater--------orderId==="
+
orderId
+
"----amount===="
+
amount
+
"--orderType==="
+
orderType
);
int
r
=
amount
.
compareTo
(
BigDecimal
.
ZERO
);
//更新钱包
if
(
r
==
1
&&
userId
>
0
)
{
...
...
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