Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
cms
Commits
0967f299
提交
0967f299
authored
8月 31, 2023
作者:
zhenjie
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
ssh://git.mmcuav.cn:8222/iuav/cms
into develop
上级
a68572c1
f6c327e6
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
74 行增加
和
37 行删除
+74
-37
PayWalletController.java
.../mmc/iuav/user/controller/wallet/PayWalletController.java
+0
-10
PayWalletDao.java
.../main/java/com/mmc/iuav/user/dao/wallet/PayWalletDao.java
+1
-1
XzServiceImpl.java
...va/com/mmc/iuav/user/service/xzsz/impl/XzServiceImpl.java
+72
-25
kustomization.yaml
kustomization/overlays/dev/kustomization.yaml
+1
-1
没有找到文件。
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/wallet/PayWalletController.java
浏览文件 @
0967f299
...
@@ -42,22 +42,12 @@ public class PayWalletController extends BaseController {
...
@@ -42,22 +42,12 @@ public class PayWalletController extends BaseController {
return
ResultBody
.
success
(
payWalletService
.
getPayWalletInfo
(
userAccountId
));
return
ResultBody
.
success
(
payWalletService
.
getPayWalletInfo
(
userAccountId
));
}
}
// @ApiOperation(value = "feign-初始化钱包")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
// @ApiIgnore
// @GetMapping("feignInitPayWallet")
// public ResultBody feignInitPayWallet(@RequestParam Integer userAccountId) {
// return payWalletService.initPayWallet(userAccountId);
// }
@ApiOperation
(
value
=
"feign-云享金充值增加金额"
)
@ApiOperation
(
value
=
"feign-云享金充值增加金额"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"feignTopUpCash"
)
@PostMapping
(
"feignTopUpCash"
)
public
ResultBody
feignTopUpCash
(
@RequestBody
TopUpOrderVO
topUpOrderVO
)
{
public
ResultBody
feignTopUpCash
(
@RequestBody
TopUpOrderVO
topUpOrderVO
)
{
return
payWalletService
.
feignTopUpCash
(
topUpOrderVO
);
return
payWalletService
.
feignTopUpCash
(
topUpOrderVO
);
}
}
@ApiOperation
(
value
=
"feign-钱包流水记录"
)
@ApiOperation
(
value
=
"feign-钱包流水记录"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/wallet/PayWalletDao.java
浏览文件 @
0967f299
...
@@ -46,5 +46,5 @@ public interface PayWalletDao {
...
@@ -46,5 +46,5 @@ public interface PayWalletDao {
List
<
XzWithdrawalApplyDO
>
listPageWithdrawalApply
(
WithdrawalApplyQO
param
);
List
<
XzWithdrawalApplyDO
>
listPageWithdrawalApply
(
WithdrawalApplyQO
param
);
void
updateWithdrawalApply
(
XzWithdrawalApplyDO
apply
);
int
updateWithdrawalApply
(
XzWithdrawalApplyDO
apply
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/xzsz/impl/XzServiceImpl.java
浏览文件 @
0967f299
...
@@ -39,6 +39,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -39,6 +39,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.crypto.Cipher
;
import
javax.crypto.Cipher
;
...
@@ -273,6 +274,7 @@ public class XzServiceImpl implements XzService {
...
@@ -273,6 +274,7 @@ public class XzServiceImpl implements XzService {
}
}
@Override
@Override
@Transactional
public
String
xzWithdrawNotify
(
JSONObject
notify
)
{
public
String
xzWithdrawNotify
(
JSONObject
notify
)
{
log
.
info
(
"xzWithdrawNotify获取到的推送结果:{}"
,
notify
.
toString
());
log
.
info
(
"xzWithdrawNotify获取到的推送结果:{}"
,
notify
.
toString
());
if
(
XzEnums
.
T
.
getCode
().
equals
(
notify
.
get
(
XzEnums
.
is_success
.
getCode
()).
toString
()))
{
if
(
XzEnums
.
T
.
getCode
().
equals
(
notify
.
get
(
XzEnums
.
is_success
.
getCode
()).
toString
()))
{
...
@@ -303,40 +305,59 @@ public class XzServiceImpl implements XzService {
...
@@ -303,40 +305,59 @@ public class XzServiceImpl implements XzService {
xzWithdrawalApplyDO
.
setTradeResult
(
data
.
getTradeResult
());
xzWithdrawalApplyDO
.
setTradeResult
(
data
.
getTradeResult
());
xzWithdrawalApplyDO
.
setTradeStatus
(
data
.
getTradeStatus
());
xzWithdrawalApplyDO
.
setTradeStatus
(
data
.
getTradeStatus
());
payWalletDao
.
updateWithdrawalApply
(
xzWithdrawalApplyDO
);
payWalletDao
.
updateWithdrawalApply
(
xzWithdrawalApplyDO
);
// 并且回滚用户钱包信息
// 提现失败回滚用户金额
// 生成提现流水编号
callbackUserPayWallet
(
data
,
withdrawCashApplyDetails
,
wallet
);
String
payNo
=
"T"
+
TDateUtil
.
getDateStr
(
new
Date
(),
TDateUtil
.
TYPE
)
+
withdrawCashApplyDetails
.
getUserAccountId
()
+
CodeUtil
.
getRandomNum
(
4
);
// 记录流水记录
WithdrawalLogDO
withdrawalLogDO
=
new
WithdrawalLogDO
();
withdrawalLogDO
.
setPayNo
(
payNo
);
withdrawalLogDO
.
setXzWithdrawalApplyId
(
withdrawCashApplyDetails
.
getId
());
withdrawalLogDO
.
setPayTime
(
new
Date
());
withdrawalLogDO
.
setUserAccountId
(
withdrawCashApplyDetails
.
getUserAccountId
());
withdrawalLogDO
.
setSalaryPaid
(
data
.
getPayAmount
());
withdrawalLogDO
.
setPayMethod
(
WithdrawalMethod
.
TXSB
.
getCode
());
withdrawalLogDO
.
setSalaryFreeze
(
new
BigDecimal
(
0
));
payWalletDao
.
insertWithdrawalLog
(
withdrawalLogDO
);
// 修改钱包信息,钱包冻结金额
PayWalletDO
payWalletDO
=
new
PayWalletDO
();
payWalletDO
.
setPid
(
wallet
.
getPid
());
payWalletDO
.
setUserAccountId
(
withdrawCashApplyDetails
.
getUserAccountId
());
payWalletDO
.
setSalaryAmt
(
wallet
.
getSalaryAmt
().
add
(
data
.
getPayAmount
()));
payWalletDO
.
setSalaryFreeze
(
wallet
.
getSalaryFreeze
().
subtract
(
data
.
getPayAmount
()));
int
updateCount
=
payWalletDao
.
updatePayWallet
(
payWalletDO
);
if
(
updateCount
!=
1
)
{
log
.
error
(
"回调返回提现失败时,修改钱包信息失败,信息是:{}"
,
JSON
.
toJSONString
(
payWalletDO
));
}
}
}
}
else
if
(
XzEnums
.
trade_result
.
getCode
().
equals
(
data
.
getNotifyType
()))
{
}
else
if
(
XzEnums
.
trade_result
.
getCode
().
equals
(
data
.
getNotifyType
()))
{
// 根据回调信息返回数据更新提现申请
// 根据回调信息返回数据更新提现申请
if
(
withdrawCashApplyDetails
.
getTradeStatus
()
!=
null
&&
withdrawCashApplyDetails
.
getTradeStatus
().
equals
(
XzEnums
.
success
.
getCode
()))
{
if
(
withdrawCashApplyDetails
.
getTradeStatus
()
!=
null
&&
withdrawCashApplyDetails
.
getTradeStatus
().
equals
(
XzEnums
.
success
.
getCode
()))
{
return
"success"
;
return
"success"
;
}
}
XzWithdrawalApplyDO
xzWithdrawalApplyDO
=
new
XzWithdrawalApplyDO
();
int
updateCount
;
// 判断返回的是成功还是失败
// 判断返回的是成功还是失败
if
(
XzEnums
.
success
.
getCode
().
equals
(
data
.
getTradeStatus
()))
{
if
(
XzEnums
.
success
.
getCode
().
equals
(
data
.
getTradeStatus
()))
{
// 修改提现申请状态
xzWithdrawalApplyDO
.
setTradeStatus
(
XzEnums
.
success
.
getCode
());
xzWithdrawalApplyDO
.
setTradeTime
(
data
.
getTradeTime
());
xzWithdrawalApplyDO
.
setOuterTradeNo
(
data
.
getOuterTradeNo
());
xzWithdrawalApplyDO
.
setFrontLogNo
(
data
.
getFrontLogNo
());
xzWithdrawalApplyDO
.
setTradeResult
(
data
.
getTradeResult
());
updateCount
=
payWalletDao
.
updateWithdrawalApply
(
xzWithdrawalApplyDO
);
if
(
updateCount
!=
1
)
{
log
.
error
(
"回调返回提现成功时,修改提现申请信息失败,信息是:{}"
,
JSON
.
toJSONString
(
xzWithdrawalApplyDO
));
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
"error"
;
}
}
else
if
(
XzEnums
.
handle
.
getCode
().
equals
(
data
.
getTradeStatus
()))
{
// 修改提现申请状态
xzWithdrawalApplyDO
.
setTradeStatus
(
XzEnums
.
handle
.
getCode
());
xzWithdrawalApplyDO
.
setTradeTime
(
data
.
getTradeTime
());
xzWithdrawalApplyDO
.
setOuterTradeNo
(
data
.
getOuterTradeNo
());
xzWithdrawalApplyDO
.
setFrontLogNo
(
data
.
getFrontLogNo
());
xzWithdrawalApplyDO
.
setTradeResult
(
data
.
getTradeResult
());
updateCount
=
payWalletDao
.
updateWithdrawalApply
(
xzWithdrawalApplyDO
);
if
(
updateCount
!=
1
)
{
log
.
error
(
"回调返回提现交易中时,修改提现申请信息失败,信息是:{}"
,
JSON
.
toJSONString
(
xzWithdrawalApplyDO
));
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
"error"
;
}
}
else
{
// 修改提现申请状态
xzWithdrawalApplyDO
.
setTradeStatus
(
XzEnums
.
failure
.
getCode
());
xzWithdrawalApplyDO
.
setErrorMessage
(
data
.
getTradeFailCode
());
xzWithdrawalApplyDO
.
setTradeTime
(
data
.
getTradeTime
());
xzWithdrawalApplyDO
.
setOuterTradeNo
(
data
.
getOuterTradeNo
());
xzWithdrawalApplyDO
.
setTradeResult
(
data
.
getTradeResult
());
updateCount
=
payWalletDao
.
updateWithdrawalApply
(
xzWithdrawalApplyDO
);
if
(
updateCount
!=
1
)
{
log
.
error
(
"回调返回提现交易中时,修改提现申请信息失败,信息是:{}"
,
JSON
.
toJSONString
(
xzWithdrawalApplyDO
));
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
"error"
;
}
// 提现失败回滚用户金额
callbackUserPayWallet
(
data
,
withdrawCashApplyDetails
,
wallet
);
}
}
}
}
}
else
{
}
else
{
log
.
info
(
"xzWithdrawNotify fail:{}"
,
notify
);
log
.
info
(
"xzWithdrawNotify fail:{}"
,
notify
);
...
@@ -345,6 +366,32 @@ public class XzServiceImpl implements XzService {
...
@@ -345,6 +366,32 @@ public class XzServiceImpl implements XzService {
return
"success"
;
return
"success"
;
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
callbackUserPayWallet
(
WithdrawalResp
.
Data
data
,
XzWithdrawalApplyDO
withdrawCashApplyDetails
,
PayWalletDO
wallet
)
{
String
payNo
=
"T"
+
TDateUtil
.
getDateStr
(
new
Date
(),
TDateUtil
.
TYPE
)
+
withdrawCashApplyDetails
.
getUserAccountId
()
+
CodeUtil
.
getRandomNum
(
4
);
// 记录流水记录
WithdrawalLogDO
withdrawalLogDO
=
new
WithdrawalLogDO
();
withdrawalLogDO
.
setPayNo
(
payNo
);
withdrawalLogDO
.
setXzWithdrawalApplyId
(
withdrawCashApplyDetails
.
getId
());
withdrawalLogDO
.
setPayTime
(
new
Date
());
withdrawalLogDO
.
setUserAccountId
(
withdrawCashApplyDetails
.
getUserAccountId
());
withdrawalLogDO
.
setSalaryPaid
(
data
.
getPayAmount
());
withdrawalLogDO
.
setPayMethod
(
WithdrawalMethod
.
TXSB
.
getCode
());
withdrawalLogDO
.
setSalaryFreeze
(
new
BigDecimal
(
0
));
payWalletDao
.
insertWithdrawalLog
(
withdrawalLogDO
);
// 修改钱包信息,钱包冻结金额
PayWalletDO
payWalletDO
=
new
PayWalletDO
();
payWalletDO
.
setPid
(
wallet
.
getPid
());
payWalletDO
.
setUserAccountId
(
withdrawCashApplyDetails
.
getUserAccountId
());
payWalletDO
.
setSalaryAmt
(
wallet
.
getSalaryAmt
().
add
(
data
.
getPayAmount
()));
payWalletDO
.
setSalaryFreeze
(
wallet
.
getSalaryFreeze
().
subtract
(
data
.
getPayAmount
()));
int
updatePayWalletCount
=
payWalletDao
.
updatePayWallet
(
payWalletDO
);
if
(
updatePayWalletCount
!=
1
)
{
log
.
error
(
"回调返回提现失败时,修改钱包信息失败,信息是:{}"
,
JSON
.
toJSONString
(
payWalletDO
));
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
}
public
String
decrypt
(
String
aesData
)
{
public
String
decrypt
(
String
aesData
)
{
try
{
try
{
byte
[]
raw
=
userSystemConstant
.
getXzAppSecret
().
getBytes
(
"ASCII"
);
byte
[]
raw
=
userSystemConstant
.
getXzAppSecret
().
getBytes
(
"ASCII"
);
...
...
kustomization/overlays/dev/kustomization.yaml
浏览文件 @
0967f299
...
@@ -18,4 +18,4 @@ patches:
...
@@ -18,4 +18,4 @@ patches:
images
:
images
:
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag
:
c
691a3e53ee0c171aea036abdb27532a8056f41e
newTag
:
c
888e97c2d1b188e9513246df4b49c156c243aec
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论