出场时检查时间:当前时间必须大于进场时间3分钟
parent
8e2427369f
commit
8532c96343
|
|
@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.time.Duration;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -68,6 +69,18 @@ public class TruckWeighingBusinessService {
|
||||||
boolean isComing = isTruckComing(orderTrans);
|
boolean isComing = isTruckComing(orderTrans);
|
||||||
boolean isLeaving = isTruckLeaving(orderTrans);
|
boolean isLeaving = isTruckLeaving(orderTrans);
|
||||||
if (isLeaving) {
|
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())) {
|
if (!CheckStatus.YiKanLiao.equals(orderTrans.getCheckStatus())) {
|
||||||
handle.playVoice(licensePlate + VoiceConstants.VOICE_UNCHECKED);
|
handle.playVoice(licensePlate + VoiceConstants.VOICE_UNCHECKED);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue