🐛 计划调度生成的运单允许司机为空

计划调度与多联总单调度归一后的数据来源豁免司机必填;手工建单规则不变。
This commit is contained in:
2026-11-07 04:29:50 +08:00
parent dbc7f3718b
commit 22091b5dd9
@@ -2174,7 +2174,7 @@ public class WaybillServiceImpl extends BaseServiceImpl<WaybillMapper, Waybill>
if (isRoadTransport(waybill.getTransportType())) {
if ("承运商".equals(waybill.getCarrierType())) {
TransportBusinessSupport.validateRequired(waybill.getCarrierName(), "承运商不能为空");
} else if (!isBatchImport(waybill)) {
} else if (!isBatchImport(waybill) && !isDriverOptionalSource(waybill)) {
TransportBusinessSupport.validateRequired(waybill.getDriverName(), "司机不能为空");
}
}
@@ -2350,6 +2350,14 @@ public class WaybillServiceImpl extends BaseServiceImpl<WaybillMapper, Waybill>
return waybill != null && TransportBusinessSupport.DATA_SOURCE_BATCH_IMPORT.equals(waybill.getDataSource());
}
/**
* 计划调度生成的运单允许司机为空:调度明细里司机与手机号对全部承运类型都是选填。
* 数据来源已由 prepare 归一,多联总单调度同样归为计划调度。
*/
private boolean isDriverOptionalSource(Waybill waybill) {
return waybill != null && TransportBusinessSupport.DATA_SOURCE_PLAN_DISPATCH.equals(waybill.getDataSource());
}
private void fillJsonFromFlatFields(Waybill waybill) {
if (Func.isEmpty(waybill.getTaskEntryMode())) {
waybill.setTaskEntryMode("simple");