Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
payment-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
payment-ci-test
Commits
c69ec67a
提交
c69ec67a
authored
6月 06, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Auth(update)
上级
d8e2aa8b
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
46 行增加
和
3 行删除
+46
-3
ResultEnum.java
src/main/java/com/mmc/payment/common/result/ResultEnum.java
+1
-0
RepoCashController.java
...n/java/com/mmc/payment/controller/RepoCashController.java
+8
-0
RepoCashDao.java
src/main/java/com/mmc/payment/dao/RepoCashDao.java
+2
-0
RepoCashServiceImpl.java
...ava/com/mmc/payment/service/Impl/RepoCashServiceImpl.java
+17
-3
RepoCashService.java
src/main/java/com/mmc/payment/service/RepoCashService.java
+2
-0
RepoCashDao.xml
src/main/resources/mapper/RepoCashDao.xml
+16
-0
没有找到文件。
src/main/java/com/mmc/payment/common/result/ResultEnum.java
浏览文件 @
c69ec67a
...
@@ -403,6 +403,7 @@ public enum ResultEnum implements BaseErrorInfoInterface {
...
@@ -403,6 +403,7 @@ public enum ResultEnum implements BaseErrorInfoInterface {
FAILED_TO_CHARGE_MONEY
(
"2015"
,
"只有后台账号才能给小程序客户端充值"
),
FAILED_TO_CHARGE_MONEY
(
"2015"
,
"只有后台账号才能给小程序客户端充值"
),
NO_WALLET_FUNCTION
(
"2016"
,
"后台账号无钱包功能"
),
NO_WALLET_FUNCTION
(
"2016"
,
"后台账号无钱包功能"
),
THE_ORDER_HAS_BEEN_PAID
(
"2017"
,
"订单已支付/订单编号错误"
),
THE_ORDER_HAS_BEEN_PAID
(
"2017"
,
"订单已支付/订单编号错误"
),
THE_CURRENT_AMOUNT_IS_INSUFFICIENT
(
"2019"
,
"当前余额不足,请充值再支付"
),
THE_TOKEN_CANNOT_BE_NULL
(
"2018"
,
"token不能为null"
);
THE_TOKEN_CANNOT_BE_NULL
(
"2018"
,
"token不能为null"
);
/**
/**
...
...
src/main/java/com/mmc/payment/controller/RepoCashController.java
浏览文件 @
c69ec67a
...
@@ -133,6 +133,14 @@ public class RepoCashController extends BaseController {
...
@@ -133,6 +133,14 @@ public class RepoCashController extends BaseController {
}
}
@ApiOperation
(
value
=
"通过用户获取用户钱包"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
RepoCashDTO
.
class
)})
@GetMapping
(
"userWallet"
)
public
ResultBody
<
RepoWalletDTO
>
userWallet
(
HttpServletRequest
request
)
{
return
repoCashService
.
userWallet
(
this
.
getCurrentAccount
(
request
));
}
@ApiOperation
(
value
=
"退款金额---用户后台内部调用前端不使用"
)
@ApiOperation
(
value
=
"退款金额---用户后台内部调用前端不使用"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"amountOfRefund"
)
@GetMapping
(
"amountOfRefund"
)
...
...
src/main/java/com/mmc/payment/dao/RepoCashDao.java
浏览文件 @
c69ec67a
...
@@ -47,4 +47,6 @@ public interface RepoCashDao {
...
@@ -47,4 +47,6 @@ public interface RepoCashDao {
Integer
findWalletUsers
(
WalletUsersQO
properties
);
Integer
findWalletUsers
(
WalletUsersQO
properties
);
List
<
CashTypeDO
>
cashType
();
List
<
CashTypeDO
>
cashType
();
RepoWalletDO
userWallet
(
Integer
userAccountId
);
}
}
src/main/java/com/mmc/payment/service/Impl/RepoCashServiceImpl.java
浏览文件 @
c69ec67a
...
@@ -354,15 +354,19 @@ public class RepoCashServiceImpl implements RepoCashService {
...
@@ -354,15 +354,19 @@ public class RepoCashServiceImpl implements RepoCashService {
if
(
wallet
==
null
)
{
if
(
wallet
==
null
)
{
return
ResultBody
.
error
(
ResultEnum
.
WALLET_NOT_FIND_ERROR
);
return
ResultBody
.
error
(
ResultEnum
.
WALLET_NOT_FIND_ERROR
);
}
}
if
(!
currentAccount
.
getUserAccountId
().
equals
(
currentAccount
.
getUserAccountId
()))
{
return
ResultBody
.
error
(
ResultEnum
.
WALLET_NOT_FIND_ERROR
);
}
if
(
wallet
.
getCashAmt
().
compareTo
(
actualPay
)
==
-
1
)
{
return
ResultBody
.
error
(
ResultEnum
.
THE_CURRENT_AMOUNT_IS_INSUFFICIENT
);
}
BigDecimal
newCashAmt
=
BigDecimal
newCashAmt
=
(
wallet
.
getCashAmt
().
add
(
negate
)).
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
);
(
wallet
.
getCashAmt
().
add
(
negate
)).
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
);
repoCashDO
.
setAmtPaid
(
negate
);
repoCashDO
.
setAmtPaid
(
negate
);
repoCashDO
.
setCashAmt
(
newCashAmt
);
repoCashDO
.
setCashAmt
(
newCashAmt
);
repoCashDao
.
orderPayment
(
repoCashDO
);
repoCashDao
.
orderPayment
(
repoCashDO
);
repoCashDao
.
updateRepoWalletAmt
(
currentAccount
.
getUserAccountId
(),
negate
);
repoCashDao
.
updateRepoWalletAmt
(
currentAccount
.
getUserAccountId
(),
negate
);
if
(!
currentAccount
.
getUserAccountId
().
equals
(
currentAccount
.
getUserAccountId
()))
{
return
ResultBody
.
error
(
ResultEnum
.
WALLET_NOT_FIND_ERROR
);
}
orderStatusChanges
(
currentAccount
.
getToken
(),
orderNo
);
orderStatusChanges
(
currentAccount
.
getToken
(),
orderNo
);
return
ResultBody
.
success
();
return
ResultBody
.
success
();
}
}
...
@@ -517,6 +521,16 @@ public class RepoCashServiceImpl implements RepoCashService {
...
@@ -517,6 +521,16 @@ public class RepoCashServiceImpl implements RepoCashService {
return
ResultBody
.
success
(
collect
);
return
ResultBody
.
success
(
collect
);
}
}
@Override
public
ResultBody
userWallet
(
BaseAccountDTO
currentAccount
)
{
RepoWalletDO
repoWalletDO
=
repoCashDao
.
userWallet
(
currentAccount
.
getUserAccountId
());
if
(
null
==
repoWalletDO
)
{
return
ResultBody
.
error
(
"当前账号没有钱包"
);
}
RepoWalletDTO
repoWalletDTO
=
repoWalletDO
.
buildRepoWalletDTO
();
return
ResultBody
.
success
(
repoWalletDTO
);
}
public
List
<
RepoWalletDTO
>
listWalletInfo
(
UserCashQO
param
)
{
public
List
<
RepoWalletDTO
>
listWalletInfo
(
UserCashQO
param
)
{
if
(
CollectionUtils
.
isEmpty
(
param
.
getAccountIds
()))
{
if
(
CollectionUtils
.
isEmpty
(
param
.
getAccountIds
()))
{
...
...
src/main/java/com/mmc/payment/service/RepoCashService.java
浏览文件 @
c69ec67a
...
@@ -49,4 +49,6 @@ public interface RepoCashService {
...
@@ -49,4 +49,6 @@ public interface RepoCashService {
ResultBody
walletUsers
(
WalletUsersVO
walletUsersVO
);
ResultBody
walletUsers
(
WalletUsersVO
walletUsersVO
);
ResultBody
cashType
();
ResultBody
cashType
();
ResultBody
userWallet
(
BaseAccountDTO
currentAccount
);
}
}
src/main/resources/mapper/RepoCashDao.xml
浏览文件 @
c69ec67a
...
@@ -251,4 +251,20 @@
...
@@ -251,4 +251,20 @@
select id, `type`
select id, `type`
from cash_type
from cash_type
</select>
</select>
<select
id=
"userWallet"
resultType=
"com.mmc.payment.entity.repo.RepoWalletDO"
>
SELECT id,
repo_account_id AS repoAccountId,
cash_amt AS cashAmt,
cash_paid AS cashPaid,
cash_paid,
cash_freeze AS cashFreeze,
remark,
rcd_rebate_amt AS rcdRebateAmt,
rebate_wdl AS rebateWdl,
rebate_freeze AS rebateFreeze,
update_time AS updateTime,
create_time AS createTime
FROM repo_wallet
where repo_account_id = #{userAccountId}
</select>
</mapper>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论