This commit is contained in:
2026-08-27 11:39:32 +08:00
parent 575cee7a86
commit c80307a838
4 changed files with 15 additions and 1 deletions
@@ -15633,9 +15633,11 @@ CREATE TABLE IF NOT EXISTS baiyue_firstleg.fl_container_transport_history (
id BIGINT UNSIGNED NOT NULL COMMENT '运输字段变更历史ID',container_booking_id BIGINT UNSIGNED NOT NULL COMMENT '稳定柜次ID',
before_container_no VARCHAR(64) NULL COMMENT '变更前真实集装箱号',after_container_no VARCHAR(64) NULL COMMENT '变更后真实集装箱号',
before_voyage_no VARCHAR(64) NULL COMMENT '变更前航次号',after_voyage_no VARCHAR(64) NULL COMMENT '变更后航次号',
operation_id VARCHAR(64) NOT NULL COMMENT '运输字段操作幂等ID',request_hash CHAR(64) NOT NULL COMMENT '运输字段请求哈希',
reason VARCHAR(500) NULL COMMENT '运输字段变更原因',operator_id BIGINT UNSIGNED NOT NULL COMMENT '变更操作人ID',
operator_name VARCHAR(64) NULL COMMENT '变更操作人名称快照',created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '变更记录创建时间',
PRIMARY KEY(id),KEY idx_container_transport_history(container_booking_id,created_at,id)
PRIMARY KEY(id),UNIQUE KEY uk_container_transport_history_operation(container_booking_id,operator_id,operation_id),
KEY idx_container_transport_history(container_booking_id,created_at,id)
) ENGINE=InnoDB COMMENT='柜次真实运输字段不可变变更审计';
ALTER TABLE baiyue_firstleg.fl_container_transport_history
@@ -15645,6 +15647,8 @@ ALTER TABLE baiyue_firstleg.fl_container_transport_history
MODIFY COLUMN after_container_no VARCHAR(64) NULL COMMENT '变更后真实集装箱号',
MODIFY COLUMN before_voyage_no VARCHAR(64) NULL COMMENT '变更前航次号',
MODIFY COLUMN after_voyage_no VARCHAR(64) NULL COMMENT '变更后航次号',
MODIFY COLUMN operation_id VARCHAR(64) NOT NULL COMMENT '运输字段操作幂等ID',
MODIFY COLUMN request_hash CHAR(64) NOT NULL COMMENT '运输字段请求哈希',
MODIFY COLUMN reason VARCHAR(500) NULL COMMENT '运输字段变更原因',
MODIFY COLUMN operator_id BIGINT UNSIGNED NOT NULL COMMENT '变更操作人ID',
MODIFY COLUMN operator_name VARCHAR(64) NULL COMMENT '变更操作人名称快照',
@@ -496,6 +496,10 @@ public class LoadingListService {
}
requireLoadingMutable(before);
if (java.util.Objects.equals(before.getContainerNo(), containerNo)
&& java.util.Objects.equals(before.getVoyageNo(), voyageNo)) {
return repository.preloadDetail(before);
}
if (containerNo == null && pickRepository.taskByPlan(planId) != null) {
throw conflict("PDA拣货任务已创建,不能清空真实集装箱号");
}
@@ -349,6 +349,9 @@ public class SmartLoadingService {
LoadingPlanEntity plan = editing(planId, request.expectedPlanVersion(), operatorId, operatorName);
LoadingPlanItemEntity item = repository.item(planId, itemId);
if (item == null) throw new BizException(ResultCode.NOT_FOUND, "装柜明细不存在");
if (Objects.equals(item.getWarehouseRemark(), remark)) {
return view(plan, requireBooking(plan.getContainerBookingId()));
}
String before = json(values("warehouseRemark", item.getWarehouseRemark(), "version", item.getVersion()));
try {
touch(plan, operatorId, operatorName);
@@ -166,9 +166,12 @@ CREATE TABLE IF NOT EXISTS fl_container_transport_history (
after_container_no VARCHAR(64) NULL COMMENT '变更后真实集装箱号',
before_voyage_no VARCHAR(64) NULL COMMENT '变更前航次号',
after_voyage_no VARCHAR(64) NULL COMMENT '变更后航次号',
operation_id VARCHAR(64) NOT NULL COMMENT '运输字段操作幂等ID',
request_hash CHAR(64) NOT NULL COMMENT '运输字段请求哈希',
reason VARCHAR(500) NULL COMMENT '运输字段变更原因',
operator_id BIGINT UNSIGNED NOT NULL COMMENT '变更操作人ID',
operator_name VARCHAR(64) NULL COMMENT '变更操作人名称快照',
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '变更记录创建时间', PRIMARY KEY(id),
UNIQUE KEY uk_container_transport_history_operation (container_booking_id,operator_id,operation_id),
KEY idx_container_transport_history (container_booking_id,created_at,id)
) ENGINE=InnoDB COMMENT='柜次真实运输字段不可变变更审计';