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
ea0be758
Commit
ea0be758
authored
Jan 20, 2024
by
wuwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序端房间接口
parent
eb426ecd
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
95 additions
and
32 deletions
+95
-32
SRoomController.java
...ain/java/share/web/controller/system/SRoomController.java
+2
-1
SRoomVo.java
...-system/src/main/java/share/system/domain/vo/SRoomVo.java
+4
-1
ISCleanRecordsService.java
...main/java/share/system/service/ISCleanRecordsService.java
+3
-0
ISOrderService.java
...em/src/main/java/share/system/service/ISOrderService.java
+3
-2
RoomStatusService.java
...src/main/java/share/system/service/RoomStatusService.java
+9
-0
RoomStatusServiceImpl.java
...java/share/system/service/impl/RoomStatusServiceImpl.java
+24
-1
SCleanRecordsServiceImpl.java
...a/share/system/service/impl/SCleanRecordsServiceImpl.java
+16
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+4
-2
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+29
-24
SStoreServiceImpl.java
...ain/java/share/system/service/impl/SStoreServiceImpl.java
+1
-1
No files found.
share-front/src/main/java/share/web/controller/system/SRoomController.java
View file @
ea0be758
...
@@ -44,10 +44,11 @@ public class SRoomController extends BaseController {
...
@@ -44,10 +44,11 @@ public class SRoomController extends BaseController {
/**
/**
* 查询房间列表
* 查询房间列表
*/
*/
@ApiOperation
(
value
=
"房间列表"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SRoom
sRoom
)
{
public
TableDataInfo
list
(
SRoom
sRoom
)
{
startPage
();
startPage
();
List
<
SRoom
>
list
=
sRoomService
.
selectSRoom
List
(
sRoom
);
List
<
SRoom
Vo
>
list
=
sRoomService
.
selectSRoomVo
List
(
sRoom
);
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
...
...
share-system/src/main/java/share/system/domain/vo/SRoomVo.java
View file @
ea0be758
...
@@ -123,7 +123,10 @@ public class SRoomVo extends BaseEntity
...
@@ -123,7 +123,10 @@ public class SRoomVo extends BaseEntity
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm"
)
private
Date
recordsTime
;
private
Date
recordsTime
;
/** 门店名称 */
/**
* 房间状态列表
*/
private
List
<
RoomStatusVo
>
roomStatusList
;
@Override
@Override
...
...
share-system/src/main/java/share/system/service/ISCleanRecordsService.java
View file @
ea0be758
package
share
.
system
.
service
;
package
share
.
system
.
service
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.SCleanRecords
;
import
share.system.domain.SCleanRecords
;
...
@@ -89,6 +90,8 @@ public interface ISCleanRecordsService extends IService<SCleanRecords>
...
@@ -89,6 +90,8 @@ public interface ISCleanRecordsService extends IService<SCleanRecords>
SCleanRecords
lastCleanByRoomId
(
Long
roomId
);
SCleanRecords
lastCleanByRoomId
(
Long
roomId
);
Map
<
Long
,
SCleanRecords
>
lastCleanRoomByRoomIds
(
List
<
Long
>
roomIds
);
/**
/**
* 结束保洁
* 结束保洁
* @param sCleanRecords
* @param sCleanRecords
...
...
share-system/src/main/java/share/system/service/ISOrderService.java
View file @
ea0be758
...
@@ -89,11 +89,12 @@ public interface ISOrderService extends IService<SOrder>
...
@@ -89,11 +89,12 @@ public interface ISOrderService extends IService<SOrder>
/**
/**
* 查询房间指定日T+1的订单
* 查询房间指定日T+1的订单
* @param storeId
* @param storeId
* @param roomId
* @param roomId
s
* @param day
* @param day
* @return
* @return
*/
*/
List
<
SOrder
>
listByRoomInfo
(
Long
storeId
,
Long
roomId
,
Date
day
);
List
<
SOrder
>
listByRoomInfo
(
Long
storeId
,
List
<
Long
>
roomIds
,
Date
day
);
/**
/**
* 订单预下单
* 订单预下单
...
...
share-system/src/main/java/share/system/service/RoomStatusService.java
View file @
ea0be758
...
@@ -20,4 +20,13 @@ public interface RoomStatusService {
...
@@ -20,4 +20,13 @@ public interface RoomStatusService {
*/
*/
List
<
RoomStatusVo
>
roomStatus
(
Long
storeId
,
Long
roomId
,
Date
day
,
Integer
orderType
);
List
<
RoomStatusVo
>
roomStatus
(
Long
storeId
,
Long
roomId
,
Date
day
,
Integer
orderType
);
/**
* 通过门店ID,房间ID,日期查询房间T+1天时段状态
* @param storeId
* @param roomIds
* @return List<RoomStatusVo>
*/
List
<
RoomStatusVo
>
listRoomStatus
(
Long
storeId
,
List
<
Long
>
roomIds
);
}
}
share-system/src/main/java/share/system/service/impl/RoomStatusServiceImpl.java
View file @
ea0be758
...
@@ -51,13 +51,36 @@ public class RoomStatusServiceImpl implements RoomStatusService {
...
@@ -51,13 +51,36 @@ public class RoomStatusServiceImpl implements RoomStatusService {
//查询门店营业时间
//查询门店营业时间
SStore
store
=
storeService
.
getById
(
storeId
);
SStore
store
=
storeService
.
getById
(
storeId
);
// 通过门店及房间查询指定日期T+1的订单
// 通过门店及房间查询指定日期T+1的订单
List
<
SOrder
>
orderList
=
orderService
.
listByRoomInfo
(
storeId
,
roomId
,
day
);
List
<
SOrder
>
orderList
=
orderService
.
listByRoomInfo
(
storeId
,
new
ArrayList
<
Long
>(){{
add
(
roomId
);}}
,
day
);
SCleanRecords
cleanRecords
=
cleanRecordsService
.
lastCleanByRoomId
(
roomId
);
SCleanRecords
cleanRecords
=
cleanRecordsService
.
lastCleanByRoomId
(
roomId
);
List
<
RoomStatusVo
>
voList
=
generatorRoomStatusList
(
store
,
roomId
,
orderList
,
cleanRecords
,
day
,
orderType
);
List
<
RoomStatusVo
>
voList
=
generatorRoomStatusList
(
store
,
roomId
,
orderList
,
cleanRecords
,
day
,
orderType
);
voList
.
addAll
(
generatorRoomStatusList
(
store
,
roomId
,
orderList
,
cleanRecords
,
DateUtils
.
addDays
(
day
,
1
),
orderType
));
voList
.
addAll
(
generatorRoomStatusList
(
store
,
roomId
,
orderList
,
cleanRecords
,
DateUtils
.
addDays
(
day
,
1
),
orderType
));
return
voList
;
return
voList
;
}
}
@Override
public
List
<
RoomStatusVo
>
listRoomStatus
(
Long
storeId
,
List
<
Long
>
roomIds
)
{
SConsumer
user
=
consumerService
.
getInfo
();
if
(
user
!=
null
){
FrontTokenComponent
.
loginSConsumerEntryThreadLocal
.
set
(
user
);
}
Date
day
=
new
Date
();
//查询门店营业时间
SStore
store
=
storeService
.
getById
(
storeId
);
// 通过门店及房间查询指定日期T+1的订单
List
<
SOrder
>
orderList
=
orderService
.
listByRoomInfo
(
storeId
,
roomIds
,
day
);
Map
<
Long
,
SCleanRecords
>
cleanRecordMap
=
cleanRecordsService
.
lastCleanRoomByRoomIds
(
roomIds
);
List
<
RoomStatusVo
>
voList
=
new
ArrayList
<>();
roomIds
.
stream
().
forEach
(
roomId
->
{
voList
.
addAll
(
generatorRoomStatusList
(
store
,
roomId
,
orderList
,
cleanRecordMap
.
get
(
roomId
),
day
,
OrderTypeEnum
.
RESERVER
.
getCode
()));
voList
.
addAll
(
generatorRoomStatusList
(
store
,
roomId
,
orderList
,
cleanRecordMap
.
get
(
roomId
),
DateUtils
.
addDays
(
day
,
1
),
OrderTypeEnum
.
RESERVER
.
getCode
()));
});
return
voList
;
}
private
List
<
RoomStatusVo
>
generatorRoomStatusList
(
SStore
store
,
Long
roomId
,
List
<
SOrder
>
orderList
,
SCleanRecords
cleanRecords
,
Date
day
,
Integer
orderType
){
private
List
<
RoomStatusVo
>
generatorRoomStatusList
(
SStore
store
,
Long
roomId
,
List
<
SOrder
>
orderList
,
SCleanRecords
cleanRecords
,
Date
day
,
Integer
orderType
){
String
nowTime
=
"00:00"
;
String
nowTime
=
"00:00"
;
String
dayStr
=
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
day
);
String
dayStr
=
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
day
);
...
...
share-system/src/main/java/share/system/service/impl/SCleanRecordsServiceImpl.java
View file @
ea0be758
...
@@ -274,6 +274,22 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
...
@@ -274,6 +274,22 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
}
}
@Override
@Override
public
Map
<
Long
,
SCleanRecords
>
lastCleanRoomByRoomIds
(
List
<
Long
>
roomIds
)
{
LambdaQueryWrapper
<
SCleanRecords
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
in
(
SCleanRecords:
:
getRoomId
,
roomIds
);
queryWrapper
.
gt
(
SCleanRecords:
:
getCreateTime
,
DateUtils
.
addDays
(
new
Date
(),-
1
));
List
<
SCleanRecords
>
records
=
list
(
queryWrapper
);
if
(
CollectionUtils
.
isNotEmpty
(
records
)){
Map
<
Long
,
SCleanRecords
>
cleanMap
=
records
.
parallelStream
().
collect
(
Collectors
.
groupingBy
(
SCleanRecords:
:
getRoomId
,
Collectors
.
collectingAndThen
(
Collectors
.
reducing
((
c1
,
c2
)
->
c1
.
getCreateTime
().
compareTo
(
c2
.
getCreateTime
())>
0
?
c1
:
c2
),
Optional:
:
get
)));
return
cleanMap
;
}
return
null
;
}
@Override
public
int
endCleanRecords
(
SCleanRecords
sCleanRecords
)
{
public
int
endCleanRecords
(
SCleanRecords
sCleanRecords
)
{
SCleanRecords
records
=
baseMapper
.
selectSCleanRecordsById
(
sCleanRecords
.
getId
());
SCleanRecords
records
=
baseMapper
.
selectSCleanRecordsById
(
sCleanRecords
.
getId
());
if
(
records
==
null
)
{
if
(
records
==
null
)
{
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
ea0be758
...
@@ -277,10 +277,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -277,10 +277,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
}
@Override
@Override
public
List
<
SOrder
>
listByRoomInfo
(
Long
storeId
,
L
ong
roomId
,
Date
day
)
{
public
List
<
SOrder
>
listByRoomInfo
(
Long
storeId
,
L
ist
<
Long
>
roomIds
,
Date
day
)
{
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SOrder:
:
getStoreId
,
storeId
);
queryWrapper
.
eq
(
SOrder:
:
getStoreId
,
storeId
);
queryWrapper
.
eq
(
SOrder:
:
getRoomId
,
roomId
);
if
(
CollectionUtils
.
isNotEmpty
(
roomIds
))
{
queryWrapper
.
in
(
SOrder:
:
getRoomId
,
roomIds
);
}
queryWrapper
.
notIn
(
SOrder:
:
getRefundStatus
,
RefundStatusEnum
.
getRefundedStatus
());
queryWrapper
.
notIn
(
SOrder:
:
getRefundStatus
,
RefundStatusEnum
.
getRefundedStatus
());
queryWrapper
.
in
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
getValidOrderStatus
());
queryWrapper
.
in
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
getValidOrderStatus
());
queryWrapper
.
eq
(
SOrder:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
());
queryWrapper
.
eq
(
SOrder:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
());
...
...
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
ea0be758
...
@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
...
@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
import
share.system.domain.*
;
import
share.system.domain.*
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.MqttxVo
;
import
share.system.domain.vo.MqttxVo
;
import
share.system.domain.vo.RoomStatusVo
;
import
share.system.domain.vo.SRoomVo
;
import
share.system.domain.vo.SRoomVo
;
import
share.system.mapper.DeviceMapper
;
import
share.system.mapper.DeviceMapper
;
import
share.system.mapper.SRoomMapper
;
import
share.system.mapper.SRoomMapper
;
...
@@ -32,8 +33,6 @@ import share.system.service.*;
...
@@ -32,8 +33,6 @@ import share.system.service.*;
*/
*/
@Service
@Service
public
class
SRoomServiceImpl
extends
ServiceImpl
<
SRoomMapper
,
SRoom
>
implements
ISRoomService
{
public
class
SRoomServiceImpl
extends
ServiceImpl
<
SRoomMapper
,
SRoom
>
implements
ISRoomService
{
@Autowired
private
SRoomMapper
sRoomMapper
;
@Autowired
@Autowired
private
ISStoreService
sStoreService
;
private
ISStoreService
sStoreService
;
...
@@ -51,6 +50,8 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -51,6 +50,8 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
private
MqttxService
mqttxService
;
private
MqttxService
mqttxService
;
@Autowired
@Autowired
private
DeviceOpService
deviceOpService
;
private
DeviceOpService
deviceOpService
;
@Autowired
private
RoomStatusService
roomStatusService
;
/**
/**
...
@@ -61,7 +62,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -61,7 +62,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
*/
*/
@Override
@Override
public
SRoomVo
selectSRoomById
(
Long
id
)
{
public
SRoomVo
selectSRoomById
(
Long
id
)
{
SRoom
sRoom
=
sRoom
Mapper
.
selectSRoomById
(
id
);
SRoom
sRoom
=
base
Mapper
.
selectSRoomById
(
id
);
return
convertVo
(
sRoom
);
return
convertVo
(
sRoom
);
}
}
...
@@ -73,7 +74,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -73,7 +74,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
*/
*/
@Override
@Override
public
List
<
SRoom
>
selectSRoomList
(
SRoom
sRoom
)
{
public
List
<
SRoom
>
selectSRoomList
(
SRoom
sRoom
)
{
List
<
SRoom
>
roomList
=
sRoom
Mapper
.
selectSRoomList
(
sRoom
);
List
<
SRoom
>
roomList
=
base
Mapper
.
selectSRoomList
(
sRoom
);
if
(
CollectionUtils
.
isEmpty
(
roomList
))
{
if
(
CollectionUtils
.
isEmpty
(
roomList
))
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
...
@@ -105,25 +106,29 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -105,25 +106,29 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
return
vo
;
return
vo
;
}
}
/**
* TODO 注意:只能转换一个门店下的房间列表
* 门店列表VO转换
* @param roomList
* @return
*/
private
List
<
SRoomVo
>
convertVoList
(
List
<
SRoom
>
roomList
)
{
private
List
<
SRoomVo
>
convertVoList
(
List
<
SRoom
>
roomList
)
{
List
<
SRoomVo
>
voList
=
new
ArrayList
<>();
List
<
SRoomVo
>
voList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
roomList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
roomList
))
{
List
<
Long
>
storeIds
=
roomList
.
stream
().
map
(
SRoom:
:
getStoreId
).
collect
(
Collectors
.
toList
());
//
List<Long> storeIds = roomList.stream().map(SRoom::getStoreId).collect(Collectors.toList());
List
<
Long
>
roomIds
=
roomList
.
stream
().
map
(
SRoom:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
roomIds
=
roomList
.
stream
().
map
(
SRoom:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
SRoomPack
>
roomPacks
=
roomPackService
.
packIdsByRoomIds
(
roomIds
);
List
<
SRoomPack
>
roomPacks
=
roomPackService
.
packIdsByRoomIds
(
roomIds
);
List
<
Map
>
storeList
=
sStoreService
.
optionList
(
storeIds
);
SStore
store
=
sStoreService
.
getById
(
roomList
.
get
(
0
).
getStoreId
()
);
Map
<
Long
,
List
<
SRoomPack
>>
roomPackMap
=
Optional
.
ofNullable
(
roomPacks
).
orElse
(
new
ArrayList
<>()).
stream
().
collect
(
Collectors
.
groupingBy
(
SRoomPack:
:
getRoomId
));
Map
<
Long
,
List
<
SRoomPack
>>
roomPackMap
=
Optional
.
ofNullable
(
roomPacks
).
orElse
(
new
ArrayList
<>()).
stream
().
collect
(
Collectors
.
groupingBy
(
SRoomPack:
:
getRoomId
));
List
<
Long
>
packIdList
=
Optional
.
ofNullable
(
roomPacks
).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
SRoomPack:
:
getPackId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
packIdList
=
Optional
.
ofNullable
(
roomPacks
).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
SRoomPack:
:
getPackId
).
collect
(
Collectors
.
toList
());
List
<
SPack
>
packList
=
packService
.
selectPackListByIds
(
packIdList
);
List
<
SPack
>
packList
=
packService
.
selectPackListByIds
(
packIdList
);
List
<
RoomStatusVo
>
roomStatusVoList
=
roomStatusService
.
listRoomStatus
(
store
.
getId
(),
roomIds
);
Map
<
Long
,
List
<
RoomStatusVo
>>
roomStatusMap
=
Optional
.
ofNullable
(
roomStatusVoList
).
orElse
(
new
ArrayList
<>()).
stream
().
collect
(
Collectors
.
groupingBy
(
RoomStatusVo:
:
getRoomId
));
roomList
.
stream
().
forEach
(
sRoom
->
{
roomList
.
stream
().
forEach
(
sRoom
->
{
SRoomVo
vo
=
new
SRoomVo
();
SRoomVo
vo
=
new
SRoomVo
();
BeanUtils
.
copyProperties
(
sRoom
,
vo
);
BeanUtils
.
copyProperties
(
sRoom
,
vo
);
storeList
.
stream
().
forEach
(
store
->
{
vo
.
setStoreName
(
store
.
getName
());
if
(
vo
.
getStoreId
().
compareTo
(
Long
.
parseLong
(
store
.
get
(
"id"
).
toString
()))
==
0
)
{
vo
.
setRoomStatusList
(
roomStatusMap
.
get
(
sRoom
.
getId
()));
vo
.
setStoreName
(
store
.
getOrDefault
(
"name"
,
""
).
toString
());
}
});
if
(!
roomPackMap
.
isEmpty
())
{
if
(!
roomPackMap
.
isEmpty
())
{
List
<
Long
>
packIds
=
Optional
.
ofNullable
(
roomPackMap
.
get
(
sRoom
.
getId
())).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
SRoomPack:
:
getPackId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
packIds
=
Optional
.
ofNullable
(
roomPackMap
.
get
(
sRoom
.
getId
())).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
SRoomPack:
:
getPackId
).
collect
(
Collectors
.
toList
());
sRoom
.
setPackIds
(
packIds
.
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
sRoom
.
setPackIds
(
packIds
.
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
...
@@ -150,7 +155,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -150,7 +155,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
*/
*/
@Override
@Override
public
List
<
SRoomVo
>
selectSRoomVoList
(
SRoom
sRoom
)
{
public
List
<
SRoomVo
>
selectSRoomVoList
(
SRoom
sRoom
)
{
List
<
SRoom
>
roomList
=
sRoom
Mapper
.
selectSRoomList
(
sRoom
);
List
<
SRoom
>
roomList
=
base
Mapper
.
selectSRoomList
(
sRoom
);
return
convertVoList
(
roomList
);
return
convertVoList
(
roomList
);
}
}
...
@@ -165,7 +170,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -165,7 +170,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
int
i
=
0
;
int
i
=
0
;
try
{
try
{
sRoom
.
setCreateTime
(
DateUtils
.
getNowDate
());
sRoom
.
setCreateTime
(
DateUtils
.
getNowDate
());
i
=
sRoom
Mapper
.
insertSRoom
(
sRoom
);
i
=
base
Mapper
.
insertSRoom
(
sRoom
);
//判断套餐ID
//判断套餐ID
if
(!
sRoom
.
getPackIds
().
isEmpty
())
{
if
(!
sRoom
.
getPackIds
().
isEmpty
())
{
//String 转Long
//String 转Long
...
@@ -222,7 +227,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -222,7 +227,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
roomPackService
.
deleteRoomPackByRoomId
(
sRoom
.
getId
());
roomPackService
.
deleteRoomPackByRoomId
(
sRoom
.
getId
());
}
}
sRoom
.
setUpdateTime
(
DateUtils
.
getNowDate
());
sRoom
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
sRoom
Mapper
.
updateSRoom
(
sRoom
);
return
base
Mapper
.
updateSRoom
(
sRoom
);
}
}
/**
/**
...
@@ -234,7 +239,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -234,7 +239,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
@Override
@Override
public
int
deleteSRoomByIds
(
Long
[]
ids
)
{
public
int
deleteSRoomByIds
(
Long
[]
ids
)
{
roomPackService
.
deleteRoomPackByIds
(
ids
);
roomPackService
.
deleteRoomPackByIds
(
ids
);
return
sRoom
Mapper
.
deleteSRoomByIds
(
ids
);
return
base
Mapper
.
deleteSRoomByIds
(
ids
);
}
}
/**
/**
...
@@ -245,14 +250,14 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -245,14 +250,14 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
*/
*/
@Override
@Override
public
int
deleteSRoomById
(
Long
id
)
{
public
int
deleteSRoomById
(
Long
id
)
{
return
sRoom
Mapper
.
deleteSRoomById
(
id
);
return
base
Mapper
.
deleteSRoomById
(
id
);
}
}
@Override
@Override
public
List
<
SRoomVo
>
listByStoreIds
(
List
<
Long
>
storeIds
)
{
public
List
<
SRoomVo
>
listByStoreIds
(
List
<
Long
>
storeIds
)
{
LambdaQueryWrapper
<
SRoom
>
queryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
SRoom
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
in
(
SRoom:
:
getStoreId
,
storeIds
);
queryWrapper
.
in
(
SRoom:
:
getStoreId
,
storeIds
);
List
<
SRoom
>
roomList
=
sRoom
Mapper
.
selectList
(
queryWrapper
);
List
<
SRoom
>
roomList
=
base
Mapper
.
selectList
(
queryWrapper
);
return
convertDoListToVoList
(
roomList
);
return
convertDoListToVoList
(
roomList
);
}
}
...
@@ -260,7 +265,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -260,7 +265,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
public
List
<
SRoom
>
selectSroomListByIds
(
List
<
Long
>
storeIds
)
{
public
List
<
SRoom
>
selectSroomListByIds
(
List
<
Long
>
storeIds
)
{
LambdaQueryWrapper
<
SRoom
>
queryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
SRoom
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
in
(
SRoom:
:
getStoreId
,
storeIds
);
queryWrapper
.
in
(
SRoom:
:
getStoreId
,
storeIds
);
List
<
SRoom
>
roomList
=
sRoom
Mapper
.
selectList
(
queryWrapper
);
List
<
SRoom
>
roomList
=
base
Mapper
.
selectList
(
queryWrapper
);
return
roomList
;
return
roomList
;
}
}
...
@@ -268,7 +273,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -268,7 +273,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
public
List
<
SRoom
>
selectSroomListByStroeId
(
Long
storeId
)
{
public
List
<
SRoom
>
selectSroomListByStroeId
(
Long
storeId
)
{
LambdaQueryWrapper
<
SRoom
>
queryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
SRoom
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
in
(
SRoom:
:
getStoreId
,
storeId
);
queryWrapper
.
in
(
SRoom:
:
getStoreId
,
storeId
);
List
<
SRoom
>
roomList
=
sRoom
Mapper
.
selectList
(
queryWrapper
);
List
<
SRoom
>
roomList
=
base
Mapper
.
selectList
(
queryWrapper
);
return
roomList
;
return
roomList
;
}
}
...
@@ -278,7 +283,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -278,7 +283,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
throw
new
RuntimeException
(
"当前用户不是保洁人员"
);
throw
new
RuntimeException
(
"当前用户不是保洁人员"
);
}
}
SRoom
room
=
sRoom
Mapper
.
selectById
(
id
);
SRoom
room
=
base
Mapper
.
selectById
(
id
);
if
(
Objects
.
isNull
(
room
))
{
if
(
Objects
.
isNull
(
room
))
{
throw
new
RuntimeException
(
"房间不存在"
);
throw
new
RuntimeException
(
"房间不存在"
);
}
}
...
@@ -301,7 +306,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -301,7 +306,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
@Override
@Override
public
SRoomVo
queryById
(
Long
id
)
{
public
SRoomVo
queryById
(
Long
id
)
{
SRoom
room
=
sRoom
Mapper
.
selectById
(
id
);
SRoom
room
=
base
Mapper
.
selectById
(
id
);
SStore
sStore
=
sStoreService
.
selectSStoreById
(
room
.
getStoreId
());
SStore
sStore
=
sStoreService
.
selectSStoreById
(
room
.
getStoreId
());
room
.
setOpenShopUuid
(
sStore
.
getOpenShopUuid
());
room
.
setOpenShopUuid
(
sStore
.
getOpenShopUuid
());
List
<
Long
>
packIds
=
roomPackService
.
selectPackListByRoomId
(
id
);
List
<
Long
>
packIds
=
roomPackService
.
selectPackListByRoomId
(
id
);
...
@@ -339,7 +344,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -339,7 +344,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
@Override
@Override
public
List
<
Map
>
queryRoomList
()
{
public
List
<
Map
>
queryRoomList
()
{
List
<
SRoom
>
roomList
=
sRoom
Mapper
.
selectSRoomList
(
new
SRoom
());
List
<
SRoom
>
roomList
=
base
Mapper
.
selectSRoomList
(
new
SRoom
());
List
<
Map
>
result
=
new
ArrayList
<>();
List
<
Map
>
result
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
roomList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
roomList
))
{
result
=
roomList
.
stream
().
map
(
store
->
{
result
=
roomList
.
stream
().
map
(
store
->
{
...
@@ -358,7 +363,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -358,7 +363,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
public
List
<
SRoom
>
selectByStoreIds
(
List
<
Long
>
storeIds
)
{
public
List
<
SRoom
>
selectByStoreIds
(
List
<
Long
>
storeIds
)
{
LambdaQueryWrapper
<
SRoom
>
queryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
SRoom
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
in
(
SRoom:
:
getStoreId
,
storeIds
);
queryWrapper
.
in
(
SRoom:
:
getStoreId
,
storeIds
);
return
sRoom
Mapper
.
selectList
(
queryWrapper
);
return
base
Mapper
.
selectList
(
queryWrapper
);
}
}
...
...
share-system/src/main/java/share/system/service/impl/SStoreServiceImpl.java
View file @
ea0be758
...
@@ -191,7 +191,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
...
@@ -191,7 +191,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
}
else
{
}
else
{
voList
=
convertDosToVos
(
storeList
);
voList
=
convertDosToVos
(
storeList
);
}
}
handleSStoreVoList
(
voList
);
//
handleSStoreVoList(voList);
return
voList
;
return
voList
;
}
}
...
...
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