新增MES混炼示方模块,包括主表及子表结构、控制器、服务和映射器的实现,支持增删改查功能,优化数据验证和用户体验,增强系统稳定性。

This commit is contained in:
geht
2026-05-22 16:34:33 +08:00
parent 680eb6c54c
commit d7fd9c6037
22 changed files with 3483 additions and 0 deletions

View File

@@ -0,0 +1,195 @@
SET NAMES utf8mb4;
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
VALUES ('1995000000000000098', '混炼TCU区分', 'xslmes_mixing_tcu_section', '混炼示方TCU区分', 0, 'admin', NOW(), 0, 1002);
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000009801', '1995000000000000098', '上密炼机', 'up_mixer', 1, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000009802', '1995000000000000098', '下密炼机', 'down_mixer', 2, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
VALUES ('1995000000000000099', '混炼药品称量位置', 'xslmes_mixing_drug_weigh_pos', '混炼示方药品称量位置', 0, 'admin', NOW(), 0, 1002);
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000009901', '1995000000000000099', '药品称', 'drug_scale', 1, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000009902', '1995000000000000099', '胶料称', 'rubber_scale', 2, 1, 'admin', NOW());
CREATE TABLE IF NOT EXISTS `mes_xsl_mixing_spec` (
`id` varchar(32) NOT NULL COMMENT '主键',
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
`spec_name` varchar(120) DEFAULT NULL COMMENT '规格',
`purpose` varchar(300) DEFAULT NULL COMMENT '用途',
`machine_id` varchar(32) DEFAULT NULL COMMENT '机台ID',
`machine_name` varchar(120) DEFAULT NULL COMMENT '机台',
`make_date` date DEFAULT NULL COMMENT '制作日期',
`issue_number` varchar(120) DEFAULT NULL COMMENT '发行编号',
`convert_factor` decimal(18,6) DEFAULT NULL COMMENT '换算系数',
`fill_volume` decimal(18,6) DEFAULT NULL COMMENT '填充体积',
`recycle_carbon_sec` int DEFAULT NULL COMMENT '回收炭黑()',
`mother_rubber_sg` decimal(18,6) DEFAULT NULL COMMENT '母胶比重',
`final_rubber_sg` decimal(18,6) DEFAULT NULL COMMENT '终炼胶比重',
`apply_factory` varchar(120) DEFAULT NULL COMMENT '适用工厂',
`stage_count` int DEFAULT NULL COMMENT '段数',
`pure_mix_sec` int DEFAULT NULL COMMENT '纯混炼时间()',
`recycle_carbon_kg` decimal(18,6) DEFAULT NULL COMMENT '回收炭黑(KG)',
`auto_small_print_setting` varchar(200) DEFAULT NULL COMMENT '自动小料打印设定',
`set_train_count` int DEFAULT NULL COMMENT '设定车数',
`side_wall_water_temp` decimal(18,6) DEFAULT NULL COMMENT '侧壁水温',
`overtime_discharge_sec` int DEFAULT NULL COMMENT '超时排胶时间',
`overtemp_discharge_sec` int DEFAULT NULL COMMENT '超温排胶时间',
`overtemp_discharge_temp` decimal(18,6) DEFAULT NULL COMMENT '超温排胶温度',
`door_water_temp` decimal(18,6) DEFAULT NULL COMMENT '卸料门水温',
`rotor_water_temp` decimal(18,6) DEFAULT NULL COMMENT '转子水温',
`max_feed_temp` decimal(18,6) DEFAULT NULL COMMENT '最高进料温度',
`draft_by` varchar(80) DEFAULT NULL COMMENT '起草人',
`draft_time` datetime DEFAULT NULL COMMENT '起草时间',
`proofread_by` varchar(80) DEFAULT NULL COMMENT '校对人',
`proofread_time` datetime DEFAULT NULL COMMENT '校对时间',
`audit_by` varchar(80) DEFAULT NULL COMMENT '审核人',
`audit_time` datetime DEFAULT NULL COMMENT '审核时间',
`approve_by` varchar(80) DEFAULT NULL COMMENT '批准人',
`approve_time` datetime DEFAULT NULL COMMENT '批准时间',
`change_date` date DEFAULT NULL COMMENT '变更日期',
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`del_flag` int NOT NULL DEFAULT 0 COMMENT '逻辑删除',
PRIMARY KEY (`id`),
KEY `idx_mxmix_issue_number` (`issue_number`),
KEY `idx_mxmix_spec_name` (`spec_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES混炼示方';
CREATE TABLE IF NOT EXISTS `mes_xsl_mixing_spec_material` (
`id` varchar(32) NOT NULL COMMENT '主键',
`mixing_spec_id` varchar(32) NOT NULL COMMENT '混炼示方主表ID',
`sort_no` int DEFAULT NULL COMMENT '行序号',
`material_major` varchar(120) DEFAULT NULL COMMENT '物料大类',
`material_minor` varchar(120) DEFAULT NULL COMMENT '物料小类',
`material_kind` varchar(120) DEFAULT NULL COMMENT '种类',
`mixer_material_name` varchar(200) DEFAULT NULL COMMENT '密炼物料名称',
`mixer_material_desc` varchar(300) DEFAULT NULL COMMENT '密炼物料描述',
`unit_weight` decimal(18,6) DEFAULT NULL COMMENT '单重',
`accum_weight` decimal(18,6) DEFAULT NULL COMMENT '累计',
`seq_no` int DEFAULT NULL COMMENT '顺序',
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`),
KEY `idx_mxmix_mat_main` (`mixing_spec_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES混炼示方明细-橡胶及配合剂';
CREATE TABLE IF NOT EXISTS `mes_xsl_mixing_spec_step` (
`id` varchar(32) NOT NULL COMMENT '主键',
`mixing_spec_id` varchar(32) NOT NULL COMMENT '混炼示方主表ID',
`sort_no` int DEFAULT NULL COMMENT '行序号',
`action_name` varchar(120) DEFAULT NULL COMMENT '动作',
`action_sec` int DEFAULT NULL COMMENT '时间()',
`protect_sec` int DEFAULT NULL COMMENT '保护时间',
`temp_c` decimal(18,6) DEFAULT NULL COMMENT '温度()',
`power_kw` decimal(18,6) DEFAULT NULL COMMENT '功率(Kw)',
`energy_kwh` decimal(18,6) DEFAULT NULL COMMENT '能量(Kwh)',
`combo_mode` varchar(120) DEFAULT NULL COMMENT '组合',
`speed_rpm` decimal(18,6) DEFAULT NULL COMMENT '转速(rpm)',
`pressure_mpa` decimal(18,6) DEFAULT NULL COMMENT '压力(Mpa)',
`bolt_percent` decimal(18,6) DEFAULT NULL COMMENT '(%)',
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`),
KEY `idx_mxmix_step_main` (`mixing_spec_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES混炼示方明细-混合步骤';
CREATE TABLE IF NOT EXISTS `mes_xsl_mixing_spec_down_step` (
`id` varchar(32) NOT NULL COMMENT '主键',
`mixing_spec_id` varchar(32) NOT NULL COMMENT '混炼示方主表ID',
`sort_no` int DEFAULT NULL COMMENT '行序号',
`action_name` varchar(120) DEFAULT NULL COMMENT '动作',
`action_sec` int DEFAULT NULL COMMENT '时间()',
`protect_sec` int DEFAULT NULL COMMENT '保护时间',
`temp_c` decimal(18,6) DEFAULT NULL COMMENT '温度()',
`power_kw` decimal(18,6) DEFAULT NULL COMMENT '功率(Kw)',
`energy_kwh` decimal(18,6) DEFAULT NULL COMMENT '能量(Kwh)',
`combo_mode` varchar(120) DEFAULT NULL COMMENT '组合',
`speed_rpm` decimal(18,6) DEFAULT NULL COMMENT '转速(rpm)',
`pressure_mpa` decimal(18,6) DEFAULT NULL COMMENT '压力(Mpa)',
`bolt_percent` decimal(18,6) DEFAULT NULL COMMENT '(%)',
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`),
KEY `idx_mxmix_down_step_main` (`mixing_spec_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES混炼示方明细-下密炼机混炼条件';
CREATE TABLE IF NOT EXISTS `mes_xsl_mixing_spec_tcu` (
`id` varchar(32) NOT NULL COMMENT '主键',
`mixing_spec_id` varchar(32) NOT NULL COMMENT '混炼示方主表ID',
`sort_no` int DEFAULT NULL COMMENT '行序号',
`section_type` varchar(32) DEFAULT NULL COMMENT '区分上密炼机/下密炼机',
`front_rotor_temp` decimal(18,6) DEFAULT NULL COMMENT '前转子温度',
`rear_rotor_temp` decimal(18,6) DEFAULT NULL COMMENT '后转子温度',
`front_chamber_temp` decimal(18,6) DEFAULT NULL COMMENT '前混炼室温度',
`rear_chamber_temp` decimal(18,6) DEFAULT NULL COMMENT '后混炼室温度',
`top_plug_temp` decimal(18,6) DEFAULT NULL COMMENT '上下顶栓温度',
`drug_weigh_pos` varchar(32) DEFAULT NULL COMMENT '药品称量位置',
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`),
KEY `idx_mxmix_tcu_main` (`mixing_spec_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES混炼示方明细-TCU温度条件';
UPDATE `sys_permission`
SET `is_leaf` = 0, `update_time` = NOW()
WHERE `id` = '1900000000000000810' AND `is_leaf` = 1;
INSERT IGNORE INTO `sys_permission` (
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
`del_flag`, `rule_flag`, `status`, `internal_or_external`
) VALUES (
'177925970995540', '1900000000000000810', '混炼示方', '/xslmes/mesXslMixingSpec',
'xslmes/mesXslMixingSpec/MesXslMixingSpecList', 1, 'MesXslMixingSpecList', NULL,
1, NULL, '0', 2.00, 0, 'ant-design:table-outlined', 0, 1,
0, 0, 'MES混炼示方', 'admin', NOW(), 'admin', NOW(),
0, 0, '1', 0
);
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995541', '177925970995540', '新增', 2, 'xslmes:mes_xsl_mixing_spec:add', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995542', '177925970995540', '编辑', 2, 'xslmes:mes_xsl_mixing_spec:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995543', '177925970995540', '删除', 2, 'xslmes:mes_xsl_mixing_spec:delete', '1', 3.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995544', '177925970995540', '批量删除', 2, 'xslmes:mes_xsl_mixing_spec:deleteBatch', '1', 4.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995545', '177925970995540', '导出', 2, 'xslmes:mes_xsl_mixing_spec:exportXls', '1', 5.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995546', '177925970995540', '导入', 2, 'xslmes:mes_xsl_mixing_spec:importExcel', '1', 6.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
FROM `sys_role` r
CROSS JOIN `sys_permission` p
WHERE r.`role_code` = 'admin'
AND p.`id` IN (
'177925970995540', '177925970995541', '177925970995542',
'177925970995543', '177925970995544', '177925970995545', '177925970995546'
)
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
);