修复统计查询问题2

This commit is contained in:
liaozetao
2023-12-18 18:11:04 +08:00
parent b4d31d871a
commit 9a5351f160

View File

@@ -71,48 +71,50 @@ public class LaborStatsAdminService extends BaseService {
String[] erBanNoArray = erBanNoStr.split(StrUtil.COMMA);
Map<Long, Long> erBanNoMap = Arrays.stream(erBanNoArray).map(v -> usersService.getUserByErbanNo(Long.valueOf(v))).filter(Objects::nonNull).collect(Collectors.toMap(Users::getErbanNo, Users::getUid, (v1, v2) -> v1));
List<Long> roomUidList = new ArrayList<>(erBanNoMap.values());
Date beginTimeOfDay = DateTimeUtil.getBeginTimeOfDay(startTime);
Date endTimeOfDay = DateTimeUtil.getEndTimeOfDay(endTime);
//首次进房
List<LaborStatsDto> firstInRoomRecords = laborStatsMapper.getFirstInRoom(startTime, endTime, new ArrayList<>(erBanNoMap.values()));
List<LaborStatsDto> firstInRoomRecords = laborStatsMapper.getFirstInRoom(beginTimeOfDay, endTimeOfDay, new ArrayList<>(erBanNoMap.values()));
if (firstInRoomRecords == null) {
firstInRoomRecords = Collections.emptyList();
}
//总进房
List<LaborStatsDto> totalInRoomRecords = laborStatsMapper.getTotalInRoom(startTime, endTime, roomUidList);
List<LaborStatsDto> totalInRoomRecords = laborStatsMapper.getTotalInRoom(beginTimeOfDay, endTimeOfDay, roomUidList);
if (totalInRoomRecords == null) {
totalInRoomRecords = Collections.emptyList();
}
//首进房送礼人数
List<LaborStatsDto> firstInRoomGiftUserRecords = laborStatsMapper.getFirstInRoomGiftUser(startTime, endTime, roomUidList, firstInRoomRecords.stream().map(LaborStatsDto::getUid).collect(Collectors.toList()));
List<LaborStatsDto> firstInRoomGiftUserRecords = laborStatsMapper.getFirstInRoomGiftUser(beginTimeOfDay, endTimeOfDay, roomUidList, firstInRoomRecords.stream().map(LaborStatsDto::getUid).collect(Collectors.toList()));
if (firstInRoomGiftUserRecords == null) {
firstInRoomGiftUserRecords = Collections.emptyList();
}
//送礼人数
List<LaborStatsDto> giftUserRecords = laborStatsMapper.getGiftUser(startTime, endTime, roomUidList);
List<LaborStatsDto> giftUserRecords = laborStatsMapper.getGiftUser(beginTimeOfDay, endTimeOfDay, roomUidList);
if (giftUserRecords == null) {
giftUserRecords = Collections.emptyList();
}
//房间流水
List<LaborStatsDto> roomRevenueRecords = laborStatsMapper.getRoomRevenue(startTime, endTime, roomUidList);
List<LaborStatsDto> roomRevenueRecords = laborStatsMapper.getRoomRevenue(beginTimeOfDay, endTimeOfDay, roomUidList);
if (roomRevenueRecords == null) {
roomRevenueRecords = Collections.emptyList();
}
//非背包流水
List<LaborStatsDto> roomNormalRevenueRecords = laborStatsMapper.getRoomNormalRevenue(startTime, endTime, roomUidList);
List<LaborStatsDto> roomNormalRevenueRecords = laborStatsMapper.getRoomNormalRevenue(beginTimeOfDay, endTimeOfDay, roomUidList);
if (roomNormalRevenueRecords == null) {
roomNormalRevenueRecords = Collections.emptyList();
}
//背包流水
List<LaborStatsDto> roomBackpackRevenueRecords = laborStatsMapper.getRoomBackpackRevenue(startTime, endTime, roomUidList);
List<LaborStatsDto> roomBackpackRevenueRecords = laborStatsMapper.getRoomBackpackRevenue(beginTimeOfDay, endTimeOfDay, roomUidList);
if (roomBackpackRevenueRecords == null) {
roomBackpackRevenueRecords = Collections.emptyList();
}
//新用户进房人数
List<LaborStatsDto> newUserInRoomRecords = laborStatsMapper.getCountNewUserInRoom(startTime, endTime, roomUidList);
List<LaborStatsDto> newUserInRoomRecords = laborStatsMapper.getCountNewUserInRoom(beginTimeOfDay, endTimeOfDay, roomUidList);
if (newUserInRoomRecords == null) {
newUserInRoomRecords = Collections.emptyList();
}
//新用户送礼人数
List<LaborStatsDto> newUserSendGiftRecords = laborStatsMapper.getCountNewUserSendGift(startTime, endTime, roomUidList);
List<LaborStatsDto> newUserSendGiftRecords = laborStatsMapper.getCountNewUserSendGift(beginTimeOfDay, endTimeOfDay, roomUidList);
if (newUserSendGiftRecords == null) {
newUserSendGiftRecords = Collections.emptyList();
}