Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
795dde7c
提交
795dde7c
authored
1月 31, 2024
作者:
liuhaiquan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/test' into test
上级
a11787ff
59976090
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
69 行增加
和
14 行删除
+69
-14
NbBankOrderResultVO.java
...com/clx/performance/vo/pc/nbbank/NbBankOrderResultVO.java
+2
-1
TempBankController.java
...m/clx/performance/controller/temp/TempBankController.java
+19
-1
NbBankNotifyServiceImpl.java
...rvice/impl/thirdparty/nbbank/NbBankNotifyServiceImpl.java
+7
-6
NbBankServiceImpl.java
...nce/service/impl/thirdparty/nbbank/NbBankServiceImpl.java
+36
-6
NbBankService.java
.../performance/service/thirdparty/nbbank/NbBankService.java
+5
-0
没有找到文件。
performance-api/src/main/java/com/clx/performance/vo/pc/nbbank/NbBankOrderResultVO.java
浏览文件 @
795dde7c
...
@@ -33,7 +33,7 @@ public class NbBankOrderResultVO {
...
@@ -33,7 +33,7 @@ public class NbBankOrderResultVO {
@ApiModelProperty
(
value
=
"转账编号(转账专用)"
,
example
=
"1234567"
)
@ApiModelProperty
(
value
=
"转账编号(转账专用)"
,
example
=
"1234567"
)
private
String
signNo
;
private
String
signNo
;
@ApiModelProperty
(
value
=
"交易状态
"
,
example
=
"
"
)
@ApiModelProperty
(
value
=
"交易状态
:1交易成功 2交易失败 3交易已受理 4订单初始状态 5交易不存在 6交易超时"
,
example
=
"1
"
)
private
Integer
transStatus
;
private
Integer
transStatus
;
}
}
\ No newline at end of file
performance-web/src/main/java/com/clx/performance/controller/temp/TempBankController.java
浏览文件 @
795dde7c
...
@@ -38,7 +38,17 @@ public class TempBankController {
...
@@ -38,7 +38,17 @@ public class TempBankController {
public
Result
<
NbBankOrderPayResultVO
>
orderDirectPay
()
{
public
Result
<
NbBankOrderPayResultVO
>
orderDirectPay
()
{
// return Result.ok(bankService.orderDirectPay(null,2,"313332082914","86041110000076809", "黑玫瑰"));
// return Result.ok(bankService.orderDirectPay(null,2,"313332082914","86041110000076809", "黑玫瑰"));
return
Result
.
ok
(
bankService
.
orderDirectPay
(
null
,
2
,
"313332082914"
,
"86041110000075926"
,
"客户客户"
));
// return Result.ok(bankService.orderDirectPay(null,2,"313332082914","86041110000075926", "客户客户"));
return
Result
.
ok
(
bankService
.
orderDirectPay
(
null
,
1
,
"313332082914"
,
"86031110000180611"
,
"槟榔王"
));
}
@ApiOperation
(
value
=
"订单支付1"
,
notes
=
"<br>By:艾庆国"
)
@RequestMapping
(
value
=
"/orderDirectPay1"
,
method
=
RequestMethod
.
POST
)
public
Result
<
NbBankOrderPayResultVO
>
orderDirectPay1
(
String
payAcctNo
,
String
payAcctNm
)
{
// return Result.ok(bankService.orderDirectPay(null,2,"313332082914","86041110000076809", "黑玫瑰"));
// return Result.ok(bankService.orderDirectPay(null,2,"313332082914","86041110000075926", "客户客户"));
return
Result
.
ok
(
bankService
.
orderDirectPay
(
null
,
1
,
"313332082914"
,
payAcctNo
,
payAcctNm
));
}
}
@ApiOperation
(
value
=
"查询"
,
notes
=
"<br>By:艾庆国"
)
@ApiOperation
(
value
=
"查询"
,
notes
=
"<br>By:艾庆国"
)
...
@@ -62,4 +72,12 @@ public class TempBankController {
...
@@ -62,4 +72,12 @@ public class TempBankController {
return
Result
.
ok
(
bankService
.
refund
(
orgMerSeqNo
,
amount
,
orgTransSeqNo
));
return
Result
.
ok
(
bankService
.
refund
(
orgMerSeqNo
,
amount
,
orgTransSeqNo
));
}
}
@ApiOperation
(
value
=
"回调"
,
notes
=
"<br>By:艾庆国"
)
@RequestMapping
(
value
=
"/notify"
,
method
=
RequestMethod
.
POST
)
public
Result
notify
(
NbBankOrderResultVO
param
)
{
bankService
.
orderPayCallback
(
param
.
getMerSeqNo
(),
param
.
getTransSeqNo
(),
param
.
getAmount
(),
param
.
getAmount
(),
param
.
getTransStatus
(),
param
.
getSignNo
());
return
Result
.
ok
();
}
}
}
performance-web/src/main/java/com/clx/performance/service/impl/thirdparty/nbbank/NbBankNotifyServiceImpl.java
浏览文件 @
795dde7c
...
@@ -2,6 +2,7 @@ package com.clx.performance.service.impl.thirdparty.nbbank;
...
@@ -2,6 +2,7 @@ package com.clx.performance.service.impl.thirdparty.nbbank;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.clx.performance.config.nbbank.NbBankConfig
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.enums.nbbank.NbBankRecordEnum
;
import
com.clx.performance.enums.nbbank.NbBankRecordEnum
;
import
com.clx.performance.service.thirdparty.nbbank.NbBankNotifyService
;
import
com.clx.performance.service.thirdparty.nbbank.NbBankNotifyService
;
...
@@ -13,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -13,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
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
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -20,6 +22,9 @@ import java.math.BigDecimal;
...
@@ -20,6 +22,9 @@ import java.math.BigDecimal;
@Service
@Service
public
class
NbBankNotifyServiceImpl
implements
NbBankNotifyService
{
public
class
NbBankNotifyServiceImpl
implements
NbBankNotifyService
{
@Autowired
private
NbBankConfig
nbBankConfig
;
@Autowired
@Autowired
private
NbBankService
bankService
;
private
NbBankService
bankService
;
...
@@ -64,13 +69,14 @@ public class NbBankNotifyServiceImpl implements NbBankNotifyService {
...
@@ -64,13 +69,14 @@ public class NbBankNotifyServiceImpl implements NbBankNotifyService {
* }
* }
* }
* }
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
public
void
payNotify
(
String
body
)
{
public
void
payNotify
(
String
body
)
{
log
.
info
(
"宁波银行回调, data:{}"
,
JSON
.
toJSONString
(
body
));
log
.
info
(
"宁波银行回调, data:{}"
,
JSON
.
toJSONString
(
body
));
try
{
try
{
RequestApiData
requestApiData
=
new
RequestApiData
();
RequestApiData
requestApiData
=
new
RequestApiData
();
requestApiData
.
setAppkey
(
"77667c76_3503_4c04_95f7_fc10938c7942"
);
requestApiData
.
setAppkey
(
nbBankConfig
.
getAppKey
()
);
requestApiData
.
setData
(
JSON
.
parseObject
(
body
));
requestApiData
.
setData
(
JSON
.
parseObject
(
body
));
requestApiData
.
setServiceId
(
"notifyMerchant"
);
requestApiData
.
setServiceId
(
"notifyMerchant"
);
...
@@ -89,11 +95,6 @@ public class NbBankNotifyServiceImpl implements NbBankNotifyService {
...
@@ -89,11 +95,6 @@ public class NbBankNotifyServiceImpl implements NbBankNotifyService {
nbBankThirdpartyService
.
recordSave
(
NbBankRecordEnum
.
Type
.
NOTIFY_MERCHANT
.
getCode
(),
request
,
response
);
nbBankThirdpartyService
.
recordSave
(
NbBankRecordEnum
.
Type
.
NOTIFY_MERCHANT
.
getCode
(),
request
,
response
);
if
(!
StringUtils
.
equals
(
data
.
getString
(
"errorCode"
),
"000000"
)){
log
.
info
(
"宁波银行, 下单失败(notifyMerchant), code:{}, msg:{}"
,
data
.
getString
(
"errorCode"
),
data
.
getString
(
"errorMsg"
));
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
NB_BANK_API_ERROR
);
}
String
merSeqNo
=
data
.
getString
(
"merSeqNo"
);
String
merSeqNo
=
data
.
getString
(
"merSeqNo"
);
String
transSeqNo
=
data
.
getString
(
"transSeqNo"
);
String
transSeqNo
=
data
.
getString
(
"transSeqNo"
);
Integer
trxAmt
=
data
.
getBigDecimal
(
"trxAmt"
).
movePointRight
(
2
).
intValue
();
Integer
trxAmt
=
data
.
getBigDecimal
(
"trxAmt"
).
movePointRight
(
2
).
intValue
();
...
...
performance-web/src/main/java/com/clx/performance/service/impl/thirdparty/nbbank/NbBankServiceImpl.java
浏览文件 @
795dde7c
...
@@ -44,7 +44,8 @@ public class NbBankServiceImpl implements NbBankService {
...
@@ -44,7 +44,8 @@ public class NbBankServiceImpl implements NbBankService {
JSONObject
data
=
bankThirdpartyService
.
directBankTransferOrder
(
merSeqNo
,
merDtTm
,
amount
);
JSONObject
data
=
bankThirdpartyService
.
directBankTransferOrder
(
merSeqNo
,
merDtTm
,
amount
);
String
transSeqNo
=
data
.
getString
(
"transSeqNo"
);
String
transSeqNo
=
data
.
getString
(
"transSeqNo"
);
String
signNo
=
data
.
getString
(
"signNo"
);
String
cardNo
=
data
.
getString
(
"cardNo"
);
String
signNo
=
getSignNo
(
data
.
getString
(
"signNo"
),
cardNo
);
NbBankOrderPayResultVO
result
=
new
NbBankOrderPayResultVO
();
NbBankOrderPayResultVO
result
=
new
NbBankOrderPayResultVO
();
result
.
setAmount
(
amount
);
result
.
setAmount
(
amount
);
...
@@ -203,25 +204,54 @@ public class NbBankServiceImpl implements NbBankService {
...
@@ -203,25 +204,54 @@ public class NbBankServiceImpl implements NbBankService {
log
.
info
(
"宁波银行支付回调, merSeqNo:{}, transSeqNo:{}, trxAmt:{}, realTrxAmt:{}, transSeqNo:{}, signNo:{}"
,
log
.
info
(
"宁波银行支付回调, merSeqNo:{}, transSeqNo:{}, trxAmt:{}, realTrxAmt:{}, transSeqNo:{}, signNo:{}"
,
merSeqNo
,
transSeqNo
,
trxAmt
,
realTrxAmt
,
transStatus
,
signNo
);
merSeqNo
,
transSeqNo
,
trxAmt
,
realTrxAmt
,
transStatus
,
signNo
);
NbBankOrderResultVO
result
=
new
NbBankOrderResultVO
();
if
(
StringUtils
.
equals
(
transStatus
,
"00"
)){
//交易成功
if
(
StringUtils
.
equals
(
transStatus
,
"00"
)){
//交易成功
result
.
setTransStatus
(
1
);
}
}
if
(
StringUtils
.
equals
(
transStatus
,
"01"
)){
//交易失败
if
(
StringUtils
.
equals
(
transStatus
,
"01"
)){
//交易失败
result
.
setTransStatus
(
2
);
}
}
if
(
StringUtils
.
equals
(
transStatus
,
"02"
)){
//交易已受理
if
(
StringUtils
.
equals
(
transStatus
,
"02"
)){
//交易已受理
result
.
setTransStatus
(
3
);
}
}
if
(
StringUtils
.
equals
(
transStatus
,
"80"
)){
//订单初始状态
if
(
StringUtils
.
equals
(
transStatus
,
"80"
)){
//订单初始状态
result
.
setTransStatus
(
4
);
}
}
if
(
StringUtils
.
equals
(
transStatus
,
"90"
)){
//交易不存在
if
(
StringUtils
.
equals
(
transStatus
,
"90"
)){
//交易不存在
result
.
setTransStatus
(
5
);
}
}
if
(
StringUtils
.
equals
(
transStatus
,
"99"
)){
//交易超时,须发起交易结果查询
if
(
StringUtils
.
equals
(
transStatus
,
"99"
)){
//交易超时,须发起交易结果查询
result
.
setTransStatus
(
6
);
}
orderPayCallback
(
merSeqNo
,
transSeqNo
,
trxAmt
,
realTrxAmt
,
result
.
getTransStatus
(),
signNo
);
}
}
/**
* 银行回调
* @param merSeqNo 商户流水号
* @param transSeqNo 第三方流水号
* @param trxAmt 订单金额分
* @param realTrxAmt 实收金额分
* @param transStatus 交易状态
* @param signNo 转账编码
*/
@Override
public
void
orderPayCallback
(
String
merSeqNo
,
String
transSeqNo
,
Integer
trxAmt
,
Integer
realTrxAmt
,
Integer
transStatus
,
String
signNo
)
{
log
.
info
(
"宁波银行支付回调, merSeqNo:{}, transSeqNo:{}, trxAmt:{}, realTrxAmt:{}, transSeqNo:{}, signNo:{}"
,
merSeqNo
,
transSeqNo
,
trxAmt
,
realTrxAmt
,
transStatus
,
signNo
);
}
/**
* 获取转账编码,默认银行卡后7位
*/
private
String
getSignNo
(
String
signNo
,
String
cardNo
){
return
StringUtils
.
isBlank
(
signNo
)?
StringUtils
.
right
(
cardNo
,
7
)
:
signNo
;
}
}
}
}
performance-web/src/main/java/com/clx/performance/service/thirdparty/nbbank/NbBankService.java
浏览文件 @
795dde7c
...
@@ -24,5 +24,10 @@ public interface NbBankService {
...
@@ -24,5 +24,10 @@ public interface NbBankService {
String
transStatus
,
String
transStatus
,
String
signNo
String
signNo
);
);
void
orderPayCallback
(
String
merSeqNo
,
String
transSeqNo
,
Integer
trxAmt
,
Integer
realTrxAmt
,
Integer
transStatus
,
String
signNo
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论