liyong
6 天以前 86fc2148b726357e42d8072f7f2f3641411cca5f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# 工艺路线项目
drop table if exists process_route_item;
create table process_route_item
(
    id               bigint auto_increment primary key,
    route_id         bigint   not null default 0 comment '工艺路线id',
    product_model_id bigint   not null default 0 comment '产品id',
    process_id       bigint   not null default 0 comment '工序id',
    tenant_id        bigint   not null comment '租户id',
    create_time      datetime null comment '录入时间',
    update_time      datetime null comment '更新时间'
);
 
# 生产工艺路线项目
drop table if exists product_process_route_item;
create table product_process_route_item
(
    id               bigint auto_increment primary key,
    route_id         bigint   not null default 0 comment '工艺路线id',
    product_model_id bigint   not null default 0 comment '销售台账产品id',
    process_id       bigint   not null default 0 comment '工序id',
    tenant_id        bigint   not null comment '租户id',
    create_time      datetime null comment '录入时间',
    update_time      datetime null comment '更新时间'
);
 
# 生产订单
drop table if exists product_order;
create table product_order
(
    id               bigint auto_increment primary key,
    sales_ledger_id  bigint   not null default 0 comment '销售台账id',
    product_model_id bigint   not null default 0 comment '销售台账产品id',
    route_id         bigint   not null default 0 comment '工艺路线id',
    nps_no          varchar(255) not null default '' comment '生产订单号',
    status            int not null default 0 comment '状态 0 待确认 1 已确认',
    tenant_id        bigint   not null comment '租户id',
    create_time      datetime null comment '录入时间',
    update_time      datetime null comment '更新时间'
);
alter table quality_inspect
    add purchase_ledger_id int null comment '采购订单id';
 
# 生产工单
drop table if exists product_work_order;
create table product_work_order
(
    id               bigint auto_increment primary key,
    product_process_route_item_id bigint   not null default 0 comment '工艺路线项目id',
    create_time      datetime null comment '录入时间',
    update_time      datetime null comment '更新时间',
    work_order_no    varchar(255) not null default '' comment '工单编号',
    status           int not null default 0 comment '状态  1 待确认  2 待生产 3生产中 4已生产 ',
    tenant_id        bigint   not null comment '租户id'
);
 
alter table product_process
    add salary_quota numeric(16,3) null comment '工资定额';