update 将起始soc修改为0x13获取到的第一条

This commit is contained in:
Lemon
2026-02-28 08:45:14 +08:00
parent c9d78e15d9
commit c6ffdff8aa

View File

@@ -28,6 +28,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Date; import java.util.Date;
import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@@ -325,6 +326,18 @@ public class UploadRealTimeMonitorHandler extends AbstractYkcHandler {
orderInfo.setChargeStartTime(new Date()); orderInfo.setChargeStartTime(new Date());
} }
String startSoc = orderInfo.getStartSoc();
// 获取上面存到redis中的soc
Map<String, String> socMap = YKCUtils.getSOCMap(transactionCode);
String min = socMap.get("min");
if (StringUtils.isNotBlank(startSoc) && StringUtils.isNotBlank(min)) {
if (Double.parseDouble(startSoc) < Double.parseDouble(min)) {
// 数据库中的起始soc < redis中的最小值 更新数据库
orderInfo.setStartSoc(min);
updateFlag = true;
}
}
if (updateFlag) { if (updateFlag) {
orderBasicInfoService.updateOrderBasicInfo(orderInfo); orderBasicInfoService.updateOrderBasicInfo(orderInfo);
} }