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
79652939
Commit
79652939
authored
Jul 22, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
ed01f730
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
38 deletions
+52
-38
AppUserPositionBiz.java
...github/wxiaoqi/security/admin/biz/AppUserPositionBiz.java
+1
-1
AppUserSellingWaterBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
+47
-34
MyWaterBiz.java
...ava/com/github/wxiaoqi/security/admin/biz/MyWaterBiz.java
+2
-1
AppUserPositionMapper.java
.../wxiaoqi/security/admin/mapper/AppUserPositionMapper.java
+1
-1
AppUserPositionMapper.xml
...admin/src/main/resources/mapper/AppUserPositionMapper.xml
+1
-1
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserPositionBiz.java
View file @
79652939
...
...
@@ -28,7 +28,7 @@ public class AppUserPositionBiz extends BaseBiz<AppUserPositionMapper,AppUserPos
//获取用户职位的折扣
public
Integer
getExtract
(
Integer
userId
){
public
AppUserPosition
getExtract
(
Integer
userId
){
return
mapper
.
getExtractByUserId
(
userId
);
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
View file @
79652939
...
...
@@ -103,6 +103,21 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
Integer
parentId
=
relation
.
getParentId
();
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---parentId==="
+
parentId
);
Integer
positionId
=
6
;
Integer
level
=
0
;
AppUserPosition
position
=
positionBiz
.
getExtract
(
parentId
);
if
(
position
!=
null
){
positionId
=
position
.
getId
();
}
AppUserPosition
position1
=
positionBiz
.
getExtract
(
userId
);
if
(
position
!=
null
){
level
=
position1
.
getLevel
();
}
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---positionId==="
+
positionId
+
"---level==="
+
level
);
if
(
level
!=
0
){
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"----无法享受拥金"
);
return
;
}
BigDecimal
amount
=
new
BigDecimal
(
"0.00"
);
//商品类型
Integer
orderType
=
0
;
...
...
@@ -115,13 +130,9 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
orderType
=
goodsDto
.
getType
();
//商品比例
Integer
extract
=
commissionBiz
.
getExtract
(
orderType
,
goodId
);
AppUserVo
userVo
=
detailBiz
.
getUserInfoById
(
parentId
);
Integer
positionId
=
6
;
if
(
userVo
!=
null
)
{
positionId
=
userVo
.
getPositionId
();
}
if
(
extract
==
null
||
extract
==
0
)
{
extract
=
position
Biz
.
getExtract
(
parentId
);
extract
=
position
.
getExtract
(
);
}
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---extract==="
+
extract
);
if
(
extract
!=
null
&&
extract
>
0
)
{
...
...
@@ -184,23 +195,25 @@ 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
);
int
r
=
amount
.
compareTo
(
BigDecimal
.
ZERO
);
//更新钱包
if
(
r
==
1
&&
userId
>
0
)
{
MyWalletDetail
detail
=
new
MyWalletDetail
();
detail
.
setUserId
(
userId
);
detail
.
setAmount
(
amount
);
detail
.
setCono
(
orderId
);
detail
.
setSource
(
1
);
myWaterBiz
.
updMyWater
(
detail
);
if
(
orderType
==
1
||
orderType
==
2
){
myWaterBiz
.
updMyWalletUnbooked
(
userId
,
amount
,
2
);
}
log
.
info
(
"订单完成计算用户拥金----finishOrderWater----orderId===="
+
orderId
+
"---amount=="
+
amount
);
int
r
=
amount
.
compareTo
(
BigDecimal
.
ZERO
);
//更新钱包
if
(
r
==
1
&&
userId
>
0
)
{
MyWalletDetail
detail
=
new
MyWalletDetail
();
detail
.
setUserId
(
userId
);
detail
.
setAmount
(
amount
);
detail
.
setCono
(
orderId
);
detail
.
setSource
(
1
);
myWaterBiz
.
updMyWater
(
detail
);
if
(
orderType
==
1
||
orderType
==
2
){
myWaterBiz
.
updMyWalletUnbooked
(
userId
,
amount
,
2
);
}
}
}
}
//订单退款计算用户拥金
...
...
@@ -230,20 +243,20 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
log
.
info
(
"订单完成计算用户拥金----refundOrderWater----id===="
+
id
+
"---commission=="
+
commission
+
"---orderType===="
+
orderType
);
unbooked
=
unbooked
.
add
(
commission
);
}
}
log
.
info
(
"订单完成计算用户拥金----refundOrderWater----orderId===="
+
orderId
+
"---amount=="
+
amount
+
"---unbooked==="
+
unbooked
);
int
r
=
amount
.
compareTo
(
BigDecimal
.
ZERO
);
//更新钱包
if
(
r
==
1
&&
userId
>
0
)
{
MyWalletDetail
detail
=
new
MyWalletDetail
(
);
detail
.
setUserId
(
userId
);
detail
.
setAmount
(
amount
);
detail
.
setCono
(
orderId
);
detail
.
setSource
(
1
);
myWaterBiz
.
updMyWater
(
detail
);
}
if
(
orderType
==
1
||
orderType
==
2
){
myWaterBiz
.
updMyWalletUnbooked
(
userId
,
unbooked
,
2
);
log
.
info
(
"订单完成计算用户拥金----refundOrderWater----orderId===="
+
orderId
+
"---amount=="
+
amount
+
"---unbooked==="
+
unbooked
);
int
r
=
amount
.
compareTo
(
BigDecimal
.
ZERO
);
//更新钱包
if
(
r
==
1
&&
userId
>
0
)
{
MyWalletDetail
detail
=
new
MyWalletDetail
();
detail
.
setUserId
(
userId
);
detail
.
setAmount
(
amount
);
detail
.
setCono
(
orderId
);
detail
.
setSource
(
1
);
myWaterBiz
.
updMyWater
(
detail
);
}
if
(
orderType
==
1
||
orderType
==
2
){
myWaterBiz
.
updMyWalletUnbooked
(
userId
,
unbooked
,
2
);
}
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWaterBiz.java
View file @
79652939
...
...
@@ -113,7 +113,8 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
//钱包未入账的处理type1-进;2-出
public
void
updMyWalletUnbooked
(
Integer
userId
,
BigDecimal
amount
,
Integer
type
){
log
.
info
(
"---钱包未入账的处理updMyWalletUnbooked----userId==="
+
userId
+
"----type==="
+
type
);
log
.
info
(
"---钱包未入账的处理updMyWalletUnbooked----userId==="
+
userId
+
"----type==="
+
type
+
"---amount==="
+
amount
);
MyWallet
wallet
=
new
MyWallet
();
wallet
.
setUserId
(
userId
);
wallet
=
selectOne
(
wallet
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserPositionMapper.java
View file @
79652939
...
...
@@ -17,6 +17,6 @@ import java.util.List;
public
interface
AppUserPositionMapper
extends
Mapper
<
AppUserPosition
>
{
Integer
getExtractByUserId
(
@Param
(
"userId"
)
Integer
userId
);
AppUserPosition
getExtractByUserId
(
@Param
(
"userId"
)
Integer
userId
);
}
ace-modules/ace-admin/src/main/resources/mapper/AppUserPositionMapper.xml
View file @
79652939
...
...
@@ -16,7 +16,7 @@
<result
property=
"isDel"
column=
"is_del"
/>
</resultMap>
<select
id=
"getExtractByUserId"
result
Type=
"Integer
"
>
<select
id=
"getExtractByUserId"
result
Map=
"appUserPositionMap
"
>
SELECT p.extract FROM app_user_detail d LEFT JOIN app_user_position p
ON d.position_id=p.id
WHERE d.userid=#{userId} LIMIT 1
...
...
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