记得上下班打卡 | 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
7aa78d53
Commit
7aa78d53
authored
Apr 29, 2025
by
zhoujianping
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_user_refund' into container
parents
8ad3edd2
ad62a365
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
32 deletions
+37
-32
OrderRefundCallbackController.java
...form/controller/refund/OrderRefundCallbackController.java
+10
-1
OrderRefundsCallbackServiceImpl.java
...tform/service/refund/OrderRefundsCallbackServiceImpl.java
+27
-31
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 @
7aa78d53
...
@@ -6,6 +6,7 @@ import com.liquidnet.service.kylin.dto.param.RefundApplyParam;
...
@@ -6,6 +6,7 @@ import com.liquidnet.service.kylin.dto.param.RefundApplyParam;
import
com.liquidnet.service.kylin.dto.param.RefundCallbackParam
;
import
com.liquidnet.service.kylin.dto.param.RefundCallbackParam
;
import
com.liquidnet.service.kylin.dto.param.RefundSearchParam
;
import
com.liquidnet.service.kylin.dto.param.RefundSearchParam
;
import
com.liquidnet.service.platform.service.refund.OrderRefundsCallbackServiceImpl
;
import
com.liquidnet.service.platform.service.refund.OrderRefundsCallbackServiceImpl
;
import
com.sun.org.apache.regexp.internal.RE
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
...
@@ -14,6 +15,9 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -14,6 +15,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.TimeUnit
;
/**
/**
* <p>
* <p>
...
@@ -44,7 +48,12 @@ public class OrderRefundCallbackController {
...
@@ -44,7 +48,12 @@ public class OrderRefundCallbackController {
@ApiImplicitParam
(
type
=
"from"
,
required
=
true
,
dataType
=
"String"
,
name
=
"orderRefundsId"
,
value
=
"orderRefundsId"
,
example
=
"0"
)
@ApiImplicitParam
(
type
=
"from"
,
required
=
true
,
dataType
=
"String"
,
name
=
"orderRefundsId"
,
value
=
"orderRefundsId"
,
example
=
"0"
)
})
})
public
ResponseDto
<
String
>
automaticRefund
(
@RequestParam
(
"orderRefundsId"
)
@NotBlank
(
message
=
"退款id不能为空"
)
String
orderRefundsId
)
{
public
ResponseDto
<
String
>
automaticRefund
(
@RequestParam
(
"orderRefundsId"
)
@NotBlank
(
message
=
"退款id不能为空"
)
String
orderRefundsId
)
{
return
orderRefundsCallbackServiceImpl
.
automaticRefund
(
orderRefundsId
);
//延迟5秒执行
ScheduledExecutorService
scheduler
=
Executors
.
newSingleThreadScheduledExecutor
();
scheduler
.
schedule
(()
->
{
orderRefundsCallbackServiceImpl
.
automaticRefund
(
orderRefundsId
);
},
5
,
TimeUnit
.
SECONDS
);
return
ResponseDto
.
success
(
"success"
);
}
}
@GetMapping
(
value
=
"failRefund"
)
@GetMapping
(
value
=
"failRefund"
)
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/refund/OrderRefundsCallbackServiceImpl.java
View file @
7aa78d53
...
@@ -142,35 +142,33 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun
...
@@ -142,35 +142,33 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun
return
"success"
;
return
"success"
;
}
}
public
ResponseDto
<
String
>
automaticRefund
(
String
orderRefundsId
)
{
public
void
automaticRefund
(
String
orderRefundsId
)
{
KylinOrderRefunds
refund
=
kylinOrderRefundsMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
KylinOrderRefunds
.
class
)
.
eq
(
KylinOrderRefunds:
:
getOrderRefundsId
,
orderRefundsId
)
);
if
(
null
==
refund
){
ResponseDto
.
failure
(
"退款订单不存在"
);
}
KylinOrderTickets
oderInfo
=
kylinOrderTicketsMapper
.
selectOne
(
new
QueryWrapper
<
KylinOrderTickets
>()
.
eq
(
"order_tickets_id"
,
refund
.
getOrderTicketsId
())
);
BigDecimal
refundPrice
=
refund
.
getPrice
().
add
(
refund
.
getPriceExpress
());
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
();
params
.
add
(
"code"
,
oderInfo
.
getPayCode
());
params
.
add
(
"notifyUrl"
,
refundNotify
);
params
.
add
(
"orderCode"
,
oderInfo
.
getOrderCode
());
params
.
add
(
"orderRefundCode"
,
refund
.
getOrderRefundCode
());
params
.
add
(
"paymentId"
,
oderInfo
.
getPaymentId
());
params
.
add
(
"paymentType"
,
oderInfo
.
getPaymentType
());
params
.
add
(
"price"
,
String
.
valueOf
(
refundPrice
));
params
.
add
(
"priceTotal"
,
String
.
valueOf
(
oderInfo
.
getPriceActual
()));
params
.
add
(
"reason"
,
"按需退款"
);
MultiValueMap
<
String
,
String
>
headers
=
new
LinkedMultiValueMap
();
headers
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
log
.
info
(
"自动退款退款参数"
+
JsonUtils
.
toJson
(
params
));
try
{
try
{
KylinOrderRefunds
refund
=
kylinOrderRefundsMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
KylinOrderRefunds
.
class
)
.
eq
(
KylinOrderRefunds:
:
getOrderRefundsId
,
orderRefundsId
)
);
log
.
info
(
"自动退款refund={}"
,
refund
.
toString
());
KylinOrderTickets
oderInfo
=
kylinOrderTicketsMapper
.
selectOne
(
new
QueryWrapper
<
KylinOrderTickets
>()
.
eq
(
"order_tickets_id"
,
refund
.
getOrderTicketsId
())
);
BigDecimal
refundPrice
=
refund
.
getPrice
().
add
(
refund
.
getPriceExpress
());
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
();
params
.
add
(
"code"
,
oderInfo
.
getPayCode
());
params
.
add
(
"notifyUrl"
,
refundNotify
);
params
.
add
(
"orderCode"
,
oderInfo
.
getOrderCode
());
params
.
add
(
"orderRefundCode"
,
refund
.
getOrderRefundCode
());
params
.
add
(
"paymentId"
,
oderInfo
.
getPaymentId
());
params
.
add
(
"paymentType"
,
oderInfo
.
getPaymentType
());
params
.
add
(
"price"
,
String
.
valueOf
(
refundPrice
));
params
.
add
(
"priceTotal"
,
String
.
valueOf
(
oderInfo
.
getPriceActual
()));
params
.
add
(
"reason"
,
"按需退款"
);
MultiValueMap
<
String
,
String
>
headers
=
new
LinkedMultiValueMap
();
headers
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
log
.
info
(
"调用自动退款参数"
+
JsonUtils
.
toJson
(
params
));
String
postResult
=
HttpUtil
.
post
(
refundApply
,
params
,
headers
);
String
postResult
=
HttpUtil
.
post
(
refundApply
,
params
,
headers
);
log
.
info
(
"自动退款返参res"
+
postResult
);
log
.
info
(
"
调用
自动退款返参res"
+
postResult
);
HashMap
hashMapResult
=
JsonUtils
.
fromJson
(
postResult
,
HashMap
.
class
);
HashMap
hashMapResult
=
JsonUtils
.
fromJson
(
postResult
,
HashMap
.
class
);
Boolean
success
=
(
Boolean
)
hashMapResult
.
get
(
"success"
);
Boolean
success
=
(
Boolean
)
hashMapResult
.
get
(
"success"
);
if
(!
success
)
{
if
(!
success
)
{
...
@@ -192,12 +190,10 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun
...
@@ -192,12 +190,10 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun
Query
.
query
(
Criteria
.
where
(
"orderRefundsId"
).
is
(
refund
.
getOrderRefundsId
())).
getQueryObject
(),
Query
.
query
(
Criteria
.
where
(
"orderRefundsId"
).
is
(
refund
.
getOrderRefundsId
())).
getQueryObject
(),
objectFail
objectFail
);
);
ResponseDto
.
failure
(
"fail"
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
info
(
"自动退款请求pay失败e"
+
e
.
getMessage
());
log
.
error
(
"自动退款请求pay失败e"
+
e
.
getMessage
());
}
}
return
ResponseDto
.
success
(
"success"
);
}
}
public
void
failRefund
(){
public
void
failRefund
(){
List
<
KylinOrderRefunds
>
kylinOrderRefunds
=
kylinOrderRefundsMapper
.
selectList
(
List
<
KylinOrderRefunds
>
kylinOrderRefunds
=
kylinOrderRefundsMapper
.
selectList
(
...
...
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