From 60b3a67586494fefd9501c29a00d35675b1dbdcf Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期三, 23 十月 2024 16:36:33 +0800
Subject: [PATCH] *
---
src/main/java/com/zy/asrs/utils/SortTheExecutionOfTheCarUtil.java | 36 ++++++++++++++++++++++++++----------
1 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/src/main/java/com/zy/asrs/utils/SortTheExecutionOfTheCarUtil.java b/src/main/java/com/zy/asrs/utils/SortTheExecutionOfTheCarUtil.java
index 63ee644..93fbbfa 100644
--- a/src/main/java/com/zy/asrs/utils/SortTheExecutionOfTheCarUtil.java
+++ b/src/main/java/com/zy/asrs/utils/SortTheExecutionOfTheCarUtil.java
@@ -30,9 +30,9 @@
}
//鑾峰彇鏈�杩戝苟鍦ㄥ綋鍓嶄綅缃墠杈圭殑浣嶇疆
- public static Integer LatelyAndLessThan(List<BasDevpPosition> devpPosition, long nowPosition){
+ public static Integer LatelyAndLessThan(List<BasDevpPosition> devpPosition, long nowPosition,long perimeter){
Integer result = 0;
- long Difference = 1737000L;
+ long Difference = perimeter;
for (BasDevpPosition positions : devpPosition){
Long position = positions.getPlcPosition();
if (position<=nowPosition){
@@ -41,11 +41,27 @@
result = positions.getDevNo();
}
} else {
- if ((nowPosition-(position - 1737000L)) < Difference){
- Difference = nowPosition-(position - 1737000L);
+ if ((nowPosition-(position - perimeter)) < Difference){
+ Difference = nowPosition-(position - perimeter);
result = positions.getDevNo();
}
}
+ }
+ return result;
+ }
+
+ //鑾峰彇鏈�杩戝苟鍦ㄥ綋鍓嶄綅缃悗杈圭殑浣嶇疆
+ public static Integer LatelyAndLessThanWcs(List<BasDevpPosition> devpPosition, long nowPosition,long perimeter){
+ Integer result = 0;
+ Integer integer = LatelyAndLessThan(devpPosition, nowPosition,perimeter);
+ for (BasDevpPosition basDevpPosition:devpPosition){
+ if (basDevpPosition.getDevNo().equals(integer)){
+ if (basDevpPosition.getDevNo() == 101){
+ result = 133;
+ }
+ break;
+ }
+ result = basDevpPosition.getDevNo();
}
return result;
}
@@ -70,9 +86,9 @@
// }
//鑾峰彇鏈�杩戝苟鍦ㄥ綋鍓嶄綅缃悗杈圭殑浣嶇疆
- public static Integer LatelyAndGreaterThan(List<List<Long>> sitePosition, long nowPosition){
+ public static Integer LatelyAndGreaterThan(List<List<Long>> sitePosition, long nowPosition ,long perimeter){
int result = 0;
- long Difference = 1737000L;
+ long Difference = perimeter;
for (List<Long> rgvPositions: sitePosition){
Long position = rgvPositions.get(1);
if (position>nowPosition){
@@ -81,8 +97,8 @@
result = rgvPositions.get(0).intValue();
}
} else {
- if ((1737000L - (nowPosition - position)) < Difference){
- Difference = 1737000L - (nowPosition - position);
+ if ((perimeter - (nowPosition - position)) < Difference){
+ Difference = perimeter - (nowPosition - position);
result = rgvPositions.get(0).intValue();
}
}
@@ -203,11 +219,11 @@
int intersectionSize = getIntersectionSize(siteList, one);
if (intersectionSize == temporaryMaxCount){
championCount++;
- championTemporary = siteLists;
+ championTemporary = one;
} else if (intersectionSize > temporaryMaxCount){
championCount = 1 ;
temporaryMaxCount = intersectionSize;
- championTemporary = siteLists;
+ championTemporary = one;
}
}
if (championCount == 1){
--
Gitblit v1.9.1