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
760c2c16
Commit
760c2c16
authored
Mar 06, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序退款增加判断是否有使用中的订单才断电,删除扫呗退款修改房间状态
parent
bc8fb990
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
OrderRefundServiceImpl.java
...ava/share/system/service/impl/OrderRefundServiceImpl.java
+0
-10
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+14
-3
No files found.
share-system/src/main/java/share/system/service/impl/OrderRefundServiceImpl.java
View file @
760c2c16
package
share
.
system
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.saobei.open.sdk.model.response.trade.SaobeiTradeRefundResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -15,15 +14,12 @@ import share.common.enums.*;
import
share.common.exception.base.BaseException
;
import
share.common.utils.BaseUtil
;
import
share.common.utils.DateUtil
;
import
share.common.utils.http.RestTemplateUtil
;
import
share.system.domain.SConsumptionRecords
;
import
share.system.domain.SOrder
;
import
share.system.domain.SRoom
;
import
share.system.domain.WechatPayInfo
;
import
share.system.domain.vo.SaobeiRefundVo
;
import
share.system.domain.vo.WxRefundVo
;
import
share.system.mapper.SOrderMapper
;
import
share.system.mapper.WechatPayInfoMapper
;
import
share.system.request.AdminRefundRequest
;
import
share.system.request.OrderRefundRequest
;
import
share.system.service.*
;
...
...
@@ -141,12 +137,6 @@ public class OrderRefundServiceImpl extends ServiceImpl<SOrderMapper, SOrder> im
order
.
setRefundPrice
(
request
.
getAmount
());
order
.
setRefundReason
(
request
.
getRefundReason
());
boolean
update
=
sOrderService
.
updateById
(
order
);
//更改房间状态
SRoom
sRoom
=
new
SRoom
();
sRoom
.
setId
(
order
.
getRoomId
());
sRoom
.
setStatus
(
RoomStatusEnum
.
FREE
.
getValue
());
roomService
.
updateById
(
sRoom
);
SConsumptionRecords
sConsumptionRecords
=
new
SConsumptionRecords
();
sConsumptionRecords
.
setConsumerId
(
order
.
getConsumerId
());
sConsumptionRecords
.
setOrderId
(
order
.
getId
());
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
760c2c16
...
...
@@ -423,7 +423,11 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
sOrder
.
setRefundReason
(
request
.
getRefundReason
());
this
.
updateById
(
sOrder
);
}
if
(
OrderStatusEnum
.
USED
.
getCode
().
equals
(
status
))
{
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SOrder:
:
getRoomId
,
sOrder
.
getRoomId
());
queryWrapper
.
eq
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
INUSE
.
getCode
());
List
<
SOrder
>
list
=
list
(
queryWrapper
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
// 使用中订单断电, 延时3分钟断电
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
180
);
...
...
@@ -1110,8 +1114,15 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
// 删除redis 缓存信息,防止退款订单自动开始及给用户发送提示短信
redisUtil
.
delete
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
sOrder
.
getOrderNo
());
redisUtil
.
delete
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
sOrder
.
getOrderNo
());
//房间断电
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
5
);
//查询是否有使用中的订单
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SOrder:
:
getRoomId
,
sOrder
.
getRoomId
());
queryWrapper
.
eq
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
INUSE
.
getCode
());
List
<
SOrder
>
list
=
baseMapper
.
selectList
(
queryWrapper
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
//房间断电
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
5
);
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
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