Files
oneos-backend/sql/2026-03-13-return-order-enhance.sql
kkfluous 04f0599efa feat(asset): enhance return order with inspection, BPM approval, and event-driven cross-module linkage
- Add sourceType/sourceId/deliveryOrderId to return order table and DO
- Add inspectionRecordId to return order vehicle table and DO
- Add createFromDelivery/createFromReplacement methods to auto-create return orders
- Add startVehicleInspection/completeVehicleInspection for per-vehicle inspection flow
- Add submitApproval/withdrawApproval/updateApprovalStatus for BPM workflow
- Create ReturnApprovedEvent and ReturnOrderBpmListener
- Create DeliveryCompletedEvent for future vehicle status tracking
- Create VehicleStatusEventListener (TODO stubs for vehicle status updates)
- Create ReturnOrderEventListener to auto-create return order on permanent replacement approval
- Add BPM process definitions for replacement (with GM escalation) and return order approval

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:20:25 +08:00

10 lines
517 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 还车单增强添加来源类型、来源ID、关联交车单ID
ALTER TABLE asset_return_order
ADD COLUMN source_type tinyint DEFAULT NULL COMMENT '来源1=手动 2=替换车触发',
ADD COLUMN source_id bigint DEFAULT NULL COMMENT '来源业务ID',
ADD COLUMN delivery_order_id bigint DEFAULT NULL COMMENT '关联交车单ID';
-- 还车车辆增强:添加验车记录关联
ALTER TABLE asset_return_order_vehicle
ADD COLUMN inspection_record_id bigint DEFAULT NULL COMMENT '关联验车记录';