充电桩调度

This commit is contained in:
liuhanqing
2025-12-02 10:42:02 +08:00
parent b832cf2214
commit ca1231bf2f

View File

@@ -43,6 +43,13 @@ public class CdzThread implements Runnable {
public void run() {
init();
while (isRun) {
try {
dispatch();
Thread.sleep(1500);
}catch (Exception e){
log.error(e.getMessage(),e);
}
}
}
@@ -169,7 +176,6 @@ public class CdzThread implements Runnable {
/**
* 创建充电任务
*
* @param srgvList
*/
private void createChargingInJob(List<DeviceSrgv> srgvList) {
srgvList.sort((o1, o2) -> o2.getBattery() - o1.getBattery());
@@ -187,7 +193,7 @@ public class CdzThread implements Runnable {
DeviceCdz cdz = null;
Optional<DeviceCdz> min = cdzList.stream().filter(c -> c.getSzcs().equals(floor)).min((o1, o2) -> {
Integer distance1 = Math.abs(o1.getSzcs());
Integer distance2 = Math.abs(floor);
Integer distance2 = Math.abs(o2.getSzcs());
return distance1 - distance2;
});
if (min.isPresent()) {
@@ -221,7 +227,6 @@ public class CdzThread implements Runnable {
/**
* 创建充电任务
*
* @param deviceSrgv
*/
private void createChargingOutJob(DeviceSrgv deviceSrgv, DeviceCdz cdz) {
SrgvChargingJob srgvChargingJobParam = new SrgvChargingJob();