|
|
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.yc.ship.framework.common.pojo.PageResult;
|
|
|
import com.yc.ship.framework.excel.core.util.ExcelUtils;
|
|
|
+import com.yc.ship.framework.security.core.util.SecurityFrameworkUtils;
|
|
|
import com.yc.ship.module.resource.api.ship.dto.RoomModelFloorNumDTO;
|
|
|
import com.yc.ship.module.resource.dal.mysql.room.ResourceRoomMapper;
|
|
|
import com.yc.ship.module.trade.controller.admin.report.vo.*;
|
|
|
@@ -676,15 +677,22 @@ public class VoyageStockBoardServiceImpl implements VoyageStockBoardService {
|
|
|
|
|
|
@Override
|
|
|
public VisitorSourceDashboardRespVO getVisitorSourceDashboard(VisitorSourceDashboardReqVO reqVO) {
|
|
|
- // 1. 查询游客列表
|
|
|
- List<TradeVisitorDO> visitorList = voyageStockBoardMapper.selectVisitorListForSourceDashboard(
|
|
|
- reqVO.getShipId(), reqVO.getVoyageIds());
|
|
|
- if (CollUtil.isEmpty(visitorList)) {
|
|
|
+ // 1. 查询游客列表(多游轮汇总)
|
|
|
+ List<TradeVisitorDO> allVisitorList = new ArrayList<>();
|
|
|
+ Long distributorId = SecurityFrameworkUtils.getLoginDistributorId();
|
|
|
+ for (Long shipId : reqVO.getShipIds()) {
|
|
|
+ List<TradeVisitorDO> visitorList = voyageStockBoardMapper.selectVisitorListForSourceDashboard(
|
|
|
+ shipId, reqVO.getVoyageIds(), distributorId);
|
|
|
+ if (CollUtil.isNotEmpty(visitorList)) {
|
|
|
+ allVisitorList.addAll(visitorList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (CollUtil.isEmpty(allVisitorList)) {
|
|
|
return buildEmptyResp();
|
|
|
}
|
|
|
|
|
|
// 2. 分类统计
|
|
|
- return analyzeVisitorSource(visitorList);
|
|
|
+ return analyzeVisitorSource(allVisitorList);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -949,17 +957,25 @@ public class VoyageStockBoardServiceImpl implements VoyageStockBoardService {
|
|
|
|
|
|
@Override
|
|
|
public VisitorAgeDashboardRespVO getVisitorAgeDashboard(VisitorSourceDashboardReqVO reqVO) {
|
|
|
- // 1. 查询游客年龄列表
|
|
|
- List<Integer> ageList = voyageStockBoardMapper.selectVisitorAgeListForAgeDashboard(
|
|
|
- reqVO.getShipId(), reqVO.getVoyageIds());
|
|
|
- if (CollUtil.isEmpty(ageList)) {
|
|
|
+ // 1. 查询游客年龄列表(多游轮汇总)
|
|
|
+ List<Integer> allAgeList = new ArrayList<>();
|
|
|
+ Long distributorId = SecurityFrameworkUtils.getLoginDistributorId();
|
|
|
+ for (Long shipId : reqVO.getShipIds()) {
|
|
|
+ List<Integer> ageList = voyageStockBoardMapper.selectVisitorAgeListForAgeDashboard(
|
|
|
+ shipId, reqVO.getVoyageIds(), distributorId);
|
|
|
+ if (CollUtil.isNotEmpty(ageList)) {
|
|
|
+ allAgeList.addAll(ageList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (CollUtil.isEmpty(allAgeList)) {
|
|
|
return buildEmptyAgeResp();
|
|
|
}
|
|
|
|
|
|
// 2. 年龄段分组统计
|
|
|
- return analyzeVisitorAge(ageList);
|
|
|
+ return analyzeVisitorAge(allAgeList);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public void exportVisitorAgeDashboardExcel(VisitorSourceDashboardReqVO reqVO, HttpServletResponse response) throws IOException {
|
|
|
VisitorAgeDashboardRespVO data = getVisitorAgeDashboard(reqVO);
|