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
86eb4104
Commit
86eb4104
authored
Mar 07, 2024
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
退款修改房间状态,不存在其他使用中订单修改空闲
parent
5ffc7766
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+16
-10
No files found.
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
86eb4104
...
...
@@ -356,7 +356,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Override
public
int
refundOp
(
AdminRefundRequest
request
)
{
SOrder
sOrder
=
getInfoException
(
request
.
getOrderNo
());
SOrder
oldSOrder
=
sOrder
;
SOrder
oldSOrder
=
new
SOrder
();
BeanUtils
.
copyProperties
(
sOrder
,
oldSOrder
);
if
(
sOrder
==
null
)
{
throw
new
BaseException
(
"订单不存在"
);
}
...
...
@@ -373,8 +374,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
// if (request.getAmount().compareTo(BigDecimal.ZERO) <= 0) {
// throw new BaseException("退款金额不能为0,请修改退款金额");
// }
// 当前订单状态
Integer
status
=
sOrder
.
getStatus
();
// 退款记录
OrderRefundArtificial
artificial
=
new
OrderRefundArtificial
();
artificial
.
setIsRefundCoupon
(
request
.
getRefundCoupon
());
...
...
@@ -404,13 +403,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
boolean
b
=
isCleanRecordsService
.
addSCleanRecords
(
sOrder
.
getStoreId
(),
sOrder
.
getRoomId
());
}
}
if
(
sOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
INUSE
.
getCode
()))
{
// 如果订单使用中,房间修改状态为空闲
SRoom
sRoom
=
new
SRoom
();
sRoom
.
setId
(
sOrder
.
getRoomId
());
sRoom
.
setStatus
(
RoomStatusEnum
.
FREE
.
getValue
());
roomService
.
updateById
(
sRoom
);
}
if
(
request
.
getAmount
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
// 退款金额大于0, 微信退款
//退款
...
...
@@ -477,6 +469,20 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
redisUtils
.
set
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
one
.
getOrderNo
(),
jsonObject
.
toString
());
}
}
// 如果订单使用中,房间修改状态
if
(
oldSOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
INUSE
.
getCode
()))
{
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SOrder:
:
getRoomId
,
oldSOrder
.
getRoomId
());
queryWrapper
.
eq
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
INUSE
.
getCode
());
List
<
SOrder
>
list
=
list
(
queryWrapper
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
// 不存在其他使用中订单,修改状态为空闲
SRoom
sRoom
=
new
SRoom
();
sRoom
.
setId
(
sOrder
.
getRoomId
());
sRoom
.
setStatus
(
RoomStatusEnum
.
FREE
.
getValue
());
roomService
.
updateById
(
sRoom
);
}
}
// 生成退款人工退款记录
return
orderRefundArtificialService
.
insertOrderRefundArtificial
(
artificial
);
...
...
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