Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
pseer
gxpt_ht
Commits
b2380b31
Commit
b2380b31
authored
Jul 25, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/dev' into test
parents
89cf7903
97abafa3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
11 deletions
+38
-11
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+38
-11
No files found.
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
b2380b31
...
@@ -1636,20 +1636,46 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -1636,20 +1636,46 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SOrder
order
=
getOne
(
queryWrapper
);
SOrder
order
=
getOne
(
queryWrapper
);
if
(
ObjectUtil
.
isNotEmpty
(
order
))
{
if
(
ObjectUtil
.
isNotEmpty
(
order
))
{
baseMapper
.
updateSOrder
(
sOrder
);
baseMapper
.
updateSOrder
(
sOrder
);
//延迟5秒
try
{
// 延迟 5 秒
Thread
.
sleep
(
5000
);
}
catch
(
InterruptedException
e
)
{
// 如果线程被中断,这里可以处理异常
e
.
printStackTrace
();
}
logger
.
debug
(
"订单:"
+
sOrder
.
getOrderNo
()
+
"和订单:"
+
order
.
getOrderNo
()
+
"预约时间有干涉"
);
logger
.
debug
(
"订单:"
+
sOrder
.
getOrderNo
()
+
"和订单:"
+
order
.
getOrderNo
()
+
"预约时间有干涉"
);
//退款
//退款
AdminRefundRequest
refundRequest
=
new
AdminRefundRequest
();
// AdminRefundRequest refundRequest = new AdminRefundRequest();
refundRequest
.
setOrderNo
(
sOrder
.
getOrderNo
());
// refundRequest.setOrderNo(sOrder.getOrderNo());
refundRequest
.
setAmount
(
sOrder
.
getPayPrice
());
// refundRequest.setAmount(sOrder.getPayPrice());
refundRequest
.
setIsClean
(
YesNoEnum
.
no
.
getIndex
());
// refundRequest.setIsClean(YesNoEnum.no.getIndex());
refundRequest
.
setRefundCoupon
(
YesNoEnum
.
yes
.
getIndex
());
// refundRequest.setRefundCoupon(YesNoEnum.yes.getIndex());
refundRequest
.
setRefundReason
(
"当前订单:"
+
sOrder
.
getOrderNo
()
+
"和订单:"
+
order
.
getOrderNo
()
+
"预约时间有干涉"
);
// refundRequest.setRefundReason("当前订单:" + sOrder.getOrderNo() + "和订单:" + order.getOrderNo() + "预约时间有干涉");
int
i
=
sOrderService
.
refundOp
(
refundRequest
);
// int i = sOrderService.refundOp(refundRequest);
if
(
i
==
1
)
{
OrderRefundRequest
request
=
new
OrderRefundRequest
();
sOrderService
.
removeById
(
sOrder
);
request
.
setOrderNo
(
sOrder
.
getOrderNo
());
request
.
setAmount
(
sOrder
.
getPayPrice
());
request
.
setApprovalStatus
(
YesNoEnum
.
yes
.
getIndex
());
request
.
setRefundReason
(
"当前订单:"
+
sOrder
.
getOrderNo
()
+
"和订单:"
+
order
.
getOrderNo
()
+
"预约时间有干涉"
);
boolean
isRefund
=
orderRefundService
.
refund
(
request
,
sOrder
);
if
(
isRefund
)
{
// 删除redis 缓存信息,防止退款订单自动开始及给用户发送提示短信
redisUtil
.
delete
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
sOrder
.
getOrderNo
());
redisUtil
.
delete
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
sOrder
.
getOrderNo
());
//查询是否有使用中的订单
LambdaQueryWrapper
<
SOrder
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
SOrder:
:
getRoomId
,
sOrder
.
getRoomId
());
wrapper
.
eq
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
INUSE
.
getCode
());
List
<
SOrder
>
list
=
baseMapper
.
selectList
(
wrapper
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
//房间断电
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
5
,
DeviceOpSourceEnum
.
DEVICE_SOURCE_20
.
getCode
());
}
}
return
;
refundExtracted
(
consumerWallet
,
sOrder
,
consumerMember
)
;
}
}
}
else
{
if
(
sOrder
.
getOrderType
().
equals
(
OrderTypeEnum
.
RENEW
.
getCode
()))
{
if
(
sOrder
.
getOrderType
().
equals
(
OrderTypeEnum
.
RENEW
.
getCode
()))
{
SRoom
room
=
roomService
.
getById
(
sOrder
.
getRoomId
());
SRoom
room
=
roomService
.
getById
(
sOrder
.
getRoomId
());
...
@@ -1735,7 +1761,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -1735,7 +1761,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
.
eq
(
SStoreConsumer:
:
getStoreId
,
sOrder
.
getStoreId
())
.
eq
(
SStoreConsumer:
:
getStoreId
,
sOrder
.
getStoreId
())
).
stream
().
collect
(
Collectors
.
toMap
(
SStoreConsumer:
:
getConsumerId
,
Function
.
identity
()));
).
stream
().
collect
(
Collectors
.
toMap
(
SStoreConsumer:
:
getConsumerId
,
Function
.
identity
()));
logger
.
debug
(
"订单预订成功通知发送开始"
);
logger
.
debug
(
"订单预订成功通知发送开始"
);
consumers
.
forEach
(
o
->
{
consumers
.
forEach
(
o
->
{
SStoreConsumer
sStoreConsumer
=
consumerMap
.
get
(
o
.
getId
());
SStoreConsumer
sStoreConsumer
=
consumerMap
.
get
(
o
.
getId
());
if
(
ObjectUtil
.
isNotEmpty
(
sStoreConsumer
))
{
if
(
ObjectUtil
.
isNotEmpty
(
sStoreConsumer
))
{
if
(
sStoreConsumer
.
getGating
().
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
if
(
sStoreConsumer
.
getGating
().
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
...
@@ -1751,6 +1777,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -1751,6 +1777,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
logger
.
debug
(
"订单预订成功通知发送结束"
);
logger
.
debug
(
"订单预订成功通知发送结束"
);
}
}
}
}
}
@Override
@Override
public
void
refundSuccessful
(
SOrder
sOrder
)
{
public
void
refundSuccessful
(
SOrder
sOrder
)
{
...
...
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