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
387a6edf
Commit
387a6edf
authored
Mar 11, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改新增房间没有默认状态
parent
17be0e13
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
19 deletions
+28
-19
OrderStatusEnum.java
...mon/src/main/java/share/common/enums/OrderStatusEnum.java
+3
-1
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+19
-10
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+6
-8
No files found.
share-common/src/main/java/share/common/enums/OrderStatusEnum.java
View file @
387a6edf
...
...
@@ -11,7 +11,9 @@ public enum OrderStatusEnum {
USED
(
2
,
"已使用"
),
CANCEL
(
3
,
"已取消"
),
REFUNDING
(
4
,
"退款中"
),
REFUNDED
(
5
,
"已退款"
);
REFUNDED
(
5
,
"已退款"
),
UNUSED_AND_INUSE
(
10
,
"待使用/已预约/使用中"
),
;
private
Integer
code
;
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
387a6edf
...
...
@@ -143,6 +143,14 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
*/
@Override
public
List
<
SOrder
>
selectSOrderList
(
SOrder
sOrder
)
{
if
(
ObjectUtil
.
isNotEmpty
(
sOrder
.
getStatus
())
&&
sOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
UNUSED_AND_INUSE
.
getCode
()))
{
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SOrder:
:
getRoomId
,
sOrder
.
getRoomId
());
queryWrapper
.
eq
(
SOrder:
:
getPayStatus
,
YesNoEnum
.
yes
.
getIndex
());
queryWrapper
.
in
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
getUnfinishOrderStatus
());
queryWrapper
.
orderByDesc
(
SOrder:
:
getCreateTime
);
return
baseMapper
.
selectList
(
queryWrapper
);
}
List
<
SOrder
>
orders
=
baseMapper
.
selectSOrderList
(
sOrder
);
return
orders
;
}
...
...
@@ -300,6 +308,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Override
public
TableDataInfoVo
pageList
(
SOrder
sOrder
)
{
List
<
SOrder
>
sOrders
=
selectSOrderList
(
sOrder
);
List
<
SOrderVo
>
sOrderVos
=
convertDosToVos
(
sOrders
);
BigDecimal
totalAmount
=
new
BigDecimal
(
"0.00"
);
...
...
@@ -431,16 +440,16 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
oldSOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
INUSE
.
getCode
()))
{
// 使用中订单断电, 延时3分钟断电
deviceOpService
.
openOrCloseDevice
(
oldSOrder
.
getRoomId
(),
oldSOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
1
8
0
);
}
else
if
(
oldSOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
UNUSED
.
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
))
{
deviceOpService
.
openOrCloseDevice
(
oldSOrder
.
getRoomId
(),
oldSOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
18
0
);
}
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
10
);
//
} else if (oldSOrder.getStatus().equals(OrderStatusEnum.UNUSED.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)) {
//
deviceOpService.openOrCloseDevice(oldSOrder.getRoomId(), oldSOrder.getConsumerPhone(),
// OpTypeEnum.CUT_ELECTRIC.getCode(), true, 1
0);
//
}
}
}
else
if
(
oldSOrder
.
getOrderType
().
equals
(
OrderTypeEnum
.
RENEW
.
getCode
()))
{
...
...
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
387a6edf
package
share
.
system
.
service
.
impl
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.common.enums.*
;
import
share.common.exception.base.BaseException
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.common.utils.SecurityUtils
;
import
share.system.domain.*
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.MqttxVo
;
import
share.system.domain.vo.RoomStatusVo
;
import
share.system.domain.vo.SRoomVo
;
import
share.system.mapper.DeviceMapper
;
import
share.system.mapper.SOrderMapper
;
import
share.system.mapper.SRoomMapper
;
import
share.system.mapper.SStoreConsumerMapper
;
import
share.system.service.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 房间Service业务层处理
*
...
...
@@ -172,6 +169,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
public
int
insertSRoom
(
SRoom
sRoom
)
{
int
i
=
0
;
try
{
sRoom
.
setStatus
(
YesNoEnum
.
no
.
getIndex
());
sRoom
.
setCreateTime
(
DateUtils
.
getNowDate
());
sRoom
.
setCreateBy
(
SecurityUtils
.
getUsername
());
i
=
baseMapper
.
insertSRoom
(
sRoom
);
...
...
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