gongchunyi
2 天以前 bd843578d19a1e500310bd85d4b601af3300bbd8
feat: 物料信息表配置表
已修改1个文件
114 ■■■■■ 文件已修改
doc/宁夏-中盛建材.sql 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/ÄþÏÄ-ÖÐÊ¢½¨²Ä.sql
@@ -39,54 +39,57 @@
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4 COMMENT ='销售生产计划';
CREATE TABLE `product-inventory-management-zsjc`.`energy`  (
    `id` int NOT NULL AUTO_INCREMENT,
    `energy_tyep` varchar(255) NULL COMMENT '能源类型',
    `energy_name` varchar(255) NULL COMMENT '能源名称',
    `unit` varchar(255) NULL COMMENT '单位',
    `unit_price` decimal(10, 2) NULL COMMENT '单价',
    `remark` varchar(255) NULL COMMENT '备注',
    `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
    `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
    `create_user` bigint NULL DEFAULT NULL COMMENT '创建者',
    `update_user` bigint NULL DEFAULT NULL COMMENT '更新者',
CREATE TABLE `product-inventory-management-zsjc`.`energy`
(
    `id`          int            NOT NULL AUTO_INCREMENT,
    `energy_tyep` varchar(255)   NULL COMMENT '能源类型',
    `energy_name` varchar(255)   NULL COMMENT '能源名称',
    `unit`        varchar(255)   NULL COMMENT '单位',
    `unit_price`  decimal(10, 2) NULL COMMENT '单价',
    `remark`      varchar(255)   NULL COMMENT '备注',
    `create_time` datetime(0)    NULL DEFAULT NULL COMMENT '创建时间',
    `update_time` datetime(0)    NULL DEFAULT NULL COMMENT '更新时间',
    `create_user` bigint         NULL DEFAULT NULL COMMENT '创建者',
    `update_user` bigint         NULL DEFAULT NULL COMMENT '更新者',
    PRIMARY KEY (`id`)
    ) COMMENT = '能源类型';
) COMMENT = '能源类型';
CREATE TABLE `product-inventory-management-zsjc`.`energy_consumption_detail`  (
    `id` int NOT NULL AUTO_INCREMENT,
    `energy_id` int NULL COMMENT '外检关联能源类型id',
    `type` varchar(255) NULL COMMENT '办公/生产',
    `meter_reading_location` varchar(255) NULL COMMENT '抄表位置',
    `meter_reading_date` date NULL COMMENT '抄表日期',
    `start_code` decimal(10, 2) NULL COMMENT '起码',
    `stop_code` decimal(10, 2) NULL COMMENT '止码',
    `dosage` decimal(10, 2) NULL COMMENT '用量',
    `remark` varchar(255) NULL COMMENT '备注',
    `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
    `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
    `create_user` bigint NULL DEFAULT NULL COMMENT '创建者',
    `update_user` bigint NULL DEFAULT NULL COMMENT '更新者',
CREATE TABLE `product-inventory-management-zsjc`.`energy_consumption_detail`
(
    `id`                     int            NOT NULL AUTO_INCREMENT,
    `energy_id`              int            NULL COMMENT '外检关联能源类型id',
    `type`                   varchar(255)   NULL COMMENT '办公/生产',
    `meter_reading_location` varchar(255)   NULL COMMENT '抄表位置',
    `meter_reading_date`     date           NULL COMMENT '抄表日期',
    `start_code`             decimal(10, 2) NULL COMMENT '起码',
    `stop_code`              decimal(10, 2) NULL COMMENT '止码',
    `dosage`                 decimal(10, 2) NULL COMMENT '用量',
    `remark`                 varchar(255)   NULL COMMENT '备注',
    `create_time`            datetime(0)    NULL DEFAULT NULL COMMENT '创建时间',
    `update_time`            datetime(0)    NULL DEFAULT NULL COMMENT '更新时间',
    `create_user`            bigint         NULL DEFAULT NULL COMMENT '创建者',
    `update_user`            bigint         NULL DEFAULT NULL COMMENT '更新者',
    PRIMARY KEY (`id`)
    ) COMMENT = '能源类型-能耗抄表明细';
) COMMENT = '能源类型-能耗抄表明细';
CREATE TABLE `product-inventory-management-zsjc`.`energy_consumption_detail_file`  (
    `id` int NOT NULL AUTO_INCREMENT,
    `energy_consumption_detail_id` int NULL COMMENT '关联外键能耗抄表id',
    `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `file_size` double NULL DEFAULT NULL,
    `create_time` timestamp(0) NULL DEFAULT NULL,
    `create_user` int NULL DEFAULT NULL,
    `update_time` timestamp(0) NULL DEFAULT NULL,
    `update_user` int NULL DEFAULT NULL,
CREATE TABLE `product-inventory-management-zsjc`.`energy_consumption_detail_file`
(
    `id`                           int                                                           NOT NULL AUTO_INCREMENT,
    `energy_consumption_detail_id` int                                                           NULL COMMENT '关联外键能耗抄表id',
    `name`                         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `url`                          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `file_size`                    double                                                        NULL DEFAULT NULL,
    `create_time`                  timestamp(0)                                                  NULL DEFAULT NULL,
    `create_user`                  int                                                           NULL DEFAULT NULL,
    `update_time`                  timestamp(0)                                                  NULL DEFAULT NULL,
    `update_user`                  int                                                           NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
    ) COMMENT = '能源类型-能耗抄表明细_附件';
) COMMENT = '能源类型-能耗抄表明细_附件';
alter table product_order
drop column sales_ledger_id,
drop column sale_ledger_product_id,
drop column product_model_id;
    drop column sales_ledger_id,
    drop column sale_ledger_product_id,
    drop column product_model_id;
alter table production_plan
    add assigned_quantity DECIMAL(10, 4) default 0 not null COMMENT '下发数量';
@@ -98,12 +101,12 @@
drop table if exists product_order_plan;
create table product_order_plan
(
    id                       bigint auto_increment primary key,
    product_order_id bigint not null default 0 comment '生产订单id',
    production_plan_id  bigint not null default 0 comment '生产计划id',
    create_time              datetime null comment '录入时间',
    update_time              datetime null comment '更新时间',
    assigned_quantity DECIMAL(10, 4) default 0 not null comment '下发数量',
    id                 bigint auto_increment primary key,
    product_order_id   bigint   not null default 0 comment '生产订单id',
    production_plan_id bigint   not null default 0 comment '生产计划id',
    create_time        datetime null comment '录入时间',
    update_time        datetime null comment '更新时间',
    assigned_quantity  DECIMAL(10, 4)    default 0 not null comment '下发数量',
    index idx_product_order_id (product_order_id),
    index idx_production_plan_id (production_plan_id),
    unique idx_product_order_production_plan (product_order_id, production_plan_id)
@@ -148,4 +151,19 @@
  DEFAULT CHARSET = utf8mb4 COMMENT = '物料规格表';
ALTER TABLE product_material_sku
    DROP FOREIGN KEY fk_material;
    DROP FOREIGN KEY fk_material;
DROP TABLE IF EXISTS `product_material_config`;
CREATE TABLE `product_material_config`
(
    `id`          int                                                           NOT NULL AUTO_INCREMENT,
    `config_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NOT NULL COMMENT '区分类型: MATERIAL_TYPE æˆ– INVENTORY_CAT',
    `config_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '显示的名称',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 39
  CHARACTER SET = utf8mb3
  COLLATE = utf8mb3_general_ci COMMENT = '物料信息表配置表'
  ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;