Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
payment-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
payment-ci-test
Commits
498001ad
提交
498001ad
authored
6月 02, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
RepoCash
上级
fbdd250f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
75 行增加
和
0 行删除
+75
-0
RepoCashController.java
...n/java/com/mmc/payment/controller/RepoCashController.java
+13
-0
RepoCashServiceImpl.java
...ava/com/mmc/payment/service/Impl/RepoCashServiceImpl.java
+60
-0
RepoCashService.java
src/main/java/com/mmc/payment/service/RepoCashService.java
+2
-0
没有找到文件。
src/main/java/com/mmc/payment/controller/RepoCashController.java
浏览文件 @
498001ad
...
...
@@ -131,4 +131,17 @@ public class RepoCashController extends BaseController {
public
RepoCashDTO
feignRefundInfo
(
@RequestParam
String
refundNo
)
{
return
repoCashService
.
getRefundInfo
(
refundNo
);
}
@ApiOperation
(
value
=
"退款金额---用户后台内部调用前端不使用"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"amountOfRefund"
)
public
ResultBody
amountOfRefund
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"orderNo"
)
String
orderNo
,
@RequestParam
(
value
=
"actualPay"
)
BigDecimal
actualPay
,
@RequestParam
(
value
=
"repoAccountId"
)
Integer
repoAccountId
,
@RequestParam
(
value
=
"refundNo"
)
String
refundNo
)
{
return
repoCashService
.
amountOfRefund
(
this
.
getCurrentAccount
(
request
),
orderNo
,
actualPay
,
repoAccountId
,
refundNo
);
}
}
src/main/java/com/mmc/payment/service/Impl/RepoCashServiceImpl.java
浏览文件 @
498001ad
...
...
@@ -172,6 +172,66 @@ public class RepoCashServiceImpl implements RepoCashService {
return
ResultBody
.
success
();
}
@Override
public
ResultBody
amountOfRefund
(
BaseAccountDTO
cuser
,
String
orderNo
,
BigDecimal
actualPay
,
Integer
repoAccountId
,
String
refundNo
)
{
if
(
cuser
.
getPortType
().
equals
(
PortTypeEnum
.
CLIENTS_AND_APPLETS
.
getCode
()))
{
return
ResultBody
.
error
(
ResultEnum
.
FAILED_TO_CHARGE_MONEY
);
}
// 金额范围验证
/*if (!AmtUtil.vertifyRepoAmt(cash.getAmtPaid())) {
return ResultBody.error(ResultEnum.AMT_PAID_VERITY_ERROR);
}*/
// 密码认证
/* ResultBody body = passwordAuthentication(cuser, cash);
if (body != null) {
return body;
}*/
/**
* 用户信息
*/
ResponseEntity
<
String
>
responseEntity
=
UserId
(
repoAccountId
);
UserAccountSimpleDTO
account
=
JSON
.
parseObject
(
responseEntity
.
getBody
(),
UserAccountSimpleDTO
.
class
);
if
(
account
==
null
)
{
return
ResultBody
.
error
(
ResultEnum
.
FEIGN_REPOUSER_SERVLET_ERROR
);
}
RepoWalletDO
wallet
=
repoCashDao
.
getRepoWalletInfo
(
repoAccountId
);
if
(
wallet
==
null
)
{
return
ResultBody
.
error
(
ResultEnum
.
WALLET_NOT_FIND_ERROR
);
}
// 扣除的金额不能大于余额
BigDecimal
amtPaid
=
actualPay
;
if
(
amtPaid
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
BigDecimal
negate
=
new
BigDecimal
(
String
.
valueOf
(
amtPaid
)).
negate
();
if
(
negate
.
compareTo
(
wallet
.
getCashAmt
())
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
WALLET_CASH_NOT_ENOUGH_ERROR
);
}
}
Date
cdate
=
new
Date
();
RepoCashDO
rc
=
new
RepoCashDO
();
rc
.
setRepoAccountId
(
account
.
getId
());
rc
.
setUid
(
account
.
getUid
());
rc
.
setAccountName
(
account
.
getUserName
());
rc
.
setPayNo
(
CodeUtil
.
createRepoCashNo
());
rc
.
setPayMethod
(
RepoCashMethod
.
REG
.
getCode
());
rc
.
setAmtPaid
(
actualPay
);
BigDecimal
newCashAmt
=
(
wallet
.
getCashAmt
().
add
(
actualPay
)).
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
);
rc
.
setCashAmt
(
newCashAmt
);
rc
.
setPayTime
(
cdate
);
/* String voucher =
Collections.isEmpty(cash.getVoucher()) ? null : String.join(",", cash.getVoucher());*/
rc
.
setCreateTime
(
cdate
);
rc
.
setCreateUser
(
cuser
.
getUserAccountId
());
rc
.
setRefundNo
(
refundNo
);
repoCashDao
.
insertRepoCash
(
rc
);
Integer
id
=
account
.
getId
();
BigDecimal
amtPaid1
=
rc
.
getAmtPaid
();
repoCashDao
.
updateRepoWalletAmt
(
account
.
getId
(),
rc
.
getAmtPaid
());
return
ResultBody
.
success
();
}
/**
* 密码认证
*
...
...
src/main/java/com/mmc/payment/service/RepoCashService.java
浏览文件 @
498001ad
...
...
@@ -31,6 +31,8 @@ public interface RepoCashService {
*/
ResultBody
reqCash
(
BaseAccountDTO
cuser
,
RepoCashVO
cash
);
ResultBody
amountOfRefund
(
BaseAccountDTO
cuser
,
String
orderNo
,
BigDecimal
actualPay
,
Integer
repoAccountId
,
String
refundNo
);
ResultBody
dedCash
(
BaseAccountDTO
cuser
,
RepoCashVO
cash
);
RepoCashDTO
getRefundInfo
(
String
refundNo
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论