记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
bdc3454b
Commit
bdc3454b
authored
Aug 12, 2021
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改redis的退款相关id获取
parent
cddb2f87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
31 deletions
+83
-31
DragonOrderRefundsServiceImpl.java
...ce/dragon/service/impl/DragonOrderRefundsServiceImpl.java
+83
-31
No files found.
liquidnet-bus-service/liquidnet-service-notify/liquidnet-service-notify-impl/src/main/java/com/liquidnet/service/dragon/service/impl/DragonOrderRefundsServiceImpl.java
View file @
bdc3454b
...
@@ -68,7 +68,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -68,7 +68,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
new
Object
[]{
code
,
refundCode
,
orderRefundCode
,
price
,
reason
,
notifyUrl
,
paymentType
,
nowTime
,
nowTime
},
new
Object
[]{
code
,
refundCode
,
orderRefundCode
,
price
,
reason
,
notifyUrl
,
paymentType
,
nowTime
,
nowTime
},
DragonConstant
.
MysqlRedisQueueEnum
.
DRAGON_REFUND_KEY
.
getCode
()
DragonConstant
.
MysqlRedisQueueEnum
.
DRAGON_REFUND_KEY
.
getCode
()
);
);
dataUtils
.
setRefundNotifyUrl
(
DragonConstant
.
REFUND_REDIS_KET
+
orderRefundCode
,
notifyUrl
);
dataUtils
.
setRefundNotifyUrl
(
orderRefundCode
,
notifyUrl
);
DragonRefundChannelDto
dto
=
null
;
DragonRefundChannelDto
dto
=
null
;
String
localWePayCallBackUrl
=
url
+
"/refund/callBack/wepay"
;
String
localWePayCallBackUrl
=
url
+
"/refund/callBack/wepay"
;
if
(
insertResult
)
{
if
(
insertResult
)
{
...
@@ -94,32 +94,37 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -94,32 +94,37 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
case
DragonConstant
.
REFUND_TYPE_JS_WEPAY
:
case
DragonConstant
.
REFUND_TYPE_JS_WEPAY
:
dto
=
weyPayRefund
(
code
,
orderRefundCode
,
code
,
reason
,
price
,
priceTotal
,
paymentId
,
paymentType
,
localWePayCallBackUrl
,
nowTime
);
dto
=
weyPayRefund
(
code
,
orderRefundCode
,
code
,
reason
,
price
,
priceTotal
,
paymentId
,
paymentType
,
localWePayCallBackUrl
,
nowTime
);
break
;
break
;
case
DragonConstant
.
REFUND_TYPE_APPLET_WEPAY
:
dto
=
weyPayRefund
(
code
,
orderRefundCode
,
code
,
reason
,
price
,
priceTotal
,
paymentId
,
paymentType
,
localWePayCallBackUrl
,
nowTime
);
break
;
}
}
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"refunding"
))
{
log
.
info
(
"dto = "
+
JSON
.
toJSONString
(
dto
));
log
.
info
(
""
);
if
(
dto
==
null
)
{
return
ResponseDto
.
failure
(
"退款失败:参数异常"
);
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"refunding"
))
{
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"refunded"
))
{
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"refunded"
))
{
//调用回调
//调用回调
log
.
info
(
""
);
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"error"
))
{
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"error"
))
{
//调用回调
//调用回调
log
.
error
(
""
);
return
ResponseDto
.
failure
(
"退款失败:"
+
dto
.
getMessage
());
return
ResponseDto
.
failure
(
"退款失败:"
+
dto
.
getMessage
());
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"exception"
))
{
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"exception"
))
{
log
.
error
(
""
);
}
}
DragonRefundAppDto
refundAppDto
=
new
DragonRefundAppDto
();
DragonRefundAppDto
refundAppDto
=
new
DragonRefundAppDto
();
refundAppDto
.
setOrderCode
(
orderCode
);
refundAppDto
.
setOrderCode
(
orderCode
);
refundAppDto
.
setCode
(
code
);
refundAppDto
.
setCode
(
code
);
refundAppDto
.
setOrderRefundCode
(
orderRefundCode
);
refundAppDto
.
setOrderRefundCode
(
orderRefundCode
);
refundAppDto
.
setRefundCode
(
refundCode
);
refundAppDto
.
setRefundCode
(
refundCode
);
log
.
info
(
"refundAppDto = "
+
JSON
.
toJSONString
(
refundAppDto
));
return
ResponseDto
.
success
(
refundAppDto
);
return
ResponseDto
.
success
(
refundAppDto
);
}
else
{
}
else
{
return
ResponseDto
.
failure
(
"退款失败"
);
return
ResponseDto
.
failure
(
"退款失败"
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
log
.
error
(
""
);
log
.
info
(
"orderCode = "
+
orderCode
+
""
,
e
);
return
ResponseDto
.
failure
(
"退款失败:"
+
e
.
getMessage
());
return
ResponseDto
.
failure
(
"退款失败:"
+
e
.
getMessage
());
}
}
}
}
...
@@ -155,7 +160,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -155,7 +160,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
String
sign
=
PayWepayUtils
.
getInstance
().
createSign
(
parameters
);
String
sign
=
PayWepayUtils
.
getInstance
().
createSign
(
parameters
);
parameters
.
put
(
"sign"
,
sign
);
parameters
.
put
(
"sign"
,
sign
);
String
data
=
PayWepayUtils
.
getInstance
().
getRequestXml
(
parameters
);
String
data
=
PayWepayUtils
.
getInstance
().
getRequestXml
(
parameters
);
log
.
debug
(
"XMLSTRING = "
+
data
)
;
String
refundError
=
""
;
try
{
try
{
HttpPost
httpost
=
new
HttpPost
(
"https://api.mch.weixin.qq.com/secapi/pay/refund"
);
HttpPost
httpost
=
new
HttpPost
(
"https://api.mch.weixin.qq.com/secapi/pay/refund"
);
httpost
.
setEntity
(
new
StringEntity
(
data
,
"UTF-8"
));
httpost
.
setEntity
(
new
StringEntity
(
data
,
"UTF-8"
));
...
@@ -164,20 +169,18 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -164,20 +169,18 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
HttpEntity
entity
=
response
.
getEntity
();
HttpEntity
entity
=
response
.
getEntity
();
entity
.
getContent
();
entity
.
getContent
();
String
jsonStr
=
EntityUtils
.
toString
(
entity
,
"UTF-8"
);
String
jsonStr
=
EntityUtils
.
toString
(
entity
,
"UTF-8"
);
log
.
debug
(
"JSONSTR = "
+
jsonStr
);
log
.
info
(
"JSONSTR = "
+
jsonStr
);
WePayRefundReturnDto
wePayRefundReturnDto
=
XmlUtil
.
toBean
(
jsonStr
,
WePayRefundReturnDto
.
class
);
WePayRefundReturnDto
wePayRefundReturnDto
=
XmlUtil
.
toBean
(
jsonStr
,
WePayRefundReturnDto
.
class
);
if
(
wePayRefundReturnDto
.
getErrCodeDes
()
!=
null
)
{
if
(
wePayRefundReturnDto
.
getErrCodeDes
()
!=
null
)
{
channelDto
.
setResult
(
"error"
);
channelDto
.
setResult
(
"error"
);
channelDto
.
setMessage
(
paymentType
+
" refund error: "
+
wePayRefundReturnDto
.
getErrCodeDes
());
channelDto
.
setMessage
(
wePayRefundReturnDto
.
getErrCodeDes
());
contentDto
.
setRequest
(
data
);
contentDto
.
setRequest
(
data
);
contentDto
.
setResponse
(
jsonStr
);
contentDto
.
setResponse
(
jsonStr
);
channelDto
.
setContent
(
contentDto
);
channelDto
.
setContent
(
contentDto
);
return
channelDto
;
return
channelDto
;
}
}
log
.
debug
(
"BEAN = "
+
wePayRefundReturnDto
);
if
(!
wePayRefundReturnDto
.
getReturnCode
().
equalsIgnoreCase
(
"SUCCESS"
)
||
wePayRefundReturnDto
.
getReturnCode
()
==
null
)
{
if
(!
wePayRefundReturnDto
.
getReturnCode
().
equalsIgnoreCase
(
"SUCCESS"
)
||
wePayRefundReturnDto
.
getReturnCode
()
==
null
)
{
try
{
try
{
String
refundError
=
""
;
refundStatus
=
DragonConstant
.
RefundStatusEnum
.
STATUS_ERROR
.
getCode
();
refundStatus
=
DragonConstant
.
RefundStatusEnum
.
STATUS_ERROR
.
getCode
();
if
(
null
==
wePayRefundReturnDto
.
getReturnMsg
())
{
if
(
null
==
wePayRefundReturnDto
.
getReturnMsg
())
{
refundError
=
"退款失败,原因未知"
;
refundError
=
"退款失败,原因未知"
;
...
@@ -202,7 +205,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -202,7 +205,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
return
channelDto
;
return
channelDto
;
}
}
channelDto
.
setResult
(
"error"
);
channelDto
.
setResult
(
"error"
);
channelDto
.
setMessage
(
paymentType
+
" refund error: "
);
channelDto
.
setMessage
(
refundError
);
contentDto
.
setRequest
(
data
);
contentDto
.
setRequest
(
data
);
contentDto
.
setResponse
(
jsonStr
);
contentDto
.
setResponse
(
jsonStr
);
channelDto
.
setContent
(
contentDto
);
channelDto
.
setContent
(
contentDto
);
...
@@ -261,6 +264,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -261,6 +264,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
RefundContentDto
contentDto
=
new
RefundContentDto
();
RefundContentDto
contentDto
=
new
RefundContentDto
();
AlipayTradeRefundRequest
request
=
new
AlipayTradeRefundRequest
();
//创建API对应的request类
AlipayTradeRefundRequest
request
=
new
AlipayTradeRefundRequest
();
//创建API对应的request类
try
{
try
{
String
refundError
=
""
;
request
.
setBizContent
(
"{"
+
request
.
setBizContent
(
"{"
+
"\"out_trade_no\":\""
+
code
+
"\","
+
"\"out_trade_no\":\""
+
code
+
"\","
+
"\"trade_no\":\""
+
paymentId
+
"\","
+
"\"trade_no\":\""
+
paymentId
+
"\","
+
...
@@ -268,9 +272,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -268,9 +272,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
"\"refund_reason\":\""
+
reason
+
"\","
+
"\"refund_reason\":\""
+
reason
+
"\","
+
"\"refund_amount\":\""
+
price
.
doubleValue
()
+
"\"}"
);
//设置业务参数
"\"refund_amount\":\""
+
price
.
doubleValue
()
+
"\"}"
);
//设置业务参数
AlipayTradeRefundResponse
response
=
PayAlipayUtils
.
getInstance
().
getHttpClient
().
execute
(
request
);
AlipayTradeRefundResponse
response
=
PayAlipayUtils
.
getInstance
().
getHttpClient
().
execute
(
request
);
if
(
response
.
getFundChange
()
.
equals
(
"N"
)
||
response
.
getFundChange
()
==
null
)
{
if
(
response
.
getFundChange
()
==
null
||
response
.
getFundChange
().
equals
(
"N"
)
)
{
try
{
try
{
String
refundError
=
""
;
refundStatus
=
DragonConstant
.
RefundStatusEnum
.
STATUS_ERROR
.
getCode
();
refundStatus
=
DragonConstant
.
RefundStatusEnum
.
STATUS_ERROR
.
getCode
();
if
(
null
==
response
.
getSubMsg
())
{
if
(
null
==
response
.
getSubMsg
())
{
refundError
=
"退款失败,原因未知"
;
refundError
=
"退款失败,原因未知"
;
...
@@ -295,7 +298,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -295,7 +298,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
return
channelDto
;
return
channelDto
;
}
}
channelDto
.
setResult
(
"error"
);
channelDto
.
setResult
(
"error"
);
channelDto
.
setMessage
(
paymentType
+
" refund error: "
);
channelDto
.
setMessage
(
refundError
);
contentDto
.
setRequest
(
JSON
.
toJSONString
(
response
.
getParams
()));
contentDto
.
setRequest
(
JSON
.
toJSONString
(
response
.
getParams
()));
contentDto
.
setResponse
(
response
.
getBody
());
contentDto
.
setResponse
(
response
.
getBody
());
channelDto
.
setContent
(
contentDto
);
channelDto
.
setContent
(
contentDto
);
...
@@ -323,7 +326,6 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -323,7 +326,6 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
);
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
log
.
error
(
""
);
channelDto
.
setResult
(
"exception"
);
channelDto
.
setResult
(
"exception"
);
channelDto
.
setMessage
(
"update order refund with db error: "
+
e
.
getMessage
());
channelDto
.
setMessage
(
"update order refund with db error: "
+
e
.
getMessage
());
contentDto
.
setRequest
(
JSON
.
toJSONString
(
response
.
getParams
()));
contentDto
.
setRequest
(
JSON
.
toJSONString
(
response
.
getParams
()));
...
@@ -361,17 +363,14 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -361,17 +363,14 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
String
jsonStr
=
new
String
(
outSteam
.
toByteArray
(),
"utf-8"
);
String
jsonStr
=
new
String
(
outSteam
.
toByteArray
(),
"utf-8"
);
outSteam
.
close
();
outSteam
.
close
();
inStream
.
close
();
inStream
.
close
();
log
.
debug
(
"JSON = "
+
jsonStr
);
WePayRefundReturnCallBackDto
callBackDto
=
XmlUtil
.
toBean
(
jsonStr
,
WePayRefundReturnCallBackDto
.
class
);
WePayRefundReturnCallBackDto
callBackDto
=
XmlUtil
.
toBean
(
jsonStr
,
WePayRefundReturnCallBackDto
.
class
);
log
.
debug
(
"DATA
= "
+
callBackDto
);
log
.
info
(
"callBackDto
= "
+
callBackDto
);
if
(
callBackDto
.
getReturnCode
().
equalsIgnoreCase
(
"SUCCESS"
))
{
if
(
callBackDto
.
getReturnCode
().
equalsIgnoreCase
(
"SUCCESS"
))
{
String
reqInfo
=
PayWepayUtils
.
getInstance
().
unCodeReqInfo
(
callBackDto
.
getReqInfo
());
String
reqInfo
=
PayWepayUtils
.
getInstance
().
unCodeReqInfo
(
callBackDto
.
getReqInfo
());
log
.
debug
(
"REQINFO = "
+
reqInfo
);
WePayRefundReturnCallBackInfoDto
info
=
XmlUtil
.
toBean
(
reqInfo
,
WePayRefundReturnCallBackInfoDto
.
class
);
WePayRefundReturnCallBackInfoDto
info
=
XmlUtil
.
toBean
(
reqInfo
,
WePayRefundReturnCallBackInfoDto
.
class
);
String
outRefundNo
=
info
.
getOutRefundNo
();
String
outRefundNo
=
info
.
getOutRefundNo
();
String
refundAt
=
info
.
getSuccessTime
();
String
refundAt
=
info
.
getSuccessTime
();
try
{
try
{
NotifyUrlDto
dto
=
new
NotifyUrlDto
();
NotifyUrlDto
dto
=
new
NotifyUrlDto
();
if
(
info
.
getRefundStatus
().
equalsIgnoreCase
(
"SUCCESS"
))
{
if
(
info
.
getRefundStatus
().
equalsIgnoreCase
(
"SUCCESS"
))
{
dto
.
setStatus
(
1
);
dto
.
setStatus
(
1
);
...
@@ -383,8 +382,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -383,8 +382,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
dto
.
setRefundPrice
(
new
BigDecimal
(
info
.
getRefundFee
()).
divide
(
BigDecimal
.
valueOf
(
100
)).
toString
());
dto
.
setRefundPrice
(
new
BigDecimal
(
info
.
getRefundFee
()).
divide
(
BigDecimal
.
valueOf
(
100
)).
toString
());
dto
.
setRefundAt
(
refundAt
);
dto
.
setRefundAt
(
refundAt
);
dto
.
setRefundError
(
callBackDto
.
getReturnMsg
());
dto
.
setRefundError
(
callBackDto
.
getReturnMsg
());
log
.
debug
(
"SEND WEPAY NOTIFTURL = "
+
JSON
.
toJSONString
(
dto
));
log
.
info
(
"SEND WEPAY NOTIFTURL = "
+
JSON
.
toJSONString
(
dto
));
sendNotifyUrl
(
dto
);
sendNotifyUrl
(
dto
,
null
);
mqHandleUtil
.
sendMySqlRedis
(
mqHandleUtil
.
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund_log.insert"
),
SqlMapping
.
get
(
"dragon_order_refund_log.insert"
),
...
@@ -413,7 +412,61 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -413,7 +412,61 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
}
}
@Override
@Override
public
String
aliPayRefundCodeStatus
(
String
outTradeNo
,
String
tradeNo
,
String
outBizNo
,
String
callBackUrl
)
{
public
String
aliPayRefundCodeStatus
(
String
outTradeNo
,
String
tradeNo
,
String
outBizNo
,
String
callBackUrl
)
{
try
{
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
AlipayTradeFastpayRefundQueryRequest
request
=
new
AlipayTradeFastpayRefundQueryRequest
();
//创建API对应的request类
request
.
setBizContent
(
"{"
+
"\"out_trade_no\":\""
+
outTradeNo
+
"\","
+
"\"trade_no\":\""
+
tradeNo
+
"\","
+
"\"out_request_no\":\""
+
outBizNo
+
"\"}"
);
//设置业务参数
AlipayTradeFastpayRefundQueryResponse
response
=
PayAlipayUtils
.
getInstance
().
getHttpClient
().
execute
(
request
);
log
.
info
(
"AlipayTradeFastpayRefundQueryRequest -> data = "
+
response
);
if
(
response
.
isSuccess
())
{
try
{
NotifyUrlDto
dto
=
new
NotifyUrlDto
();
if
(
response
.
getMsg
().
equalsIgnoreCase
(
"SUCCESS"
))
{
dto
.
setStatus
(
1
);
}
else
{
dto
.
setStatus
(
0
);
}
dto
.
setOrderRefundCode
(
response
.
getOutRequestNo
());
dto
.
setRefundCode
(
response
.
getOutTradeNo
());
dto
.
setRefundPrice
(
response
.
getRefundAmount
());
dto
.
setRefundAt
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
LocalDateTime
.
now
()));
dto
.
setRefundPrice
(
response
.
getRefundAmount
());
dto
.
setRefundError
(
""
);
sendNotifyUrl
(
dto
,
callBackUrl
);
log
.
debug
(
"SEND ALIPAY NOTIFTURL2 = "
+
JSON
.
toJSONString
(
dto
));
mqHandleUtil
.
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund_log.insert"
),
new
Object
[]{
outBizNo
,
"ALIPAY"
,
JSON
.
toJSONString
(
response
),
nowTime
,
nowTime
},
DragonConstant
.
MysqlRedisQueueEnum
.
DRAGON_REFUND_KEY
.
getCode
()
);
mqHandleUtil
.
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund_success.update"
),
new
Object
[]{
nowTime
,
DateUtil
.
format
(
response
.
getGmtRefundPay
(),
DateUtil
.
Formatter
.
yyyyMMddHHmmss
),
DragonConstant
.
RefundStatusEnum
.
STATUS_REFUNDED
.
getCode
(),
response
.
getOutRequestNo
()},
DragonConstant
.
MysqlRedisQueueEnum
.
DRAGON_REFUND_KEY
.
getCode
()
);
return
"success"
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
""
);
return
"fail"
;
}
}
else
{
log
.
error
(
"response.isSuccess() -> fail "
);
return
"fail"
;
}
}
catch
(
Exception
e
)
{
}
return
null
;
return
null
;
}
}
...
@@ -427,11 +480,10 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -427,11 +480,10 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
"\"trade_no\":\""
+
callBackDto
.
getTradeNo
()
+
"\","
+
"\"trade_no\":\""
+
callBackDto
.
getTradeNo
()
+
"\","
+
"\"out_request_no\":\""
+
callBackDto
.
getOutBizNo
()
+
"\"}"
);
//设置业务参数
"\"out_request_no\":\""
+
callBackDto
.
getOutBizNo
()
+
"\"}"
);
//设置业务参数
AlipayTradeFastpayRefundQueryResponse
response
=
PayAlipayUtils
.
getInstance
().
getHttpClient
().
execute
(
request
);
AlipayTradeFastpayRefundQueryResponse
response
=
PayAlipayUtils
.
getInstance
().
getHttpClient
().
execute
(
request
);
log
.
debug
(
"AlipayTradeFastpayRefundQueryRequest -> data = "
+
JSON
.
toJSONString
(
response
));
log
.
info
(
"AlipayTradeFastpayRefundQueryRequest -> data = "
+
JSON
.
toJSONString
(
response
));
if
(
response
.
isSuccess
())
{
if
(
response
.
isSuccess
())
{
try
{
try
{
NotifyUrlDto
dto
=
new
NotifyUrlDto
();
NotifyUrlDto
dto
=
new
NotifyUrlDto
();
if
(
response
.
getMsg
().
equalsIgnoreCase
(
"SUCCESS"
))
{
if
(
response
.
getMsg
().
equalsIgnoreCase
(
"SUCCESS"
))
{
dto
.
setStatus
(
1
);
dto
.
setStatus
(
1
);
...
@@ -444,8 +496,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -444,8 +496,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
dto
.
setRefundAt
(
callBackDto
.
getGmtRefund
());
dto
.
setRefundAt
(
callBackDto
.
getGmtRefund
());
dto
.
setRefundPrice
(
response
.
getRefundAmount
());
dto
.
setRefundPrice
(
response
.
getRefundAmount
());
dto
.
setRefundError
(
""
);
dto
.
setRefundError
(
""
);
log
.
debug
(
"SEND ALIPAY NOTIFTURL = "
+
JSON
.
toJSONString
(
dto
));
sendNotifyUrl
(
dto
,
null
);
sendNotifyUrl
(
dto
);
mqHandleUtil
.
sendMySqlRedis
(
mqHandleUtil
.
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund_log.insert"
),
SqlMapping
.
get
(
"dragon_order_refund_log.insert"
),
...
@@ -476,7 +527,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -476,7 +527,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
}
}
}
}
private
void
sendNotifyUrl
(
NotifyUrlDto
notifyUrlDto
)
{
private
void
sendNotifyUrl
(
NotifyUrlDto
notifyUrlDto
,
String
url
)
{
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
();
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
();
params
.
add
(
"orderRefundCode"
,
notifyUrlDto
.
getOrderRefundCode
());
params
.
add
(
"orderRefundCode"
,
notifyUrlDto
.
getOrderRefundCode
());
...
@@ -485,8 +536,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -485,8 +536,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
params
.
add
(
"refundError"
,
notifyUrlDto
.
getRefundError
());
params
.
add
(
"refundError"
,
notifyUrlDto
.
getRefundError
());
params
.
add
(
"refundPrice"
,
notifyUrlDto
.
getRefundPrice
());
params
.
add
(
"refundPrice"
,
notifyUrlDto
.
getRefundPrice
());
params
.
add
(
"status"
,
notifyUrlDto
.
getStatus
().
toString
());
params
.
add
(
"status"
,
notifyUrlDto
.
getStatus
().
toString
());
String
response
=
HttpUtil
.
post
(
dataUtils
.
getRefundNotifyUrl
(
DragonConstant
.
REFUND_REDIS_KET
+
notifyUrlDto
.
getOrderRefundCode
())
,
params
);
String
response
=
HttpUtil
.
post
(
url
==
null
?
dataUtils
.
getRefundNotifyUrl
(
notifyUrlDto
.
getOrderRefundCode
())
:
url
,
params
);
log
.
debug
(
"RETURN RESPONSE="
+
response
);
log
.
info
(
"RETURN RESPONSE="
+
response
);
if
(
response
.
equals
(
"success"
))
{
if
(
response
.
equals
(
"success"
))
{
mqHandleUtil
.
sendMySqlRedis
(
mqHandleUtil
.
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund_call_back.update"
),
SqlMapping
.
get
(
"dragon_order_refund_call_back.update"
),
...
@@ -501,4 +552,5 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -501,4 +552,5 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
);
);
}
}
}
}
}
}
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