From d61f1bcae409093d958ffcd753d46cb244a393a6 Mon Sep 17 00:00:00 2001 From: "weicw1996@qq.com" Date: Fri, 2 Oct 2026 17:01:34 +0800 Subject: [PATCH] =?UTF-8?q?:recycle:=20=E9=97=A8=E6=A7=9B=E9=87=8C?= =?UTF-8?q?=E7=9A=84=E5=90=AF=E7=94=A8=E5=88=A4=E6=96=AD=E6=94=B9=E7=94=A8?= =?UTF-8?q?=20BladeConstant.DB=5FSTATUS=5FNORMAL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原先写死 Integer.valueOf(1),虽然值与常量一致,但读代码的人无从判断 「1 到底是启用还是别的什么」。改用框架常量后语义自明, 将来若有人改动状态取值也不会遗漏此处。 已核对:车辆表 status 实际取值为 1(18 辆)与 2(2 辆), BladeConstant.DB_STATUS_NORMAL 确为 1,判断逻辑未变。 73 个测试通过。 --- .../transport/service/impl/DriverWaybillServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/DriverWaybillServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/DriverWaybillServiceImpl.java index 7cd3b1a4..ea4b53c6 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/DriverWaybillServiceImpl.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/DriverWaybillServiceImpl.java @@ -31,6 +31,7 @@ import org.springblade.core.log.exception.ServiceException; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.jackson.JsonUtil; import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.utils.Func; import org.springblade.transport.mapper.WaybillEnroutePunchMapper; import org.springblade.transport.mapper.WaybillNodePunchMapper; @@ -395,7 +396,8 @@ public class DriverWaybillServiceImpl implements IDriverWaybillService { .in(TransportVehicle::getPlateNo, currentBoundPlates(driver))); boolean anyCertified = boundVehicles.stream().anyMatch(vehicle -> certificationGate.isVehicleAvailable( - Integer.valueOf(1).equals(vehicle.getStatus()), vehicle.getEffectiveCertRecordId())); + vehicle.getStatus() != null && vehicle.getStatus() == BladeConstant.DB_STATUS_NORMAL, + vehicle.getEffectiveCertRecordId())); if (!anyCertified) { throw new ServiceException(certificationGate.vehicleUnavailableReason()); }