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
7c70d58e
Commit
7c70d58e
authored
Jan 20, 2024
by
wuwenlong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
ba58daa6
ea0be758
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 @
7c70d58e
...
...
@@ -44,10 +44,11 @@ public class SRoomController extends BaseController {
/**
* 查询房间列表
*/
@ApiOperation
(
value
=
"房间列表"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SRoom
sRoom
)
{
startPage
();
List
<
SRoom
>
list
=
sRoomService
.
selectSRoom
List
(
sRoom
);
List
<
SRoom
Vo
>
list
=
sRoomService
.
selectSRoomVo
List
(
sRoom
);
return
getDataTable
(
list
);
}
...
...
share-system/src/main/java/share/system/domain/vo/SRoomVo.java
View file @
7c70d58e
...
...
@@ -123,7 +123,10 @@ public class SRoomVo extends BaseEntity
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm"
)
private
Date
recordsTime
;
/** 门店名称 */
/**
* 房间状态列表
*/
private
List
<
RoomStatusVo
>
roomStatusList
;
@Override
...
...
share-system/src/main/java/share/system/service/ISCleanRecordsService.java
View file @
7c70d58e
package
share
.
system
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.SCleanRecords
;
...
...
@@ -89,6 +90,8 @@ public interface ISCleanRecordsService extends IService<SCleanRecords>
SCleanRecords
lastCleanByRoomId
(
Long
roomId
);
Map
<
Long
,
SCleanRecords
>
lastCleanRoomByRoomIds
(
List
<
Long
>
roomIds
);
/**
* 结束保洁
* @param sCleanRecords
...
...
share-system/src/main/java/share/system/service/ISOrderService.java
View file @
7c70d58e
...
...
@@ -89,11 +89,12 @@ public interface ISOrderService extends IService<SOrder>
/**
* 查询房间指定日T+1的订单
* @param storeId
* @param roomId
* @param roomId
s
* @param day
* @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 @
7c70d58e
...
...
@@ -20,4 +20,13 @@ public interface RoomStatusService {
*/
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 @
7c70d58e
...
...
@@ -51,13 +51,36 @@ public class RoomStatusServiceImpl implements RoomStatusService {
//查询门店营业时间
SStore
store
=
storeService
.
getById
(
storeId
);
// 通过门店及房间查询指定日期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
);
List
<
RoomStatusVo
>
voList
=
generatorRoomStatusList
(
store
,
roomId
,
orderList
,
cleanRecords
,
day
,
orderType
);
voList
.
addAll
(
generatorRoomStatusList
(
store
,
roomId
,
orderList
,
cleanRecords
,
DateUtils
.
addDays
(
day
,
1
),
orderType
));
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
){
String
nowTime
=
"00:00"
;
String
dayStr
=
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
day
);
...
...
share-system/src/main/java/share/system/service/impl/SCleanRecordsServiceImpl.java
View file @
7c70d58e
...
...
@@ -274,6 +274,22 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
}
@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
)
{
SCleanRecords
records
=
baseMapper
.
selectSCleanRecordsById
(
sCleanRecords
.
getId
());
if
(
records
==
null
)
{
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
7c70d58e
...
...
@@ -277,10 +277,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
@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
<>();
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
.
in
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
getValidOrderStatus
());
queryWrapper
.
eq
(
SOrder:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
());
...
...
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
7c70d58e
...
...
@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
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.SRoomMapper
;
...
...
@@ -32,8 +33,6 @@ import share.system.service.*;
*/
@Service
public
class
SRoomServiceImpl
extends
ServiceImpl
<
SRoomMapper
,
SRoom
>
implements
ISRoomService
{
@Autowired
private
SRoomMapper
sRoomMapper
;
@Autowired
private
ISStoreService
sStoreService
;
...
...
@@ -51,6 +50,8 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
private
MqttxService
mqttxService
;
@Autowired
private
DeviceOpService
deviceOpService
;
@Autowired
private
RoomStatusService
roomStatusService
;
/**
...
...
@@ -61,7 +62,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
*/
@Override
public
SRoomVo
selectSRoomById
(
Long
id
)
{
SRoom
sRoom
=
sRoom
Mapper
.
selectSRoomById
(
id
);
SRoom
sRoom
=
base
Mapper
.
selectSRoomById
(
id
);
return
convertVo
(
sRoom
);
}
...
...
@@ -73,7 +74,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
*/
@Override
public
List
<
SRoom
>
selectSRoomList
(
SRoom
sRoom
)
{
List
<
SRoom
>
roomList
=
sRoom
Mapper
.
selectSRoomList
(
sRoom
);
List
<
SRoom
>
roomList
=
base
Mapper
.
selectSRoomList
(
sRoom
);
if
(
CollectionUtils
.
isEmpty
(
roomList
))
{
return
new
ArrayList
<>();
}
...
...
@@ -105,25 +106,29 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
return
vo
;
}
/**
* TODO 注意:只能转换一个门店下的房间列表
* 门店列表VO转换
* @param roomList
* @return
*/
private
List
<
SRoomVo
>
convertVoList
(
List
<
SRoom
>
roomList
)
{
List
<
SRoomVo
>
voList
=
new
ArrayList
<>();
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
<
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
));
List
<
Long
>
packIdList
=
Optional
.
ofNullable
(
roomPacks
).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
SRoomPack:
:
getPackId
).
collect
(
Collectors
.
toList
());
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
->
{
SRoomVo
vo
=
new
SRoomVo
();
BeanUtils
.
copyProperties
(
sRoom
,
vo
);
storeList
.
stream
().
forEach
(
store
->
{
if
(
vo
.
getStoreId
().
compareTo
(
Long
.
parseLong
(
store
.
get
(
"id"
).
toString
()))
==
0
)
{
vo
.
setStoreName
(
store
.
getOrDefault
(
"name"
,
""
).
toString
());
}
});
vo
.
setStoreName
(
store
.
getName
());
vo
.
setRoomStatusList
(
roomStatusMap
.
get
(
sRoom
.
getId
()));
if
(!
roomPackMap
.
isEmpty
())
{
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
(
","
)));
...
...
@@ -150,7 +155,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
*/
@Override
public
List
<
SRoomVo
>
selectSRoomVoList
(
SRoom
sRoom
)
{
List
<
SRoom
>
roomList
=
sRoom
Mapper
.
selectSRoomList
(
sRoom
);
List
<
SRoom
>
roomList
=
base
Mapper
.
selectSRoomList
(
sRoom
);
return
convertVoList
(
roomList
);
}
...
...
@@ -165,7 +170,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
int
i
=
0
;
try
{
sRoom
.
setCreateTime
(
DateUtils
.
getNowDate
());
i
=
sRoom
Mapper
.
insertSRoom
(
sRoom
);
i
=
base
Mapper
.
insertSRoom
(
sRoom
);
//判断套餐ID
if
(!
sRoom
.
getPackIds
().
isEmpty
())
{
//String 转Long
...
...
@@ -222,7 +227,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
roomPackService
.
deleteRoomPackByRoomId
(
sRoom
.
getId
());
}
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
@Override
public
int
deleteSRoomByIds
(
Long
[]
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
*/
@Override
public
int
deleteSRoomById
(
Long
id
)
{
return
sRoom
Mapper
.
deleteSRoomById
(
id
);
return
base
Mapper
.
deleteSRoomById
(
id
);
}
@Override
public
List
<
SRoomVo
>
listByStoreIds
(
List
<
Long
>
storeIds
)
{
LambdaQueryWrapper
<
SRoom
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
in
(
SRoom:
:
getStoreId
,
storeIds
);
List
<
SRoom
>
roomList
=
sRoom
Mapper
.
selectList
(
queryWrapper
);
List
<
SRoom
>
roomList
=
base
Mapper
.
selectList
(
queryWrapper
);
return
convertDoListToVoList
(
roomList
);
}
...
...
@@ -260,7 +265,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
public
List
<
SRoom
>
selectSroomListByIds
(
List
<
Long
>
storeIds
)
{
LambdaQueryWrapper
<
SRoom
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
in
(
SRoom:
:
getStoreId
,
storeIds
);
List
<
SRoom
>
roomList
=
sRoom
Mapper
.
selectList
(
queryWrapper
);
List
<
SRoom
>
roomList
=
base
Mapper
.
selectList
(
queryWrapper
);
return
roomList
;
}
...
...
@@ -268,7 +273,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
public
List
<
SRoom
>
selectSroomListByStroeId
(
Long
storeId
)
{
LambdaQueryWrapper
<
SRoom
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
in
(
SRoom:
:
getStoreId
,
storeId
);
List
<
SRoom
>
roomList
=
sRoom
Mapper
.
selectList
(
queryWrapper
);
List
<
SRoom
>
roomList
=
base
Mapper
.
selectList
(
queryWrapper
);
return
roomList
;
}
...
...
@@ -278,7 +283,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
throw
new
RuntimeException
(
"当前用户不是保洁人员"
);
}
SRoom
room
=
sRoom
Mapper
.
selectById
(
id
);
SRoom
room
=
base
Mapper
.
selectById
(
id
);
if
(
Objects
.
isNull
(
room
))
{
throw
new
RuntimeException
(
"房间不存在"
);
}
...
...
@@ -301,7 +306,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
@Override
public
SRoomVo
queryById
(
Long
id
)
{
SRoom
room
=
sRoom
Mapper
.
selectById
(
id
);
SRoom
room
=
base
Mapper
.
selectById
(
id
);
SStore
sStore
=
sStoreService
.
selectSStoreById
(
room
.
getStoreId
());
room
.
setOpenShopUuid
(
sStore
.
getOpenShopUuid
());
List
<
Long
>
packIds
=
roomPackService
.
selectPackListByRoomId
(
id
);
...
...
@@ -339,7 +344,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
@Override
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
<>();
if
(
CollectionUtils
.
isNotEmpty
(
roomList
))
{
result
=
roomList
.
stream
().
map
(
store
->
{
...
...
@@ -358,7 +363,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
public
List
<
SRoom
>
selectByStoreIds
(
List
<
Long
>
storeIds
)
{
LambdaQueryWrapper
<
SRoom
>
queryWrapper
=
new
LambdaQueryWrapper
();
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 @
7c70d58e
...
...
@@ -191,7 +191,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
}
else
{
voList
=
convertDosToVos
(
storeList
);
}
handleSStoreVoList
(
voList
);
//
handleSStoreVoList(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