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
9b36552f
Commit
9b36552f
authored
Feb 28, 2024
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
房间下架验证是否存在待使用和使用中订单
parent
7f2e6a0e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
5 deletions
+57
-5
RoomStatEnum.java
...common/src/main/java/share/common/enums/RoomStatEnum.java
+30
-0
SRoomVo.java
...-system/src/main/java/share/system/domain/vo/SRoomVo.java
+6
-0
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+21
-5
No files found.
share-common/src/main/java/share/common/enums/RoomStatEnum.java
0 → 100644
View file @
9b36552f
package
share
.
common
.
enums
;
/**
* @className: share.common.enums.RoomStatEnum
* @description: 门店房间上下架
* @author: lwj
* @create: 2024-02-28 13:46
*/
public
enum
RoomStatEnum
{
GROUNDING
(
1
,
"上架"
),
UNDERCARRIAGE
(
2
,
"下架"
),
MAINTENANCE
(
3
,
"维护"
);
private
Integer
value
;
private
String
name
;
RoomStatEnum
(
Integer
value
,
String
name
)
{
this
.
value
=
value
;
this
.
name
=
name
;
}
public
Integer
getValue
()
{
return
value
;
}
public
String
getName
()
{
return
name
;
}
}
share-system/src/main/java/share/system/domain/vo/SRoomVo.java
View file @
9b36552f
...
...
@@ -96,6 +96,12 @@ public class SRoomVo extends BaseEntity
private
String
packIds
;
/**
* 房间上下架(1-上架,2-下架,3-维护)
*/
@Excel
(
name
=
"房间上下架"
)
private
Integer
roomStat
;
/**
* 套餐列表
*/
private
List
<
SPack
>
packList
;
...
...
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
9b36552f
...
...
@@ -9,20 +9,19 @@ 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
share.common.enums.DeviceType
;
import
share.common.enums.PositionEnum
;
import
share.common.enums.RoleTypeEnum
;
import
share.common.enums.YesNoEnum
;
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.*
;
...
...
@@ -49,7 +48,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
@Autowired
private
DeviceService
deviceService
;
@Autowired
private
MqttxService
mqttx
Service
;
private
ISOrderService
order
Service
;
@Autowired
private
DeviceOpService
deviceOpService
;
@Autowired
...
...
@@ -174,6 +173,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
int
i
=
0
;
try
{
sRoom
.
setCreateTime
(
DateUtils
.
getNowDate
());
sRoom
.
setCreateBy
(
SecurityUtils
.
getUsername
());
i
=
baseMapper
.
insertSRoom
(
sRoom
);
//判断套餐ID
if
(!
sRoom
.
getPackIds
().
isEmpty
())
{
...
...
@@ -189,6 +189,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
SRoomPack
.
setPackId
(
o
);
SRoomPack
.
setRoomId
(
sRoom
.
getId
());
SRoomPack
.
setCreateTime
(
DateUtils
.
getNowDate
());
SRoomPack
.
setCreateBy
(
SecurityUtils
.
getUsername
());
SRoomPackList
.
add
(
SRoomPack
);
});
roomPackService
.
saveBatch
(
SRoomPackList
);
...
...
@@ -207,6 +208,19 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
*/
@Override
public
int
updateSRoom
(
SRoom
sRoom
)
{
SRoom
room
=
baseMapper
.
selectSRoomById
(
sRoom
.
getId
());
if
(
RoomStatEnum
.
UNDERCARRIAGE
.
getValue
().
equals
(
sRoom
.
getRoomStat
())
&&
!
sRoom
.
getRoomStat
().
equals
(
room
.
getRoomStat
()))
{
// 房间下架验证是否存在使用中、待使用的订单
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
eq
(
SOrder:
:
getRoomId
,
sRoom
.
getId
());
queryWrapper
.
in
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
UNUSED
.
getCode
(),
OrderStatusEnum
.
INUSE
.
getCode
());
queryWrapper
.
eq
(
SOrder:
:
getPayStatus
,
PayStatusEnum
.
PAID
.
getCode
());
List
<
SOrder
>
list
=
orderService
.
list
(
queryWrapper
);
if
(
list
.
size
()
>
0
)
{
throw
new
RuntimeException
(
"门店房间存在待使用或使用中订单,不允许下架!"
);
}
}
//判断套餐ID
if
(!
StrUtil
.
isEmpty
(
sRoom
.
getPackIds
()))
{
//判断套餐ID
...
...
@@ -223,6 +237,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
SRoomPack
.
setPackId
(
o
);
SRoomPack
.
setRoomId
(
sRoom
.
getId
());
SRoomPack
.
setCreateTime
(
DateUtils
.
getNowDate
());
SRoomPack
.
setCreateBy
(
SecurityUtils
.
getUsername
());
SRoomPackList
.
add
(
SRoomPack
);
});
roomPackService
.
saveBatch
(
SRoomPackList
);
...
...
@@ -231,6 +246,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
roomPackService
.
deleteRoomPackByRoomId
(
sRoom
.
getId
());
}
sRoom
.
setUpdateTime
(
DateUtils
.
getNowDate
());
sRoom
.
setUpdateBy
(
SecurityUtils
.
getUsername
());
return
baseMapper
.
updateSRoom
(
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