- 添加移动工作空间对话框全屏样式支持 - 更新应用主视图以支持桌面视口布局 - 重构Excel导入对话框增加预览和校验功能 - 在移动端主页增加生产与交付模块和项目借还功能 - 移动端库存列表显示项目名称和成品标识 - 增加入库记录批量操作和撤销功能 - 优化分页组件在桌面视口中的滚动行为 - 更新路由配置和数据库连接配置 - 调整仓库领域模型移除预期日期字段 - 优化智能代理服务的正则匹配和出库类型处理
32 lines
2.3 KiB
SQL
32 lines
2.3 KiB
SQL
-- target-database: cmvr-project-dev
|
|
CREATE TABLE IF NOT EXISTS inventory_cost_link (
|
|
source_event_id bigint NOT NULL, target_event_id bigint NOT NULL PRIMARY KEY,
|
|
CONSTRAINT fk_cost_link_source FOREIGN KEY(source_event_id) REFERENCES inventory_cost_event(id),
|
|
CONSTRAINT fk_cost_link_target FOREIGN KEY(target_event_id) REFERENCES inventory_cost_event(id),
|
|
CONSTRAINT ck_cost_link_order CHECK(source_event_id<target_event_id)
|
|
) ENGINE=InnoDB;
|
|
CREATE TABLE IF NOT EXISTS project_loan (
|
|
id bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, loan_no varchar(64) NOT NULL UNIQUE,
|
|
lender_project_id bigint NOT NULL, borrower_project_id bigint NOT NULL, item_id bigint NOT NULL,
|
|
quantity decimal(20,4) NOT NULL, out_event_id bigint NOT NULL, in_event_id bigint NOT NULL,
|
|
active tinyint NOT NULL DEFAULT 1, remark varchar(500) NULL, create_by varchar(64) NOT NULL, create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
CONSTRAINT fk_loan_lender FOREIGN KEY(lender_project_id) REFERENCES project_info(id),
|
|
CONSTRAINT fk_loan_borrower FOREIGN KEY(borrower_project_id) REFERENCES project_info(id),
|
|
CONSTRAINT fk_loan_item FOREIGN KEY(item_id) REFERENCES product_info(id),
|
|
CONSTRAINT fk_loan_out FOREIGN KEY(out_event_id) REFERENCES inventory_cost_event(id),
|
|
CONSTRAINT fk_loan_in FOREIGN KEY(in_event_id) REFERENCES inventory_cost_event(id),
|
|
CONSTRAINT ck_loan_projects CHECK(lender_project_id<>borrower_project_id), CONSTRAINT ck_loan_qty CHECK(quantity>0)
|
|
) ENGINE=InnoDB;
|
|
CREATE TABLE IF NOT EXISTS project_loan_return (
|
|
id bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, loan_id bigint NOT NULL, quantity decimal(20,4) NOT NULL,
|
|
business_key varchar(160) NOT NULL UNIQUE, return_type varchar(20) NOT NULL,
|
|
out_event_id bigint NULL, in_event_id bigint NOT NULL UNIQUE, active tinyint NOT NULL DEFAULT 1,
|
|
create_by varchar(64) NOT NULL, create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
CONSTRAINT fk_loan_return_loan FOREIGN KEY(loan_id) REFERENCES project_loan(id),
|
|
CONSTRAINT fk_loan_return_out FOREIGN KEY(out_event_id) REFERENCES inventory_cost_event(id),
|
|
CONSTRAINT fk_loan_return_in FOREIGN KEY(in_event_id) REFERENCES inventory_cost_event(id),
|
|
CONSTRAINT ck_loan_return_qty CHECK(quantity>0)
|
|
) ENGINE=InnoDB;
|
|
ALTER TABLE purchase_request ADD COLUMN purchase_purpose varchar(10) NOT NULL DEFAULT 'SELF';
|
|
ALTER TABLE purchase_request ADD COLUMN loan_id bigint NULL;
|