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
b834162a
Commit
b834162a
authored
Nov 14, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
621ee0cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
6 deletions
+31
-6
AgentUserServiceImpl.java
.../gogirl/application/common/impl/AgentUserServiceImpl.java
+28
-5
AgentUser.java
src/main/java/com/gogirl/domain/common/AgentUser.java
+2
-0
WxPayService.java
...va/com/gogirl/infrastructure/service/wx/WxPayService.java
+1
-1
No files found.
src/main/java/com/gogirl/application/common/impl/AgentUserServiceImpl.java
View file @
b834162a
...
...
@@ -83,8 +83,7 @@ public class AgentUserServiceImpl extends ServiceImpl<AgentUserMapper, AgentUser
.
sceneInfo
(
"gogirl美甲美睫沙龙"
)
.
build
();
WxPayMpOrderResult
result
=
wxPayService
.
createJsapiOrder
(
request
);
return
result
;
return
wxPayService
.
createJsapiOrder
(
request
);
}
@Resource
...
...
@@ -139,17 +138,34 @@ public class AgentUserServiceImpl extends ServiceImpl<AgentUserMapper, AgentUser
public
void
addBalanceLog
(
Integer
type
,
BigDecimal
amount
,
Integer
agentUserId
)
{
AgentUser
agentUser
=
agentUserMapper
.
selectById
(
agentUserId
);
Customer
customer
=
customerService
.
selectByPhone
(
agentUser
.
getPhone
());
AgentUserBalanceLog
agentUserBalanceLog
=
new
AgentUserBalanceLog
();
//1 = 充值余额 2 = 商城订单扣余额 3 = 充保证金 4 = 商城订单扣保证金
switch
(
type
)
{
//充值余额
case
1
:
case
2
:
agentUser
.
setBalance
(
agentUser
.
getBalance
().
add
(
amount
));
agentUserBalanceLog
.
setAmount
(
amount
);
agentUserBalanceLog
.
setAgentUserId
(
agentUserId
);
agentUserBalanceLog
.
setBalance
(
agentUser
.
getBalance
());
agentUserBalanceLog
.
setBondAmountBalance
(
agentUser
.
getBondAmount
());
agentUserBalanceLog
.
setCreateUser
(
customer
.
getNickname
());
agentUserBalanceLog
.
setDiscount
(
agentUser
.
getDiscount
());
agentUserBalanceLog
.
setType
(
type
);
agentUserBalanceLogMapper
.
insert
(
agentUserBalanceLog
);
break
;
//商城订单扣余额
case
2
:
agentUser
.
setBalance
(
agentUser
.
getBalance
().
subtract
(
amount
));
if
(
agentUser
.
getBalance
().
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
throw
new
RRException
(
"余额不足"
);
}
agentUserMapper
.
updateById
(
agentUser
);
AgentUserBalanceLog
agentUserBalanceLog
=
new
AgentUserBalanceLog
();
agentUserBalanceLog
.
setAmount
(
amount
);
agentUserBalanceLog
.
setAmount
(
BigDecimal
.
ZERO
.
subtract
(
amount
));
agentUserBalanceLog
.
setAgentUserId
(
agentUserId
);
agentUserBalanceLog
.
setBalance
(
agentUser
.
getBalance
());
agentUserBalanceLog
.
setBondAmountBalance
(
agentUser
.
getBondAmount
());
...
...
@@ -159,11 +175,18 @@ public class AgentUserServiceImpl extends ServiceImpl<AgentUserMapper, AgentUser
agentUserBalanceLogMapper
.
insert
(
agentUserBalanceLog
);
break
;
//充保证金
case
3
:
break
;
//商城订单扣保证金
case
4
:
break
;
default
:
throw
new
RRException
(
"invalid type"
);
}
}
@Override
public
WxPayMpOrderResult
chargeAmount
(
BigDecimal
amount
)
throws
UnknownHostException
,
WxPayException
{
...
...
src/main/java/com/gogirl/domain/common/AgentUser.java
View file @
b834162a
...
...
@@ -93,4 +93,6 @@ public class AgentUser implements Serializable {
@TableField
(
exist
=
false
)
private
AgentConfig
agentConfig
;
@ApiModelProperty
(
"累计充值金额"
)
private
BigDecimal
currentRechargeAmount
;
}
src/main/java/com/gogirl/infrastructure/service/wx/WxPayService.java
View file @
b834162a
...
...
@@ -13,7 +13,7 @@ public interface WxPayService {
/**
* 调用统一下单接口,并组装生成支付所需参数对象.
*
* @param request 统一下单请求参数
* @param request 统一下单请求参数
w
* @param <T> 请使用{@link com.github.binarywang.wxpay.bean.order}包下的类
* @return 返回 {@link com.github.binarywang.wxpay.bean.order}包下的类对象
*/
...
...
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