出场时检查时间:当前时间必须大于进场时间3分钟

master
ljw 2026-01-04 13:25:59 +08:00
parent 8e2427369f
commit 8532c96343
1 changed files with 13 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.ByteArrayInputStream;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.Base64;
import java.util.List;
@ -68,6 +69,18 @@ public class TruckWeighingBusinessService {
boolean isComing = isTruckComing(orderTrans);
boolean isLeaving = isTruckLeaving(orderTrans);
if (isLeaving) {
// 出场时检查时间当前时间必须大于进场时间3分钟
if (orderTrans.getInTime() != null) {
long minutesSinceEntry = Duration.between(orderTrans.getInTime(), LocalDateTime.now()).toMinutes();
if (minutesSinceEntry < 3) {
log.warn("车辆 {} 出场时间过早,进场时间: {}, 当前已过 {} 分钟不满足最少3分钟要求",
licensePlate, orderTrans.getInTime(), minutesSinceEntry);
return;
}
} else {
return;
}
// 出场时检查是否已看料
if (!CheckStatus.YiKanLiao.equals(orderTrans.getCheckStatus())) {
handle.playVoice(licensePlate + VoiceConstants.VOICE_UNCHECKED);