Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huluobin
gogirl-miniapp-backend
Commits
d2db3d36
Commit
d2db3d36
authored
May 18, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
42df269b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
ChargeOrderServiceImpl.java
...application/order/member/impl/ChargeOrderServiceImpl.java
+7
-3
No files found.
src/main/java/com/gogirl/application/order/member/impl/ChargeOrderServiceImpl.java
View file @
d2db3d36
...
...
@@ -27,6 +27,7 @@ import com.gogirl.infrastructure.mapper.user.customer.CustomerBalanceRecordMappe
import
com.gogirl.infrastructure.mapper.user.customer.CustomerMapper
;
import
com.gogirl.infrastructure.service.wx.WxPayService
;
import
com.gogirl.infrastructure.util.SessionUtils
;
import
com.google.common.collect.Lists
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
...
...
@@ -67,7 +68,6 @@ public class ChargeOrderServiceImpl extends ServiceImpl<ChargeOrderMapper, Charg
throw
new
RRException
(
"回调失败"
);
}
Customer
customer
=
customerMapper
.
selectOne
(
new
LambdaQueryWrapper
<
Customer
>().
eq
(
Customer:
:
getOpenid1
,
result
.
getOpenid
()));
CustomerBalance
customerBalance
=
customerBalanceMapper
.
selectOne
(
...
...
@@ -85,7 +85,10 @@ public class ChargeOrderServiceImpl extends ServiceImpl<ChargeOrderMapper, Charg
//首次充值
if
(
customerBalance
==
null
||
customerBalance
.
getBalance
()
==
0
)
{
if
(
customerBalance
==
null
||
(
customerBalance
.
getBalance
()
==
0
&&
customerBalanceRecordMapper
.
selectCount
(
new
LambdaQueryWrapper
<
CustomerBalanceRecord
>().
eq
(
CustomerBalanceRecord:
:
getCustomerId
,
customer
.
getId
())
.
in
(
CustomerBalanceRecord:
:
getType
,
Lists
.
newArrayList
(
CustomerBalanceRecord
.
TYPE_CHARGE
,
CustomerBalanceRecord
.
TYPE_FIRST_CHARGE
))
)
==
0
))
{
if
(
customerBalance
==
null
)
{
customerBalance
=
CustomerBalance
.
builder
()
//充值金额+赠送金额
...
...
@@ -249,11 +252,12 @@ public class ChargeOrderServiceImpl extends ServiceImpl<ChargeOrderMapper, Charg
CustomerBalance
customerBalance
=
customerBalanceMapper
.
selectOne
(
new
LambdaQueryWrapper
<
CustomerBalance
>()
.
eq
(
CustomerBalance:
:
getCustomerId
,
customer
.
getId
()));
//充值类型
Integer
type
;
int
type
;
if
(
customerBalance
==
null
)
{
type
=
2
;
}
else
if
(
customerBalance
.
getBalance
()
==
0
&&
customerBalanceRecordMapper
.
selectCount
(
new
LambdaQueryWrapper
<
CustomerBalanceRecord
>().
eq
(
CustomerBalanceRecord:
:
getCustomerId
,
customer
.
getId
())
.
in
(
CustomerBalanceRecord:
:
getType
,
Lists
.
newArrayList
(
CustomerBalanceRecord
.
TYPE_CHARGE
,
CustomerBalanceRecord
.
TYPE_FIRST_CHARGE
))
)
==
0
)
{
type
=
2
;
}
else
{
...
...
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