新增月台预约楼层车辆查询

This commit is contained in:
秦鸿展
2026-08-26 00:01:40 +08:00
parent d1d55ce52a
commit 8fe5e079dd
5 changed files with 77 additions and 0 deletions
@@ -5,6 +5,7 @@ import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformOverviewPO
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealVehicleStatusPO;
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealTaskLoadPO;
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealBusinessTypeStatPO;
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformFloorStatPO;
import java.util.List;
@@ -35,4 +36,7 @@ public interface BiPlatformRealDataMapper {
/** 今日预约-业务类型统计(按 businessName 分组统计今日预约数量) */
List<RealBusinessTypeStatPO> queryTodayBusinessTypeStats();
/** 月台监控-按楼层统计月台车辆(楼层、月台数量、今日预约车辆、当前作业车辆) */
List<RealPlatformFloorStatPO> queryPlatformFloorStats();
}
@@ -0,0 +1,26 @@
package com.mhd.bi.domain.biPlatformRealData.repository.po;
import lombok.Data;
import java.io.Serializable;
/**
* 月台监控-月台车辆统计(按楼层分组)
* 数据来源:TEST_NGWL_YMS.QMS_WINDOW_INFO(楼层+月台)与 QMS_MAIN_BUSINESS(当日预约/作业)
*/
@Data
public class RealPlatformFloorStatPO implements Serializable {
private static final long serialVersionUID = 1L;
/** 楼层(从叫号月台 WINDOW_NAME 解析,如 S1-01 -> F1 */
private String floorNo;
/** 该楼层的月台数量 */
private Long platformCount;
/** 今日预约车辆数(按 WINDOW_NAME 关联楼层) */
private Long todayReservedVehicles;
/** 当前作业车辆数(FLOW_STATUS IN 5,6,7,8,9,10 */
private Long operatingVehicles;
}
@@ -7,6 +7,7 @@ import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformOverviewPO
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealVehicleStatusPO;
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealTaskLoadPO;
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealBusinessTypeStatPO;
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformFloorStatPO;
import com.mhd.bi.domain.biPlatformSurveillance.repository.mapper.BiPlatformSurveillanceReportMapper;
import com.mhd.bi.domain.biSnapshotSync.repository.mapper.BiSnapshotWriteMapper;
import com.mhd.bi.domain.biSnapshotSync.support.BiSnapshotWeeklyRandomDataBuilder;
@@ -216,6 +217,19 @@ public class BiPlatformRealDataService {
}
}
/**
* 月台监控-按楼层统计月台车辆:返回 {floorNo, platformCount, todayReservedVehicles, operatingVehicles}
* 实时查 YMS 库,不落库。
*/
public List<RealPlatformFloorStatPO> queryPlatformFloorStats() {
try {
return biPlatformRealDataMapper.queryPlatformFloorStats();
} catch (Exception e) {
log.error("【YMS】月台监控按楼层统计失败: {}", e.getMessage(), e);
return java.util.Collections.emptyList();
}
}
/**
* 实时组装月台监测数据:真实字段查 YMS 库,写死字段保留静态值。
* 每次调用实时查库,不经过快照表。
@@ -5,6 +5,7 @@ import com.mhd.bi.domain.biComprehensive.service.BiComprehensiveReportService;
import com.mhd.bi.domain.biPlatformSurveillance.service.BiPlatformSurveillanceReportService;
import com.mhd.bi.domain.biPlatformRealData.service.BiPlatformRealDataService;
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealBusinessTypeStatPO;
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformFloorStatPO;
import com.mhd.bi.domain.biOverallOperation.service.BiOverallOperationReportService;
import com.mhd.bi.domain.biHkMacaoServiceZone.service.BiHkMacaoServiceZoneReportService;
import com.mhd.bi.domain.biTransportOperationZone.service.BiTransportOperationZoneReportService;
@@ -117,6 +118,16 @@ public class BiReportApi extends BaseController {
List<RealBusinessTypeStatPO> data = biPlatformRealDataService.queryTodayBusinessTypeStats();
return BiApiResult.ok(data);
}
/**
* 月台监控-按楼层统计月台车辆(实时查 YMS 库,不落库)
*/
@ApiOperation(value = "月台车辆统计(按楼层)", notes = "按楼层统计月台数量、今日预约车辆、当前作业车辆,实时查询 YMS 库,不落库")
@GetMapping("/platformFloorStats")
public BiApiResult<List<RealPlatformFloorStatPO>> platformFloorStats() {
List<RealPlatformFloorStatPO> data = biPlatformRealDataService.queryPlatformFloorStats();
return BiApiResult.ok(data);
}
//园区物流大屏接口----------------------------------------------------------------------
/**
* 总体运营态势
@@ -77,6 +77,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY COUNT(1) DESC
</select>
<!-- 月台监控-按楼层统计:楼层从叫号月台 WINDOW_NAME 解析(如 S1-01 / N1-02 -> F1),不依赖字母前缀,只取 - 前面那段的数字
platformCount 来自 QMS_WINDOW_INFOtodayReservedVehicles/operatingVehicles 来自 QMS_MAIN_BUSINESS(按 TARGET_DATE=今天) -->
<select id="queryPlatformFloorStats" resultType="com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformFloorStatPO">
SELECT
'F' || SUBSTR(W.WINDOW_NAME, INSTR(W.WINDOW_NAME,'-')-1, 1) AS floorNo,
COUNT(DISTINCT W.WINDOW_NAME) AS platformCount,
COUNT(DISTINCT CASE
WHEN TRUNC(mb.TARGET_DATE) = TRUNC(SYSDATE) THEN mb.CAR_NO
END) AS todayReservedVehicles,
COUNT(DISTINCT CASE
WHEN TRUNC(mb.TARGET_DATE) = TRUNC(SYSDATE)
AND mb.FLOW_STATUS IN ('5','6','7','8','9','10')
THEN mb.CAR_NO
END) AS operatingVehicles
FROM NGWL_TEST_YMS.QMS_WINDOW_INFO W
LEFT JOIN NGWL_TEST_YMS.QMS_MAIN_BUSINESS mb
ON mb.WINDOW_NAME = W.WINDOW_NAME
WHERE W.WINDOW_NAME LIKE '%-%'
GROUP BY SUBSTR(W.WINDOW_NAME, INSTR(W.WINDOW_NAME,'-')-1, 1)
ORDER BY 1 DESC
</select>
<!-- 任务负荷(今日 24 小时时段):按 EXTRACT(HOUR FROM ENTRY_TIME) 统计 -->
<select id="queryTaskLoadToday" resultType="com.mhd.bi.domain.biPlatformRealData.repository.po.RealTaskLoadPO">
SELECT