Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
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
haoban3.0
haoban-manage3.0
Commits
3030bdff
Commit
3030bdff
authored
Mar 31, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付回调加锁处理 + 好办后台列表显示企业微信支付时间
parent
4b505707
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
LicenceOrderApiServiceImpl.java
.../service/out/impl/licence/LicenceOrderApiServiceImpl.java
+14
-0
LicenceOrderPageVO.java
.../gic/haoban/manage/web/vo/licence/LicenceOrderPageVO.java
+4
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/licence/LicenceOrderApiServiceImpl.java
View file @
3030bdff
...
...
@@ -25,6 +25,7 @@ import com.gic.haoban.manage.service.service.WxEnterpriseService;
import
com.gic.haoban.manage.service.service.licence.LicenceOrderProgressService
;
import
com.gic.haoban.manage.service.service.licence.LicenceOrderService
;
import
com.gic.haoban.manage.service.util.DingUtils
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.thirdparty.api.dto.RefundReqDataDTO
;
import
com.gic.thirdparty.api.dto.RefundResDataDTO
;
import
com.gic.thirdparty.api.service.Pay4WXService
;
...
...
@@ -36,6 +37,7 @@ import com.gic.wechat.api.service.qywx.QywxOrderApiService;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.redisson.client.RedisClient
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -197,14 +199,19 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
String
orderId
=
object
.
getString
(
"orderId"
);
String
transactionId
=
object
.
getString
(
"transactionId"
);
String
timeEnd
=
object
.
getString
(
"timeEnd"
);
//对同一笔订单上锁
String
key
=
"haoban_wx_licence_order_+"
+
transactionId
;
RedisUtil
.
lock
(
key
,
2L
);
TabHaobanLicenceOrder
licenceOrder
=
licenceOrderService
.
selectByTransactionId
(
orderId
);
if
(
licenceOrder
==
null
)
{
logger
.
info
(
"微信回调的订单编号:{}异常!!"
,
orderId
);
RedisUtil
.
unlock
(
key
);
return
ServiceResponse
.
success
(
false
);
}
if
(
licenceOrder
.
getOrderStatus
()
==
1
)
{
//微信会多次回调
logger
.
info
(
"微信回调的订单已处理!"
);
RedisUtil
.
unlock
(
key
);
return
ServiceResponse
.
success
(
false
);
}
Date
payTime
=
DateUtil
.
strToDate
(
timeEnd
,
DateUtil
.
FORMAT_DATETIME_14
);
...
...
@@ -212,6 +219,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
licenceOrderService
.
updateLicenceOrderType
(
licenceOrder
.
getOrderId
(),
1
,
licenceOrder
.
getEnterpriseId
(),
licenceOrder
.
getWxEnterpriseId
(),
"系统"
,
1
);
//保存微信订单id
licenceOrderService
.
saveTransactionCode
(
licenceOrder
.
getOrderId
(),
null
,
null
,
transactionId
,
payTime
,
null
);
RedisUtil
.
unlock
(
key
);
//查询gic品牌名称
String
enterpriseName
=
""
;
String
wxEnterpriseName
=
""
;
...
...
@@ -250,6 +258,9 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
String
orderId
=
object
.
getString
(
"orderId"
);
String
timeStamp
=
object
.
getString
(
"timeStamp"
);
Integer
orderStatus
=
object
.
getInteger
(
"orderStatus"
);
//对同一笔订单上锁
String
key
=
"haoban_qywx_licence_order_+"
+
orderId
;
RedisUtil
.
lock
(
key
,
2L
);
TabHaobanLicenceOrder
order
=
licenceOrderService
.
selectByQywxOrderId
(
orderId
);
//将秒级时间戳转换位Date类型
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
DateUtil
.
FORMAT_DATETIME_19
);
...
...
@@ -261,6 +272,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
if
(
"license_pay_success"
.
equals
(
infoType
))
{
if
(
order
.
getQywxPayTime
()
!=
null
)
{
//该笔订单已处理
RedisUtil
.
unlock
(
key
);
return
ServiceResponse
.
success
(
false
);
}
//更新企业微信订单状态
...
...
@@ -271,6 +283,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
if
(
"license_refund"
.
equals
(
infoType
))
{
if
(
order
.
getQywxRefundTime
()
!=
null
)
{
//该笔订单已处理
RedisUtil
.
unlock
(
key
);
return
ServiceResponse
.
success
(
false
);
}
//退款回调 订单状态,1:退款成功,2:退款被拒绝。
...
...
@@ -289,6 +302,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
licenceOrderService
.
saveCallBackTime
(
order
.
getOrderId
(),
3
,
date
);
}
}
RedisUtil
.
unlock
(
key
);
return
ServiceResponse
.
success
(
true
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/licence/LicenceOrderPageVO.java
View file @
3030bdff
...
...
@@ -108,6 +108,10 @@ public class LicenceOrderPageVO implements Serializable {
* 创建人名称
*/
private
String
creatorName
;
/**
* 企业微信支付时间
*/
private
Date
qywxPayTime
;
}
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