Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
Details
Activity
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
曲欣亮
shop
Commits
9a577398
Commit
9a577398
authored
Apr 18, 2023
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加退款回调
parent
54ad0368
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
OrderServiceImpl.java
...ava/com/egolm/shop/api/service/impl/OrderServiceImpl.java
+19
-5
No files found.
src/main/java/com/egolm/shop/api/service/impl/OrderServiceImpl.java
View file @
9a577398
package
com
.
egolm
.
shop
.
api
.
service
.
impl
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.TimeZone
;
import
java.util.stream.Collectors
;
import
org.apache.commons.logging.Log
;
...
...
@@ -337,11 +339,7 @@ public class OrderServiceImpl implements OrderService {
return
Rjx
.
jsonOk
().
set
(
"list"
,
subList
).
toJson
();
}
public
static
void
main
(
String
[]
args
)
{
BigDecimal
nPayAmount
=
new
BigDecimal
(
"30239"
);
nPayAmount
=
nPayAmount
.
multiply
(
new
BigDecimal
(
0.01
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
System
.
out
.
println
(
nPayAmount
);
}
@Transactional
public
List
<
Map
<
String
,
Object
>>
paySuccess
(
String
sSalesOrderID
,
BigDecimal
nPayAmount
,
String
sOpenID
,
String
sTransTraceNO
,
String
sOutTradeNO
,
Date
dPayDateTime
)
{
...
...
@@ -1242,6 +1240,17 @@ public class OrderServiceImpl implements OrderService {
String
sql
=
"exec up_B2BSalesOrderPayCallBack '"
+
out_payment_id
+
"' ,'"
+
payment_id
+
"' , '"
+
PayAmount
+
"' , '"
+
pay_succ_time
+
"' , '"
+
PayTypeID
+
"' , '"
+
StatusID
+
"' , '"
+
StatusName
+
"' "
;
returnMap
=
jdbcTemplate
.
executeMutil
(
sql
).
getDatas
().
get
(
0
);
}
else
if
(
event_type
.
equals
(
"mse_refund.succeeded"
))
{
//退款成功
//up_B2BCancelOrderBizPayCallBack
String
status
=
event_content
.
getString
(
"status"
);
if
(
status
.
equals
(
"SUCCEEDED"
))
{
//退款成功
String
refund_id
=
event_content
.
getString
(
"refund_id"
);
String
succeeded_time
=
event_content
.
getString
(
"succeeded_time"
).
replace
(
"T"
,
" "
).
replace
(
"+08:00"
,
""
);
//东八区时间 如:2021-06-08T10:34:56+08:00,status=SUCCEEDED时返回
String
refund_amount
=
event_content
.
getString
(
"refund_amount"
);
//退款金额
String
sql
=
"exec up_B2BCancelOrderBizPayCallBack '"
+
out_payment_id
+
"' ,'"
+
payment_id
+
"','"
+
refund_id
+
"' , '"
+
refund_amount
+
"' , '"
+
succeeded_time
+
"' , '"
+
PayTypeID
+
"' , '0' , '退款成功' "
;
returnMap
=
jdbcTemplate
.
executeMutil
(
sql
).
getDatas
().
get
(
0
);
}
else
{
logger
.
info
(
"微企付退款回调-退款状态不成功 ,{} "
,
req
);
}
}
}
...
...
@@ -1285,5 +1294,10 @@ public class OrderServiceImpl implements OrderService {
return
returnMap
;
}
public
static
void
main
(
String
[]
args
)
{
String
s
=
"2021-06-08T10:34:56+08:00"
.
replace
(
"T"
,
" "
).
replace
(
"+08:00"
,
""
);
System
.
out
.
println
(
s
);
}
}
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