From 993a6e6ea8ae047b9e5fffd249ae7adfcd650d3a Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期日, 17 五月 2026 11:35:44 +0800
Subject: [PATCH] 合并代码
---
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpElectronicFenceManagementController.java | 92 +++++++++++++++++-----------------------------
1 files changed, 34 insertions(+), 58 deletions(-)
diff --git a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpElectronicFenceManagementController.java b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpElectronicFenceManagementController.java
index b7bd54a..8babcb0 100644
--- a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpElectronicFenceManagementController.java
+++ b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpElectronicFenceManagementController.java
@@ -200,39 +200,29 @@
ElectronicFenceDetailVo.Numbers pointsNumbers = new ElectronicFenceDetailVo.Numbers();
if(CollUtil.isNotEmpty(pointList)){
LocalTime localTime = LocalTime.now();
- for (XpPoint xpPoint : pointList) {
- if(xpPoint.getVerificationStatus() !=5){
- //verificationStatus 验证状态 1=待验证、2=验证中、3=已验证 4验证失败 5待生效
- if (xpPoint.getVerificationStatus() == 1){
- pointsNumbers.setToBeTested(pointsNumbers.getToBeTested() + 1);
- }else if (xpPoint.getVerificationStatus() == 2){
- pointsNumbers.setTesting(pointsNumbers.getTesting() + 1);
- }else if (xpPoint.getVerificationStatus() == 4){
- pointsNumbers.setTestNotPass(pointsNumbers.getTestNotPass() + 1);
- }
- }else{
- //operationStatus 运营状态 1=待启用 2=启用中 3=已停用 4=已失效
- if(xpPoint.getOperationStatus() == 1){
- pointsNumbers.setPendingLaunch(pointsNumbers.getPendingLaunch() + 1);
- }
- else if (xpPoint.getOperationStatus() == 2) {
- boolean pointOperation = bootCommonService.getPointOperation(localTime, xpPoint);
- if (pointOperation) {
- pointsNumbers.setStartingUp(pointsNumbers.getStartingUp() + 1);
- }else{
- pointsNumbers.setPendingLaunch(pointsNumbers.getPendingLaunch() + 1);
- }
- }
- else if (xpPoint.getOperationStatus() == 3) {
- pointsNumbers.setExpired(pointsNumbers.getExpired() + 1);
- }
- else if (xpPoint.getOperationStatus() == 4) {
- pointsNumbers.setDisabled(pointsNumbers.getDisabled() + 1);
- }
- }
-
- }
+ //总数
pointsNumbers.setTotalNum(pointList.size());
+ //待测试
+ long count = pointList.stream().filter(xpPoint -> xpPoint.getVerificationStatus() == 1).count();
+ pointsNumbers.setToBeTested(Integer.parseInt(count+""));
+ //测试中
+ long count2 = pointList.stream().filter(xpPoint -> xpPoint.getVerificationStatus() == 2).count();
+ pointsNumbers.setTesting(Integer.parseInt(count2+""));
+ //测试不通过
+ long count3 = pointList.stream().filter(xpPoint -> xpPoint.getVerificationStatus() == 4).count();
+ pointsNumbers.setTestNotPass(Integer.parseInt(count3+""));
+ //待启用
+ long count4 = pointList.stream().filter(xpPoint -> xpPoint.getOperationStatus() == 1 && xpPoint.getVerificationStatus() == 3).count();
+ pointsNumbers.setPendingLaunch(Integer.parseInt(count4+""));
+ //启用中
+ long count5 = pointList.stream().filter(xpPoint -> xpPoint.getOperationStatus() == 2 && xpPoint.getVerificationStatus() == 3).count();
+ pointsNumbers.setStartingUp(Integer.parseInt(count5+""));
+ //已停用
+ long count6 = pointList.stream().filter(xpPoint -> xpPoint.getOperationStatus() == 3 && xpPoint.getVerificationStatus() == 3).count();
+ pointsNumbers.setDisabled(Integer.parseInt(count6+""));
+ //已失效
+ long count7 = pointList.stream().filter(xpPoint -> xpPoint.getOperationStatus() == 4 && xpPoint.getVerificationStatus() == 3).count();
+ pointsNumbers.setExpired(Integer.parseInt(count7+""));
}
res.setPointsNumbers(pointsNumbers);
}
@@ -244,34 +234,20 @@
ElectronicFenceDetailVo.Numbers stationNumbers = new ElectronicFenceDetailVo.Numbers();
if(CollUtil.isNotEmpty(stationList)){
- LocalTime localTime = LocalTime.now();
//status 场站状态 0=草稿 1=待启用 2=启用中 3=已停用 4=失效
- for (XpStation xpStation : stationList) {
- switch (xpStation.getStatus()) {
- case 0:
- stationNumbers.setDraft(stationNumbers.getDraft() + 1);
- break;
- case 1:
- stationNumbers.setPendingLaunch(stationNumbers.getPendingLaunch() + 1);
- break;
- case 2: //启动中 判断 待启动的状态 ,当前时间在 运营时间 内是启动中,否则是 待启动
-
- boolean stationOperation = bootCommonService.getStationOperation(localTime, xpStation.getOperationType(), xpStation.getEffectivePeriod(), xpStation.getEffectiveTimePeriod(), xpStation.getFenceOperationStrategy());
- if (stationOperation) {
- stationNumbers.setStartingUp(stationNumbers.getStartingUp() + 1);
- }else{
- stationNumbers.setPendingLaunch(stationNumbers.getPendingLaunch() + 1);
- }
- break;
- case 3:
- stationNumbers.setDisabled(stationNumbers.getDisabled() + 1);
- break;
- case 4:
- stationNumbers.setExpired(stationNumbers.getExpired() + 1);
- break;
- }
- }
stationNumbers.setTotalNum(stationList.size());
+ //待生效
+ long count1 = stationList.stream().filter(xpStation -> xpStation.getStatus() == 1).count();
+ stationNumbers.setPendingLaunch(Integer.parseInt(count1+""));
+ //启用中
+ long count2 = stationList.stream().filter(xpStation -> xpStation.getStatus() == 2).count();
+ stationNumbers.setStartingUp(Integer.parseInt(count2+""));
+ //已停用
+ long count3 = stationList.stream().filter(xpStation -> xpStation.getStatus() == 3).count();
+ stationNumbers.setDisabled(Integer.parseInt(count3+""));
+ //已失效
+ long count4 = stationList.stream().filter(xpStation -> xpStation.getStatus() == 4).count();
+ stationNumbers.setExpired(Integer.parseInt(count4+""));
}
res.setStationNumbers(stationNumbers);
return R.ok(res);
--
Gitblit v1.7.1