记得上下班打卡 | 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
feecdd56
Commit
feecdd56
authored
Aug 03, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付宝退款主动查询
parent
b2d54abf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
2 deletions
+52
-2
OrderRefundCallbackController.java
...form/controller/refund/OrderRefundCallbackController.java
+8
-0
OrderRefundsCallbackServiceImpl.java
...tform/service/refund/OrderRefundsCallbackServiceImpl.java
+44
-2
No files found.
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/controller/refund/OrderRefundCallbackController.java
View file @
feecdd56
...
@@ -5,6 +5,7 @@ import com.liquidnet.service.platform.service.refund.OrderRefundsCallbackService
...
@@ -5,6 +5,7 @@ import com.liquidnet.service.platform.service.refund.OrderRefundsCallbackService
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -31,4 +32,11 @@ public class OrderRefundCallbackController {
...
@@ -31,4 +32,11 @@ public class OrderRefundCallbackController {
String
result
=
orderRefundsCallbackServiceImpl
.
refundCallback
(
refundCallbackParam
);
String
result
=
orderRefundsCallbackServiceImpl
.
refundCallback
(
refundCallbackParam
);
return
result
;
return
result
;
}
}
@GetMapping
(
"alipayActiveCallback"
)
@ApiOperation
(
"支付宝主动查询退款结果"
)
public
String
alipayActiveCallback
()
{
String
result
=
orderRefundsCallbackServiceImpl
.
alipayActiveCallback
();
return
result
;
}
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/refund/OrderRefundsCallbackServiceImpl.java
View file @
feecdd56
package
com
.
liquidnet
.
service
.
platform
.
service
.
refund
;
package
com
.
liquidnet
.
service
.
platform
.
service
.
refund
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.commons.lang.util.HttpUtil
;
import
com.liquidnet.service.kylin.constant.KylinTableStatusConst
;
import
com.liquidnet.service.kylin.constant.KylinTableStatusConst
;
import
com.liquidnet.service.kylin.dto.param.RefundCallbackParam
;
import
com.liquidnet.service.kylin.dto.param.RefundCallbackParam
;
import
com.liquidnet.service.kylin.dto.vo.returns.KylinOrderRefundsVo
;
import
com.liquidnet.service.kylin.dto.vo.returns.KylinOrderRefundsVo
;
import
com.liquidnet.service.kylin.entity.KylinOrderRefunds
;
import
com.liquidnet.service.kylin.entity.KylinOrderRefunds
;
import
com.liquidnet.service.kylin.entity.KylinOrderTickets
;
import
com.liquidnet.service.kylin.mapper.*
;
import
com.liquidnet.service.kylin.mapper.*
;
import
com.liquidnet.service.kylin.service.IKylinOrderRefundsService
;
import
com.liquidnet.service.kylin.service.IKylinOrderRefundsService
;
import
com.liquidnet.service.platform.utils.DataUtils
;
import
com.liquidnet.service.platform.utils.DataUtils
;
...
@@ -14,13 +17,17 @@ import com.mongodb.client.result.UpdateResult;
...
@@ -14,13 +17,17 @@ import com.mongodb.client.result.UpdateResult;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.convert.MongoConverter
;
import
org.springframework.data.mongodb.core.convert.MongoConverter
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
/**
* <p>
* <p>
...
@@ -33,18 +40,23 @@ import java.time.LocalDateTime;
...
@@ -33,18 +40,23 @@ import java.time.LocalDateTime;
@Slf4j
@Slf4j
@Service
@Service
public
class
OrderRefundsCallbackServiceImpl
extends
ServiceImpl
<
KylinOrderRefundsMapper
,
KylinOrderRefunds
>
implements
IKylinOrderRefundsService
{
public
class
OrderRefundsCallbackServiceImpl
extends
ServiceImpl
<
KylinOrderRefundsMapper
,
KylinOrderRefunds
>
implements
IKylinOrderRefundsService
{
@Value
(
"${liquidnet.client.admin.platformUrl}"
)
private
String
platformUrl
;
@Value
(
"${liquidnet.client.admin.phpPayUrl}"
)
private
String
phpPayUrl
;
@Autowired
@Autowired
private
KylinRefundsStatusServiceImpl
kylinRefundsStatusServiceImpl
;
private
KylinRefundsStatusServiceImpl
kylinRefundsStatusServiceImpl
;
@Autowired
@Autowired
private
KylinOrderRefundsMapper
kylinOrderRefundsMapper
;
private
KylinOrderRefundsMapper
kylinOrderRefundsMapper
;
@Autowired
private
KylinOrderTicketsMapper
kylinOrderTicketsMapper
;
@Autowired
@Autowired
MongoTemplate
mongoTemplate
;
MongoTemplate
mongoTemplate
;
@Autowired
@Autowired
private
MongoConverter
mongoConverter
;
private
MongoConverter
mongoConverter
;
@Autowired
@Autowired
private
DataUtils
dataUtils
;
private
DataUtils
dataUtils
;
...
@@ -104,4 +116,34 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun
...
@@ -104,4 +116,34 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun
public
String
getOrderRefundCode
(
String
orderRefundCode
,
int
type
)
{
public
String
getOrderRefundCode
(
String
orderRefundCode
,
int
type
)
{
return
null
;
return
null
;
}
}
public
String
alipayActiveCallback
()
{
List
<
KylinOrderRefunds
>
kylinOrderRefunds
=
kylinOrderRefundsMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
KylinOrderRefunds
.
class
)
.
eq
(
KylinOrderRefunds:
:
getStatus
,
KylinTableStatusConst
.
ORDER_REFUND_STATUS_UNFILLED
)
);
for
(
KylinOrderRefunds
refundInfo
:
kylinOrderRefunds
)
{
KylinOrderTickets
orderInfo
=
kylinOrderTicketsMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
KylinOrderTickets
.
class
)
.
eq
(
KylinOrderTickets:
:
getOrderTicketsId
,
refundInfo
.
getOrderTicketsId
())
);
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
();
params
.
add
(
"notifyUrl"
,
platformUrl
.
concat
(
"/platform/refund/callback"
));
params
.
add
(
"orderCode"
,
orderInfo
.
getOrderCode
());
params
.
add
(
"orderRefundCode"
,
refundInfo
.
getOrderRefundCode
());
params
.
add
(
"paymentId"
,
orderInfo
.
getPaymentId
());
// log.info("退款参数" + JsonUtils.toJson(params));
log
.
info
(
"\n支付宝退款主动查询参数:\n[{}] "
,
params
.
toString
());
// 请求pay
try
{
String
postResult
=
HttpUtil
.
post
(
phpPayUrl
.
concat
(
"/dragon/refund/refund/alipay/result"
),
params
);
log
.
info
(
"\n支付宝退款主动查询处理结果:\n[{}] "
+
postResult
);
}
catch
(
Exception
e
)
{
log
.
info
(
"\n支付宝退款主动查询失败:[errorMsg=[{}], [orderRefundsId=[{}]"
,
e
.
getMessage
(),
refundInfo
.
getOrderRefundsId
());
}
}
return
"success"
;
}
}
}
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