diff --git a/jeecg-boot/db/mes-xsl-rubber-quick-test-data-point-menu-permission.sql b/jeecg-boot/db/mes-xsl-rubber-quick-test-data-point-menu-permission.sql new file mode 100644 index 0000000..0d40ca5 --- /dev/null +++ b/jeecg-boot/db/mes-xsl-rubber-quick-test-data-point-menu-permission.sql @@ -0,0 +1,66 @@ +-- MES 胶料快检数据点:建表 + 菜单(质量管理下)+ 按钮 + 租户 admin 授权(可整文件一次执行) +-- 权限前缀:mes:mes_xsl_rubber_quick_test_data_point:* +-- 依赖:mes_xsl_rubber_quick_test_type;修改租户改 SET @mes_tenant_id +SET NAMES utf8mb4; + +CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_data_point` ( + `id` varchar(32) NOT NULL COMMENT '主键', + `point_name` varchar(128) NOT NULL COMMENT '数据点名称(同租户未删除唯一)', + `quick_test_type_id` varchar(32) NOT NULL COMMENT '实验类型 mes_xsl_rubber_quick_test_type.id', + `quick_test_type_name` varchar(128) DEFAULT NULL COMMENT '实验类型名称冗余', + `unit_type` varchar(64) DEFAULT NULL COMMENT '单位类型(手填)', + `point_desc` varchar(500) DEFAULT NULL COMMENT '描述', + `tenant_id` int DEFAULT NULL COMMENT '租户', + `sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门', + `create_by` varchar(32) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(32) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)', + PRIMARY KEY (`id`), + KEY `idx_mrqtdp_tenant_type` (`tenant_id`, `quick_test_type_id`), + UNIQUE KEY `uk_mrqtdp_tenant_name_del` (`tenant_id`, `point_name`, `del_flag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检数据点'; + +SET @mes_tenant_id = 1002; +SET @mes_quality_pid = IFNULL( + (SELECT `id` FROM `sys_permission` WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '质量管理' LIMIT 1), + '1860000000000000162' +); + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`) +VALUES ('1860000000000000170', @mes_quality_pid, '胶料快检数据点', '/xslmes/mesXslRubberQuickTestDataPoint', 'xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPointList', 'MesXslRubberQuickTestDataPointList', 1, NULL, '1', 2, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW()) +ON DUPLICATE KEY UPDATE +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`), +`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`), +`is_route` = VALUES(`is_route`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0, +`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`); + +UPDATE `sys_permission` SET `icon` = 'ant-design:dot-chart-outlined' WHERE `id` = '1860000000000000170' AND `del_flag` = 0; + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `is_leaf`, `status`, `del_flag`, `create_by`, `create_time`) VALUES +('1860000000000000171', '1860000000000000170', '新增', 2, 'mes:mes_xsl_rubber_quick_test_data_point:add', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000172', '1860000000000000170', '编辑', 2, 'mes:mes_xsl_rubber_quick_test_data_point:edit', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000173', '1860000000000000170', '删除', 2, 'mes:mes_xsl_rubber_quick_test_data_point:delete', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000174', '1860000000000000170', '批量删除', 2, 'mes:mes_xsl_rubber_quick_test_data_point:deleteBatch', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000175', '1860000000000000170', '导出', 2, 'mes:mes_xsl_rubber_quick_test_data_point:exportXls', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000176', '1860000000000000170', '导入', 2, 'mes:mes_xsl_rubber_quick_test_data_point:importExcel', '1', 1, '1', 0, 'admin', NOW()) +ON DUPLICATE KEY UPDATE +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), +`is_leaf` = 1, `status` = '1', `del_flag` = 0; + +INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`) +SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1' +FROM `sys_role` r +CROSS JOIN `sys_permission` p +WHERE r.`tenant_id` = @mes_tenant_id + AND r.`role_code` = 'admin' + AND p.`id` IN ( + '1860000000000000170', + '1860000000000000171', '1860000000000000172', '1860000000000000173', '1860000000000000174', + '1860000000000000175', '1860000000000000176' + ) + AND NOT EXISTS ( + SELECT 1 FROM `sys_role_permission` rp + WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id` + ); diff --git a/jeecg-boot/db/mes-xsl-rubber-quick-test-method-drop.sql b/jeecg-boot/db/mes-xsl-rubber-quick-test-method-drop.sql new file mode 100644 index 0000000..cc985de --- /dev/null +++ b/jeecg-boot/db/mes-xsl-rubber-quick-test-method-drop.sql @@ -0,0 +1,27 @@ +-- 撤销「胶料快检实验方法」:删除菜单权限、字典、业务表(可整文件一次执行) +-- 说明:若仅未执行过 V3.9.2_99 / mes-xsl-rubber-quick-test-method-menu-permission.sql,执行本脚本即可; +-- 已 Flyway 执行过 V3.9.2_99 的环境,请同时执行 flyway V3.9.2_100 或本脚本(内容一致)。 +SET NAMES utf8mb4; + +DELETE FROM `sys_role_permission` +WHERE `permission_id` IN ( + '1860000000000000170', + '1860000000000000171', '1860000000000000172', '1860000000000000173', + '1860000000000000174', '1860000000000000175', '1860000000000000176' +); + +DELETE FROM `sys_permission` +WHERE `id` IN ( + '1860000000000000170', + '1860000000000000171', '1860000000000000172', '1860000000000000173', + '1860000000000000174', '1860000000000000175', '1860000000000000176' +); + +DELETE di FROM `sys_dict_item` di +INNER JOIN `sys_dict` d ON di.`dict_id` = d.`id` +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND d.`del_flag` = 0; + +DELETE FROM `sys_dict` +WHERE `dict_code` = 'xslmes_rubber_quick_test_rotor_type'; + +DROP TABLE IF EXISTS `mes_xsl_rubber_quick_test_method`; diff --git a/jeecg-boot/db/mes-xsl-rubber-quick-test-method-menu-permission.sql b/jeecg-boot/db/mes-xsl-rubber-quick-test-method-menu-permission.sql new file mode 100644 index 0000000..dd5e140 --- /dev/null +++ b/jeecg-boot/db/mes-xsl-rubber-quick-test-method-menu-permission.sql @@ -0,0 +1,294 @@ +-- 胶料快检实验方法(主子表):字典 + 建表 + 菜单(质量管理下)+ 按钮 + 租户 admin 授权 + +-- 权限前缀:mes:mes_xsl_rubber_quick_test_method:* + +-- 菜单 ID 段 1860000000000000177(与数据点 170 段区分) + +-- 可与 Flyway V3.9.2_102 重复执行(ON DUPLICATE / IF NOT EXISTS) + +-- SET @mes_tenant_id:多租户 admin 授权目标租户 + +SET NAMES utf8mb4; + + + +INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`) + +SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检转子类型', 'xslmes_rubber_quick_test_rotor_type', '1大转子2小转子', 0, 'admin', NOW(), 0, 0 + +WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND `del_flag` = 0); + + + +INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`) + +SELECT REPLACE(UUID(), '-', ''), d.id, '大转子', '1', 1, 1, 'admin', NOW() FROM `sys_dict` d + +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '1'); + +INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`) + +SELECT REPLACE(UUID(), '-', ''), d.id, '小转子', '2', 2, 1, 'admin', NOW() FROM `sys_dict` d + +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '2'); + + + +INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`) + +SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检扭矩单位', 'xslmes_rubber_quick_test_torque_unit', 'Ib.in、dNm、kg.cm、Nm、mdm', 0, 'admin', NOW(), 0, 0 + +WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_torque_unit' AND `del_flag` = 0); + + + +INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`) + +SELECT REPLACE(UUID(), '-', ''), d.id, v.txt, v.val, v.ord, 1, 'admin', NOW() + +FROM `sys_dict` d + +CROSS JOIN ( + + SELECT 'Ib.in' AS txt, 'Ib.in' AS val, 1 AS ord UNION ALL + + SELECT 'dNm', 'dNm', 2 UNION ALL + + SELECT 'kg.cm', 'kg.cm', 3 UNION ALL + + SELECT 'Nm', 'Nm', 4 UNION ALL + + SELECT 'mdm', 'mdm', 5 + +) v + +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_torque_unit' + + AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = v.val); + + + +INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`) + +SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检时间单位', 'xslmes_rubber_quick_test_time_unit', 'sec、min、m:s', 0, 'admin', NOW(), 0, 0 + +WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_time_unit' AND `del_flag` = 0); + + + +INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`) + +SELECT REPLACE(UUID(), '-', ''), d.id, v.txt, v.val, v.ord, 1, 'admin', NOW() + +FROM `sys_dict` d + +CROSS JOIN ( + + SELECT 'sec' AS txt, 'sec' AS val, 1 AS ord UNION ALL + + SELECT 'min', 'min', 2 UNION ALL + + SELECT 'm:s', 'm:s', 3 + +) v + +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_time_unit' + + AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = v.val); + + + +INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`) + +SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检门尼单位', 'xslmes_rubber_quick_test_mooney_unit', 'MU', 0, 'admin', NOW(), 0, 0 + +WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_mooney_unit' AND `del_flag` = 0); + + + +INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`) + +SELECT REPLACE(UUID(), '-', ''), d.id, 'MU', 'MU', 1, 1, 'admin', NOW() FROM `sys_dict` d + +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_mooney_unit' + + AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'MU'); + + + +CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_method` ( + + `id` varchar(32) NOT NULL COMMENT '主键', + + `method_code` varchar(16) NOT NULL COMMENT '方法编号(租户内从001递增自动生成)', + + `method_name` varchar(128) NOT NULL COMMENT '实验方法名称(同租户未删除唯一)', + + `quick_test_type_id` varchar(32) NOT NULL COMMENT '实验类型 mes_xsl_rubber_quick_test_type.id', + + `quick_test_type_name` varchar(128) DEFAULT NULL COMMENT '实验类型名称冗余', + + `test_temp_c` decimal(12,2) DEFAULT NULL COMMENT '实验温度°C', + + `preheat_time_min` decimal(12,2) DEFAULT NULL COMMENT '预热时间min', + + `test_time_min` decimal(12,2) DEFAULT NULL COMMENT '实验时间min', + + `test_angle_deg` decimal(12,2) DEFAULT NULL COMMENT '实验角度Deg', + + `test_freq_hz` decimal(12,2) DEFAULT NULL COMMENT '实验频率Hz', + + `rotor_type` varchar(2) DEFAULT NULL COMMENT '转子类型(字典xslmes_rubber_quick_test_rotor_type:1大转子2小转子)', + + `rotor_speed_rpm` decimal(12,2) DEFAULT NULL COMMENT '转子速度rpm', + + `method_desc` varchar(500) DEFAULT NULL COMMENT '方法描述', + + `tenant_id` int DEFAULT NULL COMMENT '租户', + + `sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门', + + `create_by` varchar(32) DEFAULT NULL COMMENT '创建人', + + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + + `update_by` varchar(32) DEFAULT NULL COMMENT '更新人', + + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + + `del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)', + + PRIMARY KEY (`id`), + + KEY `idx_mrqtm_tenant_code` (`tenant_id`, `method_code`), + + KEY `idx_mrqtm_type` (`quick_test_type_id`), + + UNIQUE KEY `uk_mrqtm_tenant_name_del` (`tenant_id`, `method_name`, `del_flag`) + +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检实验方法'; + + + +CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_method_line` ( + + `id` varchar(32) NOT NULL COMMENT '主键', + + `method_id` varchar(32) NOT NULL COMMENT '主表 mes_xsl_rubber_quick_test_method.id', + + `data_point_id` varchar(32) NOT NULL COMMENT '数据点 mes_xsl_rubber_quick_test_data_point.id', + + `point_name` varchar(128) DEFAULT NULL COMMENT '数据点名称冗余(只读带出)', + + `unit_type` varchar(64) DEFAULT NULL COMMENT '单位类型冗余(只读带出)', + + `torque_unit_type` varchar(32) DEFAULT NULL COMMENT '扭矩单位类型(字典xslmes_rubber_quick_test_torque_unit)', + + `time_unit_type` varchar(32) DEFAULT NULL COMMENT '时间单位类型(字典xslmes_rubber_quick_test_time_unit)', + + `mooney_unit_type` varchar(32) DEFAULT NULL COMMENT '门尼单位类型(字典xslmes_rubber_quick_test_mooney_unit)', + + `sort_no` int DEFAULT NULL COMMENT '排序号', + + `create_by` varchar(32) DEFAULT NULL COMMENT '创建人', + + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + + `update_by` varchar(32) DEFAULT NULL COMMENT '更新人', + + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + + PRIMARY KEY (`id`), + + KEY `idx_mrqtml_method` (`method_id`), + + UNIQUE KEY `uk_mrqtml_method_point` (`method_id`, `data_point_id`) + +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检实验方法明细'; + + + +SET @mes_tenant_id = 1002; + +SET @mes_quality_pid = IFNULL( + + (SELECT `id` FROM `sys_permission` WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '质量管理' LIMIT 1), + + '1860000000000000162' + +); + + + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`) + +VALUES ('1860000000000000177', @mes_quality_pid, '胶料快检实验方法', '/xslmes/mesXslRubberQuickTestMethod', 'xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethodList', 'MesXslRubberQuickTestMethodList', 1, NULL, '1', 3, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW()) + +ON DUPLICATE KEY UPDATE + +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`), + +`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`), + +`is_route` = VALUES(`is_route`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0, + +`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`); + + + +UPDATE `sys_permission` SET `icon` = 'ant-design:profile-outlined' WHERE `id` = '1860000000000000177' AND `del_flag` = 0; + + + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `is_leaf`, `status`, `del_flag`, `create_by`, `create_time`) VALUES + +('1860000000000000178', '1860000000000000177', '新增', 2, 'mes:mes_xsl_rubber_quick_test_method:add', '1', 1, '1', 0, 'admin', NOW()), + +('1860000000000000179', '1860000000000000177', '编辑', 2, 'mes:mes_xsl_rubber_quick_test_method:edit', '1', 1, '1', 0, 'admin', NOW()), + +('1860000000000000180', '1860000000000000177', '删除', 2, 'mes:mes_xsl_rubber_quick_test_method:delete', '1', 1, '1', 0, 'admin', NOW()), + +('1860000000000000181', '1860000000000000177', '批量删除', 2, 'mes:mes_xsl_rubber_quick_test_method:deleteBatch', '1', 1, '1', 0, 'admin', NOW()), + +('1860000000000000182', '1860000000000000177', '导出', 2, 'mes:mes_xsl_rubber_quick_test_method:exportXls', '1', 1, '1', 0, 'admin', NOW()), + +('1860000000000000183', '1860000000000000177', '导入', 2, 'mes:mes_xsl_rubber_quick_test_method:importExcel', '1', 1, '1', 0, 'admin', NOW()) + +ON DUPLICATE KEY UPDATE + +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), + +`is_leaf` = 1, `status` = '1', `del_flag` = 0; + + + +INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`) + +SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1' + +FROM `sys_role` r + +CROSS JOIN `sys_permission` p + +WHERE r.`tenant_id` = @mes_tenant_id + + AND r.`role_code` = 'admin' + + AND p.`id` IN ( + + '1860000000000000177', + + '1860000000000000178', '1860000000000000179', '1860000000000000180', '1860000000000000181', + + '1860000000000000182', '1860000000000000183' + + ) + + AND NOT EXISTS ( + + SELECT 1 FROM `sys_role_permission` rp + + WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id` + + ); + diff --git a/jeecg-boot/db/mes-xsl-rubber-quick-test-type-menu-permission.sql b/jeecg-boot/db/mes-xsl-rubber-quick-test-type-menu-permission.sql new file mode 100644 index 0000000..13f65fc --- /dev/null +++ b/jeecg-boot/db/mes-xsl-rubber-quick-test-type-menu-permission.sql @@ -0,0 +1,87 @@ +-- MES 胶料快检实验类型:建表 + 质量管理目录 + 子菜单 + 按钮 + 租户 admin 授权(可整文件一次执行) +-- 权限前缀与 Controller、前端 v-auth 一致:mes:mes_xsl_rubber_quick_test_type:* +-- 修改租户:改 SET @mes_tenant_id +SET NAMES utf8mb4; + +CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_type` ( + `id` varchar(32) NOT NULL COMMENT '主键', + `type_code` varchar(16) NOT NULL COMMENT '实验类型编号(租户内从001递增自动生成)', + `type_name` varchar(128) NOT NULL COMMENT '实验类型名称', + `tenant_id` int DEFAULT NULL COMMENT '租户', + `sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门', + `create_by` varchar(32) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(32) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)', + PRIMARY KEY (`id`), + KEY `idx_mrqtt_tenant_code` (`tenant_id`, `type_code`), + KEY `idx_mrqtt_tenant_name` (`tenant_id`, `type_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检实验类型'; + +SET @mes_tenant_id = 1002; + +SET @mes_root_parent = ( + SELECT `parent_id` FROM `sys_permission` + WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES基础资料' + LIMIT 1 +); +SET @mes_root_parent = IFNULL(@mes_root_parent, ( + SELECT `parent_id` FROM `sys_permission` + WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES资料' + LIMIT 1 +)); +SET @mes_root_parent = IFNULL(@mes_root_parent, '1860000000000000001'); + +SET @mes_quality_sort = IFNULL(( + SELECT `sort_no` + 1 FROM `sys_permission` + WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料', '设备管理') + ORDER BY `sort_no` DESC + LIMIT 1 +), 52); + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`) +VALUES ('1860000000000000162', @mes_root_parent, '质量管理', '/xslmes/quality', 'layouts/RouteView', 'MesQualityLayout', 0, NULL, '1', @mes_quality_sort, 1, 0, 0, '1', 0, 0, 0, 'admin', NOW()) +ON DUPLICATE KEY UPDATE +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), +`menu_type` = VALUES(`menu_type`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0; + +UPDATE `sys_permission` SET `icon` = 'ant-design:safety-certificate-outlined' WHERE `id` = '1860000000000000162' AND `del_flag` = 0; + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`) +VALUES ('1860000000000000163', '1860000000000000162', '胶料快检实验类型', '/xslmes/mesXslRubberQuickTestType', 'xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestTypeList', 'MesXslRubberQuickTestTypeList', 1, NULL, '1', 1, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW()) +ON DUPLICATE KEY UPDATE +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`), +`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`), +`is_route` = VALUES(`is_route`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0, +`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`); + +UPDATE `sys_permission` SET `icon` = 'ant-design:experiment-outlined' WHERE `id` = '1860000000000000163' AND `del_flag` = 0; + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `is_leaf`, `status`, `del_flag`, `create_by`, `create_time`) VALUES +('1860000000000000164', '1860000000000000163', '新增', 2, 'mes:mes_xsl_rubber_quick_test_type:add', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000165', '1860000000000000163', '编辑', 2, 'mes:mes_xsl_rubber_quick_test_type:edit', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000166', '1860000000000000163', '删除', 2, 'mes:mes_xsl_rubber_quick_test_type:delete', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000167', '1860000000000000163', '批量删除', 2, 'mes:mes_xsl_rubber_quick_test_type:deleteBatch', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000168', '1860000000000000163', '导出', 2, 'mes:mes_xsl_rubber_quick_test_type:exportXls', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000169', '1860000000000000163', '导入', 2, 'mes:mes_xsl_rubber_quick_test_type:importExcel', '1', 1, '1', 0, 'admin', NOW()) +ON DUPLICATE KEY UPDATE +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), +`is_leaf` = 1, `status` = '1', `del_flag` = 0; + +INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`) +SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1' +FROM `sys_role` r +CROSS JOIN `sys_permission` p +WHERE r.`tenant_id` = @mes_tenant_id + AND r.`role_code` = 'admin' + AND p.`id` IN ( + '1860000000000000162', + '1860000000000000163', + '1860000000000000164', '1860000000000000165', '1860000000000000166', '1860000000000000167', + '1860000000000000168', '1860000000000000169' + ) + AND NOT EXISTS ( + SELECT 1 FROM `sys_role_permission` rp + WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id` + ); diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/doc/代码修改日志 b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/doc/代码修改日志 index 419402b..ba0a328 100644 --- a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/doc/代码修改日志 +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/doc/代码修改日志 @@ -103,3 +103,79 @@ jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecMo -- author:cursor---date:20260521--for: 【配合示方】编辑打开时基本资料闪清修复 --- jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue + +-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验类型:质量管理目录、001自动编号、CRUD与菜单权限 --- +jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_97__mes_xsl_rubber_quick_test_type.sql +jeecg-boot/db/mes-xsl-rubber-quick-test-type-menu-permission.sql +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestType.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestTypeMapper.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestTypeService.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestTypeServiceImpl.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestTypeController.java +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestTypeList.vue +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.data.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.api.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/components/MesXslRubberQuickTestTypeModal.vue + +-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验方法:质量管理菜单、001编号、名称唯一、关联实验类型 --- +jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_99__mes_xsl_rubber_quick_test_method.sql +jeecg-boot/db/mes-xsl-rubber-quick-test-method-menu-permission.sql +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestMethod.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestMethodMapper.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestMethodService.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestMethodServiceImpl.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestMethodController.java +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethodList.vue +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.data.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.api.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestMethodModal.vue + +-- author:jiangxh---date:20260522--for: 【MES】撤销胶料快检实验方法功能(删代码+库清理脚本)--- +jeecg-boot/db/mes-xsl-rubber-quick-test-method-drop.sql +jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_100__drop_mes_xsl_rubber_quick_test_method.sql + +-- author:jiangxh---date:20260522--for: 【MES】胶料快检数据点:质量管理菜单、名称唯一、关联实验类型、单位手填 --- +jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_101__mes_xsl_rubber_quick_test_data_point.sql +jeecg-boot/db/mes-xsl-rubber-quick-test-data-point-menu-permission.sql +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestDataPoint.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestDataPointMapper.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestDataPointService.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestDataPointServiceImpl.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestDataPointController.java +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPointList.vue +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPoint.data.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPoint.api.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/components/MesXslRubberQuickTestDataPointModal.vue + +-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验类型名称同租户不可重复(Service兜底+唯一索引)--- +jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_98__mes_xsl_rubber_quick_test_type_name_unique.sql +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestTypeServiceImpl.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestTypeController.java +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.data.ts + +-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验方法主子表:质量管理菜单177段、001编号、名称唯一、选择数据点明细 --- +jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_102__mes_xsl_rubber_quick_test_method.sql +jeecg-boot/db/mes-xsl-rubber-quick-test-method-menu-permission.sql +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestMethod.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestMethodLine.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslRubberQuickTestMethodPage.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestMethodMapper.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestMethodLineMapper.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestMethodService.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestMethodServiceImpl.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestMethodController.java +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethodList.vue +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.data.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.api.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestMethodModal.vue +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestDataPointSelectModal.vue + +-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验方法明细字典单位必选、不可清空 --- +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.data.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestMethodModal.vue + +-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验方法明细单位字典默认取首项(非空选)--- +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.data.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestMethodModal.vue +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestMethodController.java +jeecgboot-vue3/src/components/jeecg/JVxeTable/src/components/cells/JVxeSelectCell.vue diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestDataPointController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestDataPointController.java new file mode 100644 index 0000000..4b332ae --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestDataPointController.java @@ -0,0 +1,297 @@ +package org.jeecg.modules.xslmes.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.constant.CommonConstant; +import org.jeecg.common.exception.JeecgBootException; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestDataPoint; +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType; +import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestDataPointService; +import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService; +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; + +/** + * MES 胶料快检数据点 + */ +@Tag(name = "MES胶料快检数据点") +@RestController +@RequestMapping("/xslmes/mesXslRubberQuickTestDataPoint") +@Slf4j +public class MesXslRubberQuickTestDataPointController + extends JeecgController { + + @Autowired + private IMesXslRubberQuickTestDataPointService mesXslRubberQuickTestDataPointService; + + @Autowired + private IMesXslRubberQuickTestTypeService mesXslRubberQuickTestTypeService; + + @Operation(summary = "MES胶料快检数据点-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList( + MesXslRubberQuickTestDataPoint model, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = + QueryGenerator.initQueryWrapper(model, req.getParameterMap()); + Page page = new Page<>(pageNo, pageSize); + IPage pageList = mesXslRubberQuickTestDataPointService.page(page, queryWrapper); + return Result.OK(pageList); + } + + @AutoLog(value = "MES胶料快检数据点-添加") + @Operation(summary = "MES胶料快检数据点-添加") + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:add") + @PostMapping(value = "/add") + public Result add(@RequestBody MesXslRubberQuickTestDataPoint model) { + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点保存校验、实验类型回填----------- + String err = validateForSave(model, null); + if (err != null) { + return Result.error(err); + } + try { + mesXslRubberQuickTestDataPointService.save(model); + } catch (JeecgBootException e) { + return Result.error(e.getMessage()); + } + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点保存校验、实验类型回填----------- + return Result.OK("添加成功!"); + } + + @AutoLog(value = "MES胶料快检数据点-编辑") + @Operation(summary = "MES胶料快检数据点-编辑") + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody MesXslRubberQuickTestDataPoint model) { + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点编辑校验----------- + if (oConvertUtils.isEmpty(model.getId())) { + return Result.error("缺少主键"); + } + MesXslRubberQuickTestDataPoint old = mesXslRubberQuickTestDataPointService.getById(model.getId()); + if (old == null) { + return Result.error("未找到对应数据"); + } + String err = validateForSave(model, model.getId()); + if (err != null) { + return Result.error(err); + } + old.setPointName(model.getPointName()); + old.setQuickTestTypeId(model.getQuickTestTypeId()); + old.setQuickTestTypeName(model.getQuickTestTypeName()); + old.setUnitType(model.getUnitType()); + old.setPointDesc(model.getPointDesc()); + try { + mesXslRubberQuickTestDataPointService.updateById(old); + } catch (JeecgBootException e) { + return Result.error(e.getMessage()); + } + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点编辑校验----------- + return Result.OK("编辑成功!"); + } + + @AutoLog(value = "MES胶料快检数据点-删除") + @Operation(summary = "MES胶料快检数据点-通过id删除") + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + mesXslRubberQuickTestDataPointService.removeById(id); + return Result.OK("删除成功!"); + } + + @AutoLog(value = "MES胶料快检数据点-批量删除") + @Operation(summary = "MES胶料快检数据点-批量删除") + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + mesXslRubberQuickTestDataPointService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + @Operation(summary = "MES胶料快检数据点-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + MesXslRubberQuickTestDataPoint entity = mesXslRubberQuickTestDataPointService.getById(id); + if (entity == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(entity); + } + + @Operation(summary = "校验数据点名称是否重复") + @GetMapping(value = "/checkPointName") + public Result checkPointName( + @RequestParam(name = "pointName", required = true) String pointName, + @RequestParam(name = "dataId", required = false) String dataId) { + if (oConvertUtils.isEmpty(pointName) || pointName.trim().isEmpty()) { + return Result.OK("该值可用!"); + } + MesXslRubberQuickTestDataPoint ctx = new MesXslRubberQuickTestDataPoint(); + if (mesXslRubberQuickTestDataPointService.isPointNameDuplicated(pointName.trim(), dataId, ctx)) { + return Result.error("该数据点名称已存在"); + } + return Result.OK("该值可用!"); + } + + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, MesXslRubberQuickTestDataPoint model) { + return super.exportXls(request, model, MesXslRubberQuickTestDataPoint.class, "MES胶料快检数据点"); + } + + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点导入校验----------- + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; + Map fileMap = multipartRequest.getFileMap(); + for (Map.Entry ent : fileMap.entrySet()) { + MultipartFile file = ent.getValue(); + ImportParams params = new ImportParams(); + params.setTitleRows(2); + params.setHeadRows(1); + params.setNeedSave(true); + try { + List list = + ExcelImportUtil.importExcel(file.getInputStream(), MesXslRubberQuickTestDataPoint.class, params); + if (list == null) { + list = List.of(); + } + Set namesInFile = new HashSet<>(); + for (int i = 0; i < list.size(); i++) { + MesXslRubberQuickTestDataPoint row = list.get(i); + int rowNo = i + 1; + if (row == null) { + return Result.error("文件导入失败:第 " + rowNo + " 条数据无效(空行)"); + } + String err = validateImportRow(row, rowNo, namesInFile); + if (err != null) { + return Result.error(err); + } + } + for (MesXslRubberQuickTestDataPoint row : list) { + try { + mesXslRubberQuickTestDataPointService.save(row); + } catch (JeecgBootException e) { + return Result.error("文件导入失败:" + e.getMessage()); + } + } + log.info("胶料快检数据点Excel导入完成,行数={}", list.size()); + return Result.ok("文件导入成功!数据行数:" + list.size()); + } catch (Exception e) { + String msg = e.getMessage(); + log.error(msg, e); + return Result.error("文件导入失败:" + e.getMessage()); + } finally { + try { + file.getInputStream().close(); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + } + } + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点导入校验----------- + return Result.error("文件导入失败!"); + } + + private String validateForSave(MesXslRubberQuickTestDataPoint model, String excludeId) { + if (oConvertUtils.isEmpty(model.getPointName()) || model.getPointName().trim().isEmpty()) { + return "数据点名称不能为空"; + } + model.setPointName(model.getPointName().trim()); + if (mesXslRubberQuickTestDataPointService.isPointNameDuplicated(model.getPointName(), excludeId, model)) { + return "数据点名称已存在"; + } + if (oConvertUtils.isNotEmpty(model.getUnitType())) { + model.setUnitType(model.getUnitType().trim()); + } + if (oConvertUtils.isNotEmpty(model.getPointDesc())) { + model.setPointDesc(model.getPointDesc().trim()); + } + return resolveAndFillQuickTestType(model); + } + + private String validateImportRow(MesXslRubberQuickTestDataPoint row, int rowNo, Set namesInFile) { + if (oConvertUtils.isEmpty(row.getPointName()) || row.getPointName().trim().isEmpty()) { + return "文件导入失败:第 " + rowNo + " 条数据点名称不能为空"; + } + row.setPointName(row.getPointName().trim()); + if (!namesInFile.add(row.getPointName())) { + return "文件导入失败:数据点名称【" + row.getPointName() + "】在导入文件中重复"; + } + if (mesXslRubberQuickTestDataPointService.isPointNameDuplicated(row.getPointName(), null, row)) { + return "文件导入失败:第 " + rowNo + " 条数据点名称【" + row.getPointName() + "】已存在"; + } + if (oConvertUtils.isEmpty(row.getQuickTestTypeId()) && oConvertUtils.isNotEmpty(row.getImportQuickTestTypeName())) { + row.setQuickTestTypeName(row.getImportQuickTestTypeName().trim()); + } + if (oConvertUtils.isEmpty(row.getQuickTestTypeId()) && oConvertUtils.isNotEmpty(row.getQuickTestTypeName())) { + MesXslRubberQuickTestType type = findQuickTestTypeByName(row.getQuickTestTypeName(), row); + if (type == null) { + return "文件导入失败:第 " + rowNo + " 条实验类型【" + row.getQuickTestTypeName() + "】不存在"; + } + row.setQuickTestTypeId(type.getId()); + } + String typeErr = resolveAndFillQuickTestType(row); + if (typeErr != null) { + return "文件导入失败:第 " + rowNo + " 条" + typeErr; + } + if (oConvertUtils.isNotEmpty(row.getUnitType())) { + row.setUnitType(row.getUnitType().trim()); + } + return null; + } + + private String resolveAndFillQuickTestType(MesXslRubberQuickTestDataPoint model) { + if (oConvertUtils.isEmpty(model.getQuickTestTypeId())) { + return "请选择实验类型"; + } + MesXslRubberQuickTestType type = mesXslRubberQuickTestTypeService.getById(model.getQuickTestTypeId()); + if (type == null) { + return "实验类型不存在或已删除"; + } + model.setQuickTestTypeName(type.getTypeName()); + return null; + } + + private MesXslRubberQuickTestType findQuickTestTypeByName(String typeName, MesXslRubberQuickTestDataPoint context) { + LambdaQueryWrapper w = new LambdaQueryWrapper<>(); + w.eq(MesXslRubberQuickTestType::getTypeName, typeName.trim()); + w.and( + q -> + q.eq(MesXslRubberQuickTestType::getDelFlag, CommonConstant.DEL_FLAG_0) + .or() + .isNull(MesXslRubberQuickTestType::getDelFlag)); + Integer tenantId = context != null ? context.getTenantId() : null; + if (tenantId != null) { + w.eq(MesXslRubberQuickTestType::getTenantId, tenantId); + } + w.last("LIMIT 1"); + return mesXslRubberQuickTestTypeService.getOne(w, false); + } +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestMethodController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestMethodController.java new file mode 100644 index 0000000..80b5442 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestMethodController.java @@ -0,0 +1,508 @@ +package org.jeecg.modules.xslmes.controller; + + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +import io.swagger.v3.oas.annotations.Operation; + +import io.swagger.v3.oas.annotations.tags.Tag; + +import jakarta.servlet.http.HttpServletRequest; + +import jakarta.servlet.http.HttpServletResponse; + +import java.util.Arrays; + +import java.util.HashSet; + +import java.util.List; + +import java.util.Set; + +import lombok.extern.slf4j.Slf4j; + +import org.apache.shiro.authz.annotation.RequiresPermissions; + +import org.jeecg.common.api.vo.Result; + +import org.jeecg.common.aspect.annotation.AutoLog; + +import org.jeecg.common.constant.CommonConstant; + +import org.jeecg.common.system.base.controller.JeecgController; + +import org.jeecg.common.system.query.QueryGenerator; + +import org.jeecg.common.util.oConvertUtils; + +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestDataPoint; + +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethod; + +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethodLine; + +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType; + +import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestDataPointService; + +import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestMethodService; + +import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService; + +import org.jeecg.modules.xslmes.vo.MesXslRubberQuickTestMethodPage; + +import org.springframework.beans.BeanUtils; + +import org.springframework.beans.factory.annotation.Autowired; + +import org.springframework.web.bind.annotation.*; + +import org.springframework.web.servlet.ModelAndView; + + + +/** + + * MES 胶料快检实验方法(主子表) + + */ + +@Tag(name = "MES胶料快检实验方法") + +@RestController + +@RequestMapping("/xslmes/mesXslRubberQuickTestMethod") + +@Slf4j + +public class MesXslRubberQuickTestMethodController + + extends JeecgController { + + + + @Autowired + + private IMesXslRubberQuickTestMethodService mesXslRubberQuickTestMethodService; + + + + @Autowired + + private IMesXslRubberQuickTestTypeService mesXslRubberQuickTestTypeService; + + + + @Autowired + + private IMesXslRubberQuickTestDataPointService mesXslRubberQuickTestDataPointService; + + + + @Operation(summary = "MES胶料快检实验方法-分页列表查询") + + @GetMapping(value = "/list") + + public Result> queryPageList( + + MesXslRubberQuickTestMethod model, + + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + + HttpServletRequest req) { + + QueryWrapper queryWrapper = + + QueryGenerator.initQueryWrapper(model, req.getParameterMap()); + + queryWrapper.orderByDesc("create_time"); + + Page page = new Page<>(pageNo, pageSize); + + IPage pageList = mesXslRubberQuickTestMethodService.page(page, queryWrapper); + + return Result.OK(pageList); + + } + + + + @AutoLog(value = "MES胶料快检实验方法-添加") + + @Operation(summary = "MES胶料快检实验方法-添加") + + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_method:add") + + @PostMapping(value = "/add") + + public Result add(@RequestBody MesXslRubberQuickTestMethodPage page) { + + MesXslRubberQuickTestMethod main = new MesXslRubberQuickTestMethod(); + + BeanUtils.copyProperties(page, main); + + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法保存校验与明细从数据点带出----------- + + String err = validateForSave(main, page.getLineList(), null); + + if (err != null) { + + return Result.error(err); + + } + + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法保存校验与明细从数据点带出----------- + + try { + + mesXslRubberQuickTestMethodService.saveMain(main, page.getLineList()); + + } catch (Exception e) { + + log.error(e.getMessage(), e); + + return Result.error(e.getMessage()); + + } + + return Result.OK("添加成功!"); + + } + + + + @AutoLog(value = "MES胶料快检实验方法-编辑") + + @Operation(summary = "MES胶料快检实验方法-编辑") + + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_method:edit") + + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + + public Result edit(@RequestBody MesXslRubberQuickTestMethodPage page) { + + MesXslRubberQuickTestMethod main = new MesXslRubberQuickTestMethod(); + + BeanUtils.copyProperties(page, main); + + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法保存校验与明细从数据点带出----------- + + String err = validateForSave(main, page.getLineList(), main.getId()); + + if (err != null) { + + return Result.error(err); + + } + + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法保存校验与明细从数据点带出----------- + + try { + + mesXslRubberQuickTestMethodService.updateMain(main, page.getLineList()); + + } catch (Exception e) { + + log.error(e.getMessage(), e); + + return Result.error(e.getMessage()); + + } + + return Result.OK("编辑成功!"); + + } + + + + @AutoLog(value = "MES胶料快检实验方法-删除") + + @Operation(summary = "MES胶料快检实验方法-通过id删除") + + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_method:delete") + + @DeleteMapping(value = "/delete") + + public Result delete(@RequestParam(name = "id", required = true) String id) { + + mesXslRubberQuickTestMethodService.delMain(id); + + return Result.OK("删除成功!"); + + } + + + + @AutoLog(value = "MES胶料快检实验方法-批量删除") + + @Operation(summary = "MES胶料快检实验方法-批量删除") + + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_method:deleteBatch") + + @DeleteMapping(value = "/deleteBatch") + + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + + mesXslRubberQuickTestMethodService.delBatchMain(Arrays.asList(ids.split(","))); + + return Result.OK("批量删除成功!"); + + } + + + + @Operation(summary = "MES胶料快检实验方法-通过id查询") + + @GetMapping(value = "/queryById") + + public Result queryById(@RequestParam(name = "id", required = true) String id) { + + MesXslRubberQuickTestMethod entity = mesXslRubberQuickTestMethodService.getById(id); + + if (entity == null) { + + return Result.error("未找到对应数据"); + + } + + return Result.OK(entity); + + } + + + + @Operation(summary = "MES胶料快检实验方法-查询明细") + + @GetMapping(value = "/queryLineListByMethodId") + + public Result> queryLineListByMethodId( + + @RequestParam(name = "id", required = true) String id) { + + return Result.OK(mesXslRubberQuickTestMethodService.selectLinesByMethodId(id)); + + } + + + + @Operation(summary = "MES胶料快检实验方法-下一编号") + + @GetMapping(value = "/nextMethodCode") + + public Result nextMethodCode() { + + MesXslRubberQuickTestMethod ctx = new MesXslRubberQuickTestMethod(); + + return Result.OK(mesXslRubberQuickTestMethodService.generateNextMethodCode(ctx)); + + } + + + + @Operation(summary = "MES胶料快检实验方法-校验名称唯一") + + @GetMapping(value = "/checkMethodName") + + public Result checkMethodName( + + @RequestParam(name = "methodName") String methodName, + + @RequestParam(name = "dataId", required = false) String dataId) { + + if (oConvertUtils.isEmpty(methodName) || methodName.trim().isEmpty()) { + + return Result.OK(); + + } + + MesXslRubberQuickTestMethod ctx = new MesXslRubberQuickTestMethod(); + + if (mesXslRubberQuickTestMethodService.isMethodNameDuplicated(methodName.trim(), dataId, ctx)) { + + return Result.error("实验方法名称已存在"); + + } + + return Result.OK(); + + } + + + + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_method:exportXls") + + @RequestMapping(value = "/exportXls") + + public ModelAndView exportXls(HttpServletRequest request, MesXslRubberQuickTestMethod model) { + + return super.exportXls(request, model, MesXslRubberQuickTestMethod.class, "MES胶料快检实验方法"); + + } + + + + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_method:importExcel") + + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + + return super.importExcel(request, response, MesXslRubberQuickTestMethod.class); + + } + + + + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法保存校验与明细从数据点带出----------- + + private String validateForSave( + + MesXslRubberQuickTestMethod main, List lineList, String excludeId) { + + if (main == null) { + + return "参数不能为空"; + + } + + if (oConvertUtils.isEmpty(main.getMethodName())) { + + return "实验方法名称不能为空"; + + } + + main.setMethodName(main.getMethodName().trim()); + + if (mesXslRubberQuickTestMethodService.isMethodNameDuplicated(main.getMethodName(), excludeId, main)) { + + return "实验方法名称已存在"; + + } + + if (oConvertUtils.isEmpty(main.getQuickTestTypeId())) { + + return "请选择实验类型"; + + } + + MesXslRubberQuickTestType type = mesXslRubberQuickTestTypeService.getById(main.getQuickTestTypeId()); + + if (type == null || isDeleted(type.getDelFlag())) { + + return "实验类型不存在或已删除"; + + } + + main.setQuickTestTypeName(type.getTypeName()); + + + + if (lineList == null || lineList.isEmpty()) { + + return "请通过「选择数据点」至少添加一条明细"; + + } + + + + Set pointIds = new HashSet<>(); + + int sort = 0; + + for (int i = 0; i < lineList.size(); i++) { + + MesXslRubberQuickTestMethodLine line = lineList.get(i); + + if (line == null) { + + continue; + + } + + int rowNo = i + 1; + + if (oConvertUtils.isEmpty(line.getDataPointId())) { + + return "第 " + rowNo + " 行未选择数据点"; + + } + + String pointId = line.getDataPointId().trim(); + + if (!pointIds.add(pointId)) { + + return "第 " + rowNo + " 行数据点与前面行重复,同一方法中数据点不能重复"; + + } + + MesXslRubberQuickTestDataPoint point = mesXslRubberQuickTestDataPointService.getById(pointId); + + if (point == null || isDeleted(point.getDelFlag())) { + + return "第 " + rowNo + " 行数据点不存在或已删除"; + + } + + if (!main.getQuickTestTypeId().equals(point.getQuickTestTypeId())) { + + return "第 " + rowNo + " 行数据点的实验类型与主表实验类型不一致"; + + } + + line.setDataPointId(pointId); + + line.setPointName(point.getPointName()); + + line.setUnitType(point.getUnitType()); + + if (oConvertUtils.isEmpty(line.getTorqueUnitType())) { + + return "第 " + rowNo + " 行请选择扭矩单位类型"; + + } + + if (oConvertUtils.isEmpty(line.getTimeUnitType())) { + + return "第 " + rowNo + " 行请选择时间单位类型"; + + } + + if (oConvertUtils.isEmpty(line.getMooneyUnitType())) { + + return "第 " + rowNo + " 行请选择门尼单位类型"; + + } + + line.setSortNo(sort++); + + } + + if (pointIds.isEmpty()) { + + return "请通过「选择数据点」至少添加一条明细"; + + } + + return null; + + } + + + + private static boolean isDeleted(Integer delFlag) { + + return delFlag != null && delFlag.equals(CommonConstant.DEL_FLAG_1); + + } + + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法保存校验与明细从数据点带出----------- + +} + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestTypeController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestTypeController.java new file mode 100644 index 0000000..59f4b5a --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestTypeController.java @@ -0,0 +1,235 @@ +package org.jeecg.modules.xslmes.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.exception.JeecgBootException; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType; +import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService; +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; + +/** + * MES 胶料快检实验类型 + */ +@Tag(name = "MES胶料快检实验类型") +@RestController +@RequestMapping("/xslmes/mesXslRubberQuickTestType") +@Slf4j +public class MesXslRubberQuickTestTypeController + extends JeecgController { + + @Autowired + private IMesXslRubberQuickTestTypeService mesXslRubberQuickTestTypeService; + + @Operation(summary = "MES胶料快检实验类型-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList( + MesXslRubberQuickTestType model, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = + QueryGenerator.initQueryWrapper(model, req.getParameterMap()); + Page page = new Page<>(pageNo, pageSize); + IPage pageList = mesXslRubberQuickTestTypeService.page(page, queryWrapper); + return Result.OK(pageList); + } + + @AutoLog(value = "MES胶料快检实验类型-添加") + @Operation(summary = "MES胶料快检实验类型-添加") + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:add") + @PostMapping(value = "/add") + public Result add(@RequestBody MesXslRubberQuickTestType model) { + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型新增校验与自动编号----------- + if (oConvertUtils.isEmpty(model.getTypeName()) || model.getTypeName().trim().isEmpty()) { + return Result.error("实验类型名称不能为空"); + } + model.setTypeName(model.getTypeName().trim()); + if (mesXslRubberQuickTestTypeService.isTypeNameDuplicated(model.getTypeName(), null, model)) { + return Result.error("实验类型名称已存在"); + } + model.setTypeCode(null); + try { + mesXslRubberQuickTestTypeService.save(model); + } catch (JeecgBootException e) { + return Result.error(e.getMessage()); + } + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型新增校验与自动编号----------- + return Result.OK("添加成功!"); + } + + @AutoLog(value = "MES胶料快检实验类型-编辑") + @Operation(summary = "MES胶料快检实验类型-编辑") + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody MesXslRubberQuickTestType model) { + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型编辑仅改名称、编号只读----------- + if (oConvertUtils.isEmpty(model.getId())) { + return Result.error("缺少主键"); + } + if (oConvertUtils.isEmpty(model.getTypeName()) || model.getTypeName().trim().isEmpty()) { + return Result.error("实验类型名称不能为空"); + } + model.setTypeName(model.getTypeName().trim()); + if (mesXslRubberQuickTestTypeService.isTypeNameDuplicated(model.getTypeName(), model.getId(), model)) { + return Result.error("实验类型名称已存在"); + } + MesXslRubberQuickTestType old = mesXslRubberQuickTestTypeService.getById(model.getId()); + if (old == null) { + return Result.error("未找到对应数据"); + } + old.setTypeName(model.getTypeName()); + try { + mesXslRubberQuickTestTypeService.updateById(old); + } catch (JeecgBootException e) { + return Result.error(e.getMessage()); + } + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型编辑仅改名称、编号只读----------- + return Result.OK("编辑成功!"); + } + + @AutoLog(value = "MES胶料快检实验类型-删除") + @Operation(summary = "MES胶料快检实验类型-通过id删除") + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + mesXslRubberQuickTestTypeService.removeById(id); + return Result.OK("删除成功!"); + } + + @AutoLog(value = "MES胶料快检实验类型-批量删除") + @Operation(summary = "MES胶料快检实验类型-批量删除") + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + mesXslRubberQuickTestTypeService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + @Operation(summary = "MES胶料快检实验类型-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + MesXslRubberQuickTestType entity = mesXslRubberQuickTestTypeService.getById(id); + if (entity == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(entity); + } + + @Operation(summary = "预览下一实验类型编号(001起)") + @GetMapping(value = "/nextTypeCode") + public Result nextTypeCode() { + MesXslRubberQuickTestType ctx = new MesXslRubberQuickTestType(); + return Result.OK(mesXslRubberQuickTestTypeService.generateNextTypeCode(ctx)); + } + + @Operation(summary = "校验实验类型名称是否重复") + @GetMapping(value = "/checkTypeName") + public Result checkTypeName( + @RequestParam(name = "typeName", required = true) String typeName, + @RequestParam(name = "dataId", required = false) String dataId) { + if (oConvertUtils.isEmpty(typeName) || typeName.trim().isEmpty()) { + return Result.OK("该值可用!"); + } + MesXslRubberQuickTestType ctx = new MesXslRubberQuickTestType(); + if (mesXslRubberQuickTestTypeService.isTypeNameDuplicated(typeName.trim(), dataId, ctx)) { + return Result.error("该实验类型名称已存在"); + } + return Result.OK("该值可用!"); + } + + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, MesXslRubberQuickTestType model) { + return super.exportXls(request, model, MesXslRubberQuickTestType.class, "MES胶料快检实验类型"); + } + + @RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型导入:名称必填且不重复,编号可空则自动生成----------- + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; + Map fileMap = multipartRequest.getFileMap(); + for (Map.Entry ent : fileMap.entrySet()) { + MultipartFile file = ent.getValue(); + ImportParams params = new ImportParams(); + params.setTitleRows(2); + params.setHeadRows(1); + params.setNeedSave(true); + try { + List list = + ExcelImportUtil.importExcel(file.getInputStream(), MesXslRubberQuickTestType.class, params); + if (list == null) { + list = List.of(); + } + Set namesInFile = new HashSet<>(); + for (int i = 0; i < list.size(); i++) { + MesXslRubberQuickTestType row = list.get(i); + int rowNo = i + 1; + if (row == null) { + return Result.error("文件导入失败:第 " + rowNo + " 条数据无效(空行)"); + } + if (oConvertUtils.isEmpty(row.getTypeName()) || row.getTypeName().trim().isEmpty()) { + return Result.error("文件导入失败:第 " + rowNo + " 条实验类型名称不能为空"); + } + row.setTypeName(row.getTypeName().trim()); + if (!namesInFile.add(row.getTypeName())) { + return Result.error("文件导入失败:实验类型名称【" + row.getTypeName() + "】在导入文件中重复"); + } + if (mesXslRubberQuickTestTypeService.isTypeNameDuplicated(row.getTypeName(), null, row)) { + return Result.error("文件导入失败:第 " + rowNo + " 条实验类型名称【" + row.getTypeName() + "】已存在"); + } + if (oConvertUtils.isNotEmpty(row.getTypeCode())) { + row.setTypeCode(row.getTypeCode().trim()); + } else { + row.setTypeCode(null); + } + } + for (MesXslRubberQuickTestType row : list) { + try { + mesXslRubberQuickTestTypeService.save(row); + } catch (JeecgBootException e) { + return Result.error("文件导入失败:" + e.getMessage()); + } + } + log.info("胶料快检实验类型Excel导入完成,行数={}", list.size()); + return Result.ok("文件导入成功!数据行数:" + list.size()); + } catch (Exception e) { + String msg = e.getMessage(); + log.error(msg, e); + return Result.error("文件导入失败:" + e.getMessage()); + } finally { + try { + file.getInputStream().close(); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + } + } + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型导入:名称必填且不重复,编号可空则自动生成----------- + return Result.error("文件导入失败!"); + } +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestDataPoint.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestDataPoint.java new file mode 100644 index 0000000..50489f2 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestDataPoint.java @@ -0,0 +1,74 @@ +package org.jeecg.modules.xslmes.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecg.common.aspect.annotation.Dict; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * MES 胶料快检数据点 + */ +@Data +@TableName("mes_xsl_rubber_quick_test_data_point") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@Schema(description = "MES胶料快检数据点") +public class MesXslRubberQuickTestDataPoint implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.ASSIGN_ID) + private String id; + + @Excel(name = "数据点名称", width = 24) + @Schema(description = "数据点名称(同租户未删除唯一)") + private String pointName; + + @Excel(name = "实验类型", width = 20, dictTable = "mes_xsl_rubber_quick_test_type", dicText = "type_name", dicCode = "id") + @Dict(dictTable = "mes_xsl_rubber_quick_test_type", dicText = "type_name", dicCode = "id") + @Schema(description = "实验类型ID") + private String quickTestTypeId; + + @Excel(name = "实验类型名称", width = 20) + @Schema(description = "实验类型名称冗余") + private String quickTestTypeName; + + @Excel(name = "单位类型", width = 16) + @Schema(description = "单位类型(手填)") + private String unitType; + + @Excel(name = "描述", width = 40) + @Schema(description = "描述") + private String pointDesc; + + @TableField(exist = false) + @Excel(name = "实验类型名称导入", width = 20) + @Schema(description = "导入用实验类型名称") + private String importQuickTestTypeName; + + private Integer tenantId; + private String sysOrgCode; + private String createBy; + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + private String updateBy; + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @TableLogic + @Schema(description = "删除状态(0正常 1已删除)") + private Integer delFlag; +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestMethod.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestMethod.java new file mode 100644 index 0000000..07302e8 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestMethod.java @@ -0,0 +1,208 @@ +package org.jeecg.modules.xslmes.entity; + + + +import com.baomidou.mybatisplus.annotation.IdType; + +import com.baomidou.mybatisplus.annotation.TableField; + +import com.baomidou.mybatisplus.annotation.TableId; + +import com.baomidou.mybatisplus.annotation.TableLogic; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import io.swagger.v3.oas.annotations.media.Schema; + +import java.io.Serializable; + +import java.math.BigDecimal; + +import java.util.Date; + +import java.util.List; + +import lombok.Data; + +import lombok.EqualsAndHashCode; + +import lombok.experimental.Accessors; + +import org.jeecg.common.aspect.annotation.Dict; + +import org.jeecgframework.poi.excel.annotation.Excel; + +import org.springframework.format.annotation.DateTimeFormat; + + + +/** + + * MES 胶料快检实验方法主表 + + */ + +@Data + +@TableName("mes_xsl_rubber_quick_test_method") + +@Accessors(chain = true) + +@EqualsAndHashCode(callSuper = false) + +@Schema(description = "MES胶料快检实验方法") + +public class MesXslRubberQuickTestMethod implements Serializable { + + + + private static final long serialVersionUID = 1L; + + + + @TableId(type = IdType.ASSIGN_ID) + + private String id; + + + + @Excel(name = "方法编号", width = 14) + + @Schema(description = "方法编号(租户内从001递增自动生成,只读)") + + private String methodCode; + + + + @Excel(name = "实验方法名称", width = 24) + + @Schema(description = "实验方法名称(同租户未删除唯一)") + + private String methodName; + + + + @Excel(name = "实验类型", width = 20, dictTable = "mes_xsl_rubber_quick_test_type", dicText = "type_name", dicCode = "id") + + @Dict(dictTable = "mes_xsl_rubber_quick_test_type", dicText = "type_name", dicCode = "id") + + @Schema(description = "实验类型ID") + + private String quickTestTypeId; + + + + @Excel(name = "实验类型名称", width = 20) + + @Schema(description = "实验类型名称冗余") + + private String quickTestTypeName; + + + + @Excel(name = "实验温度°C", width = 14, type = 10) + + @Schema(description = "实验温度°C") + + private BigDecimal testTempC; + + + + @Excel(name = "预热时间min", width = 14, type = 10) + + @Schema(description = "预热时间min") + + private BigDecimal preheatTimeMin; + + + + @Excel(name = "实验时间min", width = 14, type = 10) + + @Schema(description = "实验时间min") + + private BigDecimal testTimeMin; + + + + @Excel(name = "实验角度Deg", width = 14, type = 10) + + @Schema(description = "实验角度Deg") + + private BigDecimal testAngleDeg; + + + + @Excel(name = "实验频率Hz", width = 14, type = 10) + + @Schema(description = "实验频率Hz") + + private BigDecimal testFreqHz; + + + + @Excel(name = "转子类型", width = 12, dicCode = "xslmes_rubber_quick_test_rotor_type") + + @Dict(dicCode = "xslmes_rubber_quick_test_rotor_type") + + @Schema(description = "转子类型(字典xslmes_rubber_quick_test_rotor_type)") + + private String rotorType; + + + + @Excel(name = "转子速度rpm", width = 14, type = 10) + + @Schema(description = "转子速度rpm") + + private BigDecimal rotorSpeedRpm; + + + + @Excel(name = "方法描述", width = 40) + + @Schema(description = "方法描述") + + private String methodDesc; + + + + private Integer tenantId; + + private String sysOrgCode; + + private String createBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + + private Date createTime; + + private String updateBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + + private Date updateTime; + + + + @TableLogic + + @Schema(description = "删除状态(0正常 1已删除)") + + private Integer delFlag; + + + + @TableField(exist = false) + + @Schema(description = "数据点明细") + + private List lineList; + +} + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestMethodLine.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestMethodLine.java new file mode 100644 index 0000000..7d03451 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestMethodLine.java @@ -0,0 +1,128 @@ +package org.jeecg.modules.xslmes.entity; + + + +import com.baomidou.mybatisplus.annotation.IdType; + +import com.baomidou.mybatisplus.annotation.TableId; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import io.swagger.v3.oas.annotations.media.Schema; + +import java.io.Serializable; + +import java.util.Date; + +import lombok.Data; + +import lombok.EqualsAndHashCode; + +import lombok.experimental.Accessors; + +import org.jeecg.common.aspect.annotation.Dict; + +import org.springframework.format.annotation.DateTimeFormat; + + + +/** + + * MES 胶料快检实验方法明细 + + */ + +@Data + +@TableName("mes_xsl_rubber_quick_test_method_line") + +@Accessors(chain = true) + +@EqualsAndHashCode(callSuper = false) + +@Schema(description = "MES胶料快检实验方法明细") + +public class MesXslRubberQuickTestMethodLine implements Serializable { + + + + private static final long serialVersionUID = 1L; + + + + @TableId(type = IdType.ASSIGN_ID) + + private String id; + + + + @Schema(description = "主表主键 mes_xsl_rubber_quick_test_method.id") + + private String methodId; + + + + @Schema(description = "数据点主键 mes_xsl_rubber_quick_test_data_point.id") + + private String dataPointId; + + + + @Schema(description = "数据点名称冗余(只读带出)") + + private String pointName; + + + + @Schema(description = "单位类型冗余(只读带出)") + + private String unitType; + + + + @Dict(dicCode = "xslmes_rubber_quick_test_torque_unit") + + @Schema(description = "扭矩单位类型") + + private String torqueUnitType; + + + + @Dict(dicCode = "xslmes_rubber_quick_test_time_unit") + + @Schema(description = "时间单位类型") + + private String timeUnitType; + + + + @Dict(dicCode = "xslmes_rubber_quick_test_mooney_unit") + + @Schema(description = "门尼单位类型") + + private String mooneyUnitType; + + + + private Integer sortNo; + + private String createBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + + private Date createTime; + + private String updateBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + + private Date updateTime; + +} + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestType.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestType.java new file mode 100644 index 0000000..8359e38 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestType.java @@ -0,0 +1,54 @@ +package org.jeecg.modules.xslmes.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * MES 胶料快检实验类型 + */ +@Data +@TableName("mes_xsl_rubber_quick_test_type") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@Schema(description = "MES胶料快检实验类型") +public class MesXslRubberQuickTestType implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.ASSIGN_ID) + private String id; + + @Excel(name = "实验类型编号", width = 16) + @Schema(description = "实验类型编号(租户内从001递增自动生成,只读)") + private String typeCode; + + @Excel(name = "实验类型名称", width = 24) + @Schema(description = "实验类型名称") + private String typeName; + + private Integer tenantId; + private String sysOrgCode; + private String createBy; + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + private String updateBy; + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @TableLogic + @Schema(description = "删除状态(0正常 1已删除)") + private Integer delFlag; +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestDataPointMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestDataPointMapper.java new file mode 100644 index 0000000..5a1a7a5 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestDataPointMapper.java @@ -0,0 +1,11 @@ +package org.jeecg.modules.xslmes.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestDataPoint; + +/** + * MES 胶料快检数据点 Mapper + */ +@Mapper +public interface MesXslRubberQuickTestDataPointMapper extends BaseMapper {} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestMethodLineMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestMethodLineMapper.java new file mode 100644 index 0000000..bdbf1d0 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestMethodLineMapper.java @@ -0,0 +1,16 @@ +package org.jeecg.modules.xslmes.mapper; + + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import org.apache.ibatis.annotations.Mapper; + +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethodLine; + + + +@Mapper + +public interface MesXslRubberQuickTestMethodLineMapper extends BaseMapper {} + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestMethodMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestMethodMapper.java new file mode 100644 index 0000000..bdf6c35 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestMethodMapper.java @@ -0,0 +1,38 @@ +package org.jeecg.modules.xslmes.mapper; + + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import org.apache.ibatis.annotations.Mapper; + +import org.apache.ibatis.annotations.Param; + +import org.apache.ibatis.annotations.Select; + +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethod; + + + +@Mapper + +public interface MesXslRubberQuickTestMethodMapper extends BaseMapper { + + + + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法租户内最大三位数字编号----------- + + @Select( + + "SELECT IFNULL(MAX(CAST(method_code AS UNSIGNED)), 0) FROM mes_xsl_rubber_quick_test_method " + + + "WHERE del_flag = 0 AND method_code REGEXP '^[0-9]+$' " + + + "AND (#{tenantId} IS NULL OR tenant_id = #{tenantId})") + + Integer selectMaxNumericMethodCode(@Param("tenantId") Integer tenantId); + + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法租户内最大三位数字编号----------- + +} + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestTypeMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestTypeMapper.java new file mode 100644 index 0000000..4db08f0 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestTypeMapper.java @@ -0,0 +1,22 @@ +package org.jeecg.modules.xslmes.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType; + +/** + * MES 胶料快检实验类型 Mapper + */ +@Mapper +public interface MesXslRubberQuickTestTypeMapper extends BaseMapper { + + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型租户内最大三位数字编号----------- + @Select( + "SELECT IFNULL(MAX(CAST(type_code AS UNSIGNED)), 0) FROM mes_xsl_rubber_quick_test_type " + + "WHERE del_flag = 0 AND type_code REGEXP '^[0-9]+$' " + + "AND (#{tenantId} IS NULL OR tenant_id = #{tenantId})") + Integer selectMaxNumericTypeCode(@Param("tenantId") Integer tenantId); + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型租户内最大三位数字编号----------- +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestDataPointService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestDataPointService.java new file mode 100644 index 0000000..06524af --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestDataPointService.java @@ -0,0 +1,9 @@ +package org.jeecg.modules.xslmes.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestDataPoint; + +public interface IMesXslRubberQuickTestDataPointService extends IService { + + boolean isPointNameDuplicated(String pointName, String excludeId, MesXslRubberQuickTestDataPoint context); +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestMethodService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestMethodService.java new file mode 100644 index 0000000..f57bbc9 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestMethodService.java @@ -0,0 +1,50 @@ +package org.jeecg.modules.xslmes.service; + + + +import com.baomidou.mybatisplus.extension.service.IService; + +import java.io.Serializable; + +import java.util.Collection; + +import java.util.List; + +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethod; + +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethodLine; + + + +public interface IMesXslRubberQuickTestMethodService extends IService { + + + + String generateNextMethodCode(MesXslRubberQuickTestMethod context); + + + + boolean isMethodNameDuplicated(String methodName, String excludeId, MesXslRubberQuickTestMethod context); + + + + void saveMain(MesXslRubberQuickTestMethod main, List lineList); + + + + void updateMain(MesXslRubberQuickTestMethod main, List lineList); + + + + void delMain(String id); + + + + void delBatchMain(Collection idList); + + + + List selectLinesByMethodId(String methodId); + +} + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestTypeService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestTypeService.java new file mode 100644 index 0000000..8dcc29f --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestTypeService.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.xslmes.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType; + +public interface IMesXslRubberQuickTestTypeService extends IService { + + /** + * 生成下一实验类型编号(001 起,三位数字,租户维度) + */ + String generateNextTypeCode(MesXslRubberQuickTestType context); + + /** + * 实验类型名称是否重复(仅未删除数据,同租户) + */ + boolean isTypeNameDuplicated(String typeName, String excludeId, MesXslRubberQuickTestType context); +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestDataPointServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestDataPointServiceImpl.java new file mode 100644 index 0000000..16e90e2 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestDataPointServiceImpl.java @@ -0,0 +1,94 @@ +package org.jeecg.modules.xslmes.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.common.config.TenantContext; +import org.jeecg.common.constant.CommonConstant; +import org.jeecg.common.exception.JeecgBootException; +import org.jeecg.common.util.SpringContextUtils; +import org.jeecg.common.util.TokenUtils; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestDataPoint; +import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestDataPointMapper; +import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestDataPointService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +public class MesXslRubberQuickTestDataPointServiceImpl + extends ServiceImpl + implements IMesXslRubberQuickTestDataPointService { + + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点名称同租户唯一----------- + @Override + public boolean isPointNameDuplicated(String pointName, String excludeId, MesXslRubberQuickTestDataPoint context) { + if (oConvertUtils.isEmpty(pointName)) { + return false; + } + Integer tenantId = resolveTenantId(context); + LambdaQueryWrapper w = new LambdaQueryWrapper<>(); + w.eq(MesXslRubberQuickTestDataPoint::getPointName, pointName.trim()); + w.and( + q -> + q.eq(MesXslRubberQuickTestDataPoint::getDelFlag, CommonConstant.DEL_FLAG_0) + .or() + .isNull(MesXslRubberQuickTestDataPoint::getDelFlag)); + if (oConvertUtils.isNotEmpty(excludeId)) { + w.ne(MesXslRubberQuickTestDataPoint::getId, excludeId); + } + if (tenantId != null) { + w.eq(MesXslRubberQuickTestDataPoint::getTenantId, tenantId); + } + return this.count(w) > 0; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean save(MesXslRubberQuickTestDataPoint entity) { + assertPointNameUniqueForSave(entity, null); + return super.save(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateById(MesXslRubberQuickTestDataPoint entity) { + if (oConvertUtils.isEmpty(entity.getId())) { + throw new JeecgBootException("缺少主键"); + } + assertPointNameUniqueForSave(entity, entity.getId()); + return super.updateById(entity); + } + + private void assertPointNameUniqueForSave(MesXslRubberQuickTestDataPoint entity, String excludeId) { + if (entity == null || oConvertUtils.isEmpty(entity.getPointName())) { + throw new JeecgBootException("数据点名称不能为空"); + } + String name = entity.getPointName().trim(); + entity.setPointName(name); + if (isPointNameDuplicated(name, excludeId, entity)) { + throw new JeecgBootException("数据点名称已存在"); + } + } + + private static Integer resolveTenantId(MesXslRubberQuickTestDataPoint context) { + if (context != null && context.getTenantId() != null) { + return context.getTenantId(); + } + String ts = TenantContext.getTenant(); + if (oConvertUtils.isEmpty(ts)) { + try { + ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest()); + } catch (Exception ignored) { + } + } + if (oConvertUtils.isEmpty(ts)) { + return null; + } + try { + return Integer.parseInt(ts.trim()); + } catch (NumberFormatException e) { + return null; + } + } + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点名称同租户唯一----------- +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestMethodServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestMethodServiceImpl.java new file mode 100644 index 0000000..dda5acf --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestMethodServiceImpl.java @@ -0,0 +1,332 @@ +package org.jeecg.modules.xslmes.service.impl; + + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import java.io.Serializable; + +import java.util.Collection; + +import java.util.List; + +import org.jeecg.common.config.TenantContext; + +import org.jeecg.common.constant.CommonConstant; + +import org.jeecg.common.exception.JeecgBootException; + +import org.jeecg.common.util.SpringContextUtils; + +import org.jeecg.common.util.TokenUtils; + +import org.jeecg.common.util.oConvertUtils; + +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethod; + +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethodLine; + +import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestMethodLineMapper; + +import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestMethodMapper; + +import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestMethodService; + +import org.springframework.beans.factory.annotation.Autowired; + +import org.springframework.stereotype.Service; + +import org.springframework.transaction.annotation.Transactional; + +import org.springframework.util.CollectionUtils; + + + +@Service + +public class MesXslRubberQuickTestMethodServiceImpl + + extends ServiceImpl + + implements IMesXslRubberQuickTestMethodService { + + + + @Autowired + + private MesXslRubberQuickTestMethodLineMapper mesXslRubberQuickTestMethodLineMapper; + + + + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法编号001递增、名称同租户唯一、主子保存----------- + + @Override + + public String generateNextMethodCode(MesXslRubberQuickTestMethod context) { + + Integer tenantId = resolveTenantId(context); + + Integer max = baseMapper.selectMaxNumericMethodCode(tenantId); + + int next = (max == null ? 0 : max) + 1; + + if (next > 999) { + + throw new IllegalStateException("实验方法编号已超过999,请联系管理员"); + + } + + return String.format("%03d", next); + + } + + + + @Override + + public boolean isMethodNameDuplicated(String methodName, String excludeId, MesXslRubberQuickTestMethod context) { + + if (oConvertUtils.isEmpty(methodName)) { + + return false; + + } + + Integer tenantId = resolveTenantId(context); + + LambdaQueryWrapper w = new LambdaQueryWrapper<>(); + + w.eq(MesXslRubberQuickTestMethod::getMethodName, methodName.trim()); + + w.and( + + q -> + + q.eq(MesXslRubberQuickTestMethod::getDelFlag, CommonConstant.DEL_FLAG_0) + + .or() + + .isNull(MesXslRubberQuickTestMethod::getDelFlag)); + + if (oConvertUtils.isNotEmpty(excludeId)) { + + w.ne(MesXslRubberQuickTestMethod::getId, excludeId); + + } + + if (tenantId != null) { + + w.eq(MesXslRubberQuickTestMethod::getTenantId, tenantId); + + } + + return this.count(w) > 0; + + } + + + + @Override + + @Transactional(rollbackFor = Exception.class) + + public void saveMain(MesXslRubberQuickTestMethod main, List lineList) { + + assertMethodNameUniqueForSave(main, null); + + if (oConvertUtils.isEmpty(main.getMethodCode())) { + + main.setMethodCode(generateNextMethodCode(main)); + + } + + this.save(main); + + insertLines(main.getId(), lineList); + + } + + + + @Override + + @Transactional(rollbackFor = Exception.class) + + public void updateMain(MesXslRubberQuickTestMethod main, List lineList) { + + if (oConvertUtils.isEmpty(main.getId())) { + + throw new JeecgBootException("缺少主键"); + + } + + MesXslRubberQuickTestMethod old = this.getById(main.getId()); + + if (old == null) { + + throw new JeecgBootException("实验方法不存在"); + + } + + main.setMethodCode(old.getMethodCode()); + + assertMethodNameUniqueForSave(main, main.getId()); + + this.updateById(main); + + mesXslRubberQuickTestMethodLineMapper.delete( + + new LambdaQueryWrapper() + + .eq(MesXslRubberQuickTestMethodLine::getMethodId, main.getId())); + + insertLines(main.getId(), lineList); + + } + + + + private void insertLines(String methodId, List lineList) { + + if (CollectionUtils.isEmpty(lineList)) { + + return; + + } + + int sort = 0; + + for (MesXslRubberQuickTestMethodLine line : lineList) { + + line.setId(null); + + line.setMethodId(methodId); + + line.setSortNo(sort++); + + mesXslRubberQuickTestMethodLineMapper.insert(line); + + } + + } + + + + @Override + + @Transactional(rollbackFor = Exception.class) + + public void delMain(String id) { + + mesXslRubberQuickTestMethodLineMapper.delete( + + new LambdaQueryWrapper() + + .eq(MesXslRubberQuickTestMethodLine::getMethodId, id)); + + this.removeById(id); + + } + + + + @Override + + @Transactional(rollbackFor = Exception.class) + + public void delBatchMain(Collection idList) { + + for (Serializable id : idList) { + + delMain(id.toString()); + + } + + } + + + + @Override + + public List selectLinesByMethodId(String methodId) { + + return mesXslRubberQuickTestMethodLineMapper.selectList( + + new LambdaQueryWrapper() + + .eq(MesXslRubberQuickTestMethodLine::getMethodId, methodId) + + .orderByAsc(MesXslRubberQuickTestMethodLine::getSortNo)); + + } + + + + private void assertMethodNameUniqueForSave(MesXslRubberQuickTestMethod entity, String excludeId) { + + if (entity == null || oConvertUtils.isEmpty(entity.getMethodName())) { + + throw new JeecgBootException("实验方法名称不能为空"); + + } + + String name = entity.getMethodName().trim(); + + entity.setMethodName(name); + + if (isMethodNameDuplicated(name, excludeId, entity)) { + + throw new JeecgBootException("实验方法名称已存在"); + + } + + } + + + + private static Integer resolveTenantId(MesXslRubberQuickTestMethod context) { + + if (context != null && context.getTenantId() != null) { + + return context.getTenantId(); + + } + + String ts = TenantContext.getTenant(); + + if (oConvertUtils.isEmpty(ts)) { + + try { + + ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest()); + + } catch (Exception ignored) { + + } + + } + + if (oConvertUtils.isEmpty(ts)) { + + return null; + + } + + try { + + return Integer.parseInt(ts.trim()); + + } catch (NumberFormatException e) { + + return null; + + } + + } + + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法编号001递增、名称同租户唯一、主子保存----------- + +} + diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestTypeServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestTypeServiceImpl.java new file mode 100644 index 0000000..7bd38b4 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestTypeServiceImpl.java @@ -0,0 +1,108 @@ +package org.jeecg.modules.xslmes.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.common.config.TenantContext; +import org.jeecg.common.constant.CommonConstant; +import org.jeecg.common.exception.JeecgBootException; +import org.jeecg.common.util.SpringContextUtils; +import org.jeecg.common.util.TokenUtils; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType; +import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestTypeMapper; +import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +public class MesXslRubberQuickTestTypeServiceImpl + extends ServiceImpl + implements IMesXslRubberQuickTestTypeService { + + //update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型编号001递增、名称同租户唯一----------- + @Override + public String generateNextTypeCode(MesXslRubberQuickTestType context) { + Integer tenantId = resolveTenantId(context); + Integer max = baseMapper.selectMaxNumericTypeCode(tenantId); + int next = (max == null ? 0 : max) + 1; + if (next > 999) { + throw new IllegalStateException("实验类型编号已超过999,请联系管理员"); + } + return String.format("%03d", next); + } + + @Override + public boolean isTypeNameDuplicated(String typeName, String excludeId, MesXslRubberQuickTestType context) { + if (oConvertUtils.isEmpty(typeName)) { + return false; + } + Integer tenantId = resolveTenantId(context); + LambdaQueryWrapper w = new LambdaQueryWrapper<>(); + w.eq(MesXslRubberQuickTestType::getTypeName, typeName.trim()); + w.and( + q -> + q.eq(MesXslRubberQuickTestType::getDelFlag, CommonConstant.DEL_FLAG_0) + .or() + .isNull(MesXslRubberQuickTestType::getDelFlag)); + if (oConvertUtils.isNotEmpty(excludeId)) { + w.ne(MesXslRubberQuickTestType::getId, excludeId); + } + if (tenantId != null) { + w.eq(MesXslRubberQuickTestType::getTenantId, tenantId); + } + return this.count(w) > 0; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean save(MesXslRubberQuickTestType entity) { + assertTypeNameUniqueForSave(entity, null); + if (oConvertUtils.isEmpty(entity.getTypeCode())) { + entity.setTypeCode(generateNextTypeCode(entity)); + } + return super.save(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateById(MesXslRubberQuickTestType entity) { + if (oConvertUtils.isEmpty(entity.getId())) { + throw new JeecgBootException("缺少主键"); + } + assertTypeNameUniqueForSave(entity, entity.getId()); + return super.updateById(entity); + } + + private void assertTypeNameUniqueForSave(MesXslRubberQuickTestType entity, String excludeId) { + if (entity == null || oConvertUtils.isEmpty(entity.getTypeName())) { + throw new JeecgBootException("实验类型名称不能为空"); + } + String name = entity.getTypeName().trim(); + entity.setTypeName(name); + if (isTypeNameDuplicated(name, excludeId, entity)) { + throw new JeecgBootException("实验类型名称已存在"); + } + } + + private static Integer resolveTenantId(MesXslRubberQuickTestType context) { + if (context != null && context.getTenantId() != null) { + return context.getTenantId(); + } + String ts = TenantContext.getTenant(); + if (oConvertUtils.isEmpty(ts)) { + try { + ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest()); + } catch (Exception ignored) { + } + } + if (oConvertUtils.isEmpty(ts)) { + return null; + } + try { + return Integer.parseInt(ts.trim()); + } catch (NumberFormatException e) { + return null; + } + } + //update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型编号001递增、名称同租户唯一----------- +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslRubberQuickTestMethodPage.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslRubberQuickTestMethodPage.java new file mode 100644 index 0000000..35c6893 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslRubberQuickTestMethodPage.java @@ -0,0 +1,24 @@ +package org.jeecg.modules.xslmes.vo; + + + +import lombok.Data; + +import lombok.EqualsAndHashCode; + +import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethod; + + + +/** + + * 胶料快检实验方法主子保存页 VO + + */ + +@Data + +@EqualsAndHashCode(callSuper = true) + +public class MesXslRubberQuickTestMethodPage extends MesXslRubberQuickTestMethod {} + diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/docs/代码修改日志 b/jeecg-boot/jeecg-module-system/jeecg-system-biz/docs/代码修改日志 index f6f1358..9711c03 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/docs/代码修改日志 +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/docs/代码修改日志 @@ -418,3 +418,53 @@ jeecgboot-vue3/src/views/xslmes/mesXslEquipInspectRecord/MesXslEquipInspectRecor jeecgboot-vue3/src/views/xslmes/mesXslEquipInspectRecord/MesXslEquipInspectRecordList.vue jeecgboot-vue3/src/views/xslmes/mesXslEquipInspectRecord/components/MesXslEquipInspectRecordModal.vue jeecgboot-vue3/src/views/xslmes/mesXslEquipInspectRecord/components/MesXslEquipInspectRecordHandleModal.vue + +-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验类型:质量管理目录、001自动编号、CRUD与菜单权限 --- +jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_97__mes_xsl_rubber_quick_test_type.sql +jeecg-boot/db/mes-xsl-rubber-quick-test-type-menu-permission.sql +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestType.java +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestTypeMapper.java +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestTypeService.java +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestTypeServiceImpl.java +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestTypeController.java +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestTypeList.vue +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.data.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.api.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/components/MesXslRubberQuickTestTypeModal.vue + +-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验方法:质量管理菜单、001编号、名称唯一、关联实验类型 --- +jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_99__mes_xsl_rubber_quick_test_method.sql +jeecg-boot/db/mes-xsl-rubber-quick-test-method-menu-permission.sql +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestMethod.java +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestMethodMapper.java +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestMethodService.java +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestMethodServiceImpl.java +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestMethodController.java +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethodList.vue +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.data.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.api.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestMethodModal.vue + +-- author:jiangxh---date:20260522--for: 【MES】撤销胶料快检实验方法功能(删代码+库清理脚本)--- +jeecg-boot/db/mes-xsl-rubber-quick-test-method-drop.sql +jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_100__drop_mes_xsl_rubber_quick_test_method.sql +(已删除 MesXslRubberQuickTestMethod 后端与前端、mes-xsl-rubber-quick-test-method-menu-permission.sql) + +-- author:jiangxh---date:20260522--for: 【MES】胶料快检数据点:质量管理菜单、名称唯一、关联实验类型、单位手填 --- +jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_101__mes_xsl_rubber_quick_test_data_point.sql +jeecg-boot/db/mes-xsl-rubber-quick-test-data-point-menu-permission.sql +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestDataPoint.java +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestDataPointMapper.java +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestDataPointService.java +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestDataPointServiceImpl.java +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestDataPointController.java +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPointList.vue +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPoint.data.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPoint.api.ts +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/components/MesXslRubberQuickTestDataPointModal.vue + +-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验类型名称同租户不可重复(Service兜底+唯一索引)--- +jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_98__mes_xsl_rubber_quick_test_type_name_unique.sql +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestTypeServiceImpl.java +jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestTypeController.java +jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.data.ts diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_100__drop_mes_xsl_rubber_quick_test_method.sql b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_100__drop_mes_xsl_rubber_quick_test_method.sql new file mode 100644 index 0000000..19948e3 --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_100__drop_mes_xsl_rubber_quick_test_method.sql @@ -0,0 +1,25 @@ +-- 撤销胶料快检实验方法(与 db/mes-xsl-rubber-quick-test-method-drop.sql 一致) +SET NAMES utf8mb4; + +DELETE FROM `sys_role_permission` +WHERE `permission_id` IN ( + '1860000000000000170', + '1860000000000000171', '1860000000000000172', '1860000000000000173', + '1860000000000000174', '1860000000000000175', '1860000000000000176' +); + +DELETE FROM `sys_permission` +WHERE `id` IN ( + '1860000000000000170', + '1860000000000000171', '1860000000000000172', '1860000000000000173', + '1860000000000000174', '1860000000000000175', '1860000000000000176' +); + +DELETE di FROM `sys_dict_item` di +INNER JOIN `sys_dict` d ON di.`dict_id` = d.`id` +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND d.`del_flag` = 0; + +DELETE FROM `sys_dict` +WHERE `dict_code` = 'xslmes_rubber_quick_test_rotor_type'; + +DROP TABLE IF EXISTS `mes_xsl_rubber_quick_test_method`; diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_101__mes_xsl_rubber_quick_test_data_point.sql b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_101__mes_xsl_rubber_quick_test_data_point.sql new file mode 100644 index 0000000..91ac32b --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_101__mes_xsl_rubber_quick_test_data_point.sql @@ -0,0 +1,66 @@ +-- MES 胶料快检数据点:建表 + 菜单(质量管理下)+ 按钮 + 租户 admin 授权 +-- 权限前缀:mes:mes_xsl_rubber_quick_test_data_point:* +-- 依赖:mes_xsl_rubber_quick_test_type、质量管理目录 id 1860000000000000162 +SET NAMES utf8mb4; + +CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_data_point` ( + `id` varchar(32) NOT NULL COMMENT '主键', + `point_name` varchar(128) NOT NULL COMMENT '数据点名称(同租户未删除唯一)', + `quick_test_type_id` varchar(32) NOT NULL COMMENT '实验类型 mes_xsl_rubber_quick_test_type.id', + `quick_test_type_name` varchar(128) DEFAULT NULL COMMENT '实验类型名称冗余', + `unit_type` varchar(64) DEFAULT NULL COMMENT '单位类型(手填)', + `point_desc` varchar(500) DEFAULT NULL COMMENT '描述', + `tenant_id` int DEFAULT NULL COMMENT '租户', + `sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门', + `create_by` varchar(32) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(32) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)', + PRIMARY KEY (`id`), + KEY `idx_mrqtdp_tenant_type` (`tenant_id`, `quick_test_type_id`), + UNIQUE KEY `uk_mrqtdp_tenant_name_del` (`tenant_id`, `point_name`, `del_flag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检数据点'; + +SET @mes_tenant_id = 1002; +SET @mes_quality_pid = IFNULL( + (SELECT `id` FROM `sys_permission` WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '质量管理' LIMIT 1), + '1860000000000000162' +); + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`) +VALUES ('1860000000000000170', @mes_quality_pid, '胶料快检数据点', '/xslmes/mesXslRubberQuickTestDataPoint', 'xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPointList', 'MesXslRubberQuickTestDataPointList', 1, NULL, '1', 2, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW()) +ON DUPLICATE KEY UPDATE +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`), +`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`), +`is_route` = VALUES(`is_route`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0, +`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`); + +UPDATE `sys_permission` SET `icon` = 'ant-design:dot-chart-outlined' WHERE `id` = '1860000000000000170' AND `del_flag` = 0; + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `is_leaf`, `status`, `del_flag`, `create_by`, `create_time`) VALUES +('1860000000000000171', '1860000000000000170', '新增', 2, 'mes:mes_xsl_rubber_quick_test_data_point:add', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000172', '1860000000000000170', '编辑', 2, 'mes:mes_xsl_rubber_quick_test_data_point:edit', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000173', '1860000000000000170', '删除', 2, 'mes:mes_xsl_rubber_quick_test_data_point:delete', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000174', '1860000000000000170', '批量删除', 2, 'mes:mes_xsl_rubber_quick_test_data_point:deleteBatch', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000175', '1860000000000000170', '导出', 2, 'mes:mes_xsl_rubber_quick_test_data_point:exportXls', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000176', '1860000000000000170', '导入', 2, 'mes:mes_xsl_rubber_quick_test_data_point:importExcel', '1', 1, '1', 0, 'admin', NOW()) +ON DUPLICATE KEY UPDATE +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), +`is_leaf` = 1, `status` = '1', `del_flag` = 0; + +INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`) +SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1' +FROM `sys_role` r +CROSS JOIN `sys_permission` p +WHERE r.`tenant_id` = @mes_tenant_id + AND r.`role_code` = 'admin' + AND p.`id` IN ( + '1860000000000000170', + '1860000000000000171', '1860000000000000172', '1860000000000000173', '1860000000000000174', + '1860000000000000175', '1860000000000000176' + ) + AND NOT EXISTS ( + SELECT 1 FROM `sys_role_permission` rp + WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id` + ); diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_102__mes_xsl_rubber_quick_test_method.sql b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_102__mes_xsl_rubber_quick_test_method.sql new file mode 100644 index 0000000..93e76a7 --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_102__mes_xsl_rubber_quick_test_method.sql @@ -0,0 +1,292 @@ +-- MES 胶料快检实验方法(主子表):字典 + 建表 + 菜单(质量管理下)+ 按钮 + 租户 admin 授权 + +-- 权限前缀:mes:mes_xsl_rubber_quick_test_method:* + +-- 菜单 ID 段 1860000000000000177(避免与数据点 170 段冲突) + +-- 依赖:mes_xsl_rubber_quick_test_type、mes_xsl_rubber_quick_test_data_point、质量管理目录 + +SET NAMES utf8mb4; + + + +INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`) + +SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检转子类型', 'xslmes_rubber_quick_test_rotor_type', '1大转子2小转子', 0, 'admin', NOW(), 0, 0 + +WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND `del_flag` = 0); + + + +INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`) + +SELECT REPLACE(UUID(), '-', ''), d.id, '大转子', '1', 1, 1, 'admin', NOW() FROM `sys_dict` d + +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '1'); + +INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`) + +SELECT REPLACE(UUID(), '-', ''), d.id, '小转子', '2', 2, 1, 'admin', NOW() FROM `sys_dict` d + +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '2'); + + + +INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`) + +SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检扭矩单位', 'xslmes_rubber_quick_test_torque_unit', 'Ib.in、dNm、kg.cm、Nm、mdm', 0, 'admin', NOW(), 0, 0 + +WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_torque_unit' AND `del_flag` = 0); + + + +INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`) + +SELECT REPLACE(UUID(), '-', ''), d.id, v.txt, v.val, v.ord, 1, 'admin', NOW() + +FROM `sys_dict` d + +CROSS JOIN ( + + SELECT 'Ib.in' AS txt, 'Ib.in' AS val, 1 AS ord UNION ALL + + SELECT 'dNm', 'dNm', 2 UNION ALL + + SELECT 'kg.cm', 'kg.cm', 3 UNION ALL + + SELECT 'Nm', 'Nm', 4 UNION ALL + + SELECT 'mdm', 'mdm', 5 + +) v + +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_torque_unit' + + AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = v.val); + + + +INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`) + +SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检时间单位', 'xslmes_rubber_quick_test_time_unit', 'sec、min、m:s', 0, 'admin', NOW(), 0, 0 + +WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_time_unit' AND `del_flag` = 0); + + + +INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`) + +SELECT REPLACE(UUID(), '-', ''), d.id, v.txt, v.val, v.ord, 1, 'admin', NOW() + +FROM `sys_dict` d + +CROSS JOIN ( + + SELECT 'sec' AS txt, 'sec' AS val, 1 AS ord UNION ALL + + SELECT 'min', 'min', 2 UNION ALL + + SELECT 'm:s', 'm:s', 3 + +) v + +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_time_unit' + + AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = v.val); + + + +INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`) + +SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检门尼单位', 'xslmes_rubber_quick_test_mooney_unit', 'MU', 0, 'admin', NOW(), 0, 0 + +WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_mooney_unit' AND `del_flag` = 0); + + + +INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`) + +SELECT REPLACE(UUID(), '-', ''), d.id, 'MU', 'MU', 1, 1, 'admin', NOW() FROM `sys_dict` d + +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_mooney_unit' + + AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'MU'); + + + +CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_method` ( + + `id` varchar(32) NOT NULL COMMENT '主键', + + `method_code` varchar(16) NOT NULL COMMENT '方法编号(租户内从001递增自动生成)', + + `method_name` varchar(128) NOT NULL COMMENT '实验方法名称(同租户未删除唯一)', + + `quick_test_type_id` varchar(32) NOT NULL COMMENT '实验类型 mes_xsl_rubber_quick_test_type.id', + + `quick_test_type_name` varchar(128) DEFAULT NULL COMMENT '实验类型名称冗余', + + `test_temp_c` decimal(12,2) DEFAULT NULL COMMENT '实验温度°C', + + `preheat_time_min` decimal(12,2) DEFAULT NULL COMMENT '预热时间min', + + `test_time_min` decimal(12,2) DEFAULT NULL COMMENT '实验时间min', + + `test_angle_deg` decimal(12,2) DEFAULT NULL COMMENT '实验角度Deg', + + `test_freq_hz` decimal(12,2) DEFAULT NULL COMMENT '实验频率Hz', + + `rotor_type` varchar(2) DEFAULT NULL COMMENT '转子类型(字典xslmes_rubber_quick_test_rotor_type:1大转子2小转子)', + + `rotor_speed_rpm` decimal(12,2) DEFAULT NULL COMMENT '转子速度rpm', + + `method_desc` varchar(500) DEFAULT NULL COMMENT '方法描述', + + `tenant_id` int DEFAULT NULL COMMENT '租户', + + `sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门', + + `create_by` varchar(32) DEFAULT NULL COMMENT '创建人', + + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + + `update_by` varchar(32) DEFAULT NULL COMMENT '更新人', + + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + + `del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)', + + PRIMARY KEY (`id`), + + KEY `idx_mrqtm_tenant_code` (`tenant_id`, `method_code`), + + KEY `idx_mrqtm_type` (`quick_test_type_id`), + + UNIQUE KEY `uk_mrqtm_tenant_name_del` (`tenant_id`, `method_name`, `del_flag`) + +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检实验方法'; + + + +CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_method_line` ( + + `id` varchar(32) NOT NULL COMMENT '主键', + + `method_id` varchar(32) NOT NULL COMMENT '主表 mes_xsl_rubber_quick_test_method.id', + + `data_point_id` varchar(32) NOT NULL COMMENT '数据点 mes_xsl_rubber_quick_test_data_point.id', + + `point_name` varchar(128) DEFAULT NULL COMMENT '数据点名称冗余(只读带出)', + + `unit_type` varchar(64) DEFAULT NULL COMMENT '单位类型冗余(只读带出)', + + `torque_unit_type` varchar(32) DEFAULT NULL COMMENT '扭矩单位类型(字典xslmes_rubber_quick_test_torque_unit)', + + `time_unit_type` varchar(32) DEFAULT NULL COMMENT '时间单位类型(字典xslmes_rubber_quick_test_time_unit)', + + `mooney_unit_type` varchar(32) DEFAULT NULL COMMENT '门尼单位类型(字典xslmes_rubber_quick_test_mooney_unit)', + + `sort_no` int DEFAULT NULL COMMENT '排序号', + + `create_by` varchar(32) DEFAULT NULL COMMENT '创建人', + + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + + `update_by` varchar(32) DEFAULT NULL COMMENT '更新人', + + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + + PRIMARY KEY (`id`), + + KEY `idx_mrqtml_method` (`method_id`), + + UNIQUE KEY `uk_mrqtml_method_point` (`method_id`, `data_point_id`) + +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检实验方法明细'; + + + +SET @mes_tenant_id = 1002; + +SET @mes_quality_pid = IFNULL( + + (SELECT `id` FROM `sys_permission` WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '质量管理' LIMIT 1), + + '1860000000000000162' + +); + + + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`) + +VALUES ('1860000000000000177', @mes_quality_pid, '胶料快检实验方法', '/xslmes/mesXslRubberQuickTestMethod', 'xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethodList', 'MesXslRubberQuickTestMethodList', 1, NULL, '1', 3, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW()) + +ON DUPLICATE KEY UPDATE + +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`), + +`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`), + +`is_route` = VALUES(`is_route`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0, + +`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`); + + + +UPDATE `sys_permission` SET `icon` = 'ant-design:profile-outlined' WHERE `id` = '1860000000000000177' AND `del_flag` = 0; + + + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `is_leaf`, `status`, `del_flag`, `create_by`, `create_time`) VALUES + +('1860000000000000178', '1860000000000000177', '新增', 2, 'mes:mes_xsl_rubber_quick_test_method:add', '1', 1, '1', 0, 'admin', NOW()), + +('1860000000000000179', '1860000000000000177', '编辑', 2, 'mes:mes_xsl_rubber_quick_test_method:edit', '1', 1, '1', 0, 'admin', NOW()), + +('1860000000000000180', '1860000000000000177', '删除', 2, 'mes:mes_xsl_rubber_quick_test_method:delete', '1', 1, '1', 0, 'admin', NOW()), + +('1860000000000000181', '1860000000000000177', '批量删除', 2, 'mes:mes_xsl_rubber_quick_test_method:deleteBatch', '1', 1, '1', 0, 'admin', NOW()), + +('1860000000000000182', '1860000000000000177', '导出', 2, 'mes:mes_xsl_rubber_quick_test_method:exportXls', '1', 1, '1', 0, 'admin', NOW()), + +('1860000000000000183', '1860000000000000177', '导入', 2, 'mes:mes_xsl_rubber_quick_test_method:importExcel', '1', 1, '1', 0, 'admin', NOW()) + +ON DUPLICATE KEY UPDATE + +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), + +`is_leaf` = 1, `status` = '1', `del_flag` = 0; + + + +INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`) + +SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1' + +FROM `sys_role` r + +CROSS JOIN `sys_permission` p + +WHERE r.`tenant_id` = @mes_tenant_id + + AND r.`role_code` = 'admin' + + AND p.`id` IN ( + + '1860000000000000177', + + '1860000000000000178', '1860000000000000179', '1860000000000000180', '1860000000000000181', + + '1860000000000000182', '1860000000000000183' + + ) + + AND NOT EXISTS ( + + SELECT 1 FROM `sys_role_permission` rp + + WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id` + + ); + diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_97__mes_xsl_rubber_quick_test_type.sql b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_97__mes_xsl_rubber_quick_test_type.sql new file mode 100644 index 0000000..d6e946d --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_97__mes_xsl_rubber_quick_test_type.sql @@ -0,0 +1,86 @@ +-- MES 胶料快检实验类型:建表 + 质量管理目录 + 子菜单 + 按钮 + 租户 admin 授权 +-- 权限前缀:mes:mes_xsl_rubber_quick_test_type:* +SET NAMES utf8mb4; + +CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_type` ( + `id` varchar(32) NOT NULL COMMENT '主键', + `type_code` varchar(16) NOT NULL COMMENT '实验类型编号(租户内从001递增自动生成)', + `type_name` varchar(128) NOT NULL COMMENT '实验类型名称', + `tenant_id` int DEFAULT NULL COMMENT '租户', + `sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门', + `create_by` varchar(32) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(32) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)', + PRIMARY KEY (`id`), + KEY `idx_mrqtt_tenant_code` (`tenant_id`, `type_code`), + KEY `idx_mrqtt_tenant_name` (`tenant_id`, `type_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检实验类型'; + +SET @mes_tenant_id = 1002; + +SET @mes_root_parent = ( + SELECT `parent_id` FROM `sys_permission` + WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES基础资料' + LIMIT 1 +); +SET @mes_root_parent = IFNULL(@mes_root_parent, ( + SELECT `parent_id` FROM `sys_permission` + WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES资料' + LIMIT 1 +)); +SET @mes_root_parent = IFNULL(@mes_root_parent, '1860000000000000001'); + +SET @mes_quality_sort = IFNULL(( + SELECT `sort_no` + 1 FROM `sys_permission` + WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料', '设备管理') + ORDER BY `sort_no` DESC + LIMIT 1 +), 52); + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`) +VALUES ('1860000000000000162', @mes_root_parent, '质量管理', '/xslmes/quality', 'layouts/RouteView', 'MesQualityLayout', 0, NULL, '1', @mes_quality_sort, 1, 0, 0, '1', 0, 0, 0, 'admin', NOW()) +ON DUPLICATE KEY UPDATE +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), +`menu_type` = VALUES(`menu_type`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0; + +UPDATE `sys_permission` SET `icon` = 'ant-design:safety-certificate-outlined' WHERE `id` = '1860000000000000162' AND `del_flag` = 0; + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`) +VALUES ('1860000000000000163', '1860000000000000162', '胶料快检实验类型', '/xslmes/mesXslRubberQuickTestType', 'xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestTypeList', 'MesXslRubberQuickTestTypeList', 1, NULL, '1', 1, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW()) +ON DUPLICATE KEY UPDATE +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`), +`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`), +`is_route` = VALUES(`is_route`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0, +`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`); + +UPDATE `sys_permission` SET `icon` = 'ant-design:experiment-outlined' WHERE `id` = '1860000000000000163' AND `del_flag` = 0; + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `is_leaf`, `status`, `del_flag`, `create_by`, `create_time`) VALUES +('1860000000000000164', '1860000000000000163', '新增', 2, 'mes:mes_xsl_rubber_quick_test_type:add', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000165', '1860000000000000163', '编辑', 2, 'mes:mes_xsl_rubber_quick_test_type:edit', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000166', '1860000000000000163', '删除', 2, 'mes:mes_xsl_rubber_quick_test_type:delete', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000167', '1860000000000000163', '批量删除', 2, 'mes:mes_xsl_rubber_quick_test_type:deleteBatch', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000168', '1860000000000000163', '导出', 2, 'mes:mes_xsl_rubber_quick_test_type:exportXls', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000169', '1860000000000000163', '导入', 2, 'mes:mes_xsl_rubber_quick_test_type:importExcel', '1', 1, '1', 0, 'admin', NOW()) +ON DUPLICATE KEY UPDATE +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), +`is_leaf` = 1, `status` = '1', `del_flag` = 0; + +INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`) +SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1' +FROM `sys_role` r +CROSS JOIN `sys_permission` p +WHERE r.`tenant_id` = @mes_tenant_id + AND r.`role_code` = 'admin' + AND p.`id` IN ( + '1860000000000000162', + '1860000000000000163', + '1860000000000000164', '1860000000000000165', '1860000000000000166', '1860000000000000167', + '1860000000000000168', '1860000000000000169' + ) + AND NOT EXISTS ( + SELECT 1 FROM `sys_role_permission` rp + WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id` + ); diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_98__mes_xsl_rubber_quick_test_type_name_unique.sql b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_98__mes_xsl_rubber_quick_test_type_name_unique.sql new file mode 100644 index 0000000..4f7007a --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_98__mes_xsl_rubber_quick_test_type_name_unique.sql @@ -0,0 +1,20 @@ +-- 胶料快检实验类型:同租户未删除数据实验类型名称唯一(del_flag 参与唯一键,逻辑删除后可复用名称) +SET NAMES utf8mb4; + +SET @idx_exists = ( + SELECT COUNT(1) + FROM information_schema.statistics + WHERE table_schema = DATABASE() + AND table_name = 'mes_xsl_rubber_quick_test_type' + AND index_name = 'uk_mrqtt_tenant_name_del' +); + +SET @ddl = IF( + @idx_exists = 0, + 'ALTER TABLE `mes_xsl_rubber_quick_test_type` ADD UNIQUE KEY `uk_mrqtt_tenant_name_del` (`tenant_id`, `type_name`, `del_flag`)', + 'SELECT 1' +); + +PREPARE stmt FROM @ddl; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_99__mes_xsl_rubber_quick_test_method.sql b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_99__mes_xsl_rubber_quick_test_method.sql new file mode 100644 index 0000000..7a7057b --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_99__mes_xsl_rubber_quick_test_method.sql @@ -0,0 +1,85 @@ +-- MES 胶料快检实验方法:字典 + 建表 + 菜单(质量管理下)+ 按钮 + 租户 admin 授权 +-- 权限前缀:mes:mes_xsl_rubber_quick_test_method:* +-- 依赖:mes_xsl_rubber_quick_test_type、质量管理目录 id 1860000000000000162 +SET NAMES utf8mb4; + +INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`) +SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检转子类型', 'xslmes_rubber_quick_test_rotor_type', '1大转子2小转子', 0, 'admin', NOW(), 0, 0 +WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND `del_flag` = 0); + +INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`) +SELECT REPLACE(UUID(), '-', ''), d.id, '大转子', '1', 1, 1, 'admin', NOW() FROM `sys_dict` d +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '1'); +INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`) +SELECT REPLACE(UUID(), '-', ''), d.id, '小转子', '2', 2, 1, 'admin', NOW() FROM `sys_dict` d +WHERE d.`dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '2'); + +CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_method` ( + `id` varchar(32) NOT NULL COMMENT '主键', + `method_code` varchar(16) NOT NULL COMMENT '方法编号(租户内从001递增自动生成)', + `method_name` varchar(128) NOT NULL COMMENT '实验方法名称(同租户未删除唯一)', + `quick_test_type_id` varchar(32) NOT NULL COMMENT '实验类型 mes_xsl_rubber_quick_test_type.id', + `quick_test_type_name` varchar(128) DEFAULT NULL COMMENT '实验类型名称冗余', + `test_temp_c` decimal(12,2) DEFAULT NULL COMMENT '实验温度°C', + `preheat_time_min` decimal(12,2) DEFAULT NULL COMMENT '预热时间min', + `test_time_min` decimal(12,2) DEFAULT NULL COMMENT '实验时间min', + `test_angle_deg` decimal(12,2) DEFAULT NULL COMMENT '实验角度Deg', + `test_freq_hz` decimal(12,2) DEFAULT NULL COMMENT '实验频率Hz', + `rotor_type` varchar(2) DEFAULT NULL COMMENT '转子类型(字典xslmes_rubber_quick_test_rotor_type:1大转子2小转子)', + `rotor_speed_rpm` decimal(12,2) DEFAULT NULL COMMENT '转子速度rpm', + `method_desc` varchar(500) DEFAULT NULL COMMENT '方法描述', + `tenant_id` int DEFAULT NULL COMMENT '租户', + `sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门', + `create_by` varchar(32) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(32) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)', + PRIMARY KEY (`id`), + KEY `idx_mrqtm_tenant_code` (`tenant_id`, `method_code`), + KEY `idx_mrqtm_type` (`quick_test_type_id`), + UNIQUE KEY `uk_mrqtm_tenant_name_del` (`tenant_id`, `method_name`, `del_flag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检实验方法'; + +SET @mes_tenant_id = 1002; +SET @mes_quality_pid = IFNULL( + (SELECT `id` FROM `sys_permission` WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '质量管理' LIMIT 1), + '1860000000000000162' +); + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`) +VALUES ('1860000000000000170', @mes_quality_pid, '胶料快检实验方法', '/xslmes/mesXslRubberQuickTestMethod', 'xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethodList', 'MesXslRubberQuickTestMethodList', 1, NULL, '1', 2, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW()) +ON DUPLICATE KEY UPDATE +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`), +`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`), +`is_route` = VALUES(`is_route`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0, +`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`); + +UPDATE `sys_permission` SET `icon` = 'ant-design:profile-outlined' WHERE `id` = '1860000000000000170' AND `del_flag` = 0; + +INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `is_leaf`, `status`, `del_flag`, `create_by`, `create_time`) VALUES +('1860000000000000171', '1860000000000000170', '新增', 2, 'mes:mes_xsl_rubber_quick_test_method:add', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000172', '1860000000000000170', '编辑', 2, 'mes:mes_xsl_rubber_quick_test_method:edit', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000173', '1860000000000000170', '删除', 2, 'mes:mes_xsl_rubber_quick_test_method:delete', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000174', '1860000000000000170', '批量删除', 2, 'mes:mes_xsl_rubber_quick_test_method:deleteBatch', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000175', '1860000000000000170', '导出', 2, 'mes:mes_xsl_rubber_quick_test_method:exportXls', '1', 1, '1', 0, 'admin', NOW()), +('1860000000000000176', '1860000000000000170', '导入', 2, 'mes:mes_xsl_rubber_quick_test_method:importExcel', '1', 1, '1', 0, 'admin', NOW()) +ON DUPLICATE KEY UPDATE +`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), +`is_leaf` = 1, `status` = '1', `del_flag` = 0; + +INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`) +SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1' +FROM `sys_role` r +CROSS JOIN `sys_permission` p +WHERE r.`tenant_id` = @mes_tenant_id + AND r.`role_code` = 'admin' + AND p.`id` IN ( + '1860000000000000170', + '1860000000000000171', '1860000000000000172', '1860000000000000173', '1860000000000000174', + '1860000000000000175', '1860000000000000176' + ) + AND NOT EXISTS ( + SELECT 1 FROM `sys_role_permission` rp + WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id` + ); diff --git a/jeecgboot-vue3/src/components/jeecg/JVxeTable/src/components/cells/JVxeSelectCell.vue b/jeecgboot-vue3/src/components/jeecg/JVxeTable/src/components/cells/JVxeSelectCell.vue index 251acd6..cdea8b2 100644 --- a/jeecgboot-vue3/src/components/jeecg/JVxeTable/src/components/cells/JVxeSelectCell.vue +++ b/jeecgboot-vue3/src/components/jeecg/JVxeTable/src/components/cells/JVxeSelectCell.vue @@ -34,7 +34,7 @@ const selectProps = computed(() => { let selProps = { ...cellProps.value, - allowClear: true, + allowClear: originColumn.value?.allowClear !== false, autofocus: true, defaultOpen: !scrolling.value, style: { width: '100%' }, diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPoint.api.ts b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPoint.api.ts new file mode 100644 index 0000000..2f5e8dc --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPoint.api.ts @@ -0,0 +1,58 @@ +import { defHttp } from '/@/utils/http/axios'; +import { useMessage } from '/@/hooks/web/useMessage'; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/xslmes/mesXslRubberQuickTestDataPoint/list', + checkPointName = '/xslmes/mesXslRubberQuickTestDataPoint/checkPointName', + save = '/xslmes/mesXslRubberQuickTestDataPoint/add', + edit = '/xslmes/mesXslRubberQuickTestDataPoint/edit', + deleteOne = '/xslmes/mesXslRubberQuickTestDataPoint/delete', + deleteBatch = '/xslmes/mesXslRubberQuickTestDataPoint/deleteBatch', + importExcel = '/xslmes/mesXslRubberQuickTestDataPoint/importExcel', + exportXls = '/xslmes/mesXslRubberQuickTestDataPoint/exportXls', + queryById = '/xslmes/mesXslRubberQuickTestDataPoint/queryById', +} + +export const getExportUrl = Api.exportXls; +export const getImportUrl = Api.importExcel; + +export const list = (params) => defHttp.get({ url: Api.list, params }); + +export const queryById = (params: { id: string }) => defHttp.get({ url: Api.queryById, params }); + +export const checkPointName = (params: { pointName: string; dataId?: string }) => + defHttp.get( + { url: Api.checkPointName, params }, + { + successMessageMode: 'none', + errorMessageMode: 'none', + }, + ); + +export const deleteOne = (params, handleSuccess) => { + return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); +}; + +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); + }, + }); +}; + +export const saveOrUpdate = (params, isUpdate) => { + const url = isUpdate ? Api.edit : Api.save; + return defHttp.post({ url, params }); +}; diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPoint.data.ts b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPoint.data.ts new file mode 100644 index 0000000..f0696f4 --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPoint.data.ts @@ -0,0 +1,85 @@ +import { BasicColumn, FormSchema } from '/@/components/Table'; +import { checkPointName } from './MesXslRubberQuickTestDataPoint.api'; + +export const columns: BasicColumn[] = [ + { title: '数据点名称', align: 'center', dataIndex: 'pointName', width: 160 }, + { title: '实验类型', align: 'center', dataIndex: 'quickTestTypeName', width: 140 }, + { title: '单位类型', align: 'center', dataIndex: 'unitType', width: 120 }, + { title: '描述', align: 'center', dataIndex: 'pointDesc', width: 200, ellipsis: true }, + { title: '创建人', align: 'center', dataIndex: 'createBy', width: 100, defaultHidden: true }, + { + title: '创建时间', + align: 'center', + dataIndex: 'createTime', + width: 165, + defaultHidden: true, + customRender: ({ text }) => (!text ? '' : String(text).length > 19 ? String(text).substring(0, 19) : text), + }, +]; + +export const searchFormSchema: FormSchema[] = [ + { label: '数据点名称', field: 'pointName', component: 'Input', colProps: { span: 6 } }, + { + label: '实验类型', + field: 'quickTestTypeId', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'mes_xsl_rubber_quick_test_type,type_name,id', + placeholder: '请选择实验类型', + }, + colProps: { span: 6 }, + }, + { label: '单位类型', field: 'unitType', component: 'Input', colProps: { span: 6 } }, +]; + +export const formSchema: FormSchema[] = [ + { label: '', field: 'id', component: 'Input', show: false }, + { + label: '数据点名称', + field: 'pointName', + component: 'Input', + required: true, + componentProps: { placeholder: '同租户内不可重复' }, + dynamicRules: ({ model }) => [ + { required: true, message: '请输入数据点名称' }, + { + validator: async (_rule, value) => { + const v = value == null ? '' : String(value).trim(); + if (!v) { + return Promise.resolve(); + } + try { + await checkPointName({ pointName: v, dataId: model?.id }); + return Promise.resolve(); + } catch (e: any) { + const msg = e?.response?.data?.message || e?.message || '数据点名称已存在'; + return Promise.reject(msg); + } + }, + trigger: ['blur', 'change'], + }, + ], + }, + { + label: '实验类型', + field: 'quickTestTypeId', + component: 'JDictSelectTag', + required: true, + componentProps: { + dictCode: 'mes_xsl_rubber_quick_test_type,type_name,id', + placeholder: '请选择系统维护的实验类型', + }, + }, + { + label: '单位类型', + field: 'unitType', + component: 'Input', + componentProps: { placeholder: '请手填单位类型,如 mm、MPa、%' }, + }, + { + label: '描述', + field: 'pointDesc', + component: 'InputTextArea', + componentProps: { rows: 3, placeholder: '请输入描述' }, + }, +]; diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPointList.vue b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPointList.vue new file mode 100644 index 0000000..d5fdceb --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPointList.vue @@ -0,0 +1,136 @@ + + + diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/components/MesXslRubberQuickTestDataPointModal.vue b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/components/MesXslRubberQuickTestDataPointModal.vue new file mode 100644 index 0000000..2115134 --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/components/MesXslRubberQuickTestDataPointModal.vue @@ -0,0 +1,50 @@ + + + diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.api.ts b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.api.ts new file mode 100644 index 0000000..8318d6f --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.api.ts @@ -0,0 +1,128 @@ +import { defHttp } from '/@/utils/http/axios'; + +import { useMessage } from '/@/hooks/web/useMessage'; + + + +const { createConfirm } = useMessage(); + + + +enum Api { + + list = '/xslmes/mesXslRubberQuickTestMethod/list', + + nextMethodCode = '/xslmes/mesXslRubberQuickTestMethod/nextMethodCode', + + checkMethodName = '/xslmes/mesXslRubberQuickTestMethod/checkMethodName', + + save = '/xslmes/mesXslRubberQuickTestMethod/add', + + edit = '/xslmes/mesXslRubberQuickTestMethod/edit', + + deleteOne = '/xslmes/mesXslRubberQuickTestMethod/delete', + + deleteBatch = '/xslmes/mesXslRubberQuickTestMethod/deleteBatch', + + importExcel = '/xslmes/mesXslRubberQuickTestMethod/importExcel', + + exportXls = '/xslmes/mesXslRubberQuickTestMethod/exportXls', + + queryById = '/xslmes/mesXslRubberQuickTestMethod/queryById', + + queryLineList = '/xslmes/mesXslRubberQuickTestMethod/queryLineListByMethodId', + +} + + + +export const getExportUrl = Api.exportXls; + +export const getImportUrl = Api.importExcel; + + + +export const list = (params) => defHttp.get({ url: Api.list, params }); + + + +export const queryById = (params: { id: string }) => defHttp.get({ url: Api.queryById, params }); + + + +export const queryLineListByMethodId = (params: { id: string }) => defHttp.get({ url: Api.queryLineList, params }); + + + +export const fetchNextMethodCode = () => defHttp.get({ url: Api.nextMethodCode }, { successMessageMode: 'none' }); + + + +export const checkMethodName = (params: { methodName: string; dataId?: string }) => + + defHttp.get( + + { url: Api.checkMethodName, params }, + + { + + successMessageMode: 'none', + + errorMessageMode: 'none', + + }, + + ); + + + +export const deleteOne = (params, handleSuccess) => { + + return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => { + + handleSuccess(); + + }); + +}; + + + +export const batchDelete = (params, handleSuccess) => { + + createConfirm({ + + iconType: 'warning', + + title: '确认删除', + + content: '是否删除选中数据', + + okText: '确认', + + cancelText: '取消', + + onOk: () => { + + return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => { + + handleSuccess(); + + }); + + }, + + }); + +}; + + + +export const saveOrUpdate = (params, isUpdate) => { + + const url = isUpdate ? Api.edit : Api.save; + + return defHttp.post({ url, params }); + +}; + diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.data.ts b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.data.ts new file mode 100644 index 0000000..5d73bba --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.data.ts @@ -0,0 +1,364 @@ +import { BasicColumn, FormSchema } from '/@/components/Table'; + +import { JVxeColumn, JVxeTypes } from '/@/components/jeecg/JVxeTable/types'; + +import { checkMethodName } from './MesXslRubberQuickTestMethod.api'; + + + +export const columns: BasicColumn[] = [ + + { title: '方法编号', align: 'center', dataIndex: 'methodCode', width: 100 }, + + { title: '实验方法名称', align: 'center', dataIndex: 'methodName', width: 180 }, + + { title: '实验类型', align: 'center', dataIndex: 'quickTestTypeName', width: 140 }, + + { title: '实验温度°C', align: 'center', dataIndex: 'testTempC', width: 110 }, + + { title: '预热时间min', align: 'center', dataIndex: 'preheatTimeMin', width: 110 }, + + { title: '实验时间min', align: 'center', dataIndex: 'testTimeMin', width: 110 }, + + { title: '转子类型', align: 'center', dataIndex: 'rotorType_dictText', width: 90 }, + + { title: '创建人', align: 'center', dataIndex: 'createBy', width: 100 }, + + { + + title: '创建时间', + + align: 'center', + + dataIndex: 'createTime', + + width: 165, + + customRender: ({ text }) => (!text ? '' : String(text).length > 19 ? String(text).substring(0, 19) : text), + + }, + +]; + + + +export const searchFormSchema: FormSchema[] = [ + + { label: '方法编号', field: 'methodCode', component: 'Input', colProps: { span: 6 } }, + + { label: '实验方法名称', field: 'methodName', component: 'Input', colProps: { span: 6 } }, + + { + + label: '实验类型', + + field: 'quickTestTypeId', + + component: 'JSearchSelect', + + componentProps: { + + dict: 'mes_xsl_rubber_quick_test_type,type_name,id', + + async: true, + + }, + + colProps: { span: 6 }, + + }, + +]; + + + +export const formSchema: FormSchema[] = [ + + { label: '', field: 'id', component: 'Input', show: false }, + + { + + label: '方法编号', + + field: 'methodCode', + + component: 'Input', + + componentProps: { readonly: true, placeholder: '保存时从001起自动生成' }, + + }, + + { + + label: '实验方法名称', + + field: 'methodName', + + component: 'Input', + + required: true, + + componentProps: { placeholder: '同租户内不可重复' }, + + dynamicRules: ({ model }) => [ + + { required: true, message: '请输入实验方法名称' }, + + { + + validator: async (_rule, value) => { + + const v = value == null ? '' : String(value).trim(); + + if (!v) { + + return Promise.resolve(); + + } + + try { + + await checkMethodName({ methodName: v, dataId: model?.id }); + + return Promise.resolve(); + + } catch (e: any) { + + const msg = e?.response?.data?.message || e?.message || '实验方法名称已存在'; + + return Promise.reject(msg); + + } + + }, + + trigger: ['blur', 'change'], + + }, + + ], + + }, + + { + + label: '实验类型', + + field: 'quickTestTypeId', + + component: 'JSearchSelect', + + required: true, + + componentProps: { + + dict: 'mes_xsl_rubber_quick_test_type,type_name,id', + + async: true, + + placeholder: '请选择实验类型', + + }, + + }, + + { label: '', field: 'quickTestTypeName', component: 'Input', show: false }, + + { + + label: '实验温度°C', + + field: 'testTempC', + + component: 'InputNumber', + + componentProps: { style: { width: '100%' }, precision: 2 }, + + }, + + { + + label: '预热时间min', + + field: 'preheatTimeMin', + + component: 'InputNumber', + + componentProps: { style: { width: '100%' }, precision: 2, min: 0 }, + + }, + + { + + label: '实验时间min', + + field: 'testTimeMin', + + component: 'InputNumber', + + componentProps: { style: { width: '100%' }, precision: 2, min: 0 }, + + }, + + { + + label: '实验角度Deg', + + field: 'testAngleDeg', + + component: 'InputNumber', + + componentProps: { style: { width: '100%' }, precision: 2 }, + + }, + + { + + label: '实验频率Hz', + + field: 'testFreqHz', + + component: 'InputNumber', + + componentProps: { style: { width: '100%' }, precision: 2, min: 0 }, + + }, + + { + + label: '转子类型', + + field: 'rotorType', + + component: 'JDictSelectTag', + + componentProps: { dictCode: 'xslmes_rubber_quick_test_rotor_type', placeholder: '大转子/小转子' }, + + }, + + { + + label: '转子速度rpm', + + field: 'rotorSpeedRpm', + + component: 'InputNumber', + + componentProps: { style: { width: '100%' }, precision: 2, min: 0 }, + + }, + + { + + label: '方法描述', + + field: 'methodDesc', + + component: 'InputTextArea', + + colProps: { span: 24 }, + + componentProps: { rows: 3, maxlength: 500 }, + + }, + +]; + + + +/** 明细行单位字典编码(与 Flyway / sys_dict 一致) */ +export const LINE_UNIT_DICT_CODES = { + torque: 'xslmes_rubber_quick_test_torque_unit', + time: 'xslmes_rubber_quick_test_time_unit', + mooney: 'xslmes_rubber_quick_test_mooney_unit', +} as const; + +/** 字典未加载时的兜底默认值(与字典 sort_order 首项一致) */ +export const LINE_UNIT_DICT_FALLBACK = { + torqueUnitType: 'Ib.in', + timeUnitType: 'sec', + mooneyUnitType: 'MU', +}; + +/** 取字典排序后的第一项 value */ +export function pickFirstDictItemValue(items: Recordable[] | null | undefined): string | undefined { + if (!items?.length) { + return undefined; + } + const sorted = [...items].sort( + (a, b) => Number(a.sortOrder ?? a.sort ?? 0) - Number(b.sortOrder ?? b.sort ?? 0), + ); + const v = sorted[0]?.value; + return v != null && String(v) !== '' ? String(v) : undefined; +} + +export const lineJVxeColumns: JVxeColumn[] = [ + + { title: '', key: 'dataPointId', type: JVxeTypes.hidden }, + + { title: '数据点', key: 'pointName', type: JVxeTypes.normal, width: 160, disabled: true }, + + { title: '单位类型', key: 'unitType', type: JVxeTypes.normal, width: 120, disabled: true }, + + { + + title: '扭矩单位类型', + + key: 'torqueUnitType', + + type: JVxeTypes.select, + + width: 130, + + dictCode: 'xslmes_rubber_quick_test_torque_unit', + + allowClear: false, + + placeholder: '请选择', + + validateRules: [{ required: true, message: '${title}不能为空' }], + + }, + + { + + title: '时间单位类型', + + key: 'timeUnitType', + + type: JVxeTypes.select, + + width: 120, + + dictCode: 'xslmes_rubber_quick_test_time_unit', + + allowClear: false, + + placeholder: '请选择', + + validateRules: [{ required: true, message: '${title}不能为空' }], + + }, + + { + + title: '门尼单位类型', + + key: 'mooneyUnitType', + + type: JVxeTypes.select, + + width: 120, + + dictCode: 'xslmes_rubber_quick_test_mooney_unit', + + allowClear: false, + + placeholder: '请选择', + + validateRules: [{ required: true, message: '${title}不能为空' }], + + }, + +]; + diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethodList.vue b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethodList.vue new file mode 100644 index 0000000..e19e4fe --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethodList.vue @@ -0,0 +1,272 @@ + + + + + + diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestDataPointSelectModal.vue b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestDataPointSelectModal.vue new file mode 100644 index 0000000..efd5c5a --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestDataPointSelectModal.vue @@ -0,0 +1,156 @@ + + + + + + diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestMethodModal.vue b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestMethodModal.vue new file mode 100644 index 0000000..0f24188 --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestMethodModal.vue @@ -0,0 +1,478 @@ + + + + + + diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.api.ts b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.api.ts new file mode 100644 index 0000000..d032251 --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.api.ts @@ -0,0 +1,61 @@ +import { defHttp } from '/@/utils/http/axios'; +import { useMessage } from '/@/hooks/web/useMessage'; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/xslmes/mesXslRubberQuickTestType/list', + nextTypeCode = '/xslmes/mesXslRubberQuickTestType/nextTypeCode', + checkTypeName = '/xslmes/mesXslRubberQuickTestType/checkTypeName', + save = '/xslmes/mesXslRubberQuickTestType/add', + edit = '/xslmes/mesXslRubberQuickTestType/edit', + deleteOne = '/xslmes/mesXslRubberQuickTestType/delete', + deleteBatch = '/xslmes/mesXslRubberQuickTestType/deleteBatch', + importExcel = '/xslmes/mesXslRubberQuickTestType/importExcel', + exportXls = '/xslmes/mesXslRubberQuickTestType/exportXls', + queryById = '/xslmes/mesXslRubberQuickTestType/queryById', +} + +export const getExportUrl = Api.exportXls; +export const getImportUrl = Api.importExcel; + +export const list = (params) => defHttp.get({ url: Api.list, params }); + +export const queryById = (params: { id: string }) => defHttp.get({ url: Api.queryById, params }); + +export const fetchNextTypeCode = () => defHttp.get({ url: Api.nextTypeCode }, { successMessageMode: 'none' }); + +export const checkTypeName = (params: { typeName: string; dataId?: string }) => + defHttp.get( + { url: Api.checkTypeName, params }, + { + successMessageMode: 'none', + errorMessageMode: 'none', + }, + ); + +export const deleteOne = (params, handleSuccess) => { + return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); +}; + +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); + }, + }); +}; + +export const saveOrUpdate = (params, isUpdate) => { + const url = isUpdate ? Api.edit : Api.save; + return defHttp.post({ url, params }); +}; diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.data.ts b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.data.ts new file mode 100644 index 0000000..2684eb5 --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.data.ts @@ -0,0 +1,64 @@ +import { BasicColumn, FormSchema } from '/@/components/Table'; +import { checkTypeName } from './MesXslRubberQuickTestType.api'; + +export const columns: BasicColumn[] = [ + { title: '实验类型编号', align: 'center', dataIndex: 'typeCode', width: 120 }, + { title: '实验类型名称', align: 'center', dataIndex: 'typeName', width: 200 }, + { title: '创建人', align: 'center', dataIndex: 'createBy', width: 100 }, + { + title: '创建时间', + align: 'center', + dataIndex: 'createTime', + width: 165, + customRender: ({ text }) => (!text ? '' : String(text).length > 19 ? String(text).substring(0, 19) : text), + }, + { title: '修改人', align: 'center', dataIndex: 'updateBy', width: 100 }, + { + title: '修改时间', + align: 'center', + dataIndex: 'updateTime', + width: 165, + customRender: ({ text }) => (!text ? '' : String(text).length > 19 ? String(text).substring(0, 19) : text), + }, +]; + +export const searchFormSchema: FormSchema[] = [ + { label: '实验类型编号', field: 'typeCode', component: 'Input', colProps: { span: 6 } }, + { label: '实验类型名称', field: 'typeName', component: 'Input', colProps: { span: 6 } }, +]; + +export const formSchema: FormSchema[] = [ + { label: '', field: 'id', component: 'Input', show: false }, + { + label: '实验类型编号', + field: 'typeCode', + component: 'Input', + componentProps: { readonly: true, placeholder: '保存时从001起自动生成' }, + }, + { + label: '实验类型名称', + field: 'typeName', + component: 'Input', + required: true, + componentProps: { placeholder: '同租户内不可重复' }, + dynamicRules: ({ model }) => [ + { required: true, message: '请输入实验类型名称' }, + { + validator: async (_rule, value) => { + const v = value == null ? '' : String(value).trim(); + if (!v) { + return Promise.resolve(); + } + try { + await checkTypeName({ typeName: v, dataId: model?.id }); + return Promise.resolve(); + } catch (e: any) { + const msg = e?.response?.data?.message || e?.message || '实验类型名称已存在'; + return Promise.reject(msg); + } + }, + trigger: ['blur', 'change'], + }, + ], + }, +]; diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestTypeList.vue b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestTypeList.vue new file mode 100644 index 0000000..aa863c4 --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestTypeList.vue @@ -0,0 +1,136 @@ + + + diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/components/MesXslRubberQuickTestTypeModal.vue b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/components/MesXslRubberQuickTestTypeModal.vue new file mode 100644 index 0000000..96cc3d9 --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/components/MesXslRubberQuickTestTypeModal.vue @@ -0,0 +1,57 @@ + + +