记得上下班打卡 | 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
c4d4f989
Commit
c4d4f989
authored
Aug 05, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dragon - 退款返回错误内容
parent
1711f9b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
DragonOrderRefundsServiceImpl.java
...ce/dragon/service/impl/DragonOrderRefundsServiceImpl.java
+14
-12
No files found.
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/service/impl/DragonOrderRefundsServiceImpl.java
View file @
c4d4f989
...
@@ -99,9 +99,11 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -99,9 +99,11 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
break
;
break
;
}
}
log
.
info
(
"dto = "
+
JSON
.
toJSONString
(
dto
));
log
.
info
(
"dto = "
+
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"refunding"
))
{
if
(
dto
==
null
)
{
return
ResponseDto
.
failure
(
"退款失败:参数异常"
);
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"refunding"
))
{
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"refunded"
))
{
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"refunded"
))
{
//调用回调
//调用回调
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"error"
))
{
}
else
if
(
dto
.
getResult
().
equalsIgnoreCase
(
"error"
))
{
...
@@ -115,14 +117,14 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -115,14 +117,14 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
refundAppDto
.
setOrderRefundCode
(
orderRefundCode
);
refundAppDto
.
setOrderRefundCode
(
orderRefundCode
);
refundAppDto
.
setRefundCode
(
refundCode
);
refundAppDto
.
setRefundCode
(
refundCode
);
log
.
info
(
"refundAppDto = "
+
JSON
.
toJSONString
(
refundAppDto
));
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
.
info
(
"orderCode = "
+
orderCode
+
""
,
e
);
log
.
info
(
"orderCode = "
+
orderCode
+
""
,
e
);
return
ResponseDto
.
failure
(
"退款失败:"
+
e
.
getMessage
());
return
ResponseDto
.
failure
(
"退款失败:"
+
e
.
getMessage
());
}
}
}
}
...
@@ -171,7 +173,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -171,7 +173,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
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
(
wePayRefundReturnDto
.
getErrCodeDes
());
channelDto
.
setMessage
(
wePayRefundReturnDto
.
getErrCodeDes
());
contentDto
.
setRequest
(
data
);
contentDto
.
setRequest
(
data
);
contentDto
.
setResponse
(
jsonStr
);
contentDto
.
setResponse
(
jsonStr
);
channelDto
.
setContent
(
contentDto
);
channelDto
.
setContent
(
contentDto
);
...
@@ -381,7 +383,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -381,7 +383,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
dto
.
setRefundAt
(
refundAt
);
dto
.
setRefundAt
(
refundAt
);
dto
.
setRefundError
(
callBackDto
.
getReturnMsg
());
dto
.
setRefundError
(
callBackDto
.
getReturnMsg
());
log
.
info
(
"SEND WEPAY NOTIFTURL = "
+
JSON
.
toJSONString
(
dto
));
log
.
info
(
"SEND WEPAY NOTIFTURL = "
+
JSON
.
toJSONString
(
dto
));
sendNotifyUrl
(
dto
,
null
);
sendNotifyUrl
(
dto
,
null
);
mqHandleUtil
.
sendMySqlRedis
(
mqHandleUtil
.
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund_log.insert"
),
SqlMapping
.
get
(
"dragon_order_refund_log.insert"
),
...
@@ -410,7 +412,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -410,7 +412,7 @@ 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
{
try
{
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
AlipayTradeFastpayRefundQueryRequest
request
=
new
AlipayTradeFastpayRefundQueryRequest
();
//创建API对应的request类
AlipayTradeFastpayRefundQueryRequest
request
=
new
AlipayTradeFastpayRefundQueryRequest
();
//创建API对应的request类
...
@@ -435,7 +437,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -435,7 +437,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
dto
.
setRefundAt
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
LocalDateTime
.
now
()));
dto
.
setRefundAt
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
LocalDateTime
.
now
()));
dto
.
setRefundPrice
(
response
.
getRefundAmount
());
dto
.
setRefundPrice
(
response
.
getRefundAmount
());
dto
.
setRefundError
(
""
);
dto
.
setRefundError
(
""
);
sendNotifyUrl
(
dto
,
callBackUrl
);
sendNotifyUrl
(
dto
,
callBackUrl
);
log
.
debug
(
"SEND ALIPAY NOTIFTURL2 = "
+
JSON
.
toJSONString
(
dto
));
log
.
debug
(
"SEND ALIPAY NOTIFTURL2 = "
+
JSON
.
toJSONString
(
dto
));
...
@@ -462,7 +464,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -462,7 +464,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
return
"fail"
;
return
"fail"
;
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
return
null
;
return
null
;
...
@@ -494,7 +496,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -494,7 +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
(
""
);
sendNotifyUrl
(
dto
,
null
);
sendNotifyUrl
(
dto
,
null
);
mqHandleUtil
.
sendMySqlRedis
(
mqHandleUtil
.
sendMySqlRedis
(
SqlMapping
.
get
(
"dragon_order_refund_log.insert"
),
SqlMapping
.
get
(
"dragon_order_refund_log.insert"
),
...
@@ -525,7 +527,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -525,7 +527,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
}
}
}
}
private
void
sendNotifyUrl
(
NotifyUrlDto
notifyUrlDto
,
String
url
)
{
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
());
...
@@ -534,7 +536,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
...
@@ -534,7 +536,7 @@ 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
(
url
==
null
?
dataUtils
.
getRefundNotifyUrl
(
DragonConstant
.
REFUND_REDIS_KET
+
notifyUrlDto
.
getOrderRefundCode
()):
url
,
params
);
String
response
=
HttpUtil
.
post
(
url
==
null
?
dataUtils
.
getRefundNotifyUrl
(
DragonConstant
.
REFUND_REDIS_KET
+
notifyUrlDto
.
getOrderRefundCode
())
:
url
,
params
);
log
.
info
(
"RETURN RESPONSE="
+
response
);
log
.
info
(
"RETURN RESPONSE="
+
response
);
if
(
response
.
equals
(
"success"
))
{
if
(
response
.
equals
(
"success"
))
{
mqHandleUtil
.
sendMySqlRedis
(
mqHandleUtil
.
sendMySqlRedis
(
...
...
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