fix(dispatch): publish capacity demands only during creation
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ public class DispatchAggregate {
|
||||
private String dispatchNo;
|
||||
private String taskType;
|
||||
/** 是否向内部散板需求池发布本车余位。 */
|
||||
private Boolean publishLooseboardDemand = true;
|
||||
private Boolean publishLooseboardDemand = false;
|
||||
private Long tripId;
|
||||
private String overseasWarehouseId;
|
||||
private String overseasWarehouseCode;
|
||||
|
||||
+4
-4
@@ -24,15 +24,15 @@ public final class DispatchCommands {
|
||||
public record Create(String idempotencyKey, String warehouseId, Vehicle vehicle, Driver driver,
|
||||
Instant plannedDepartureAt, Instant estimatedArrivalAt, String remark,
|
||||
List<CargoSelection> cargo, List<BatchAllocation> batchAllocations, Boolean publishLooseboardDemand) {
|
||||
/** 新建排车默认发布内部余位,显式取消时保持不发布。 */
|
||||
public Create { publishLooseboardDemand = publishLooseboardDemand == null ? true : publishLooseboardDemand; }
|
||||
/** 仅智能排车建单时显式选择发布,未选择时不发布。 */
|
||||
public Create { publishLooseboardDemand = Boolean.TRUE.equals(publishLooseboardDemand); }
|
||||
}
|
||||
|
||||
public record Update(Long recordVersion, String idempotencyKey, Vehicle vehicle, Driver driver,
|
||||
Instant plannedDepartureAt, Instant estimatedArrivalAt,
|
||||
String remark, Boolean publishLooseboardDemand, Maintenance maintenance) {
|
||||
String remark, Maintenance maintenance) {
|
||||
/** 缺版本与有效版本零必须区分。 */
|
||||
public Update { recordVersion = requireVersion(recordVersion); if (publishLooseboardDemand == null) throw new IllegalArgumentException("请明确是否发布散板需求"); }
|
||||
public Update { recordVersion = requireVersion(recordVersion); }
|
||||
}
|
||||
|
||||
public record AddCargo(Long recordVersion, String idempotencyKey, List<CargoSelection> cargo,
|
||||
|
||||
+1
-1
@@ -451,7 +451,7 @@ public class DispatchAggregateService implements DispatchExecutionPort,DispatchA
|
||||
}
|
||||
row.setResourcesJson(write(savedResources));row.setVehiclePlate(actual.vehicle()==null?null:actual.vehicle().plate());
|
||||
row.setPlannedDepartureAt(utc(request.plannedDepartureAt()));row.setEstimatedArrivalAt(utc(request.estimatedArrivalAt()));row.setRemark(request.remark());
|
||||
row.setPublishLooseboardDemand(request.publishLooseboardDemand());
|
||||
// 发布选择仅在建单时确定,维护车辆不得取消或重新发布需求。
|
||||
if(!Objects.equals(before,basis(row)))invalidate(row,"车辆、司机或计划信息已修改");
|
||||
fleet.saveDispatchResources(number,actor.operatorId(),actual,request.plannedDepartureAt(),request.remark());
|
||||
return saveCommand(row,actor,identity,request.remark());
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
-- 本次仅新增排车内部余位发布选项;执行需单独授权,不回填、清理或重置业务数据。
|
||||
ALTER TABLE ll_dispatch_order
|
||||
ADD COLUMN publish_looseboard_demand TINYINT(1) NOT NULL DEFAULT 1 COMMENT '是否向内部散板需求池发布余位' AFTER task_type;
|
||||
ADD COLUMN publish_looseboard_demand TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否向内部散板需求池发布余位' AFTER task_type;
|
||||
|
||||
@@ -1895,7 +1895,7 @@ CREATE TABLE IF NOT EXISTS ll_dispatch_order (
|
||||
id BIGINT NOT NULL COMMENT '整车排车主单内部主键',
|
||||
dispatch_no VARCHAR(64) NOT NULL COMMENT '真实排车业务号',
|
||||
task_type VARCHAR(32) NOT NULL DEFAULT 'DELIVERY' COMMENT '任务类型:仓库派送、到仓取货、本土卡车',
|
||||
publish_looseboard_demand TINYINT(1) NOT NULL DEFAULT 1 COMMENT '是否向内部散板需求池发布余位',
|
||||
publish_looseboard_demand TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否向内部散板需求池发布余位',
|
||||
trip_id BIGINT NOT NULL COMMENT '本趟唯一车辆资源记录ID',
|
||||
overseas_warehouse_id VARCHAR(128) NOT NULL COMMENT '真实起运海外仓ID',
|
||||
overseas_warehouse_code VARCHAR(128) NULL COMMENT '起运海外仓编码快照',
|
||||
|
||||
@@ -4080,10 +4080,6 @@ components:
|
||||
type: object
|
||||
x-java-record: DispatchCommands.Update
|
||||
properties:
|
||||
publishLooseboardDemand:
|
||||
type: boolean
|
||||
description: 是否向内部散板需求池发布本车余位;新建默认勾选。
|
||||
|
||||
recordVersion:
|
||||
oneOf:
|
||||
- type: string
|
||||
@@ -4118,7 +4114,6 @@ components:
|
||||
nullable: true
|
||||
description: 本趟可空补充资料,八字段均可空;空白字符串规范为null,不替代正式FBA预约或实际发车时间。
|
||||
required:
|
||||
- publishLooseboardDemand
|
||||
- recordVersion
|
||||
- idempotencyKey
|
||||
DeliveryStatusChange:
|
||||
@@ -5984,8 +5979,8 @@ components:
|
||||
properties:
|
||||
publishLooseboardDemand:
|
||||
type: boolean
|
||||
description: 是否向内部散板需求池发布本车余位;新建默认勾选。
|
||||
default: true
|
||||
description: 是否向内部散板需求池发布本车余位;仅智能排车建单时选择,默认不发布。
|
||||
default: false
|
||||
|
||||
idempotencyKey:
|
||||
type: string
|
||||
@@ -6701,7 +6696,7 @@ components:
|
||||
properties:
|
||||
publishLooseboardDemand:
|
||||
type: boolean
|
||||
description: 是否向内部散板需求池发布本车余位;新建默认勾选。
|
||||
description: 建单时确定的散板需求发布选择,维护车辆不可修改。
|
||||
|
||||
dispatchNo:
|
||||
type: string
|
||||
|
||||
Reference in New Issue
Block a user