22 Commits

Author SHA1 Message Date
874e513c90 Merge branch 'main' of http://27.223.88.102:33000/chenx/qhmes 2026-05-21 10:04:24 +08:00
e678276aba 密炼机动作维护、日罐物料对应关系 2026-05-21 10:04:06 +08:00
geht
a10aae420a 更新胶料信息处理逻辑,优化字段描述及数据验证,增强系统稳定性和用户体验。 2026-05-20 19:06:58 +08:00
geht
9f37292eea 更新胶料编码为胶料别名,调整相关字段和描述,新增数据库字段以支持胶料信息补全 2026-05-20 16:12:38 +08:00
geht
1a4027086c Merge branch 'main' into 20260519-3.9.2版本-葛昊天分支 2026-05-20 15:59:44 +08:00
geht
031725de7e 新增MES密炼物料替代对应关系及开炼机参数维护模块,包括相关实体、控制器、服务和映射器的实现,支持增删改查及数据验证功能。 2026-05-20 15:56:27 +08:00
09c58f80eb 胶料信息更换分类字典 2026-05-20 15:55:54 +08:00
geht
cd3194d1a6 Merge remote-tracking branch 'origin/main' into 20260519-3.9.2版本-葛昊天分支 2026-05-20 15:49:36 +08:00
0e6eba8cf4 Merge branch 'main' of http://27.223.88.102:33000/chenx/qhmes 2026-05-20 15:30:46 +08:00
34b6ed4478 胶料信息 2026-05-20 15:30:42 +08:00
geht
27c2ed898c 添加兼容旧库的桌面端登录设置配置项,确保在缺失时自动补全相关 sys_config 项 2026-05-20 12:29:10 +08:00
geht
e5e8341b3e 修正日志输出中的访问URL提示信息,去掉多余的冒号以提高可读性。 2026-05-20 11:59:21 +08:00
geht
39c990b2ae 修正日志输出中的访问URL提示信息,调整标点符号以提高可读性。 2026-05-20 11:58:43 +08:00
b86c94add9 Merge remote-tracking branch 'origin/main' into 生产及设备基础资料 2026-05-20 11:35:54 +08:00
84286a6769 配置地址 2026-05-20 11:29:52 +08:00
9fe1da209d 点检及保养项目新增 2026-05-19 15:20:51 +08:00
geht
ddc10cf7ea 桌面端打包,降低版本。 2026-05-19 14:13:32 +08:00
d57cb6cb8c eclipse文件隐藏 2026-05-19 12:01:13 +08:00
geht
be169ed131 Update VSCode configuration, enhance Java project settings, and modify application properties for improved logging and encoding support 2026-05-19 11:22:53 +08:00
geht
500de8961d Merge branch '升级分支' 2026-05-19 10:23:33 +08:00
e0833d3cbd Merge branch '生产及设备基础资料' 2026-05-19 10:17:03 +08:00
34009b8900 设备管理基础资料准备 2026-05-18 16:36:04 +08:00
138 changed files with 9180 additions and 146 deletions

10
.gitignore vendored
View File

@@ -1,10 +1,20 @@
## ide
**/.idea
**/.project
**/.classpath
**/.factorypath
**/.settings/
*.iml
rebel.xml
.project
.classpath
.settings/
.factorypath
**/.settings/
## backend
**/target
**/bin/
**/logs
## front

24
.vscode/launch.json vendored
View File

@@ -1,12 +1,14 @@
{
"configurations": [
{
"type": "java",
"name": "JeecgSystemApplication",
"request": "launch",
"mainClass": "org.jeecg.JeecgSystemApplication",
"projectName": "jeecg-system-start",
"preLaunchTask": "JeecgBoot: compile"
}
]
}
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "JeecgSystemApplication (单体)",
"request": "launch",
"mainClass": "org.jeecg.JeecgSystemApplication",
"projectName": "jeecg-system-start",
"cwd": "${workspaceFolder}/jeecg-boot/jeecg-module-system/jeecg-system-start",
"vmArgs": "-Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8"
}
]
}

18
.vscode/settings.json vendored
View File

@@ -11,5 +11,21 @@
"path": "C:\\Program Files\\Java\\jdk-17",
"default": true
}
]
],
"java.import.exclusions": [
"**/jeecg-server-cloud/**",
"**/jeecg-boot-platform/**",
"**/node_modules/**",
"**/.metadata/**",
"**/archetype-resources/**",
"**/META-INF/maven/**"
],
"java.project.resourceFilters": [
"node_modules",
".git",
"jeecg-server-cloud",
"jeecg-boot-platform"
],
"java.debug.settings.console": "integratedTerminal",
"java.debug.settings.vmArgs": "-Dspring.main.banner-mode=log -Dspring.banner.charset=UTF-8 -Dlogging.charset.console=GBK"
}

View File

@@ -2,6 +2,12 @@
**/.idea
*.iml
rebel.xml
# VS Code/Cursor Java 扩展Eclipse JDT导入 Maven 时自动生成,勿提交
.project
.classpath
.settings/
.factorypath
**/.settings/
## backend
**/target

14
jeecg-boot/.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,14 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "JeecgSystemApplication (单体)",
"request": "launch",
"mainClass": "org.jeecg.JeecgSystemApplication",
"projectName": "jeecg-system-start",
"cwd": "${workspaceFolder}/jeecg-module-system/jeecg-system-start",
"vmArgs": "-Dspring.main.banner-mode=log -Dspring.banner.charset=UTF-8 -Dlogging.charset.console=GBK"
}
]
}

31
jeecg-boot/.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,31 @@
{
"java.compile.nullAnalysis.mode": "automatic",
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms100m -Xlog:disable",
"java.import.maven.enabled": true,
"java.configuration.updateBuildConfiguration": "automatic",
"java.autobuild.enabled": true,
"java.jdt.ls.java.home": "C:\\Program Files\\Java\\jdk-17",
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "C:\\Program Files\\Java\\jdk-17",
"default": true
}
],
"java.import.exclusions": [
"**/jeecg-server-cloud/**",
"**/jeecg-boot-platform/**",
"**/node_modules/**",
"**/.metadata/**",
"**/archetype-resources/**",
"**/META-INF/maven/**"
],
"java.project.resourceFilters": [
"node_modules",
".git",
"jeecg-server-cloud",
"jeecg-boot-platform"
],
"java.debug.settings.console": "integratedTerminal",
"java.debug.settings.vmArgs": "-Dspring.main.banner-mode=log -Dspring.banner.charset=UTF-8 -Dlogging.charset.console=GBK"
}

View File

@@ -11,9 +11,9 @@ menu_type=VALUES(menu_type), perms=VALUES(perms), perms_type=VALUES(perms_type),
is_route=VALUES(is_route), is_leaf=VALUES(is_leaf), hidden=VALUES(hidden), status=VALUES(status), del_flag=VALUES(del_flag),
always_show=VALUES(always_show), keep_alive=VALUES(keep_alive), internal_or_external=VALUES(internal_or_external);
-- 二级菜单料信息
-- 二级菜单料信息
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 ('1860000000000000011', '1860000000000000001', '料信息', '/mes/materialinfo', 'mes/materialinfo/index', 'MesMaterialList', 1, NULL, '1', 1, 1, 1, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000011', '1860000000000000001', '料信息', '/mes/materialinfo', 'mes/materialinfo/index', 'MesMaterialList', 1, NULL, '1', 1, 1, 1, 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),

View File

@@ -0,0 +1,92 @@
-- 日罐物料对应信息菜单与权限挂到MES密炼工程目录
SET NAMES utf8mb4;
SET @mixer_parent_id = (
SELECT id
FROM sys_permission
WHERE name = 'MES密炼工程' AND menu_type = 0 AND del_flag = 0
ORDER BY create_time ASC
LIMIT 1
);
SET @mixer_parent_id = IFNULL(@mixer_parent_id, (
SELECT id
FROM sys_permission
WHERE url = '/mes' AND menu_type = 0 AND del_flag = 0
ORDER BY create_time ASC
LIMIT 1
));
SET @mixer_parent_id = IFNULL(@mixer_parent_id, '1860000000000000001');
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 (
'1860000000000099311', @mixer_parent_id, '日罐物料对应信息',
'/mes/daytankmaterialmapinfo',
'mes/daytankmaterialmapinfo/index',
'MesXslDayTankMaterialMapList', 1, NULL, '1', 31,
1, 1, 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 = VALUES(is_leaf),
hidden = VALUES(hidden),
status = VALUES(status),
del_flag = VALUES(del_flag),
keep_alive = VALUES(keep_alive),
internal_or_external = VALUES(internal_or_external);
INSERT INTO sys_permission(id, parent_id, name, menu_type, perms, perms_type, status, del_flag, create_by, create_time) VALUES
('1860000000000099312', '1860000000000099311', '新增', 2, 'xslmes:mes_xsl_day_tank_material_map:add', '1', '1', 0, 'admin', NOW()),
('1860000000000099313', '1860000000000099311', '编辑', 2, 'xslmes:mes_xsl_day_tank_material_map:edit', '1', '1', 0, 'admin', NOW()),
('1860000000000099314', '1860000000000099311', '删除', 2, 'xslmes:mes_xsl_day_tank_material_map:delete', '1', '1', 0, 'admin', NOW()),
('1860000000000099315', '1860000000000099311', '批量删除', 2, 'xslmes:mes_xsl_day_tank_material_map:deleteBatch', '1', '1', 0, 'admin', NOW()),
('1860000000000099316', '1860000000000099311', '导出', 2, 'xslmes:mes_xsl_day_tank_material_map:exportXls', '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),
status = VALUES(status),
del_flag = VALUES(del_flag);
-- admin 角色授权
INSERT INTO sys_role_permission(id, role_id, permission_id, operate_date, operate_ip)
SELECT REPLACE(UUID(), '-', ''), 'f6817f48af4fb3af11b9e8bf182f618b', p.id, NOW(), '127.0.0.1'
FROM sys_permission p
WHERE p.id IN (
'1860000000000099311',
'1860000000000099312', '1860000000000099313', '1860000000000099314', '1860000000000099315', '1860000000000099316'
)
AND NOT EXISTS (
SELECT 1
FROM sys_role_permission rp
WHERE rp.role_id = 'f6817f48af4fb3af11b9e8bf182f618b'
AND rp.permission_id = p.id
);
-- 强制修复确保菜单路由与组件路径正确避免历史错误路径导致查看组件引用是否正确
UPDATE sys_permission
SET
parent_id = @mixer_parent_id,
url = '/mes/daytankmaterialmapinfo',
component = 'mes/daytankmaterialmapinfo/index',
component_name = 'MesXslDayTankMaterialMapList',
menu_type = 1,
is_route = 1,
is_leaf = 1,
hidden = 0,
status = '1',
del_flag = 0
WHERE id = '1860000000000099311';

View File

@@ -37,19 +37,22 @@ CREATE TABLE IF NOT EXISTS `mes_xsl_downtime_main_type` (
SET @mes_tenant_id = 1002;
SET @mes_base_pid = (
SELECT MIN(`id`) FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料')
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_base_pid = IFNULL(@mes_base_pid, '1860000000000000001');
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
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 ('1860000000000000119', @mes_base_pid, '停机主类型', '/xslmes/mesXslDowntimeMainType', 'xslmes/mesXslDowntimeMainType/MesXslDowntimeMainTypeList', NULL, 1, NULL, '1', 18, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000119', @mes_equip_pid, '停机主类型', '/xslmes/mesXslDowntimeMainType', 'xslmes/mesXslDowntimeMainType/MesXslDowntimeMainTypeList', NULL, 1, NULL, '1', 9, 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` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`);
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`), `icon` = 'ant-design:partition-outlined';
UPDATE `sys_permission` SET `icon` = 'ant-design:partition-outlined' WHERE `id` = '1860000000000000119' AND `del_flag` = 0;
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
('1860000000000000120', '1860000000000000119', '新增', 2, 'mes:mes_xsl_downtime_main_type:add', '1', '1', 0, 'admin', NOW()),

View File

@@ -45,19 +45,22 @@ CREATE TABLE IF NOT EXISTS `mes_xsl_downtime_type` (
SET @mes_tenant_id = 1002;
SET @mes_base_pid = (
SELECT MIN(`id`) FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料')
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_base_pid = IFNULL(@mes_base_pid, '1860000000000000001');
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
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 ('1860000000000000126', @mes_base_pid, '停机类型', '/xslmes/mesXslDowntimeType', 'xslmes/mesXslDowntimeType/MesXslDowntimeTypeList', NULL, 1, NULL, '1', 19, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000126', @mes_equip_pid, '停机类型', '/xslmes/mesXslDowntimeType', 'xslmes/mesXslDowntimeType/MesXslDowntimeTypeList', NULL, 1, NULL, '1', 10, 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` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`);
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`), `icon` = 'ant-design:pause-circle-outlined';
UPDATE `sys_permission` SET `icon` = 'ant-design:pause-circle-outlined' WHERE `id` = '1860000000000000126' AND `del_flag` = 0;
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
('1860000000000000127', '1860000000000000126', '新增', 2, 'mes:mes_xsl_downtime_type:add', '1', '1', 0, 'admin', NOW()),

View File

@@ -56,14 +56,15 @@ WHERE d.`dict_code` = 'xslmes_equipment_maintain_distinct'
SET @mes_tenant_id = 1002;
SET @mes_base_pid = (
SELECT MIN(`id`) FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料')
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_base_pid = IFNULL(@mes_base_pid, '1860000000000000001');
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
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 ('1860000000000000070', @mes_base_pid, '设备类别', '/xslmes/mesXslEquipmentCategory', 'xslmes/mesXslEquipmentCategory/MesXslEquipmentCategoryList', NULL, 1, NULL, '1', 10, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000070', @mes_equip_pid, '设备类别', '/xslmes/mesXslEquipmentCategory', 'xslmes/mesXslEquipmentCategory/MesXslEquipmentCategoryList', NULL, 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`),

View File

@@ -0,0 +1,31 @@
-- 设备管理目录 MES管理 下迁出 MES基础资料 同级已执行旧版 mes-xsl-equipment-ledger-menu-permission 时用
SET NAMES utf8mb4;
SET @mes_equip_root_parent = (
SELECT `parent_id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES基础资料'
LIMIT 1
);
SET @mes_equip_root_parent = IFNULL(@mes_equip_root_parent, (
SELECT `parent_id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES资料'
LIMIT 1
));
SET @mes_equip_root_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
), 51);
UPDATE `sys_permission`
SET
`parent_id` = @mes_equip_root_parent,
`sort_no` = @mes_equip_root_sort,
`menu_type` = 0,
`is_leaf` = 0,
`hidden` = 0,
`status` = '1',
`del_flag` = 0
WHERE `id` = '1860000000000000133';

View File

@@ -0,0 +1,131 @@
-- MES 设备台账字典 + 建表 + 设备管理目录菜单 + 设备台账菜单 + 按钮 + 租户 admin 授权可整文件一次执行
-- 权限前缀mes:mes_xsl_equipment_ledger:*
-- 父菜单设备管理目录 MES基础资料 同级 MES管理 子级子菜单设备台账
-- 修改租户 SET @mes_tenant_id新环境也可依赖 Flyway V3.9.2_72__mes_xsl_equipment_ledger.sql
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_equipment_ledger_status', '在用/停用/报废', 0, 'admin', NOW(), 0, 0
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_equipment_ledger_status' 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, '在用', '0', 1, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_equipment_ledger_status' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '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', 2, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_equipment_ledger_status' 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', 3, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_equipment_ledger_status' 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_equipment_ledger` (
`id` varchar(32) NOT NULL COMMENT '主键',
`process_operation_id` varchar(32) NOT NULL COMMENT '所属工序 mes_xsl_process_operation.id',
`process_operation_name` varchar(500) DEFAULT NULL COMMENT '工序名称冗余',
`equipment_name` varchar(500) NOT NULL COMMENT '设备名称同租户未删除唯一',
`equipment_code` varchar(128) NOT NULL COMMENT '设备编号同租户未删除唯一',
`manufacturer_id` varchar(32) DEFAULT NULL COMMENT '所属设备厂家 mes_xsl_manufacturer.id',
`manufacturer_name` varchar(500) DEFAULT NULL COMMENT '设备厂家名称冗余',
`equipment_category_id` varchar(32) DEFAULT NULL COMMENT '设备类别 mes_xsl_equipment_category.id',
`equipment_category_name` varchar(500) DEFAULT NULL COMMENT '设备类别名称冗余',
`equipment_type_id` varchar(32) DEFAULT NULL COMMENT '设备类型 mes_xsl_equipment_type.id',
`equipment_type_name` varchar(500) DEFAULT NULL COMMENT '设备类型名称冗余',
`factory_id` varchar(32) DEFAULT NULL COMMENT '所属工厂厂家信息',
`factory_name` varchar(500) DEFAULT NULL COMMENT '所属工厂名称冗余',
`equipment_model` varchar(500) DEFAULT NULL COMMENT '设备型号',
`equipment_status` varchar(1) NOT NULL DEFAULT '0' COMMENT '设备状态 字典xslmes_equipment_ledger_status0在用1停用2报废',
`serial_no` varchar(500) DEFAULT NULL COMMENT '序列号',
`nameplate` varchar(500) DEFAULT NULL COMMENT '铭牌',
`maintain_dept_id` varchar(32) DEFAULT NULL COMMENT '维修部门 sys_depart.id',
`maintain_person` varchar(500) DEFAULT NULL COMMENT '维修人员',
`manage_dept_id` varchar(32) DEFAULT NULL COMMENT '主管部门 sys_depart.id',
`doc_file_no` varchar(500) DEFAULT NULL COMMENT '资料文件编号',
`production_date` date DEFAULT NULL COMMENT '生产日期',
`purchase_date` date DEFAULT NULL COMMENT '购买日期',
`use_date` date DEFAULT NULL COMMENT '使用日期',
`vendor_contact` varchar(500) DEFAULT NULL COMMENT '厂商联系人',
`asset_value` varchar(128) DEFAULT NULL COMMENT '价值',
`controlled_pda` varchar(500) DEFAULT NULL COMMENT '受控PDA',
`overproduction_ratio` varchar(128) DEFAULT NULL COMMENT '超产比率',
`effective_volume` varchar(128) DEFAULT NULL COMMENT '有效体积',
`enabled_flag` varchar(1) NOT NULL DEFAULT '1' COMMENT '是否启用 字典yn1是0否',
`equipment_desc` varchar(1000) DEFAULT NULL COMMENT '设备描述',
`tenant_id` int DEFAULT NULL COMMENT '租户',
`sys_org_code` varchar(500) DEFAULT NULL COMMENT '部门',
`create_by` varchar(500) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(500) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`del_flag` int DEFAULT '0' COMMENT '删除标记0正常1删除',
PRIMARY KEY (`id`),
KEY `idx_mel_tenant_code` (`tenant_id`, `equipment_code`),
KEY `idx_mel_tenant_name` (`tenant_id`, `equipment_name`),
KEY `idx_mel_process` (`process_operation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES设备台账';
SET @mes_tenant_id = 1002;
-- MES基础资料同级取其 parent_id通常为 NULL MES管理 并列
SET @mes_equip_root_parent = (
SELECT `parent_id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES基础资料'
LIMIT 1
);
SET @mes_equip_root_parent = IFNULL(@mes_equip_root_parent, (
SELECT `parent_id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES资料'
LIMIT 1
));
SET @mes_equip_root_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
), 51);
UPDATE `sys_permission`
SET `is_leaf` = 0
WHERE `id` = '1860000000000000133' 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 ('1860000000000000133', @mes_equip_root_parent, '设备管理', '/xslmes/equipment', 'layouts/RouteView', 'MesEquipmentLayout', 0, NULL, '1', @mes_equip_root_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`), `icon` = 'ant-design:tool-outlined', `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0;
UPDATE `sys_permission` SET `icon` = 'ant-design:tool-outlined' WHERE `id` = '1860000000000000133' 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 ('1860000000000000134', '1860000000000000133', '设备台账', '/xslmes/mesXslEquipmentLedger', 'xslmes/mesXslEquipmentLedger/MesXslEquipmentLedgerList', 'MesXslEquipmentLedgerList', 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`),
`is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0;
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
('1860000000000000135', '1860000000000000134', '新增', 2, 'mes:mes_xsl_equipment_ledger:add', '1', '1', 0, 'admin', NOW()),
('1860000000000000136', '1860000000000000134', '编辑', 2, 'mes:mes_xsl_equipment_ledger:edit', '1', '1', 0, 'admin', NOW()),
('1860000000000000137', '1860000000000000134', '删除', 2, 'mes:mes_xsl_equipment_ledger:delete', '1', '1', 0, 'admin', NOW()),
('1860000000000000138', '1860000000000000134', '批量删除', 2, 'mes:mes_xsl_equipment_ledger:deleteBatch', '1', '1', 0, 'admin', NOW()),
('1860000000000000139', '1860000000000000134', '导出', 2, 'mes:mes_xsl_equipment_ledger:exportXls', '1', '1', 0, 'admin', NOW()),
('1860000000000000140', '1860000000000000134', '导入', 2, 'mes:mes_xsl_equipment_ledger:importExcel', '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`),
`status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`);
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 (
'1860000000000000133',
'1860000000000000134',
'1860000000000000135', '1860000000000000136', '1860000000000000137', '1860000000000000138',
'1860000000000000139', '1860000000000000140'
)
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
);

View File

@@ -0,0 +1,46 @@
-- MES 设备台账仅建表完整初始化请执行 mes-xsl-equipment-ledger-menu-permission.sql
SET NAMES utf8mb4;
CREATE TABLE IF NOT EXISTS `mes_xsl_equipment_ledger` (
`id` varchar(32) NOT NULL COMMENT '主键',
`process_operation_id` varchar(32) NOT NULL COMMENT '所属工序',
`process_operation_name` varchar(500) DEFAULT NULL COMMENT '工序名称冗余',
`equipment_name` varchar(500) NOT NULL COMMENT '设备名称',
`equipment_code` varchar(128) NOT NULL COMMENT '设备编号',
`manufacturer_id` varchar(32) DEFAULT NULL COMMENT '所属设备厂家',
`manufacturer_name` varchar(500) DEFAULT NULL COMMENT '设备厂家名称冗余',
`equipment_category_id` varchar(32) DEFAULT NULL COMMENT '设备类别',
`equipment_category_name` varchar(500) DEFAULT NULL COMMENT '设备类别名称冗余',
`equipment_type_id` varchar(32) DEFAULT NULL COMMENT '设备类型',
`equipment_type_name` varchar(500) DEFAULT NULL COMMENT '设备类型名称冗余',
`factory_id` varchar(32) DEFAULT NULL COMMENT '所属工厂',
`factory_name` varchar(500) DEFAULT NULL COMMENT '所属工厂名称冗余',
`equipment_model` varchar(500) DEFAULT NULL COMMENT '设备型号',
`equipment_status` varchar(1) NOT NULL DEFAULT '0' COMMENT '设备状态',
`serial_no` varchar(500) DEFAULT NULL COMMENT '序列号',
`nameplate` varchar(500) DEFAULT NULL COMMENT '铭牌',
`maintain_dept_id` varchar(32) DEFAULT NULL COMMENT '维修部门',
`maintain_person` varchar(500) DEFAULT NULL COMMENT '维修人员',
`manage_dept_id` varchar(32) DEFAULT NULL COMMENT '主管部门',
`doc_file_no` varchar(500) DEFAULT NULL COMMENT '资料文件编号',
`production_date` date DEFAULT NULL COMMENT '生产日期',
`purchase_date` date DEFAULT NULL COMMENT '购买日期',
`use_date` date DEFAULT NULL COMMENT '使用日期',
`vendor_contact` varchar(500) DEFAULT NULL COMMENT '厂商联系人',
`asset_value` varchar(128) DEFAULT NULL COMMENT '价值',
`controlled_pda` varchar(500) DEFAULT NULL COMMENT '受控PDA',
`overproduction_ratio` varchar(128) DEFAULT NULL COMMENT '超产比率',
`effective_volume` varchar(128) DEFAULT NULL COMMENT '有效体积',
`enabled_flag` varchar(1) NOT NULL DEFAULT '1' COMMENT '是否启用',
`equipment_desc` varchar(1000) DEFAULT NULL COMMENT '设备描述',
`tenant_id` int DEFAULT NULL COMMENT '租户',
`sys_org_code` varchar(500) DEFAULT NULL COMMENT '部门',
`create_by` varchar(500) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(500) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`del_flag` int DEFAULT '0' COMMENT '删除标记',
PRIMARY KEY (`id`),
KEY `idx_mel_tenant_code` (`tenant_id`, `equipment_code`),
KEY `idx_mel_tenant_name` (`tenant_id`, `equipment_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES设备台账';

View File

@@ -0,0 +1,10 @@
-- 设备管理目录及指定子菜单图标可重复执行
SET NAMES utf8mb4;
UPDATE `sys_permission` SET `icon` = 'ant-design:tool-outlined' WHERE `id` = '1860000000000000133' AND `del_flag` = 0;
UPDATE `sys_permission` SET `icon` = 'ant-design:apartment-outlined' WHERE `id` = '1860000000000000091' AND `del_flag` = 0;
UPDATE `sys_permission` SET `icon` = 'ant-design:tags-outlined' WHERE `id` = '1860000000000000098' AND `del_flag` = 0;
UPDATE `sys_permission` SET `icon` = 'ant-design:shopping-outlined' WHERE `id` = '1860000000000000105' AND `del_flag` = 0;
UPDATE `sys_permission` SET `icon` = 'ant-design:shop-outlined' WHERE `id` = '1860000000000000112' AND `del_flag` = 0;
UPDATE `sys_permission` SET `icon` = 'ant-design:partition-outlined' WHERE `id` = '1860000000000000119' AND `del_flag` = 0;
UPDATE `sys_permission` SET `icon` = 'ant-design:pause-circle-outlined' WHERE `id` = '1860000000000000126' AND `del_flag` = 0;

View File

@@ -24,14 +24,15 @@ CREATE TABLE IF NOT EXISTS `mes_xsl_equipment_part` (
SET @mes_tenant_id = 1002;
SET @mes_base_pid = (
SELECT MIN(`id`) FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料')
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_base_pid = IFNULL(@mes_base_pid, '1860000000000000001');
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
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 ('1860000000000000084', @mes_base_pid, '设备部位', '/xslmes/mesXslEquipmentPart', 'xslmes/mesXslEquipmentPart/MesXslEquipmentPartList', NULL, 1, NULL, '1', 12, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000084', @mes_equip_pid, '设备部位', '/xslmes/mesXslEquipmentPart', 'xslmes/mesXslEquipmentPart/MesXslEquipmentPartList', NULL, 1, NULL, '1', 4, 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`),

View File

@@ -27,19 +27,22 @@ CREATE TABLE IF NOT EXISTS `mes_xsl_equipment_sub_part` (
SET @mes_tenant_id = 1002;
SET @xslmes_root_pid = (
SELECT MIN(`id`) FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES XSL', 'XSLMES管理', 'XSLMES')
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @xslmes_root_pid = IFNULL(@xslmes_root_pid, '1900000000000000300');
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
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 ('1860000000000000091', @xslmes_root_pid, '设备小部位', '/xslmes/mesXslEquipmentSubPart', 'xslmes/mesXslEquipmentSubPart/MesXslEquipmentSubPartList', NULL, 1, NULL, '1', 14, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000091', @mes_equip_pid, '设备小部位', '/xslmes/mesXslEquipmentSubPart', 'xslmes/mesXslEquipmentSubPart/MesXslEquipmentSubPartList', NULL, 1, NULL, '1', 5, 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` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`);
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`), `icon` = 'ant-design:apartment-outlined';
UPDATE `sys_permission` SET `icon` = 'ant-design:apartment-outlined' WHERE `id` = '1860000000000000091' AND `del_flag` = 0;
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
('1860000000000000092', '1860000000000000091', '新增', 2, 'mes:mes_xsl_equipment_sub_part:add', '1', '1', 0, 'admin', NOW()),

View File

@@ -1,26 +1,22 @@
-- 设备类型菜单/按钮补全并挂到 MES基础资料解决仅 UPDATE id 077 不存在菜单与权限均不显示
-- 设备类型菜单/按钮补全并挂到设备管理解决仅 UPDATE id 077 不存在菜单与权限均不显示
-- 可重复执行修改租户改 SET @mes_tenant_id
SET NAMES utf8mb4;
SET @mes_tenant_id = 1002;
SET @mes_base_pid = (
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES基础资料'
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_base_pid = IFNULL(@mes_base_pid, (
SELECT MIN(`id`) FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES资料'
));
SET @mes_base_pid = IFNULL(@mes_base_pid, '1860000000000000001');
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
UPDATE `sys_permission`
SET `is_leaf` = 0
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料');
WHERE `id` = @mes_equip_pid;
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 ('1860000000000000077', @mes_base_pid, '设备类型', '/xslmes/mesXslEquipmentType', 'xslmes/mesXslEquipmentType/MesXslEquipmentTypeList', NULL, 1, NULL, '1', 11, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000077', @mes_equip_pid, '设备类型', '/xslmes/mesXslEquipmentType', 'xslmes/mesXslEquipmentType/MesXslEquipmentTypeList', NULL, 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`),
`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`),
@@ -39,7 +35,7 @@ ON DUPLICATE KEY UPDATE
`perms_type` = VALUES(`perms_type`), `is_leaf` = 1, `status` = '1', `del_flag` = 0;
UPDATE `sys_permission` p
INNER JOIN (SELECT @mes_base_pid AS `pid`) x ON 1 = 1
INNER JOIN (SELECT @mes_equip_pid AS `pid`) x ON 1 = 1
SET p.`parent_id` = x.`pid`,
p.`is_leaf` = 0,
p.`url` = '/xslmes/mesXslEquipmentType',

View File

@@ -23,14 +23,15 @@ CREATE TABLE IF NOT EXISTS `mes_xsl_equipment_type` (
SET @mes_tenant_id = 1002;
SET @mes_base_pid = (
SELECT MIN(`id`) FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料')
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_base_pid = IFNULL(@mes_base_pid, '1860000000000000001');
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
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 ('1860000000000000077', @mes_base_pid, '设备类型', '/xslmes/mesXslEquipmentType', 'xslmes/mesXslEquipmentType/MesXslEquipmentTypeList', NULL, 1, NULL, '1', 11, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000077', @mes_equip_pid, '设备类型', '/xslmes/mesXslEquipmentType', 'xslmes/mesXslEquipmentType/MesXslEquipmentTypeList', NULL, 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`),

View File

@@ -0,0 +1,118 @@
-- MES 点检及保养项目字典 + 建表 + 菜单 + 按钮 + 租户 admin 授权可整文件一次执行
-- 权限前缀与 Controller前端 v-auth 一致mes:mes_xsl_inspect_maintain_item:*
-- 父菜单设备管理修改租户改 SET @mes_tenant_id
-- 新环境也可依赖 FlywayV3.9.2_77__mes_xsl_inspect_maintain_item.sql
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_im_item_category', 'inspect点检/maintain保养', 0, 'admin', NOW(), 0, 0
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_item_category' 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, '点检', 'inspect', 1, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_item_category' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'inspect');
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
SELECT REPLACE(UUID(), '-', ''), d.id, '保养', 'maintain', 2, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_item_category' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'maintain');
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
SELECT REPLACE(UUID(), '-', ''), 'MES点检保养项目类型', 'xslmes_im_item_type', 'mechanical机械类/electrical电气类', 0, 'admin', NOW(), 0, 0
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_item_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, '机械类', 'mechanical', 1, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_item_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'mechanical');
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
SELECT REPLACE(UUID(), '-', ''), d.id, '电气类', 'electrical', 2, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_item_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'electrical');
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
SELECT REPLACE(UUID(), '-', ''), 'MES点检方式', 'xslmes_im_inspect_method', 'visual视觉/sight目测/hearing听觉', 0, 'admin', NOW(), 0, 0
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_inspect_method' 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, '视觉', 'visual', 1, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_inspect_method' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'visual');
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
SELECT REPLACE(UUID(), '-', ''), d.id, '目测', 'sight', 2, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_inspect_method' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'sight');
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
SELECT REPLACE(UUID(), '-', ''), d.id, '听觉', 'hearing', 3, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_inspect_method' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'hearing');
CREATE TABLE IF NOT EXISTS `mes_xsl_inspect_maintain_item` (
`id` varchar(32) NOT NULL COMMENT '主键',
`item_name` varchar(500) NOT NULL COMMENT '项目名称同租户未删除数据中唯一',
`item_code` varchar(500) NOT NULL COMMENT '项目编号同租户未删除数据中唯一',
`equipment_category_id` varchar(32) NOT NULL COMMENT '设备类别主键 mes_xsl_equipment_category.id',
`equipment_category_name` varchar(500) DEFAULT NULL COMMENT '设备类别名称冗余',
`equipment_type_id` varchar(32) NOT NULL COMMENT '设备类型主键 mes_xsl_equipment_type.id',
`equipment_type_name` varchar(500) DEFAULT NULL COMMENT '设备类型名称冗余',
`equipment_part_id` varchar(32) NOT NULL COMMENT '设备部位主键 mes_xsl_equipment_part.id',
`equipment_part_name` varchar(500) DEFAULT NULL COMMENT '设备部位名称冗余',
`equipment_sub_part_id` varchar(32) NOT NULL COMMENT '设备小部位主键 mes_xsl_equipment_sub_part.id',
`equipment_sub_part_name` varchar(500) DEFAULT NULL COMMENT '设备小部位名称冗余',
`item_category` varchar(500) NOT NULL COMMENT '项目类别字典xslmes_im_item_categoryinspect点检/maintain保养',
`item_type` varchar(500) NOT NULL COMMENT '项目类型字典xslmes_im_item_typemechanical机械类/electrical电气类',
`inspect_method` varchar(500) NOT NULL COMMENT '点检方式字典xslmes_im_inspect_methodvisual视觉/sight目测/hearing听觉',
`judgment_criteria` varchar(500) NOT NULL COMMENT '判断基准',
`maintain_cycle_days` int DEFAULT NULL COMMENT '保养周期',
`tenant_id` int DEFAULT NULL COMMENT '租户',
`sys_org_code` varchar(500) DEFAULT NULL COMMENT '部门',
`create_by` varchar(500) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(500) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`del_flag` int DEFAULT '0' COMMENT '删除标记0正常1删除',
PRIMARY KEY (`id`),
KEY `idx_mimi_tenant_name` (`tenant_id`, `item_name`),
KEY `idx_mimi_tenant_code` (`tenant_id`, `item_code`),
KEY `idx_mimi_category` (`equipment_category_id`),
KEY `idx_mimi_type` (`equipment_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES点检及保养项目';
SET @mes_tenant_id = 1002;
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
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 ('1860000000000000141', @mes_equip_pid, '点检及保养项目', '/xslmes/mesXslInspectMaintainItem', 'xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItemList', NULL, 1, NULL, '1', 11, 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` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`), `icon` = 'ant-design:audit-outlined';
UPDATE `sys_permission` SET `icon` = 'ant-design:audit-outlined' WHERE `id` = '1860000000000000141' AND `del_flag` = 0;
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
('1860000000000000142', '1860000000000000141', '新增', 2, 'mes:mes_xsl_inspect_maintain_item:add', '1', '1', 0, 'admin', NOW()),
('1860000000000000143', '1860000000000000141', '编辑', 2, 'mes:mes_xsl_inspect_maintain_item:edit', '1', '1', 0, 'admin', NOW()),
('1860000000000000144', '1860000000000000141', '删除', 2, 'mes:mes_xsl_inspect_maintain_item:delete', '1', '1', 0, 'admin', NOW()),
('1860000000000000145', '1860000000000000141', '批量删除', 2, 'mes:mes_xsl_inspect_maintain_item:deleteBatch', '1', '1', 0, 'admin', NOW()),
('1860000000000000146', '1860000000000000141', '导出', 2, 'mes:mes_xsl_inspect_maintain_item:exportXls', '1', '1', 0, 'admin', NOW()),
('1860000000000000147', '1860000000000000141', '导入', 2, 'mes:mes_xsl_inspect_maintain_item:importExcel', '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`),
`status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`);
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 (
'1860000000000000141',
'1860000000000000142', '1860000000000000143', '1860000000000000144', '1860000000000000145',
'1860000000000000146', '1860000000000000147'
)
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
);

View File

@@ -1,6 +1,6 @@
-- MES 厂家信息字典 + 建表 + 菜单 + 按钮 + 租户 admin 授权可整文件一次执行
-- 权限前缀与 Controller前端 v-auth 一致mes:mes_xsl_manufacturer:*
-- 父菜单MES基础资料 / MES资料与备品件等脚本相同 @mes_base_pid修改租户改 SET @mes_tenant_id
-- 父菜单设备管理@mes_equip_pid修改租户改 SET @mes_tenant_id
-- 新环境也可依赖 FlywayV3.9.2_63__mes_xsl_manufacturer.sql与本文内容一致重复执行幂等
SET NAMES utf8mb4;
@@ -47,19 +47,22 @@ CREATE TABLE IF NOT EXISTS `mes_xsl_manufacturer` (
SET @mes_tenant_id = 1002;
SET @mes_base_pid = (
SELECT MIN(`id`) FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料')
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_base_pid = IFNULL(@mes_base_pid, '1860000000000000001');
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
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 ('1860000000000000112', @mes_base_pid, '厂家信息', '/xslmes/mesXslManufacturer', 'xslmes/mesXslManufacturer/MesXslManufacturerList', NULL, 1, NULL, '1', 17, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000112', @mes_equip_pid, '厂家信息', '/xslmes/mesXslManufacturer', 'xslmes/mesXslManufacturer/MesXslManufacturerList', NULL, 1, NULL, '1', 8, 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` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`);
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`), `icon` = 'ant-design:shop-outlined';
UPDATE `sys_permission` SET `icon` = 'ant-design:shop-outlined' WHERE `id` = '1860000000000000112' AND `del_flag` = 0;
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
('1860000000000000113', '1860000000000000112', '新增', 2, 'mes:mes_xsl_manufacturer:add', '1', '1', 0, 'admin', NOW()),

View File

@@ -0,0 +1,92 @@
-- 密炼机动作维护菜单与权限挂到MES密炼工程目录
SET NAMES utf8mb4;
SET @mixer_parent_id = (
SELECT id
FROM sys_permission
WHERE name = 'MES密炼工程' AND menu_type = 0 AND del_flag = 0
ORDER BY create_time ASC
LIMIT 1
);
SET @mixer_parent_id = IFNULL(@mixer_parent_id, (
SELECT id
FROM sys_permission
WHERE url = '/mes' AND menu_type = 0 AND del_flag = 0
ORDER BY create_time ASC
LIMIT 1
));
SET @mixer_parent_id = IFNULL(@mixer_parent_id, '1860000000000000001');
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 (
'1860000000000099211', @mixer_parent_id, '密炼机动作维护',
'/mes/mixeractioninfo',
'mes/mixeractioninfo/index',
'MesXslMixerActionList', 1, NULL, '1', 30,
1, 1, 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 = VALUES(is_leaf),
hidden = VALUES(hidden),
status = VALUES(status),
del_flag = VALUES(del_flag),
keep_alive = VALUES(keep_alive),
internal_or_external = VALUES(internal_or_external);
INSERT INTO sys_permission(id, parent_id, name, menu_type, perms, perms_type, status, del_flag, create_by, create_time) VALUES
('1860000000000099212', '1860000000000099211', '新增', 2, 'xslmes:mes_xsl_mixer_action:add', '1', '1', 0, 'admin', NOW()),
('1860000000000099213', '1860000000000099211', '编辑', 2, 'xslmes:mes_xsl_mixer_action:edit', '1', '1', 0, 'admin', NOW()),
('1860000000000099214', '1860000000000099211', '删除', 2, 'xslmes:mes_xsl_mixer_action:delete', '1', '1', 0, 'admin', NOW()),
('1860000000000099215', '1860000000000099211', '批量删除', 2, 'xslmes:mes_xsl_mixer_action:deleteBatch', '1', '1', 0, 'admin', NOW()),
('1860000000000099216', '1860000000000099211', '导出', 2, 'xslmes:mes_xsl_mixer_action:exportXls', '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),
status = VALUES(status),
del_flag = VALUES(del_flag);
-- admin 角色授权
INSERT INTO sys_role_permission(id, role_id, permission_id, operate_date, operate_ip)
SELECT REPLACE(UUID(), '-', ''), 'f6817f48af4fb3af11b9e8bf182f618b', p.id, NOW(), '127.0.0.1'
FROM sys_permission p
WHERE p.id IN (
'1860000000000099211',
'1860000000000099212', '1860000000000099213', '1860000000000099214', '1860000000000099215', '1860000000000099216'
)
AND NOT EXISTS (
SELECT 1
FROM sys_role_permission rp
WHERE rp.role_id = 'f6817f48af4fb3af11b9e8bf182f618b'
AND rp.permission_id = p.id
);
-- 强制修复确保菜单路由与组件路径正确避免历史错误路径导致查看组件引用是否正确
UPDATE sys_permission
SET
parent_id = @mixer_parent_id,
url = '/mes/mixeractioninfo',
component = 'mes/mixeractioninfo/index',
component_name = 'MesXslMixerActionList',
menu_type = 1,
is_route = 1,
is_leaf = 1,
hidden = 0,
status = '1',
del_flag = 0
WHERE id = '1860000000000099211';

View File

@@ -0,0 +1,62 @@
-- 将设备类别/类型/部位/小部位备品件厂家停机类菜单挂到设备管理目录下工序管理仍留 MES基础资料
-- 前置已执行 mes-xsl-equipment-ledger-menu-permission.sql Flyway V3.9.2_72 创建设备管理目录 id=1860000000000000133
-- 修改租户 SET @mes_tenant_id
SET NAMES utf8mb4;
SET @mes_tenant_id = 1002;
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
UPDATE `sys_permission`
SET `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0
WHERE `id` = @mes_equip_pid;
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 1, `is_leaf` = 0 WHERE `id` = '1860000000000000134';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 2, `is_leaf` = 0 WHERE `id` = '1860000000000000070';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 3, `is_leaf` = 0 WHERE `id` = '1860000000000000077';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 4, `is_leaf` = 0 WHERE `id` = '1860000000000000084';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 5, `is_leaf` = 0 WHERE `id` = '1860000000000000091';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 6, `is_leaf` = 0 WHERE `id` = '1860000000000000098';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 7, `is_leaf` = 0 WHERE `id` = '1860000000000000105';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 8, `is_leaf` = 0 WHERE `id` = '1860000000000000112';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 9, `is_leaf` = 0 WHERE `id` = '1860000000000000119';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 10, `is_leaf` = 0 WHERE `id` = '1860000000000000126';
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 (
@mes_equip_pid,
'1860000000000000134',
'1860000000000000070',
'1860000000000000071', '1860000000000000072', '1860000000000000073', '1860000000000000074', '1860000000000000075', '1860000000000000076',
'1860000000000000077',
'1860000000000000078', '1860000000000000079', '1860000000000000080', '1860000000000000081', '1860000000000000082', '1860000000000000083',
'1860000000000000084',
'1860000000000000085', '1860000000000000086', '1860000000000000087', '1860000000000000088', '1860000000000000089', '1860000000000000090',
'1860000000000000091',
'1860000000000000092', '1860000000000000093', '1860000000000000094', '1860000000000000095', '1860000000000000096', '1860000000000000097',
'1860000000000000098',
'1860000000000000099', '1860000000000000100', '1860000000000000101', '1860000000000000102', '1860000000000000103', '1860000000000000104',
'1860000000000000105',
'1860000000000000106', '1860000000000000107', '1860000000000000108', '1860000000000000109', '1860000000000000110', '1860000000000000111',
'1860000000000000112',
'1860000000000000113', '1860000000000000114', '1860000000000000115', '1860000000000000116', '1860000000000000117', '1860000000000000118',
'1860000000000000119',
'1860000000000000120', '1860000000000000121', '1860000000000000122', '1860000000000000123', '1860000000000000124', '1860000000000000125',
'1860000000000000126',
'1860000000000000127', '1860000000000000128', '1860000000000000129', '1860000000000000130', '1860000000000000131', '1860000000000000132',
'1860000000000000135', '1860000000000000136', '1860000000000000137', '1860000000000000138', '1860000000000000139', '1860000000000000140'
)
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
);

View File

@@ -1,4 +1,4 @@
-- 工序管理设备类别设备类型挂到MES基础资料修复权限树is_leaf与租户 admin 授权
-- 工序管理MES基础资料设备类别设备类型挂设备管理修复权限树is_leaf与租户 admin 授权
-- 适用菜单曾在 MES XSL 根下或 is_leaf=1 导致角色授权页不显示按钮权限
-- 修改租户 SET @mes_tenant_id
SET NAMES utf8mb4;
@@ -16,10 +16,21 @@ SET @mes_base_pid = IFNULL(@mes_base_pid, (
));
SET @mes_base_pid = IFNULL(@mes_base_pid, '1860000000000000001');
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
UPDATE `sys_permission`
SET `is_leaf` = 0
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料');
UPDATE `sys_permission`
SET `is_leaf` = 0
WHERE `id` = @mes_equip_pid;
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 ('1860000000000000060', @mes_base_pid, '工序管理', '/xslmes/mesXslProcessOperation', 'xslmes/mesXslProcessOperation/MesXslProcessOperationList', NULL, 1, NULL, '1', 9, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
ON DUPLICATE KEY UPDATE
@@ -37,7 +48,7 @@ ON DUPLICATE KEY UPDATE
`parent_id` = VALUES(`parent_id`), `perms` = VALUES(`perms`), `is_leaf` = 1, `status` = '1', `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 ('1860000000000000070', @mes_base_pid, '设备类别', '/xslmes/mesXslEquipmentCategory', 'xslmes/mesXslEquipmentCategory/MesXslEquipmentCategoryList', NULL, 1, NULL, '1', 10, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000070', @mes_equip_pid, '设备类别', '/xslmes/mesXslEquipmentCategory', 'xslmes/mesXslEquipmentCategory/MesXslEquipmentCategoryList', NULL, 1, NULL, '1', 2, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
ON DUPLICATE KEY UPDATE
`parent_id` = VALUES(`parent_id`), `url` = VALUES(`url`), `component` = VALUES(`component`),
`is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0;
@@ -53,7 +64,7 @@ ON DUPLICATE KEY UPDATE
`parent_id` = VALUES(`parent_id`), `perms` = VALUES(`perms`), `is_leaf` = 1, `status` = '1', `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 ('1860000000000000077', @mes_base_pid, '设备类型', '/xslmes/mesXslEquipmentType', 'xslmes/mesXslEquipmentType/MesXslEquipmentTypeList', NULL, 1, NULL, '1', 11, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000077', @mes_equip_pid, '设备类型', '/xslmes/mesXslEquipmentType', 'xslmes/mesXslEquipmentType/MesXslEquipmentTypeList', NULL, 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`),
`is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0;

View File

@@ -1,4 +1,4 @@
-- 工序管理(060)设备类别(070)补全菜单/按钮 MES基础资料修复 is_leaf租户 admin 授权
-- 工序管理(060) MES基础资料设备类别(070)挂设备管理修复 is_leaf租户 admin 授权
-- 可重复执行修改租户改 SET @mes_tenant_id
SET NAMES utf8mb4;
@@ -15,10 +15,21 @@ SET @mes_base_pid = IFNULL(@mes_base_pid, (
));
SET @mes_base_pid = IFNULL(@mes_base_pid, '1860000000000000001');
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
UPDATE `sys_permission`
SET `is_leaf` = 0
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料');
UPDATE `sys_permission`
SET `is_leaf` = 0
WHERE `id` = @mes_equip_pid;
-- 工序管理
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 ('1860000000000000060', @mes_base_pid, '工序管理', '/xslmes/mesXslProcessOperation', 'xslmes/mesXslProcessOperation/MesXslProcessOperationList', NULL, 1, NULL, '1', 9, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
@@ -42,7 +53,7 @@ UPDATE `sys_permission` SET `name` = '新增' WHERE `id` = '1860000000000000061'
-- 设备类别
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 ('1860000000000000070', @mes_base_pid, '设备类别', '/xslmes/mesXslEquipmentCategory', 'xslmes/mesXslEquipmentCategory/MesXslEquipmentCategoryList', NULL, 1, NULL, '1', 10, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000070', @mes_equip_pid, '设备类别', '/xslmes/mesXslEquipmentCategory', 'xslmes/mesXslEquipmentCategory/MesXslEquipmentCategoryList', NULL, 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`),
`menu_type` = VALUES(`menu_type`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`),

View File

@@ -26,19 +26,22 @@ CREATE TABLE IF NOT EXISTS `mes_xsl_spare_part` (
SET @mes_tenant_id = 1002;
SET @mes_base_pid = (
SELECT MIN(`id`) FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料')
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_base_pid = IFNULL(@mes_base_pid, '1860000000000000001');
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
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 ('1860000000000000105', @mes_base_pid, '备品件信息', '/xslmes/mesXslSparePart', 'xslmes/mesXslSparePart/MesXslSparePartList', NULL, 1, NULL, '1', 16, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000105', @mes_equip_pid, '备品件信息', '/xslmes/mesXslSparePart', 'xslmes/mesXslSparePart/MesXslSparePartList', NULL, 1, NULL, '1', 7, 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` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`);
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`), `icon` = 'ant-design:shopping-outlined';
UPDATE `sys_permission` SET `icon` = 'ant-design:shopping-outlined' WHERE `id` = '1860000000000000105' AND `del_flag` = 0;
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
('1860000000000000106', '1860000000000000105', '新增', 2, 'mes:mes_xsl_spare_part:add', '1', '1', 0, 'admin', NOW()),

View File

@@ -20,19 +20,22 @@ CREATE TABLE IF NOT EXISTS `mes_xsl_spare_parts_category` (
SET @mes_tenant_id = 1002;
SET @mes_base_pid = (
SELECT MIN(`id`) FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料')
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_base_pid = IFNULL(@mes_base_pid, '1860000000000000001');
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
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 ('1860000000000000098', @mes_base_pid, '备品件类别', '/xslmes/mesXslSparePartsCategory', 'xslmes/mesXslSparePartsCategory/MesXslSparePartsCategoryList', NULL, 1, NULL, '1', 15, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000098', @mes_equip_pid, '备品件类别', '/xslmes/mesXslSparePartsCategory', 'xslmes/mesXslSparePartsCategory/MesXslSparePartsCategoryList', NULL, 1, NULL, '1', 6, 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` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`);
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`), `icon` = 'ant-design:tags-outlined';
UPDATE `sys_permission` SET `icon` = 'ant-design:tags-outlined' WHERE `id` = '1860000000000000098' AND `del_flag` = 0;
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
('1860000000000000099', '1860000000000000098', '新增', 2, 'mes:mes_xsl_spare_parts_category:add', '1', '1', 0, 'admin', NOW()),

View File

@@ -0,0 +1,151 @@
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 java.util.Arrays;
import org.apache.commons.lang3.StringUtils;
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.util.oConvertUtils;
import org.jeecg.modules.xslmes.entity.MesXslDayTankMaterialMap;
import org.jeecg.modules.xslmes.service.IMesXslDayTankMaterialMapService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
@Tag(name = "日罐物料对应信息")
@RestController
@RequestMapping("/xslmes/mesXslDayTankMaterialMap")
public class MesXslDayTankMaterialMapController
extends JeecgController<MesXslDayTankMaterialMap, IMesXslDayTankMaterialMapService> {
@Autowired private IMesXslDayTankMaterialMapService dayTankMaterialMapService;
@Operation(summary = "日罐物料对应信息-分页列表查询")
@GetMapping("/list")
public Result<IPage<MesXslDayTankMaterialMap>> queryPageList(
MesXslDayTankMaterialMap model,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<MesXslDayTankMaterialMap> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
IPage<MesXslDayTankMaterialMap> pageList = dayTankMaterialMapService.page(new Page<>(pageNo, pageSize), queryWrapper);
return Result.OK(pageList);
}
@AutoLog(value = "日罐物料对应信息-添加")
@Operation(summary = "日罐物料对应信息-添加")
@RequiresPermissions("xslmes:mes_xsl_day_tank_material_map:add")
@PostMapping("/add")
public Result<String> add(@RequestBody MesXslDayTankMaterialMap model) {
String err = validateForSave(model);
if (err != null) {
return Result.error(err);
}
dayTankMaterialMapService.fillReferenceFields(model);
if (StringUtils.isBlank(model.getMachineCode()) || StringUtils.isBlank(model.getMachineName())) {
return Result.error("请选择有效的机台名称");
}
if (StringUtils.isBlank(model.getMaterialName())) {
return Result.error("请选择有效的物料名称");
}
dayTankMaterialMapService.save(model);
return Result.OK("添加成功!");
}
@AutoLog(value = "日罐物料对应信息-编辑")
@Operation(summary = "日罐物料对应信息-编辑")
@RequiresPermissions("xslmes:mes_xsl_day_tank_material_map:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody MesXslDayTankMaterialMap model) {
String err = validateForSave(model);
if (err != null) {
return Result.error(err);
}
dayTankMaterialMapService.fillReferenceFields(model);
if (StringUtils.isBlank(model.getMachineCode()) || StringUtils.isBlank(model.getMachineName())) {
return Result.error("请选择有效的机台名称");
}
if (StringUtils.isBlank(model.getMaterialName())) {
return Result.error("请选择有效的物料名称");
}
dayTankMaterialMapService.updateById(model);
return Result.OK("编辑成功!");
}
@AutoLog(value = "日罐物料对应信息-通过id删除")
@Operation(summary = "日罐物料对应信息-通过id删除")
@RequiresPermissions("xslmes:mes_xsl_day_tank_material_map:delete")
@DeleteMapping("/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
dayTankMaterialMapService.removeById(id);
return Result.OK("删除成功!");
}
@AutoLog(value = "日罐物料对应信息-批量删除")
@Operation(summary = "日罐物料对应信息-批量删除")
@RequiresPermissions("xslmes:mes_xsl_day_tank_material_map:deleteBatch")
@DeleteMapping("/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
dayTankMaterialMapService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@Operation(summary = "日罐物料对应信息-通过id查询")
@GetMapping("/queryById")
public Result<MesXslDayTankMaterialMap> queryById(@RequestParam(name = "id", required = true) String id) {
MesXslDayTankMaterialMap entity = dayTankMaterialMapService.getById(id);
if (entity == null) {
return Result.error("未找到对应数据");
}
return Result.OK(entity);
}
@RequiresPermissions("xslmes:mes_xsl_day_tank_material_map:exportXls")
@RequestMapping("/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MesXslDayTankMaterialMap model) {
return super.exportXls(request, model, MesXslDayTankMaterialMap.class, "日罐物料对应信息");
}
private String validateForSave(MesXslDayTankMaterialMap model) {
if (oConvertUtils.isEmpty(model.getEquipmentId()) || StringUtils.isBlank(model.getEquipmentId())) {
return "机台名称不能为空";
}
model.setEquipmentId(model.getEquipmentId().trim());
if (oConvertUtils.isEmpty(model.getMaterialId()) || StringUtils.isBlank(model.getMaterialId())) {
return "物料名称不能为空";
}
model.setMaterialId(model.getMaterialId().trim());
if (model.getUseStatus() == null) {
model.setUseStatus(1);
}
if (model.getAllowSync() == null) {
model.setAllowSync(1);
}
if (model.getSiloCategoryId() != null) {
model.setSiloCategoryId(model.getSiloCategoryId().trim());
}
if (model.getStation() != null) {
model.setStation(model.getStation().trim());
}
if (model.getSiloNo() != null) {
model.setSiloNo(model.getSiloNo().trim());
}
return null;
}
}

View File

@@ -0,0 +1,319 @@
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.util.oConvertUtils;
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
import org.jeecg.modules.xslmes.service.IMesXslEquipmentLedgerService;
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/mesXslEquipmentLedger")
@Slf4j
public class MesXslEquipmentLedgerController extends JeecgController<MesXslEquipmentLedger, IMesXslEquipmentLedgerService> {
private static final Set<String> EQUIPMENT_STATUS = Set.of("0", "1", "2");
private static final Set<String> ENABLED_FLAGS = Set.of("0", "1");
@Autowired
private IMesXslEquipmentLedgerService mesXslEquipmentLedgerService;
@Operation(summary = "MES设备台账-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<MesXslEquipmentLedger>> queryPageList(
MesXslEquipmentLedger model,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<MesXslEquipmentLedger> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
Page<MesXslEquipmentLedger> page = new Page<>(pageNo, pageSize);
IPage<MesXslEquipmentLedger> pageList = mesXslEquipmentLedgerService.page(page, queryWrapper);
return Result.OK(pageList);
}
@AutoLog(value = "MES设备台账-添加")
@Operation(summary = "MES设备台账-添加")
@RequiresPermissions("mes:mes_xsl_equipment_ledger:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody MesXslEquipmentLedger model) {
//update-begin---author:jiangxh ---date:20260518 for【MES】设备台账保存前校验-----------
String err = validateForSave(model, null);
if (err != null) {
return Result.error(err);
}
//update-end---author:jiangxh ---date:20260518 for【MES】设备台账保存前校验-----------
mesXslEquipmentLedgerService.save(model);
return Result.OK("添加成功!");
}
@AutoLog(value = "MES设备台账-编辑")
@Operation(summary = "MES设备台账-编辑")
@RequiresPermissions("mes:mes_xsl_equipment_ledger:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody MesXslEquipmentLedger model) {
//update-begin---author:jiangxh ---date:20260518 for【MES】设备台账保存前校验-----------
String err = validateForSave(model, model.getId());
if (err != null) {
return Result.error(err);
}
//update-end---author:jiangxh ---date:20260518 for【MES】设备台账保存前校验-----------
mesXslEquipmentLedgerService.updateById(model);
return Result.OK("编辑成功!");
}
@AutoLog(value = "MES设备台账-删除")
@Operation(summary = "MES设备台账-通过id删除")
@RequiresPermissions("mes:mes_xsl_equipment_ledger:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
mesXslEquipmentLedgerService.removeById(id);
return Result.OK("删除成功!");
}
@AutoLog(value = "MES设备台账-批量删除")
@Operation(summary = "MES设备台账-批量删除")
@RequiresPermissions("mes:mes_xsl_equipment_ledger:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
mesXslEquipmentLedgerService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@Operation(summary = "MES设备台账-通过id查询")
@GetMapping(value = "/queryById")
public Result<MesXslEquipmentLedger> queryById(@RequestParam(name = "id", required = true) String id) {
MesXslEquipmentLedger entity = mesXslEquipmentLedgerService.getById(id);
if (entity == null) {
return Result.error("未找到对应数据");
}
return Result.OK(entity);
}
@Operation(summary = "校验设备编号是否重复")
@GetMapping(value = "/checkEquipmentCode")
public Result<String> checkEquipmentCode(
@RequestParam(name = "equipmentCode", required = true) String equipmentCode,
@RequestParam(name = "dataId", required = false) String dataId) {
if (oConvertUtils.isEmpty(equipmentCode) || equipmentCode.trim().isEmpty()) {
return Result.OK("该值可用!");
}
MesXslEquipmentLedger ctx = new MesXslEquipmentLedger();
if (mesXslEquipmentLedgerService.isEquipmentCodeDuplicated(equipmentCode.trim(), dataId, ctx)) {
return Result.error("设备编号不能重复");
}
return Result.OK("该值可用!");
}
@Operation(summary = "校验设备名称是否重复")
@GetMapping(value = "/checkEquipmentName")
public Result<String> checkEquipmentName(
@RequestParam(name = "equipmentName", required = true) String equipmentName,
@RequestParam(name = "dataId", required = false) String dataId) {
if (oConvertUtils.isEmpty(equipmentName) || equipmentName.trim().isEmpty()) {
return Result.OK("该值可用!");
}
MesXslEquipmentLedger ctx = new MesXslEquipmentLedger();
if (mesXslEquipmentLedgerService.isEquipmentNameDuplicated(equipmentName.trim(), dataId, ctx)) {
return Result.error("设备名称不能重复");
}
return Result.OK("该值可用!");
}
@RequiresPermissions("mes:mes_xsl_equipment_ledger:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MesXslEquipmentLedger model) {
return super.exportXls(request, model, MesXslEquipmentLedger.class, "MES设备台账");
}
@RequiresPermissions("mes:mes_xsl_equipment_ledger:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> ent : fileMap.entrySet()) {
MultipartFile file = ent.getValue();
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<MesXslEquipmentLedger> list =
ExcelImportUtil.importExcel(file.getInputStream(), MesXslEquipmentLedger.class, params);
if (list == null) {
list = List.of();
}
Set<String> codesInFile = new HashSet<>();
Set<String> namesInFile = new HashSet<>();
for (int i = 0; i < list.size(); i++) {
MesXslEquipmentLedger row = list.get(i);
int rowNo = i + 1;
if (row == null) {
return Result.error("文件导入失败:第 " + rowNo + " 条数据无效(空行)");
}
String err = validateImportRow(row, rowNo, codesInFile, namesInFile);
if (err != null) {
return Result.error(err);
}
}
long start = System.currentTimeMillis();
mesXslEquipmentLedgerService.saveBatch(list);
log.info("设备台账Excel导入完成耗时{}ms行数={}", System.currentTimeMillis() - start, list.size());
return Result.ok("文件导入成功!数据行数:" + list.size());
} catch (Exception e) {
String msg = e.getMessage();
log.error(msg, e);
if (msg != null && msg.indexOf("Duplicate entry") >= 0) {
return Result.error("文件导入失败: 存在重复数据(设备编号或设备名称不能重复)");
}
return Result.error("文件导入失败:" + e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
}
return Result.error("文件导入失败!");
}
//update-begin---author:jiangxh ---date:20260518 for【MES】设备台账保存与导入校验-----------
private String validateForSave(MesXslEquipmentLedger model, String excludeId) {
if (oConvertUtils.isEmpty(model.getProcessOperationId())) {
return "请选择所属工序";
}
if (oConvertUtils.isEmpty(model.getEquipmentName()) || model.getEquipmentName().trim().isEmpty()) {
return "设备名称不能为空";
}
String name = model.getEquipmentName().trim();
model.setEquipmentName(name);
if (mesXslEquipmentLedgerService.isEquipmentNameDuplicated(name, excludeId, model)) {
return "设备名称不能重复";
}
if (oConvertUtils.isEmpty(model.getEquipmentCode()) || model.getEquipmentCode().trim().isEmpty()) {
return "设备编号不能为空";
}
String code = model.getEquipmentCode().trim();
model.setEquipmentCode(code);
if (mesXslEquipmentLedgerService.isEquipmentCodeDuplicated(code, excludeId, model)) {
return "设备编号不能重复";
}
trimRelationNames(model);
String status = model.getEquipmentStatus();
if (oConvertUtils.isEmpty(status)) {
model.setEquipmentStatus("0");
} else {
status = status.trim();
if (!EQUIPMENT_STATUS.contains(status)) {
return "设备状态无效(须为在用/停用/报废)";
}
model.setEquipmentStatus(status);
}
String enabled = model.getEnabledFlag();
if (oConvertUtils.isEmpty(enabled)) {
model.setEnabledFlag("1");
} else {
enabled = enabled.trim();
if (!ENABLED_FLAGS.contains(enabled)) {
return "是否启用无效(须为是/否)";
}
model.setEnabledFlag(enabled);
}
return null;
}
private String validateImportRow(MesXslEquipmentLedger row, int rowNo, Set<String> codesInFile, Set<String> namesInFile) {
String code = row.getEquipmentCode();
if (code != null) {
code = code.trim();
}
if (oConvertUtils.isEmpty(code)) {
return "文件导入失败:第 " + rowNo + " 条设备编号不能为空";
}
row.setEquipmentCode(code);
if (!codesInFile.add(code)) {
return "文件导入失败:设备编号【" + code + "】在导入文件中重复";
}
if (mesXslEquipmentLedgerService.isEquipmentCodeDuplicated(code, null, row)) {
return "文件导入失败:第 " + rowNo + " 条设备编号【" + code + "】不能重复";
}
String name = row.getEquipmentName();
if (name != null) {
name = name.trim();
}
if (oConvertUtils.isEmpty(name)) {
return "文件导入失败:第 " + rowNo + " 条设备名称不能为空";
}
row.setEquipmentName(name);
if (!namesInFile.add(name)) {
return "文件导入失败:设备名称【" + name + "】在导入文件中重复";
}
if (mesXslEquipmentLedgerService.isEquipmentNameDuplicated(name, null, row)) {
return "文件导入失败:第 " + rowNo + " 条设备名称【" + name + "】不能重复";
}
trimRelationNames(row);
String status = row.getEquipmentStatus();
if (oConvertUtils.isEmpty(status)) {
row.setEquipmentStatus("0");
} else if (!EQUIPMENT_STATUS.contains(status.trim())) {
return "文件导入失败:第 " + rowNo + " 条设备状态无效";
} else {
row.setEquipmentStatus(status.trim());
}
String enabled = row.getEnabledFlag();
if (oConvertUtils.isEmpty(enabled)) {
row.setEnabledFlag("1");
} else if (!ENABLED_FLAGS.contains(enabled.trim())) {
return "文件导入失败:第 " + rowNo + " 条是否启用无效";
} else {
row.setEnabledFlag(enabled.trim());
}
return null;
}
private static void trimRelationNames(MesXslEquipmentLedger model) {
if (model.getProcessOperationName() != null) {
model.setProcessOperationName(model.getProcessOperationName().trim());
}
if (model.getManufacturerName() != null) {
model.setManufacturerName(model.getManufacturerName().trim());
}
if (model.getEquipmentCategoryName() != null) {
model.setEquipmentCategoryName(model.getEquipmentCategoryName().trim());
}
if (model.getEquipmentTypeName() != null) {
model.setEquipmentTypeName(model.getEquipmentTypeName().trim());
}
if (model.getFactoryName() != null) {
model.setFactoryName(model.getFactoryName().trim());
}
}
//update-end---author:jiangxh ---date:20260518 for【MES】设备台账保存与导入校验-----------
}

View File

@@ -0,0 +1,301 @@
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.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.MesXslEquipmentCategory;
import org.jeecg.modules.xslmes.entity.MesXslEquipmentPart;
import org.jeecg.modules.xslmes.entity.MesXslEquipmentSubPart;
import org.jeecg.modules.xslmes.entity.MesXslEquipmentType;
import org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem;
import org.jeecg.modules.xslmes.service.IMesXslEquipmentCategoryService;
import org.jeecg.modules.xslmes.service.IMesXslEquipmentPartService;
import org.jeecg.modules.xslmes.service.IMesXslEquipmentSubPartService;
import org.jeecg.modules.xslmes.service.IMesXslEquipmentTypeService;
import org.jeecg.modules.xslmes.service.IMesXslInspectMaintainItemService;
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/mesXslInspectMaintainItem")
@Slf4j
public class MesXslInspectMaintainItemController
extends JeecgController<MesXslInspectMaintainItem, IMesXslInspectMaintainItemService> {
private static final Set<String> ITEM_CATEGORY = Set.of("inspect", "maintain");
private static final Set<String> ITEM_TYPE = Set.of("mechanical", "electrical");
private static final Set<String> INSPECT_METHOD = Set.of("visual", "sight", "hearing");
@Autowired
private IMesXslInspectMaintainItemService mesXslInspectMaintainItemService;
@Autowired
private IMesXslEquipmentCategoryService mesXslEquipmentCategoryService;
@Autowired
private IMesXslEquipmentTypeService mesXslEquipmentTypeService;
@Autowired
private IMesXslEquipmentPartService mesXslEquipmentPartService;
@Autowired
private IMesXslEquipmentSubPartService mesXslEquipmentSubPartService;
@Operation(summary = "MES点检及保养项目-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<MesXslInspectMaintainItem>> queryPageList(
MesXslInspectMaintainItem model,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<MesXslInspectMaintainItem> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
Page<MesXslInspectMaintainItem> page = new Page<>(pageNo, pageSize);
IPage<MesXslInspectMaintainItem> pageList = mesXslInspectMaintainItemService.page(page, queryWrapper);
return Result.OK(pageList);
}
@AutoLog(value = "MES点检及保养项目-添加")
@Operation(summary = "MES点检及保养项目-添加")
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody MesXslInspectMaintainItem model) {
//update-begin---author:jiangxh ---date:20260519 for【MES】点检及保养项目保存前校验-----------
String err = validateForSave(model, null);
if (err != null) {
return Result.error(err);
}
//update-end---author:jiangxh ---date:20260519 for【MES】点检及保养项目保存前校验-----------
mesXslInspectMaintainItemService.save(model);
return Result.OK("添加成功!");
}
@AutoLog(value = "MES点检及保养项目-编辑")
@Operation(summary = "MES点检及保养项目-编辑")
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody MesXslInspectMaintainItem model) {
//update-begin---author:jiangxh ---date:20260519 for【MES】点检及保养项目保存前校验-----------
String err = validateForSave(model, model.getId());
if (err != null) {
return Result.error(err);
}
//update-end---author:jiangxh ---date:20260519 for【MES】点检及保养项目保存前校验-----------
mesXslInspectMaintainItemService.updateById(model);
return Result.OK("编辑成功!");
}
@AutoLog(value = "MES点检及保养项目-删除")
@Operation(summary = "MES点检及保养项目-通过id删除")
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
mesXslInspectMaintainItemService.removeById(id);
return Result.OK("删除成功!");
}
@AutoLog(value = "MES点检及保养项目-批量删除")
@Operation(summary = "MES点检及保养项目-批量删除")
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
mesXslInspectMaintainItemService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@Operation(summary = "MES点检及保养项目-通过id查询")
@GetMapping(value = "/queryById")
public Result<MesXslInspectMaintainItem> queryById(@RequestParam(name = "id", required = true) String id) {
MesXslInspectMaintainItem entity = mesXslInspectMaintainItemService.getById(id);
if (entity == null) {
return Result.error("未找到对应数据");
}
return Result.OK(entity);
}
@Operation(summary = "校验项目名称是否重复同租户未删除数据dataId 为编辑时当前主键)")
@GetMapping(value = "/checkItemName")
public Result<String> checkItemName(
@RequestParam(name = "itemName", required = true) String itemName,
@RequestParam(name = "dataId", required = false) String dataId) {
if (oConvertUtils.isEmpty(itemName) || itemName.trim().isEmpty()) {
return Result.OK("该值可用!");
}
MesXslInspectMaintainItem ctx = new MesXslInspectMaintainItem();
if (mesXslInspectMaintainItemService.isItemNameDuplicated(itemName.trim(), dataId, ctx)) {
return Result.error("项目名称不能重复");
}
return Result.OK("该值可用!");
}
@Operation(summary = "校验项目编号是否重复同租户未删除数据dataId 为编辑时当前主键)")
@GetMapping(value = "/checkItemCode")
public Result<String> checkItemCode(
@RequestParam(name = "itemCode", required = true) String itemCode,
@RequestParam(name = "dataId", required = false) String dataId) {
if (oConvertUtils.isEmpty(itemCode) || itemCode.trim().isEmpty()) {
return Result.OK("该值可用!");
}
MesXslInspectMaintainItem ctx = new MesXslInspectMaintainItem();
if (mesXslInspectMaintainItemService.isItemCodeDuplicated(itemCode.trim(), dataId, ctx)) {
return Result.error("项目编号不能重复");
}
return Result.OK("该值可用!");
}
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MesXslInspectMaintainItem model) {
return super.exportXls(request, model, MesXslInspectMaintainItem.class, "MES点检及保养项目");
}
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, MesXslInspectMaintainItem.class);
}
//update-begin---author:jiangxh ---date:20260519 for【MES】点检及保养项目保存校验唯一性、设备关联、字典-----------
private String validateForSave(MesXslInspectMaintainItem model, String excludeId) {
if (model == null) {
return "参数不能为空";
}
String itemName = model.getItemName();
if (itemName != null) {
itemName = itemName.trim();
}
if (oConvertUtils.isEmpty(itemName)) {
return "项目名称不能为空";
}
model.setItemName(itemName);
String itemCode = model.getItemCode();
if (itemCode != null) {
itemCode = itemCode.trim();
}
if (oConvertUtils.isEmpty(itemCode)) {
return "项目编号不能为空";
}
model.setItemCode(itemCode);
if (mesXslInspectMaintainItemService.isItemNameDuplicated(itemName, excludeId, model)) {
return "项目名称不能重复";
}
if (mesXslInspectMaintainItemService.isItemCodeDuplicated(itemCode, excludeId, model)) {
return "项目编号不能重复";
}
if (oConvertUtils.isEmpty(model.getEquipmentCategoryId())) {
return "请选择设备类别";
}
if (oConvertUtils.isEmpty(model.getEquipmentTypeId())) {
return "请选择设备类型";
}
if (oConvertUtils.isEmpty(model.getEquipmentPartId())) {
return "请选择设备部位";
}
if (oConvertUtils.isEmpty(model.getEquipmentSubPartId())) {
return "请选择设备小部位";
}
MesXslEquipmentCategory cat = mesXslEquipmentCategoryService.getById(model.getEquipmentCategoryId());
if (cat == null || isDeleted(cat.getDelFlag())) {
return "设备类别不存在或已删除";
}
model.setEquipmentCategoryName(cat.getCategoryName());
MesXslEquipmentType type = mesXslEquipmentTypeService.getById(model.getEquipmentTypeId());
if (type == null || isDeleted(type.getDelFlag())) {
return "设备类型不存在或已删除";
}
if (!model.getEquipmentCategoryId().equals(type.getEquipmentCategoryId())) {
return "设备类型与所选设备类别不匹配";
}
model.setEquipmentTypeName(type.getTypeName());
MesXslEquipmentPart part = mesXslEquipmentPartService.getById(model.getEquipmentPartId());
if (part == null || isDeleted(part.getDelFlag())) {
return "设备部位不存在或已删除";
}
if (!model.getEquipmentCategoryId().equals(part.getEquipmentCategoryId())) {
return "设备部位与所选设备类别不匹配";
}
model.setEquipmentPartName(part.getPartName());
MesXslEquipmentSubPart sub = mesXslEquipmentSubPartService.getById(model.getEquipmentSubPartId());
if (sub == null || isDeleted(sub.getDelFlag())) {
return "设备小部位不存在或已删除";
}
if (!model.getEquipmentCategoryId().equals(sub.getEquipmentCategoryId())) {
return "设备小部位与所选设备类别不匹配";
}
if (!model.getEquipmentPartId().equals(sub.getEquipmentPartId())) {
return "设备小部位与所选设备部位不匹配";
}
model.setEquipmentSubPartName(sub.getSubPartName());
String itemCategory = model.getItemCategory();
if (itemCategory != null) {
itemCategory = itemCategory.trim();
}
if (oConvertUtils.isEmpty(itemCategory) || !ITEM_CATEGORY.contains(itemCategory)) {
return "项目类别无效,请选择点检或保养";
}
model.setItemCategory(itemCategory);
String itemType = model.getItemType();
if (itemType != null) {
itemType = itemType.trim();
}
if (oConvertUtils.isEmpty(itemType) || !ITEM_TYPE.contains(itemType)) {
return "项目类型无效,请选择机械类或电气类";
}
model.setItemType(itemType);
String inspectMethod = model.getInspectMethod();
if (inspectMethod != null) {
inspectMethod = inspectMethod.trim();
}
if (oConvertUtils.isEmpty(inspectMethod) || !INSPECT_METHOD.contains(inspectMethod)) {
return "点检方式无效,请选择视觉、目测或听觉";
}
model.setInspectMethod(inspectMethod);
if (model.getJudgmentCriteria() != null) {
model.setJudgmentCriteria(model.getJudgmentCriteria().trim());
}
if (oConvertUtils.isEmpty(model.getJudgmentCriteria())) {
return "判断基准不能为空";
}
if (model.getMaintainCycleDays() != null && model.getMaintainCycleDays() < 0) {
return "保养周期(天)不能为负数";
}
return null;
}
private static boolean isDeleted(Integer delFlag) {
return delFlag != null && delFlag.equals(CommonConstant.DEL_FLAG_1);
}
//update-end---author:jiangxh ---date:20260519 for【MES】点检及保养项目保存校验唯一性、设备关联、字典-----------
}

View File

@@ -0,0 +1,167 @@
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 java.util.Arrays;
import org.apache.commons.lang3.StringUtils;
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.util.oConvertUtils;
import org.jeecg.modules.xslmes.entity.MesXslMixerAction;
import org.jeecg.modules.xslmes.service.IMesXslMixerActionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
@Tag(name = "密炼机动作维护")
@RestController
@RequestMapping("/xslmes/mesXslMixerAction")
public class MesXslMixerActionController extends JeecgController<MesXslMixerAction, IMesXslMixerActionService> {
@Autowired private IMesXslMixerActionService mesXslMixerActionService;
@Operation(summary = "密炼机动作维护-分页列表查询")
@GetMapping("/list")
public Result<IPage<MesXslMixerAction>> queryPageList(
MesXslMixerAction model,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<MesXslMixerAction> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
IPage<MesXslMixerAction> pageList = mesXslMixerActionService.page(new Page<>(pageNo, pageSize), queryWrapper);
return Result.OK(pageList);
}
@AutoLog(value = "密炼机动作维护-添加")
@Operation(summary = "密炼机动作维护-添加")
@RequiresPermissions("xslmes:mes_xsl_mixer_action:add")
@PostMapping("/add")
public Result<String> add(@RequestBody MesXslMixerAction model) {
String err = validateForSave(model, null);
if (err != null) {
return Result.error(err);
}
mesXslMixerActionService.fillEquipmentName(model);
if (StringUtils.isBlank(model.getEquipmentName())) {
return Result.error("请选择有效的设备名称");
}
mesXslMixerActionService.save(model);
return Result.OK("添加成功!");
}
@AutoLog(value = "密炼机动作维护-编辑")
@Operation(summary = "密炼机动作维护-编辑")
@RequiresPermissions("xslmes:mes_xsl_mixer_action:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody MesXslMixerAction model) {
String err = validateForSave(model, model.getId());
if (err != null) {
return Result.error(err);
}
mesXslMixerActionService.fillEquipmentName(model);
if (StringUtils.isBlank(model.getEquipmentName())) {
return Result.error("请选择有效的设备名称");
}
mesXslMixerActionService.updateById(model);
return Result.OK("编辑成功!");
}
@AutoLog(value = "密炼机动作维护-通过id删除")
@Operation(summary = "密炼机动作维护-通过id删除")
@RequiresPermissions("xslmes:mes_xsl_mixer_action:delete")
@DeleteMapping("/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
mesXslMixerActionService.removeById(id);
return Result.OK("删除成功!");
}
@AutoLog(value = "密炼机动作维护-批量删除")
@Operation(summary = "密炼机动作维护-批量删除")
@RequiresPermissions("xslmes:mes_xsl_mixer_action:deleteBatch")
@DeleteMapping("/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
mesXslMixerActionService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@Operation(summary = "密炼机动作维护-通过id查询")
@GetMapping("/queryById")
public Result<MesXslMixerAction> queryById(@RequestParam(name = "id", required = true) String id) {
MesXslMixerAction entity = mesXslMixerActionService.getById(id);
if (entity == null) {
return Result.error("未找到对应数据");
}
return Result.OK(entity);
}
@Operation(summary = "校验动作名称是否重复")
@GetMapping("/checkActionName")
public Result<String> checkActionName(
@RequestParam(name = "actionName", required = true) String actionName,
@RequestParam(name = "dataId", required = false) String dataId) {
if (oConvertUtils.isEmpty(actionName) || actionName.trim().isEmpty()) {
return Result.OK("该值可用!");
}
if (mesXslMixerActionService.isActionNameDuplicated(actionName, dataId)) {
return Result.error("动作名称不能重复");
}
return Result.OK("该值可用!");
}
@Operation(summary = "校验动作代号是否重复")
@GetMapping("/checkActionCode")
public Result<String> checkActionCode(
@RequestParam(name = "actionCode", required = true) String actionCode,
@RequestParam(name = "dataId", required = false) String dataId) {
if (oConvertUtils.isEmpty(actionCode) || actionCode.trim().isEmpty()) {
return Result.OK("该值可用!");
}
if (mesXslMixerActionService.isActionCodeDuplicated(actionCode, dataId)) {
return Result.error("动作代号不能重复");
}
return Result.OK("该值可用!");
}
@RequiresPermissions("xslmes:mes_xsl_mixer_action:exportXls")
@RequestMapping("/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MesXslMixerAction model) {
return super.exportXls(request, model, MesXslMixerAction.class, "密炼机动作维护");
}
private String validateForSave(MesXslMixerAction model, String excludeId) {
if (oConvertUtils.isEmpty(model.getEquipmentId()) || StringUtils.isBlank(model.getEquipmentId())) {
return "设备名称不能为空";
}
model.setEquipmentId(model.getEquipmentId().trim());
if (oConvertUtils.isEmpty(model.getActionName()) || StringUtils.isBlank(model.getActionName())) {
return "动作名称不能为空";
}
model.setActionName(model.getActionName().trim());
if (mesXslMixerActionService.isActionNameDuplicated(model.getActionName(), excludeId)) {
return "动作名称不能重复";
}
if (oConvertUtils.isEmpty(model.getActionCode()) || StringUtils.isBlank(model.getActionCode())) {
return "动作代号不能为空";
}
model.setActionCode(model.getActionCode().trim());
if (mesXslMixerActionService.isActionCodeDuplicated(model.getActionCode(), excludeId)) {
return "动作代号不能重复";
}
return null;
}
}

View File

@@ -0,0 +1,172 @@
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.util.Arrays;
import java.util.HashMap;
import java.util.Map;
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.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.mes.material.entity.MesMixerMaterial;
import org.jeecg.modules.mes.material.service.IMesMixerMaterialService;
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
import org.jeecg.modules.xslmes.service.IMesXslMixerMaterialSubstituteService;
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/mesXslMixerMaterialSubstitute")
@Slf4j
public class MesXslMixerMaterialSubstituteController
extends JeecgController<MesXslMixerMaterialSubstitute, IMesXslMixerMaterialSubstituteService> {
@Autowired
private IMesXslMixerMaterialSubstituteService mesXslMixerMaterialSubstituteService;
@Autowired
private IMesMixerMaterialService mesMixerMaterialService;
@Operation(summary = "MES密炼物料替代对应关系-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<MesXslMixerMaterialSubstitute>> queryPageList(
MesXslMixerMaterialSubstitute model,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
customeRuleMap.put("mixerMaterialId", QueryRuleEnum.LIKE_WITH_OR);
customeRuleMap.put("substituteMaterialId", QueryRuleEnum.LIKE_WITH_OR);
QueryWrapper<MesXslMixerMaterialSubstitute> queryWrapper =
QueryGenerator.initQueryWrapper(model, req.getParameterMap(), customeRuleMap);
queryWrapper.orderByAsc("serial_no");
Page<MesXslMixerMaterialSubstitute> page = new Page<>(pageNo, pageSize);
IPage<MesXslMixerMaterialSubstitute> pageList = mesXslMixerMaterialSubstituteService.page(page, queryWrapper);
return Result.OK(pageList);
}
@AutoLog(value = "MES密炼物料替代对应关系-添加")
@Operation(summary = "MES密炼物料替代对应关系-添加")
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody MesXslMixerMaterialSubstitute model) {
//update-begin---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
String err = validateAndFillMaterials(model, false);
if (err != null) {
return Result.error(err);
}
//update-end---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
mesXslMixerMaterialSubstituteService.saveWithSerialNo(model);
return Result.OK("添加成功!");
}
@AutoLog(value = "MES密炼物料替代对应关系-编辑")
@Operation(summary = "MES密炼物料替代对应关系-编辑")
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody MesXslMixerMaterialSubstitute model) {
//update-begin---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
String err = validateAndFillMaterials(model, true);
if (err != null) {
return Result.error(err);
}
//update-end---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
mesXslMixerMaterialSubstituteService.updateById(model);
return Result.OK("编辑成功!");
}
@AutoLog(value = "MES密炼物料替代对应关系-删除")
@Operation(summary = "MES密炼物料替代对应关系-通过id删除")
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
mesXslMixerMaterialSubstituteService.removeById(id);
return Result.OK("删除成功!");
}
@AutoLog(value = "MES密炼物料替代对应关系-批量删除")
@Operation(summary = "MES密炼物料替代对应关系-批量删除")
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
mesXslMixerMaterialSubstituteService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@Operation(summary = "MES密炼物料替代对应关系-通过id查询")
@GetMapping(value = "/queryById")
public Result<MesXslMixerMaterialSubstitute> queryById(@RequestParam(name = "id", required = true) String id) {
MesXslMixerMaterialSubstitute entity = mesXslMixerMaterialSubstituteService.getById(id);
if (entity == null) {
return Result.error("未找到对应数据");
}
return Result.OK(entity);
}
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MesXslMixerMaterialSubstitute model) {
return super.exportXls(request, model, MesXslMixerMaterialSubstitute.class, "密炼物料替代对应关系");
}
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, MesXslMixerMaterialSubstitute.class);
}
//update-begin---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
private String validateAndFillMaterials(MesXslMixerMaterialSubstitute model, boolean isUpdate) {
if (oConvertUtils.isEmpty(model.getMixerMaterialId())) {
return "请选择密炼物料";
}
if (oConvertUtils.isEmpty(model.getSubstituteMaterialId())) {
return "请选择替代密炼物料";
}
if (model.getMixerMaterialId().equals(model.getSubstituteMaterialId())) {
return "密炼物料与替代密炼物料不能相同";
}
MesMixerMaterial mixerMaterial = mesMixerMaterialService.getById(model.getMixerMaterialId());
if (mixerMaterial == null) {
return "所选密炼物料不存在,请重新选择";
}
MesMixerMaterial substituteMaterial = mesMixerMaterialService.getById(model.getSubstituteMaterialId());
if (substituteMaterial == null) {
return "所选替代密炼物料不存在,请重新选择";
}
model.setMixerMaterialCode(mixerMaterial.getMaterialCode());
model.setMixerMaterialName(mixerMaterial.getMaterialName());
model.setSubstituteMaterialCode(substituteMaterial.getMaterialCode());
model.setSubstituteMaterialName(substituteMaterial.getMaterialName());
LambdaQueryWrapper<MesXslMixerMaterialSubstitute> dupQw = new LambdaQueryWrapper<>();
dupQw.eq(MesXslMixerMaterialSubstitute::getMixerMaterialId, model.getMixerMaterialId())
.eq(MesXslMixerMaterialSubstitute::getSubstituteMaterialId, model.getSubstituteMaterialId());
if (isUpdate && oConvertUtils.isNotEmpty(model.getId())) {
dupQw.ne(MesXslMixerMaterialSubstitute::getId, model.getId());
}
if (mesXslMixerMaterialSubstituteService.count(dupQw) > 0) {
return "该密炼物料与替代密炼物料的对应关系已存在";
}
return null;
}
//update-end---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
}

View File

@@ -0,0 +1,261 @@
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.HashMap;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
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.system.query.QueryRuleEnum;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.service.ISysDepartService;
import org.jeecg.modules.xslmes.entity.MesXslMixerPsCompile;
import org.jeecg.modules.xslmes.service.IMesXslMixerPsCompileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
/**
* MES 密炼PS编制
*/
@Tag(name = "MES密炼PS编制")
@RestController
@RequestMapping("/xslmes/mesXslMixerPsCompile")
@Slf4j
public class MesXslMixerPsCompileController extends JeecgController<MesXslMixerPsCompile, IMesXslMixerPsCompileService> {
@Autowired
private IMesXslMixerPsCompileService mesXslMixerPsCompileService;
@Autowired
private ISysDepartService sysDepartService;
@Operation(summary = "MES密炼PS编制-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<MesXslMixerPsCompile>> queryPageList(
MesXslMixerPsCompile model,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
customeRuleMap.put("psCode", QueryRuleEnum.LIKE);
customeRuleMap.put("title", QueryRuleEnum.LIKE);
QueryWrapper<MesXslMixerPsCompile> queryWrapper =
QueryGenerator.initQueryWrapper(model, req.getParameterMap(), customeRuleMap);
queryWrapper.orderByDesc("issue_date", "create_time");
Page<MesXslMixerPsCompile> page = new Page<>(pageNo, pageSize);
IPage<MesXslMixerPsCompile> pageList = mesXslMixerPsCompileService.page(page, queryWrapper);
return Result.OK(pageList);
}
@AutoLog(value = "MES密炼PS编制-添加")
@Operation(summary = "MES密炼PS编制-添加")
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody MesXslMixerPsCompile model) {
//update-begin---author:jiangxh ---date:20260520 for【密炼PS编制】保存前校验与冗余回填-----------
String err = validateAndFill(model);
if (err != null) {
return Result.error(err);
}
//update-end---author:jiangxh ---date:20260520 for【密炼PS编制】保存前校验与冗余回填-----------
mesXslMixerPsCompileService.save(model);
return Result.OK("添加成功!");
}
@AutoLog(value = "MES密炼PS编制-编辑")
@Operation(summary = "MES密炼PS编制-编辑")
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody MesXslMixerPsCompile model) {
//update-begin---author:jiangxh ---date:20260520 for【密炼PS编制】保存前校验与冗余回填-----------
String err = validateAndFill(model);
if (err != null) {
return Result.error(err);
}
//update-end---author:jiangxh ---date:20260520 for【密炼PS编制】保存前校验与冗余回填-----------
MesXslMixerPsCompile existing = mesXslMixerPsCompileService.getById(model.getId());
if (existing == null) {
return Result.error("未找到对应数据");
}
if (!"compile".equals(existing.getStatus())) {
return Result.error("仅编制状态的单据允许编辑");
}
model.setStatus("compile");
model.setProofreadBy(existing.getProofreadBy());
model.setProofreadTime(existing.getProofreadTime());
model.setAuditBy(existing.getAuditBy());
model.setAuditTime(existing.getAuditTime());
model.setApproveBy(existing.getApproveBy());
model.setApproveTime(existing.getApproveTime());
mesXslMixerPsCompileService.updateById(model);
return Result.OK("编辑成功!");
}
@AutoLog(value = "MES密炼PS编制-删除")
@Operation(summary = "MES密炼PS编制-通过id删除")
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
//update-begin---author:jiangxh ---date:20260520 for【密炼PS编制】仅编制状态允许删除-----------
MesXslMixerPsCompile existing = mesXslMixerPsCompileService.getById(id);
String err = assertCompileStatusForDelete(existing);
if (err != null) {
return Result.error(err);
}
//update-end---author:jiangxh ---date:20260520 for【密炼PS编制】仅编制状态允许删除-----------
mesXslMixerPsCompileService.removeById(id);
return Result.OK("删除成功!");
}
@AutoLog(value = "MES密炼PS编制-批量删除")
@Operation(summary = "MES密炼PS编制-批量删除")
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
//update-begin---author:jiangxh ---date:20260520 for【密炼PS编制】仅编制状态允许删除-----------
if (oConvertUtils.isEmpty(ids)) {
return Result.error("请选择要删除的记录");
}
for (String id : ids.split(",")) {
if (oConvertUtils.isEmpty(id)) {
continue;
}
MesXslMixerPsCompile existing = mesXslMixerPsCompileService.getById(id.trim());
String err = assertCompileStatusForDelete(existing);
if (err != null) {
return Result.error(err);
}
}
//update-end---author:jiangxh ---date:20260520 for【密炼PS编制】仅编制状态允许删除-----------
mesXslMixerPsCompileService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@Operation(summary = "MES密炼PS编制-通过id查询")
@GetMapping(value = "/queryById")
public Result<MesXslMixerPsCompile> queryById(@RequestParam(name = "id", required = true) String id) {
MesXslMixerPsCompile entity = mesXslMixerPsCompileService.getById(id);
if (entity == null) {
return Result.error("未找到对应数据");
}
return Result.OK(entity);
}
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MesXslMixerPsCompile model) {
return super.exportXls(request, model, MesXslMixerPsCompile.class, "密炼PS编制");
}
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, MesXslMixerPsCompile.class);
}
//update-begin---author:jiangxh ---date:20260520 for【密炼PS编制】校对/审核/批准-----------
@AutoLog(value = "MES密炼PS编制-校对")
@Operation(summary = "MES密炼PS编制-校对")
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:proofread")
@PostMapping(value = "/proofread")
public Result<String> proofread(@RequestParam(name = "ids") String ids) {
return doChangeStatus(ids, "compile", "proofread", "校对");
}
@AutoLog(value = "MES密炼PS编制-审核")
@Operation(summary = "MES密炼PS编制-审核")
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:audit")
@PostMapping(value = "/audit")
public Result<String> audit(@RequestParam(name = "ids") String ids) {
return doChangeStatus(ids, "proofread", "audit", "审核");
}
@AutoLog(value = "MES密炼PS编制-批准")
@Operation(summary = "MES密炼PS编制-批准")
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:approve")
@PostMapping(value = "/approve")
public Result<String> approve(@RequestParam(name = "ids") String ids) {
return doChangeStatus(ids, "audit", "approve", "批准");
}
private Result<String> doChangeStatus(String ids, String expectedStatus, String targetStatus, String actionLabel) {
String err = mesXslMixerPsCompileService.changeStatusBatch(
ids, expectedStatus, targetStatus, actionLabel, getOperatorName());
if (err != null) {
return Result.error(err);
}
return Result.OK(actionLabel + "成功!");
}
private String getOperatorName() {
LoginUser loginUser = null;
try {
loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
} catch (Exception e) {
log.debug("获取当前登录用户失败", e);
}
if (loginUser == null) {
return null;
}
if (oConvertUtils.isNotEmpty(loginUser.getRealname())) {
return loginUser.getRealname();
}
return loginUser.getUsername();
}
//update-end---author:jiangxh ---date:20260520 for【密炼PS编制】校对/审核/批准-----------
//update-begin---author:jiangxh ---date:20260520 for【密炼PS编制】保存前校验与冗余回填-----------
private String validateAndFill(MesXslMixerPsCompile model) {
if (oConvertUtils.isEmpty(model.getReceiveDeptId())) {
return "请选择收信部门";
}
if (oConvertUtils.isEmpty(model.getReferenceDeptId())) {
return "请选择参照部门";
}
if (oConvertUtils.isEmpty(model.getTitle())) {
return "请输入标题";
}
if (oConvertUtils.isEmpty(model.getStatus())) {
model.setStatus("compile");
}
if (oConvertUtils.isNotEmpty(model.getFactoryId())) {
SysDepart factory = sysDepartService.getById(model.getFactoryId());
if (factory == null) {
return "所选所属工厂不存在,请重新选择";
}
model.setFactoryName(factory.getDepartName());
} else {
model.setFactoryName(null);
}
return null;
}
//update-end---author:jiangxh ---date:20260520 for【密炼PS编制】保存前校验与冗余回填-----------
//update-begin---author:jiangxh ---date:20260520 for【密炼PS编制】仅编制状态允许删除-----------
private String assertCompileStatusForDelete(MesXslMixerPsCompile entity) {
if (entity == null) {
return "记录不存在或已删除";
}
String status = entity.getStatus() == null ? "" : entity.getStatus();
if (!"compile".equals(status)) {
String psCode = oConvertUtils.isEmpty(entity.getPsCode()) ? entity.getId() : entity.getPsCode();
return "PS编码[" + psCode + "]当前状态不允许删除,仅编制状态可删除";
}
return null;
}
//update-end---author:jiangxh ---date:20260520 for【密炼PS编制】仅编制状态允许删除-----------
}

View File

@@ -0,0 +1,181 @@
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.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
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.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.mes.material.entity.MesMaterial;
import org.jeecg.modules.mes.material.service.IMesMaterialService;
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
import org.jeecg.modules.xslmes.service.IMesXslOpenMillParamService;
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/mesXslOpenMillParam")
@Slf4j
public class MesXslOpenMillParamController extends JeecgController<MesXslOpenMillParam, IMesXslOpenMillParamService> {
@Autowired
private IMesXslOpenMillParamService mesXslOpenMillParamService;
@Autowired
private IMesMaterialService mesMaterialService;
@Operation(summary = "MES开炼机参数维护-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<MesXslOpenMillParam>> queryPageList(
MesXslOpenMillParam model,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
customeRuleMap.put("materialId", QueryRuleEnum.LIKE_WITH_OR);
QueryWrapper<MesXslOpenMillParam> queryWrapper =
QueryGenerator.initQueryWrapper(model, req.getParameterMap(), customeRuleMap);
Page<MesXslOpenMillParam> page = new Page<>(pageNo, pageSize);
IPage<MesXslOpenMillParam> pageList = mesXslOpenMillParamService.page(page, queryWrapper);
return Result.OK(pageList);
}
@AutoLog(value = "MES开炼机参数维护-添加")
@Operation(summary = "MES开炼机参数维护-添加")
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody MesXslOpenMillParam model) {
//update-begin---author:jiangxh ---date:20260520 for【开炼机参数维护】保存前校验与胶料冗余回填-----------
String err = validateAndFillMaterial(model);
if (err != null) {
return Result.error(err);
}
//update-end---author:jiangxh ---date:20260520 for【开炼机参数维护】保存前校验与胶料冗余回填-----------
mesXslOpenMillParamService.save(model);
return Result.OK("添加成功!");
}
@AutoLog(value = "MES开炼机参数维护-编辑")
@Operation(summary = "MES开炼机参数维护-编辑")
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody MesXslOpenMillParam model) {
//update-begin---author:jiangxh ---date:20260520 for【开炼机参数维护】保存前校验与胶料冗余回填-----------
String err = validateAndFillMaterial(model);
if (err != null) {
return Result.error(err);
}
//update-end---author:jiangxh ---date:20260520 for【开炼机参数维护】保存前校验与胶料冗余回填-----------
mesXslOpenMillParamService.updateById(model);
return Result.OK("编辑成功!");
}
@AutoLog(value = "MES开炼机参数维护-删除")
@Operation(summary = "MES开炼机参数维护-通过id删除")
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
mesXslOpenMillParamService.removeById(id);
return Result.OK("删除成功!");
}
@AutoLog(value = "MES开炼机参数维护-批量删除")
@Operation(summary = "MES开炼机参数维护-批量删除")
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
mesXslOpenMillParamService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@Operation(summary = "MES开炼机参数维护-通过id查询")
@GetMapping(value = "/queryById")
public Result<MesXslOpenMillParam> queryById(@RequestParam(name = "id", required = true) String id) {
MesXslOpenMillParam entity = mesXslOpenMillParamService.getById(id);
if (entity == null) {
return Result.error("未找到对应数据");
}
return Result.OK(entity);
}
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MesXslOpenMillParam model) {
return super.exportXls(request, model, MesXslOpenMillParam.class, "开炼机参数维护");
}
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, MesXslOpenMillParam.class);
}
//update-begin---author:jiangxh ---date:20260520 for【开炼机参数维护】保存前校验与胶料冗余回填-----------
private String validateAndFillMaterial(MesXslOpenMillParam model) {
if (oConvertUtils.isEmpty(model.getMaterialId())) {
return "请选择胶料";
}
MesMaterial material = mesMaterialService.getById(model.getMaterialId());
if (material == null) {
return "所选胶料不存在,请重新选择";
}
model.setMaterialName(material.getMaterialName());
model.setMaterialCode(oConvertUtils.isEmpty(material.getAliasName()) ? "" : material.getAliasName());
String timeErr = validateTimeFields(model);
if (timeErr != null) {
return timeErr;
}
return null;
}
private String validateTimeFields(MesXslOpenMillParam model) {
if (isNegative(model.getR0FeedTime())) {
return "R0进胶时间不能为负数";
}
if (isNegative(model.getR0RingTime())) {
return "R0成环时间不能为负数";
}
if (isNegative(model.getR0BreakTime())) {
return "R0拉断时间不能为负数";
}
if (isNegative(model.getR0DischargeTime())) {
return "R0排胶时间不能为负数";
}
if (isNegative(model.getR1FeedTime())) {
return "R1进胶时间不能为负数";
}
if (isNegative(model.getR1RingTime())) {
return "R1成环时间不能为负数";
}
if (isNegative(model.getR1BreakTime())) {
return "R1拉断时间不能为负数";
}
if (isNegative(model.getR1DischargeTime())) {
return "R1排胶时间不能为负数";
}
return null;
}
private static boolean isNegative(BigDecimal value) {
return value != null && value.compareTo(BigDecimal.ZERO) < 0;
}
//update-end---author:jiangxh ---date:20260520 for【开炼机参数维护】保存前校验与胶料冗余回填-----------
}

View File

@@ -0,0 +1,90 @@
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.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* MES 日罐物料对应信息
*/
@Data
@TableName("mes_xsl_day_tank_material_map")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES日罐物料对应信息")
public class MesXslDayTankMaterialMap implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Excel(name = "机台名称", width = 20, dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id")
@Dict(dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id")
@Schema(description = "设备台账ID")
private String equipmentId;
@Excel(name = "机台代码", width = 20)
@Schema(description = "机台代码(设备编号冗余)")
private String machineCode;
@Excel(name = "机台名称", width = 20)
@Schema(description = "机台名称冗余")
private String machineName;
@Excel(name = "料仓分类", width = 20, dictTable = "sys_category", dicText = "name", dicCode = "id")
@Dict(dictTable = "sys_category", dicText = "name", dicCode = "id")
@Schema(description = "料仓分类ID分类字典")
private String siloCategoryId;
@Excel(name = "工位", width = 20)
@Schema(description = "工位")
private String station;
@Excel(name = "料仓号", width = 20)
@Schema(description = "料仓号")
private String siloNo;
@Excel(name = "物料名称", width = 20, dictTable = "mes_material", dicText = "material_name", dicCode = "id")
@Dict(dictTable = "mes_material", dicText = "material_name", dicCode = "id")
@Schema(description = "胶料信息ID")
private String materialId;
@Excel(name = "物料名称", width = 20)
@Schema(description = "物料名称冗余")
private String materialName;
@Excel(name = "使用状态", width = 12, replace = {"使用中_1", "停用_0"})
@Schema(description = "使用状态1使用中 0停用")
private Integer useStatus;
@Excel(name = "是否允许同步", width = 12, replace = {"允许_1", "不允许_0"})
@Schema(description = "是否允许同步1允许 0不允许")
private Integer allowSync;
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;
private Integer delFlag;
}

View File

@@ -0,0 +1,168 @@
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.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* MES 设备台账(表 mes_xsl_equipment_ledger
*/
@Data
@TableName("mes_xsl_equipment_ledger")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES设备台账")
public class MesXslEquipmentLedger implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Schema(description = "所属工序主键")
private String processOperationId;
@Excel(name = "工序名称", width = 20)
@Schema(description = "工序名称冗余")
private String processOperationName;
@Excel(name = "设备名称", width = 22)
@Schema(description = "设备名称(同租户未删除数据中唯一)")
private String equipmentName;
@Excel(name = "设备编号", width = 18)
@Schema(description = "设备编号(同租户未删除数据中唯一)")
private String equipmentCode;
@Schema(description = "所属设备厂家主键")
private String manufacturerId;
@Excel(name = "设备厂家", width = 20)
@Schema(description = "设备厂家名称冗余")
private String manufacturerName;
@Schema(description = "设备类别主键")
private String equipmentCategoryId;
@Excel(name = "设备类别", width = 16)
@Schema(description = "设备类别名称冗余")
private String equipmentCategoryName;
@Schema(description = "设备类型主键")
private String equipmentTypeId;
@Excel(name = "设备类型", width = 16)
@Schema(description = "设备类型名称冗余")
private String equipmentTypeName;
@Schema(description = "所属工厂主键(厂家信息)")
private String factoryId;
@Excel(name = "所属工厂", width = 20)
@Schema(description = "所属工厂名称冗余")
private String factoryName;
@Excel(name = "设备型号", width = 16)
@Schema(description = "设备型号")
private String equipmentModel;
@Excel(name = "设备状态", width = 12, dicCode = "xslmes_equipment_ledger_status")
@Dict(dicCode = "xslmes_equipment_ledger_status")
@Schema(description = "设备状态(字典:在用/停用/报废)")
private String equipmentStatus;
@Excel(name = "序列号", width = 18)
@Schema(description = "序列号")
private String serialNo;
@Excel(name = "铭牌", width = 18)
@Schema(description = "铭牌")
private String nameplate;
@Excel(name = "维修部门", width = 16, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Schema(description = "维修部门主键")
private String maintainDeptId;
@Excel(name = "维修人员", width = 12)
@Schema(description = "维修人员")
private String maintainPerson;
@Excel(name = "主管部门", width = 16, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Schema(description = "主管部门主键")
private String manageDeptId;
@Excel(name = "资料文件编号", width = 18)
@Schema(description = "资料文件编号")
private String docFileNo;
@Excel(name = "生产日期", width = 14, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(description = "生产日期")
private Date productionDate;
@Excel(name = "购买日期", width = 14, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(description = "购买日期")
private Date purchaseDate;
@Excel(name = "使用日期", width = 14, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(description = "使用日期")
private Date useDate;
@Excel(name = "厂商联系人", width = 14)
@Schema(description = "厂商联系人")
private String vendorContact;
@Excel(name = "价值", width = 14)
@Schema(description = "价值")
private String assetValue;
@Excel(name = "受控PDA", width = 14)
@Schema(description = "受控PDA")
private String controlledPda;
@Excel(name = "超产比率", width = 12)
@Schema(description = "超产比率")
private String overproductionRatio;
@Excel(name = "有效体积", width = 12)
@Schema(description = "有效体积")
private String effectiveVolume;
@Excel(name = "是否启用", width = 10, dicCode = "yn")
@Dict(dicCode = "yn")
@Schema(description = "是否启用字典yn1是0否")
private String enabledFlag;
@Excel(name = "设备描述", width = 30)
@Schema(description = "设备描述")
private String equipmentDesc;
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;
private Integer delFlag;
}

View File

@@ -0,0 +1,102 @@
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.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* MES 点检及保养项目(表 mes_xsl_inspect_maintain_item
*/
@Data
@TableName("mes_xsl_inspect_maintain_item")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES点检及保养项目")
public class MesXslInspectMaintainItem implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Excel(name = "项目名称", width = 22)
@Schema(description = "项目名称(同租户未删除数据中唯一)")
private String itemName;
@Excel(name = "项目编号", width = 18)
@Schema(description = "项目编号(同租户未删除数据中唯一)")
private String itemCode;
@Schema(description = "设备类别主键 mes_xsl_equipment_category.id")
private String equipmentCategoryId;
@Excel(name = "设备类别", width = 20)
@Schema(description = "设备类别名称冗余")
private String equipmentCategoryName;
@Schema(description = "设备类型主键 mes_xsl_equipment_type.id")
private String equipmentTypeId;
@Excel(name = "设备类型", width = 20)
@Schema(description = "设备类型名称冗余")
private String equipmentTypeName;
@Schema(description = "设备部位主键 mes_xsl_equipment_part.id")
private String equipmentPartId;
@Excel(name = "设备部位", width = 20)
@Schema(description = "设备部位名称冗余")
private String equipmentPartName;
@Schema(description = "设备小部位主键 mes_xsl_equipment_sub_part.id")
private String equipmentSubPartId;
@Excel(name = "设备小部位", width = 20)
@Schema(description = "设备小部位名称冗余")
private String equipmentSubPartName;
@Excel(name = "项目类别", width = 12, dicCode = "xslmes_im_item_category")
@Dict(dicCode = "xslmes_im_item_category")
@Schema(description = "项目类别字典xslmes_im_item_categoryinspect点检/maintain保养")
private String itemCategory;
@Excel(name = "项目类型", width = 12, dicCode = "xslmes_im_item_type")
@Dict(dicCode = "xslmes_im_item_type")
@Schema(description = "项目类型字典xslmes_im_item_typemechanical机械类/electrical电气类")
private String itemType;
@Excel(name = "点检方式", width = 12, dicCode = "xslmes_im_inspect_method")
@Dict(dicCode = "xslmes_im_inspect_method")
@Schema(description = "点检方式字典xslmes_im_inspect_methodvisual视觉/sight目测/hearing听觉")
private String inspectMethod;
@Excel(name = "判断基准", width = 28)
@Schema(description = "判断基准")
private String judgmentCriteria;
@Excel(name = "保养周期(天)", width = 14)
@Schema(description = "保养周期(天)")
private Integer maintainCycleDays;
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;
private Integer delFlag;
}

View File

@@ -0,0 +1,68 @@
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.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* MES 密炼机动作维护
*/
@Data
@TableName("mes_xsl_mixer_action")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES密炼机动作维护")
public class MesXslMixerAction implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Excel(name = "设备名称", width = 20, dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id")
@Dict(dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id")
@Schema(description = "设备台账ID")
private String equipmentId;
@Excel(name = "设备名称", width = 20)
@Schema(description = "设备名称冗余")
private String equipmentName;
@Excel(name = "动作名称", width = 20)
@Schema(description = "动作名称")
private String actionName;
@Excel(name = "动作代号", width = 20)
@Schema(description = "动作代号")
private String actionCode;
@Excel(name = "备注", width = 30)
@Schema(description = "备注")
private String remark;
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;
private Integer delFlag;
}

View File

@@ -0,0 +1,82 @@
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.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* MES 密炼物料替代对应关系
*/
@Data
@TableName("mes_xsl_mixer_material_substitute")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES密炼物料替代对应关系")
public class MesXslMixerMaterialSubstitute implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Excel(name = "编号", width = 10)
@Schema(description = "编号租户内自动累加从1开始")
private Integer serialNo;
@Excel(name = "密炼物料ID", width = 15, dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
@Dict(dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
@Schema(description = "密炼物料ID关联 mes_mixer_material.id")
private String mixerMaterialId;
@Excel(name = "密炼物料编码", width = 15)
@Schema(description = "密炼物料编码冗余")
private String mixerMaterialCode;
@Excel(name = "密炼物料名称", width = 20)
@Schema(description = "密炼物料名称冗余")
private String mixerMaterialName;
@Excel(name = "替代密炼物料ID", width = 15, dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
@Dict(dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
@Schema(description = "替代密炼物料ID关联 mes_mixer_material.id")
private String substituteMaterialId;
@Excel(name = "替代密炼物料编码", width = 15)
@Schema(description = "替代密炼物料编码冗余")
private String substituteMaterialCode;
@Excel(name = "替代密炼物料名称", width = 20)
@Schema(description = "替代密炼物料名称冗余")
private String substituteMaterialName;
@Excel(name = "创建人", width = 15)
private String createBy;
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@Excel(name = "修改人", width = 15)
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;
@Schema(description = "租户ID")
private Integer tenantId;
private String sysOrgCode;
private Integer delFlag;
}

View File

@@ -0,0 +1,152 @@
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.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* MES 密炼PS编制
*/
@Data
@TableName("mes_xsl_mixer_ps_compile")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES密炼PS编制")
public class MesXslMixerPsCompile implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Excel(name = "所属工厂", width = 20)
@Schema(description = "所属工厂名称冗余(公司)")
private String factoryName;
@Schema(description = "所属工厂IDsys_depart.id公司")
private String factoryId;
@Excel(name = "PS编码", width = 18)
@Schema(description = "PS编码")
private String psCode;
@Excel(name = "类型", width = 15, dicCode = "xslmes_ps_belong")
@Dict(dicCode = "xslmes_ps_belong")
@Schema(description = "类型字典PS归属")
private String psType;
@Excel(name = "施工代号", width = 15, dicCode = "xslmes_construction_code")
@Dict(dicCode = "xslmes_construction_code")
@Schema(description = "施工代号")
private String constructionCode;
@Excel(name = "发放日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(description = "发放日期")
private Date issueDate;
@Excel(name = "发送部门", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Schema(description = "发送部门ID")
private String sendDeptId;
@Excel(name = "收信部门", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Schema(description = "收信部门ID")
private String receiveDeptId;
@Excel(name = "参照部门", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Schema(description = "参照部门ID")
private String referenceDeptId;
@Excel(name = "标题", width = 25)
@Schema(description = "标题")
private String title;
@Excel(name = "目的", width = 30)
@Schema(description = "目的")
private String purpose;
@Excel(name = "依据", width = 30)
@Schema(description = "依据")
private String basis;
@Excel(name = "内容", width = 40)
@Schema(description = "内容")
private String content;
@Excel(name = "担当", width = 12)
@Schema(description = "担当")
private String responsiblePerson;
@Excel(name = "状态", width = 10, dicCode = "xslmes_mixer_ps_status")
@Dict(dicCode = "xslmes_mixer_ps_status")
@Schema(description = "状态")
private String status;
@Excel(name = "校对人", width = 15)
@Schema(description = "校对人")
private String proofreadBy;
@Excel(name = "校对时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "校对时间")
private Date proofreadTime;
@Excel(name = "审核人", width = 15)
@Schema(description = "审核人")
private String auditBy;
@Excel(name = "审核时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "审核时间")
private Date auditTime;
@Excel(name = "批准人", width = 15)
@Schema(description = "批准人")
private String approveBy;
@Excel(name = "批准时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "批准时间")
private Date approveTime;
@Excel(name = "创建人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
//update-begin---author:jiangxh ---date:20260520 for【密炼PS编制】创建人翻译为姓名供编制人展示-----------
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
//update-end---author:jiangxh ---date:20260520 for【密炼PS编制】创建人翻译为姓名供编制人展示-----------
private String createBy;
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@Excel(name = "修改人", width = 15)
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;
@Schema(description = "租户ID")
private Integer tenantId;
private String sysOrgCode;
private Integer delFlag;
}

View File

@@ -0,0 +1,98 @@
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.math.BigDecimal;
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_open_mill_param")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES开炼机参数维护")
public class MesXslOpenMillParam implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Excel(name = "胶料ID", width = 15, dictTable = "mes_material", dicText = "material_name", dicCode = "id")
@Dict(dictTable = "mes_material", dicText = "material_name", dicCode = "id")
@Schema(description = "胶料ID关联 mes_material.id")
private String materialId;
@Excel(name = "胶料名称", width = 20)
@Schema(description = "胶料名称冗余")
private String materialName;
@Excel(name = "胶料别名", width = 15)
@Schema(description = "胶料别名冗余(取自 mes_material.alias_name")
private String materialCode;
@Excel(name = "R0进胶时间(秒)", width = 14)
@Schema(description = "R0进胶时间")
private BigDecimal r0FeedTime;
@Excel(name = "R0成环时间(秒)", width = 14)
@Schema(description = "R0成环时间")
private BigDecimal r0RingTime;
@Excel(name = "R0拉断时间(秒)", width = 14)
@Schema(description = "R0拉断时间")
private BigDecimal r0BreakTime;
@Excel(name = "R0排胶时间(秒)", width = 14)
@Schema(description = "R0排胶时间")
private BigDecimal r0DischargeTime;
@Excel(name = "R1进胶时间(秒)", width = 14)
@Schema(description = "R1进胶时间")
private BigDecimal r1FeedTime;
@Excel(name = "R1成环时间(秒)", width = 14)
@Schema(description = "R1成环时间")
private BigDecimal r1RingTime;
@Excel(name = "R1拉断时间(秒)", width = 14)
@Schema(description = "R1拉断时间")
private BigDecimal r1BreakTime;
@Excel(name = "R1排胶时间(秒)", width = 14)
@Schema(description = "R1排胶时间")
private BigDecimal r1DischargeTime;
@Excel(name = "创建人", width = 15)
private String createBy;
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@Excel(name = "修改人", width = 15)
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;
@Schema(description = "租户ID")
private Integer tenantId;
private String sysOrgCode;
private Integer delFlag;
}

View File

@@ -0,0 +1,6 @@
package org.jeecg.modules.xslmes.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.xslmes.entity.MesXslDayTankMaterialMap;
public interface MesXslDayTankMaterialMapMapper extends BaseMapper<MesXslDayTankMaterialMap> {}

View File

@@ -0,0 +1,6 @@
package org.jeecg.modules.xslmes.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
public interface MesXslEquipmentLedgerMapper extends BaseMapper<MesXslEquipmentLedger> {}

View File

@@ -0,0 +1,9 @@
package org.jeecg.modules.xslmes.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem;
/**
* MES 点检及保养项目
*/
public interface MesXslInspectMaintainItemMapper extends BaseMapper<MesXslInspectMaintainItem> {}

View File

@@ -0,0 +1,6 @@
package org.jeecg.modules.xslmes.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.xslmes.entity.MesXslMixerAction;
public interface MesXslMixerActionMapper extends BaseMapper<MesXslMixerAction> {}

View File

@@ -0,0 +1,20 @@
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.MesXslMixerMaterialSubstitute;
/**
* MES 密炼物料替代对应关系 Mapper
*/
@Mapper
public interface MesXslMixerMaterialSubstituteMapper extends BaseMapper<MesXslMixerMaterialSubstitute> {
//update-begin---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】查询租户内最大编号-----------
@Select("SELECT IFNULL(MAX(serial_no), 0) FROM mes_xsl_mixer_material_substitute "
+ "WHERE del_flag = 0 AND (#{tenantId} IS NULL OR tenant_id = #{tenantId})")
Integer selectMaxSerialNo(@Param("tenantId") Integer tenantId);
//update-end---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】查询租户内最大编号-----------
}

View File

@@ -0,0 +1,12 @@
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.MesXslMixerPsCompile;
/**
* MES 密炼PS编制 Mapper
*/
@Mapper
public interface MesXslMixerPsCompileMapper extends BaseMapper<MesXslMixerPsCompile> {
}

View File

@@ -0,0 +1,12 @@
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.MesXslOpenMillParam;
/**
* MES 开炼机参数维护 Mapper
*/
@Mapper
public interface MesXslOpenMillParamMapper extends BaseMapper<MesXslOpenMillParam> {
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.xslmes.mapper.MesXslOpenMillParamMapper">
</mapper>

View File

@@ -1,5 +1,5 @@
/**
* MES XSL 业务模块Maven 工程名jeecg-module-xslmes
* 包含:客户管理({@link org.jeecg.modules.xslmes.entity.MesXslCustomer})、工序管理({@link org.jeecg.modules.xslmes.entity.MesXslProcessOperation})、设备类别({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentCategory})、设备类型({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentType})、设备部位({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentPart})、设备小部位({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentSubPart})、备品件类别({@link org.jeecg.modules.xslmes.entity.MesXslSparePartsCategory})、备品件信息({@link org.jeecg.modules.xslmes.entity.MesXslSparePart})、厂家信息({@link org.jeecg.modules.xslmes.entity.MesXslManufacturer})、停机主类型({@link org.jeecg.modules.xslmes.entity.MesXslDowntimeMainType})、停机类型({@link org.jeecg.modules.xslmes.entity.MesXslDowntimeType})等。
* 包含:客户管理({@link org.jeecg.modules.xslmes.entity.MesXslCustomer})、工序管理({@link org.jeecg.modules.xslmes.entity.MesXslProcessOperation})、设备类别({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentCategory})、设备类型({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentType})、设备台账({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger})、设备部位({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentPart})、设备小部位({@link org.jeecg.modules.xslmes.entity.MesXslEquipmentSubPart})、点检及保养项目({@link org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem})、备品件类别({@link org.jeecg.modules.xslmes.entity.MesXslSparePartsCategory})、备品件信息({@link org.jeecg.modules.xslmes.entity.MesXslSparePart})、厂家信息({@link org.jeecg.modules.xslmes.entity.MesXslManufacturer})、停机主类型({@link org.jeecg.modules.xslmes.entity.MesXslDowntimeMainType})、停机类型({@link org.jeecg.modules.xslmes.entity.MesXslDowntimeType})等。
*/
package org.jeecg.modules.xslmes;

View File

@@ -0,0 +1,12 @@
package org.jeecg.modules.xslmes.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.xslmes.entity.MesXslDayTankMaterialMap;
public interface IMesXslDayTankMaterialMapService extends IService<MesXslDayTankMaterialMap> {
/**
* 由选择类字段ID回填冗余展示信息机台代码/机台名称/物料名称)
*/
void fillReferenceFields(MesXslDayTankMaterialMap model);
}

View File

@@ -0,0 +1,11 @@
package org.jeecg.modules.xslmes.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
public interface IMesXslEquipmentLedgerService extends IService<MesXslEquipmentLedger> {
boolean isEquipmentCodeDuplicated(String equipmentCode, String excludeId, MesXslEquipmentLedger context);
boolean isEquipmentNameDuplicated(String equipmentName, String excludeId, MesXslEquipmentLedger context);
}

View File

@@ -0,0 +1,14 @@
package org.jeecg.modules.xslmes.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem;
/**
* MES 点检及保养项目
*/
public interface IMesXslInspectMaintainItemService extends IService<MesXslInspectMaintainItem> {
boolean isItemNameDuplicated(String itemName, String excludeId, MesXslInspectMaintainItem context);
boolean isItemCodeDuplicated(String itemCode, String excludeId, MesXslInspectMaintainItem context);
}

View File

@@ -0,0 +1,13 @@
package org.jeecg.modules.xslmes.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.xslmes.entity.MesXslMixerAction;
public interface IMesXslMixerActionService extends IService<MesXslMixerAction> {
boolean isActionNameDuplicated(String actionName, String excludeId);
boolean isActionCodeDuplicated(String actionCode, String excludeId);
void fillEquipmentName(MesXslMixerAction model);
}

View File

@@ -0,0 +1,17 @@
package org.jeecg.modules.xslmes.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
/**
* MES 密炼物料替代对应关系
*/
public interface IMesXslMixerMaterialSubstituteService extends IService<MesXslMixerMaterialSubstitute> {
//update-begin---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】新增时分配编号-----------
/**
* 新增保存(自动分配租户内递增编号)
*/
boolean saveWithSerialNo(MesXslMixerMaterialSubstitute entity);
//update-end---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】新增时分配编号-----------
}

View File

@@ -0,0 +1,19 @@
package org.jeecg.modules.xslmes.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.xslmes.entity.MesXslMixerPsCompile;
/**
* MES 密炼PS编制
*/
public interface IMesXslMixerPsCompileService extends IService<MesXslMixerPsCompile> {
//update-begin---author:jiangxh ---date:20260520 for【密炼PS编制】批量流转状态-----------
/**
* 批量变更状态(校验当前状态后更新,并记录操作人/时间)
*
* @return 失败原因null 表示成功
*/
String changeStatusBatch(String ids, String expectedStatus, String targetStatus, String actionLabel, String operatorName);
//update-end---author:jiangxh ---date:20260520 for【密炼PS编制】批量流转状态-----------
}

View File

@@ -0,0 +1,10 @@
package org.jeecg.modules.xslmes.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
/**
* MES 开炼机参数维护
*/
public interface IMesXslOpenMillParamService extends IService<MesXslOpenMillParam> {
}

View File

@@ -0,0 +1,56 @@
package org.jeecg.modules.xslmes.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.modules.mes.material.entity.MesMaterial;
import org.jeecg.modules.mes.material.mapper.MesMaterialMapper;
import org.jeecg.modules.xslmes.entity.MesXslDayTankMaterialMap;
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
import org.jeecg.modules.xslmes.mapper.MesXslDayTankMaterialMapMapper;
import org.jeecg.modules.xslmes.mapper.MesXslEquipmentLedgerMapper;
import org.jeecg.modules.xslmes.service.IMesXslDayTankMaterialMapService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class MesXslDayTankMaterialMapServiceImpl
extends ServiceImpl<MesXslDayTankMaterialMapMapper, MesXslDayTankMaterialMap>
implements IMesXslDayTankMaterialMapService {
@Autowired private MesXslEquipmentLedgerMapper equipmentLedgerMapper;
@Autowired private MesMaterialMapper mesMaterialMapper;
@Override
public void fillReferenceFields(MesXslDayTankMaterialMap model) {
if (model == null) {
return;
}
fillEquipmentFields(model);
fillMaterialFields(model);
}
private void fillEquipmentFields(MesXslDayTankMaterialMap model) {
if (StringUtils.isBlank(model.getEquipmentId())) {
model.setMachineCode(null);
model.setMachineName(null);
return;
}
MesXslEquipmentLedger equipment = equipmentLedgerMapper.selectById(model.getEquipmentId().trim());
if (equipment == null) {
model.setMachineCode(null);
model.setMachineName(null);
return;
}
model.setMachineCode(equipment.getEquipmentCode());
model.setMachineName(equipment.getEquipmentName());
}
private void fillMaterialFields(MesXslDayTankMaterialMap model) {
if (StringUtils.isBlank(model.getMaterialId())) {
model.setMaterialName(null);
return;
}
MesMaterial material = mesMaterialMapper.selectById(model.getMaterialId().trim());
model.setMaterialName(material == null ? null : material.getMaterialName());
}
}

View File

@@ -0,0 +1,72 @@
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.util.SpringContextUtils;
import org.jeecg.common.util.TokenUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
import org.jeecg.modules.xslmes.mapper.MesXslEquipmentLedgerMapper;
import org.jeecg.modules.xslmes.service.IMesXslEquipmentLedgerService;
import org.springframework.stereotype.Service;
@Service
public class MesXslEquipmentLedgerServiceImpl extends ServiceImpl<MesXslEquipmentLedgerMapper, MesXslEquipmentLedger>
implements IMesXslEquipmentLedgerService {
//update-begin---author:jiangxh ---date:20260518 for【MES】设备台账编号、名称同租户不可重复-----------
@Override
public boolean isEquipmentCodeDuplicated(String equipmentCode, String excludeId, MesXslEquipmentLedger context) {
return isFieldDuplicated(MesXslEquipmentLedger::getEquipmentCode, equipmentCode, excludeId, context);
}
@Override
public boolean isEquipmentNameDuplicated(String equipmentName, String excludeId, MesXslEquipmentLedger context) {
return isFieldDuplicated(MesXslEquipmentLedger::getEquipmentName, equipmentName, excludeId, context);
}
private boolean isFieldDuplicated(
com.baomidou.mybatisplus.core.toolkit.support.SFunction<MesXslEquipmentLedger, String> column,
String value,
String excludeId,
MesXslEquipmentLedger context) {
if (oConvertUtils.isEmpty(value)) {
return false;
}
Integer tenantId = resolveTenantId(context);
LambdaQueryWrapper<MesXslEquipmentLedger> w = new LambdaQueryWrapper<>();
w.eq(column, value.trim());
w.and(q -> q.eq(MesXslEquipmentLedger::getDelFlag, CommonConstant.DEL_FLAG_0).or().isNull(MesXslEquipmentLedger::getDelFlag));
if (oConvertUtils.isNotEmpty(excludeId)) {
w.ne(MesXslEquipmentLedger::getId, excludeId);
}
if (tenantId != null) {
w.eq(MesXslEquipmentLedger::getTenantId, tenantId);
}
return this.count(w) > 0;
}
private static Integer resolveTenantId(MesXslEquipmentLedger 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:20260518 for【MES】设备台账编号、名称同租户不可重复-----------
}

View File

@@ -0,0 +1,78 @@
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.util.SpringContextUtils;
import org.jeecg.common.util.TokenUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem;
import org.jeecg.modules.xslmes.mapper.MesXslInspectMaintainItemMapper;
import org.jeecg.modules.xslmes.service.IMesXslInspectMaintainItemService;
import org.springframework.stereotype.Service;
@Service
public class MesXslInspectMaintainItemServiceImpl
extends ServiceImpl<MesXslInspectMaintainItemMapper, MesXslInspectMaintainItem>
implements IMesXslInspectMaintainItemService {
//update-begin---author:jiangxh ---date:20260519 for【MES】点检及保养项目项目名称/编号同租户不可重复-----------
@Override
public boolean isItemNameDuplicated(String itemName, String excludeId, MesXslInspectMaintainItem context) {
return isFieldDuplicated(MesXslInspectMaintainItem::getItemName, itemName, excludeId, context);
}
@Override
public boolean isItemCodeDuplicated(String itemCode, String excludeId, MesXslInspectMaintainItem context) {
return isFieldDuplicated(MesXslInspectMaintainItem::getItemCode, itemCode, excludeId, context);
}
private boolean isFieldDuplicated(
com.baomidou.mybatisplus.core.toolkit.support.SFunction<MesXslInspectMaintainItem, String> column,
String value,
String excludeId,
MesXslInspectMaintainItem context) {
if (oConvertUtils.isEmpty(value)) {
return false;
}
Integer tenantId = resolveTenantId(context);
LambdaQueryWrapper<MesXslInspectMaintainItem> w = new LambdaQueryWrapper<>();
w.eq(column, value.trim());
w.and(
q ->
q.eq(MesXslInspectMaintainItem::getDelFlag, CommonConstant.DEL_FLAG_0)
.or()
.isNull(MesXslInspectMaintainItem::getDelFlag));
if (oConvertUtils.isNotEmpty(excludeId)) {
w.ne(MesXslInspectMaintainItem::getId, excludeId);
}
if (tenantId != null) {
w.eq(MesXslInspectMaintainItem::getTenantId, tenantId);
}
return this.count(w) > 0;
}
private static Integer resolveTenantId(MesXslInspectMaintainItem 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) {
// ignore
}
}
if (oConvertUtils.isEmpty(ts)) {
return null;
}
try {
return Integer.parseInt(ts);
} catch (NumberFormatException e) {
return null;
}
}
//update-end---author:jiangxh ---date:20260519 for【MES】点检及保养项目项目名称/编号同租户不可重复-----------
}

View File

@@ -0,0 +1,58 @@
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.apache.commons.lang3.StringUtils;
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
import org.jeecg.modules.xslmes.entity.MesXslMixerAction;
import org.jeecg.modules.xslmes.mapper.MesXslEquipmentLedgerMapper;
import org.jeecg.modules.xslmes.mapper.MesXslMixerActionMapper;
import org.jeecg.modules.xslmes.service.IMesXslMixerActionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class MesXslMixerActionServiceImpl extends ServiceImpl<MesXslMixerActionMapper, MesXslMixerAction>
implements IMesXslMixerActionService {
@Autowired private MesXslEquipmentLedgerMapper equipmentLedgerMapper;
@Override
public boolean isActionNameDuplicated(String actionName, String excludeId) {
if (StringUtils.isBlank(actionName)) {
return false;
}
LambdaQueryWrapper<MesXslMixerAction> wrapper =
new LambdaQueryWrapper<MesXslMixerAction>().eq(MesXslMixerAction::getActionName, actionName.trim());
if (StringUtils.isNotBlank(excludeId)) {
wrapper.ne(MesXslMixerAction::getId, excludeId.trim());
}
return this.count(wrapper) > 0;
}
@Override
public boolean isActionCodeDuplicated(String actionCode, String excludeId) {
if (StringUtils.isBlank(actionCode)) {
return false;
}
LambdaQueryWrapper<MesXslMixerAction> wrapper =
new LambdaQueryWrapper<MesXslMixerAction>().eq(MesXslMixerAction::getActionCode, actionCode.trim());
if (StringUtils.isNotBlank(excludeId)) {
wrapper.ne(MesXslMixerAction::getId, excludeId.trim());
}
return this.count(wrapper) > 0;
}
@Override
public void fillEquipmentName(MesXslMixerAction model) {
if (model == null) {
return;
}
if (StringUtils.isBlank(model.getEquipmentId())) {
model.setEquipmentName(null);
return;
}
MesXslEquipmentLedger ledger = equipmentLedgerMapper.selectById(model.getEquipmentId().trim());
model.setEquipmentName(ledger == null ? null : ledger.getEquipmentName());
}
}

View File

@@ -0,0 +1,29 @@
package org.jeecg.modules.xslmes.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
import org.jeecg.modules.xslmes.mapper.MesXslMixerMaterialSubstituteMapper;
import org.jeecg.modules.xslmes.service.IMesXslMixerMaterialSubstituteService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* MES 密炼物料替代对应关系
*/
@Service
public class MesXslMixerMaterialSubstituteServiceImpl
extends ServiceImpl<MesXslMixerMaterialSubstituteMapper, MesXslMixerMaterialSubstitute>
implements IMesXslMixerMaterialSubstituteService {
//update-begin---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】新增时分配编号-----------
@Override
@Transactional(rollbackFor = Exception.class)
public boolean saveWithSerialNo(MesXslMixerMaterialSubstitute entity) {
if (entity.getSerialNo() == null) {
Integer maxSerial = baseMapper.selectMaxSerialNo(entity.getTenantId());
entity.setSerialNo(maxSerial == null ? 1 : maxSerial + 1);
}
return save(entity);
}
//update-end---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】新增时分配编号-----------
}

View File

@@ -0,0 +1,64 @@
package org.jeecg.modules.xslmes.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.xslmes.entity.MesXslMixerPsCompile;
import org.jeecg.modules.xslmes.mapper.MesXslMixerPsCompileMapper;
import org.jeecg.modules.xslmes.service.IMesXslMixerPsCompileService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* MES 密炼PS编制
*/
@Service
public class MesXslMixerPsCompileServiceImpl extends ServiceImpl<MesXslMixerPsCompileMapper, MesXslMixerPsCompile>
implements IMesXslMixerPsCompileService {
//update-begin---author:jiangxh ---date:20260520 for【密炼PS编制】批量流转状态-----------
@Override
@Transactional(rollbackFor = Exception.class)
public String changeStatusBatch(String ids, String expectedStatus, String targetStatus, String actionLabel,
String operatorName) {
if (oConvertUtils.isEmpty(ids)) {
return "请选择要" + actionLabel + "的记录";
}
List<String> idList = Arrays.asList(ids.split(","));
Date now = new Date();
for (String id : idList) {
if (oConvertUtils.isEmpty(id)) {
continue;
}
MesXslMixerPsCompile entity = getById(id.trim());
if (entity == null) {
return "记录不存在或已删除";
}
String current = entity.getStatus() == null ? "" : entity.getStatus();
if (!expectedStatus.equals(current)) {
String psCode = oConvertUtils.isEmpty(entity.getPsCode()) ? id : entity.getPsCode();
return "PS编码[" + psCode + "]当前状态不允许" + actionLabel + ",请先完成上一环节";
}
entity.setStatus(targetStatus);
fillWorkflowInfo(entity, targetStatus, operatorName, now);
updateById(entity);
}
return null;
}
private void fillWorkflowInfo(MesXslMixerPsCompile entity, String targetStatus, String operatorName, Date now) {
if ("proofread".equals(targetStatus)) {
entity.setProofreadBy(operatorName);
entity.setProofreadTime(now);
} else if ("audit".equals(targetStatus)) {
entity.setAuditBy(operatorName);
entity.setAuditTime(now);
} else if ("approve".equals(targetStatus)) {
entity.setApproveBy(operatorName);
entity.setApproveTime(now);
}
}
//update-end---author:jiangxh ---date:20260520 for【密炼PS编制】批量流转状态-----------
}

View File

@@ -0,0 +1,15 @@
package org.jeecg.modules.xslmes.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
import org.jeecg.modules.xslmes.mapper.MesXslOpenMillParamMapper;
import org.jeecg.modules.xslmes.service.IMesXslOpenMillParamService;
import org.springframework.stereotype.Service;
/**
* MES 开炼机参数维护
*/
@Service
public class MesXslOpenMillParamServiceImpl extends ServiceImpl<MesXslOpenMillParamMapper, MesXslOpenMillParam>
implements IMesXslOpenMillParamService {
}

View File

@@ -11,4 +11,13 @@
<artifactId>jeecg-system-local-api</artifactId>
<dependencies>
<!-- 接口含 SseEmitter/RequestParam显式声明便于 IDE 与编译期解析optional 不传递给调用方) -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</project>

View File

@@ -246,6 +246,31 @@ jeecg-boot/db/mes-xsl-move-process-equipment-menus-to-mes-base.sql
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_69__mes_xsl_move_process_equipment_menus_to_mes_base.sql
-- author:jiangxh---date:20260518--for: 【MES】设备类型菜单补全 INSERT077 未建时仅 UPDATE 无效)---
jeecg-boot/db/mes-xsl-equipment-type-menu-fix.sql
-- author:jiangxh---date:20260518--for: 【MES】设备管理及子菜单图标 ---
jeecg-boot/db/mes-xsl-equipment-menus-icon.sql
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_75__mes_xsl_equipment_menus_icon.sql
jeecg-boot/db/mes-xsl-equipment-ledger-menu-permission.sql
jeecg-boot/db/mes-xsl-equipment-sub-part-menu-permission.sql
jeecg-boot/db/mes-xsl-spare-parts-category-menu-permission.sql
jeecg-boot/db/mes-xsl-spare-part-menu-permission.sql
jeecg-boot/db/mes-xsl-manufacturer-menu-permission.sql
jeecg-boot/db/mes-xsl-downtime-main-type-menu-permission.sql
jeecg-boot/db/mes-xsl-downtime-type-menu-permission.sql
-- author:jiangxh---date:20260519--for: 【MES】点检及保养项目建表、字典、菜单、CRUD、设备关联选择---
jeecg-boot/db/mes-xsl-inspect-maintain-item-menu-permission.sql
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_77__mes_xsl_inspect_maintain_item.sql
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslInspectMaintainItem.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslInspectMaintainItemMapper.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslInspectMaintainItemService.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslInspectMaintainItemServiceImpl.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslInspectMaintainItemController.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/package-info.java
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItemList.vue
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItem.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItem.api.ts
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/components/MesXslInspectMaintainItemModal.vue
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/components/MesXslEquipmentTypeFilterSelectModal.vue
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/components/MesXslEquipmentSubPartFilterSelectModal.vue
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_70__mes_xsl_equipment_type_menu_ensure.sql
-- author:jiangxh---date:20260518--for: 【MES】工序管理/设备类别菜单与按钮权限补全及租户授权 ---
jeecg-boot/db/mes-xsl-process-and-category-menu-fix.sql
@@ -253,3 +278,64 @@ jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/
jeecg-boot/db/mes-process-operation-menu-permission.sql
jeecg-boot/db/mes-xsl-equipment-category-menu-permission.sql
jeecg-boot/db/mes-xsl-move-process-equipment-menus-to-mes-base.sql
-- author:jiangxh---date:20260518--for: 【MES】设备台账管理建表、设备管理菜单、CRUD、编号名称唯一校验 ---
jeecg-boot/db/mes-xsl-equipment-ledger-menu-permission.sql
jeecg-boot/db/mes-xsl-equipment-ledger.sql
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_72__mes_xsl_equipment_ledger.sql
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslEquipmentLedger.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslEquipmentLedgerMapper.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslEquipmentLedgerService.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslEquipmentLedgerServiceImpl.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipmentLedgerController.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/package-info.java
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/MesXslEquipmentLedger.api.ts
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/MesXslEquipmentLedger.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/MesXslEquipmentLedgerList.vue
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/components/MesXslEquipmentLedgerModal.vue
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/components/MesXslManufacturerSelectModal.vue
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/components/MesXslEquipmentTypeSelectModal.vue
-- author:jiangxh---date:20260518--for: 【MES】设备管理目录与 MES基础资料 同级(非 MES管理 子菜单) ---
jeecg-boot/db/mes-xsl-equipment-ledger-menu-permission.sql
jeecg-boot/db/mes-xsl-equipment-ledger-menu-parent-fix.sql
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_72__mes_xsl_equipment_ledger.sql
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_73__mes_xsl_equipment_mgmt_menu_parent_fix.sql
-- author:jiangxh---date:20260518--for: 【MES】设备类别/类型/部位/小部位、备品件、厂家、停机类菜单挂「设备管理」目录 ---
jeecg-boot/db/mes-xsl-move-menus-to-equipment-mgmt.sql
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_74__mes_xsl_move_menus_to_equipment_mgmt.sql
jeecg-boot/db/mes-xsl-equipment-category-menu-permission.sql
jeecg-boot/db/mes-xsl-equipment-type-menu-permission.sql
jeecg-boot/db/mes-xsl-equipment-part-menu-permission.sql
jeecg-boot/db/mes-xsl-equipment-sub-part-menu-permission.sql
jeecg-boot/db/mes-xsl-spare-parts-category-menu-permission.sql
jeecg-boot/db/mes-xsl-spare-part-menu-permission.sql
jeecg-boot/db/mes-xsl-manufacturer-menu-permission.sql
jeecg-boot/db/mes-xsl-downtime-main-type-menu-permission.sql
jeecg-boot/db/mes-xsl-downtime-type-menu-permission.sql
jeecg-boot/db/mes-xsl-move-process-equipment-menus-to-mes-base.sql
jeecg-boot/db/mes-xsl-process-and-category-menu-fix.sql
jeecg-boot/db/mes-xsl-equipment-type-menu-fix.sql
-- author:jiangxh---date:20260518--for: 【MES】设备管理及子菜单图标 ---
jeecg-boot/db/mes-xsl-equipment-menus-icon.sql
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_75__mes_xsl_equipment_menus_icon.sql
jeecg-boot/db/mes-xsl-equipment-ledger-menu-permission.sql
jeecg-boot/db/mes-xsl-equipment-sub-part-menu-permission.sql
jeecg-boot/db/mes-xsl-spare-parts-category-menu-permission.sql
jeecg-boot/db/mes-xsl-spare-part-menu-permission.sql
jeecg-boot/db/mes-xsl-manufacturer-menu-permission.sql
jeecg-boot/db/mes-xsl-downtime-main-type-menu-permission.sql
jeecg-boot/db/mes-xsl-downtime-type-menu-permission.sql
-- author:jiangxh---date:20260519--for: 【MES】点检及保养项目建表、字典、菜单、CRUD、设备关联选择---
jeecg-boot/db/mes-xsl-inspect-maintain-item-menu-permission.sql
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_77__mes_xsl_inspect_maintain_item.sql
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslInspectMaintainItem.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslInspectMaintainItemMapper.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslInspectMaintainItemService.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslInspectMaintainItemServiceImpl.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslInspectMaintainItemController.java
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/package-info.java
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItemList.vue
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItem.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItem.api.ts
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/components/MesXslInspectMaintainItemModal.vue
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/components/MesXslEquipmentTypeFilterSelectModal.vue
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/components/MesXslEquipmentSubPartFilterSelectModal.vue

View File

@@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@Slf4j
@Tag(name = "MES-料信息")
@Tag(name = "MES-料信息")
@RestController
@RequestMapping("/mes/material/material")
public class MesMaterialController extends JeecgController<MesMaterial, IMesMaterialService> {
@@ -39,8 +39,8 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
return Result.OK(pageList);
}
@AutoLog(value = "MES-料信息-添加")
@Operation(summary = "MES-料信息-添加")
@AutoLog(value = "MES-料信息-添加")
@Operation(summary = "MES-料信息-添加")
@RequiresPermissions("mes:mes_material:add")
@PostMapping("/add")
public Result<String> add(@RequestBody MesMaterial model) {
@@ -49,8 +49,8 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
return Result.OK("添加成功!");
}
@AutoLog(value = "MES-料信息-编辑")
@Operation(summary = "MES-料信息-编辑")
@AutoLog(value = "MES-料信息-编辑")
@Operation(summary = "MES-料信息-编辑")
@RequiresPermissions("mes:mes_material:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody MesMaterial model) {
@@ -59,8 +59,8 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
return Result.OK("编辑成功!");
}
@AutoLog(value = "MES-料信息-通过id删除")
@Operation(summary = "MES-料信息-通过id删除")
@AutoLog(value = "MES-料信息-通过id删除")
@Operation(summary = "MES-料信息-通过id删除")
@RequiresPermissions("mes:mes_material:delete")
@DeleteMapping("/delete")
public Result<String> delete(@RequestParam(name = "id") String id) {
@@ -72,8 +72,8 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
return Result.OK("删除成功!");
}
@AutoLog(value = "MES-料信息-批量删除")
@Operation(summary = "MES-料信息-批量删除")
@AutoLog(value = "MES-料信息-批量删除")
@Operation(summary = "MES-料信息-批量删除")
@RequiresPermissions("mes:mes_material:deleteBatch")
@DeleteMapping("/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids") String ids) {
@@ -94,7 +94,7 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
@RequiresPermissions("mes:mes_material:exportXls")
@RequestMapping("/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MesMaterial model) {
return super.exportXls(request, model, MesMaterial.class, "MES料信息");
return super.exportXls(request, model, MesMaterial.class, "MES料信息");
}
@RequiresPermissions("mes:mes_material:importExcel")

View File

@@ -19,7 +19,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@TableName("mes_material")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES料主数据")
@Schema(description = "MES料主数据")
public class MesMaterial implements Serializable {
private static final long serialVersionUID = 1L;
@@ -28,15 +28,15 @@ public class MesMaterial implements Serializable {
@Excel(name = "物料编码", width = 15)
private String materialCode;
@Excel(name = "料名称", width = 20)
@Excel(name = "料名称", width = 20)
private String materialName;
@Excel(name = "别名", width = 15)
@Excel(name = "胶料别名", width = 15)
private String aliasName;
@Excel(name = "简称", width = 15)
private String shortName;
@Excel(name = "分类", width = 15, dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
@Dict(dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
@Excel(name = "胶料类别", width = 15, dictTable = "sys_category", dicText = "name", dicCode = "id")
@Dict(dictTable = "sys_category", dicText = "name", dicCode = "id")
private String categoryId;
@Excel(name = "等级", width = 12)
private String materialGrade;
@@ -57,16 +57,27 @@ public class MesMaterial implements Serializable {
@Excel(name = "换算系数", width = 12)
private BigDecimal unitConvertRate;
@Excel(name = "ERP编号", width = 15)
private String erpCode;
@Excel(name = "终炼胶保质期(天)", width = 15)
private Integer finalShelfLifeDays;
@Excel(name = "母炼胶保质期(天)", width = 15)
private Integer masterShelfLifeDays;
@Excel(name = "最小停放时间(时)", width = 15)
private Integer minStandingHours;
@Excel(name = "标准码", width = 15)
private String standardCode;
@Excel(name = "产地", width = 15)
private String originPlace;
@Excel(name = "供应商ID", width = 15)
private String supplierId;
@Excel(name = "客户ID", width = 15)
@Excel(name = "胶料客户", width = 15, dictTable = "mes_xsl_customer", dicText = "customer_name", dicCode = "id")
@Dict(dictTable = "mes_xsl_customer", dicText = "customer_name", dicCode = "id")
private String customerId;
@Excel(name = "用状态", width = 10)
@Excel(name = "使用状态", width = 10, replace = {"使用中_1", "停用_0"})
private Integer enableFlag;
@Excel(name = "是否为特种胶", width = 12, replace = {"是_1", "否_0"})
private Integer isSpecialRubber;
@Excel(name = "ERP同步", width = 10)
private Integer syncFromErpFlag;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")

View File

@@ -23,6 +23,11 @@ spring:
# main:
# # 启动加速 (建议开发环境开启后flyway自动升级失效)
# lazy-initialization: true
# banner.txt 为 UTF-8Windows 下改走日志输出(与 logging.charset.console=GBK 一致),避免 System.out 乱码
main:
banner-mode: log
banner:
charset: UTF-8
flyway:
# 是否启用flyway
enabled: false
@@ -315,6 +320,10 @@ cas:
prefixUrl: http://cas.example.org:8443/cas
#Mybatis输出sql日志
logging:
charset:
# Windows 终端/Cursor 默认 GBK终端已 chcp 65001 时可改为 UTF-8
console: GBK
file: UTF-8
level:
org.springframework.context.support.PostProcessorRegistrationDelegate: error
org.flywaydb: debug

View File

@@ -0,0 +1,121 @@
-- MES 设备台账字典 + 建表 + 设备管理目录 + 设备台账菜单 + 按钮 + 租户 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_equipment_ledger_status', '在用/停用/报废', 0, 'admin', NOW(), 0, 0
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_equipment_ledger_status' 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, '在用', '0', 1, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_equipment_ledger_status' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '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', 2, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_equipment_ledger_status' 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', 3, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_equipment_ledger_status' 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_equipment_ledger` (
`id` varchar(32) NOT NULL COMMENT '主键',
`process_operation_id` varchar(32) NOT NULL COMMENT '所属工序 mes_xsl_process_operation.id',
`process_operation_name` varchar(500) DEFAULT NULL COMMENT '工序名称冗余',
`equipment_name` varchar(500) NOT NULL COMMENT '设备名称同租户未删除唯一',
`equipment_code` varchar(128) NOT NULL COMMENT '设备编号同租户未删除唯一',
`manufacturer_id` varchar(32) DEFAULT NULL COMMENT '所属设备厂家 mes_xsl_manufacturer.id',
`manufacturer_name` varchar(500) DEFAULT NULL COMMENT '设备厂家名称冗余',
`equipment_category_id` varchar(32) DEFAULT NULL COMMENT '设备类别 mes_xsl_equipment_category.id',
`equipment_category_name` varchar(500) DEFAULT NULL COMMENT '设备类别名称冗余',
`equipment_type_id` varchar(32) DEFAULT NULL COMMENT '设备类型 mes_xsl_equipment_type.id',
`equipment_type_name` varchar(500) DEFAULT NULL COMMENT '设备类型名称冗余',
`factory_id` varchar(32) DEFAULT NULL COMMENT '所属工厂厂家信息',
`factory_name` varchar(500) DEFAULT NULL COMMENT '所属工厂名称冗余',
`equipment_model` varchar(500) DEFAULT NULL COMMENT '设备型号',
`equipment_status` varchar(1) NOT NULL DEFAULT '0' COMMENT '设备状态 字典xslmes_equipment_ledger_status0在用1停用2报废',
`serial_no` varchar(500) DEFAULT NULL COMMENT '序列号',
`nameplate` varchar(500) DEFAULT NULL COMMENT '铭牌',
`maintain_dept_id` varchar(32) DEFAULT NULL COMMENT '维修部门 sys_depart.id',
`maintain_person` varchar(500) DEFAULT NULL COMMENT '维修人员',
`manage_dept_id` varchar(32) DEFAULT NULL COMMENT '主管部门 sys_depart.id',
`doc_file_no` varchar(500) DEFAULT NULL COMMENT '资料文件编号',
`production_date` date DEFAULT NULL COMMENT '生产日期',
`purchase_date` date DEFAULT NULL COMMENT '购买日期',
`use_date` date DEFAULT NULL COMMENT '使用日期',
`vendor_contact` varchar(500) DEFAULT NULL COMMENT '厂商联系人',
`asset_value` varchar(128) DEFAULT NULL COMMENT '价值',
`controlled_pda` varchar(500) DEFAULT NULL COMMENT '受控PDA',
`overproduction_ratio` varchar(128) DEFAULT NULL COMMENT '超产比率',
`effective_volume` varchar(128) DEFAULT NULL COMMENT '有效体积',
`enabled_flag` varchar(1) NOT NULL DEFAULT '1' COMMENT '是否启用 字典yn1是0否',
`equipment_desc` varchar(1000) DEFAULT NULL COMMENT '设备描述',
`tenant_id` int DEFAULT NULL COMMENT '租户',
`sys_org_code` varchar(500) DEFAULT NULL COMMENT '部门',
`create_by` varchar(500) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(500) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`del_flag` int DEFAULT '0' COMMENT '删除标记0正常1删除',
PRIMARY KEY (`id`),
KEY `idx_mel_tenant_code` (`tenant_id`, `equipment_code`),
KEY `idx_mel_tenant_name` (`tenant_id`, `equipment_name`),
KEY `idx_mel_process` (`process_operation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES设备台账';
SET @mes_tenant_id = 1002;
SET @mes_equip_root_parent = (
SELECT `parent_id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES基础资料'
LIMIT 1
);
SET @mes_equip_root_parent = IFNULL(@mes_equip_root_parent, (
SELECT `parent_id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES资料'
LIMIT 1
));
SET @mes_equip_root_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
), 51);
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 ('1860000000000000133', @mes_equip_root_parent, '设备管理', '/xslmes/equipment', 'layouts/RouteView', 'MesEquipmentLayout', 0, NULL, '1', @mes_equip_root_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;
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 ('1860000000000000134', '1860000000000000133', '设备台账', '/xslmes/mesXslEquipmentLedger', 'xslmes/mesXslEquipmentLedger/MesXslEquipmentLedgerList', 'MesXslEquipmentLedgerList', 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`),
`is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0;
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
('1860000000000000135', '1860000000000000134', '新增', 2, 'mes:mes_xsl_equipment_ledger:add', '1', '1', 0, 'admin', NOW()),
('1860000000000000136', '1860000000000000134', '编辑', 2, 'mes:mes_xsl_equipment_ledger:edit', '1', '1', 0, 'admin', NOW()),
('1860000000000000137', '1860000000000000134', '删除', 2, 'mes:mes_xsl_equipment_ledger:delete', '1', '1', 0, 'admin', NOW()),
('1860000000000000138', '1860000000000000134', '批量删除', 2, 'mes:mes_xsl_equipment_ledger:deleteBatch', '1', '1', 0, 'admin', NOW()),
('1860000000000000139', '1860000000000000134', '导出', 2, 'mes:mes_xsl_equipment_ledger:exportXls', '1', '1', 0, 'admin', NOW()),
('1860000000000000140', '1860000000000000134', '导入', 2, 'mes:mes_xsl_equipment_ledger:importExcel', '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`),
`status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`);
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 (
'1860000000000000133',
'1860000000000000134',
'1860000000000000135', '1860000000000000136', '1860000000000000137', '1860000000000000138',
'1860000000000000139', '1860000000000000140'
)
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
);

View File

@@ -0,0 +1,31 @@
-- 设备管理目录与 MES基础资料 同级修正 V3.9.2_72 曾挂在 MES管理
SET NAMES utf8mb4;
SET @mes_equip_root_parent = (
SELECT `parent_id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES基础资料'
LIMIT 1
);
SET @mes_equip_root_parent = IFNULL(@mes_equip_root_parent, (
SELECT `parent_id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES资料'
LIMIT 1
));
SET @mes_equip_root_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
), 51);
UPDATE `sys_permission`
SET
`parent_id` = @mes_equip_root_parent,
`sort_no` = @mes_equip_root_sort,
`menu_type` = 0,
`is_leaf` = 0,
`hidden` = 0,
`status` = '1',
`del_flag` = 0
WHERE `id` = '1860000000000000133';

View File

@@ -0,0 +1,60 @@
-- 设备相关子菜单挂到设备管理目录 db/mes-xsl-move-menus-to-equipment-mgmt.sql 一致
SET NAMES utf8mb4;
SET @mes_tenant_id = 1002;
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
UPDATE `sys_permission`
SET `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0
WHERE `id` = @mes_equip_pid;
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 1, `is_leaf` = 0 WHERE `id` = '1860000000000000134';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 2, `is_leaf` = 0 WHERE `id` = '1860000000000000070';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 3, `is_leaf` = 0 WHERE `id` = '1860000000000000077';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 4, `is_leaf` = 0 WHERE `id` = '1860000000000000084';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 5, `is_leaf` = 0 WHERE `id` = '1860000000000000091';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 6, `is_leaf` = 0 WHERE `id` = '1860000000000000098';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 7, `is_leaf` = 0 WHERE `id` = '1860000000000000105';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 8, `is_leaf` = 0 WHERE `id` = '1860000000000000112';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 9, `is_leaf` = 0 WHERE `id` = '1860000000000000119';
UPDATE `sys_permission` SET `parent_id` = @mes_equip_pid, `sort_no` = 10, `is_leaf` = 0 WHERE `id` = '1860000000000000126';
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 (
@mes_equip_pid,
'1860000000000000134',
'1860000000000000070',
'1860000000000000071', '1860000000000000072', '1860000000000000073', '1860000000000000074', '1860000000000000075', '1860000000000000076',
'1860000000000000077',
'1860000000000000078', '1860000000000000079', '1860000000000000080', '1860000000000000081', '1860000000000000082', '1860000000000000083',
'1860000000000000084',
'1860000000000000085', '1860000000000000086', '1860000000000000087', '1860000000000000088', '1860000000000000089', '1860000000000000090',
'1860000000000000091',
'1860000000000000092', '1860000000000000093', '1860000000000000094', '1860000000000000095', '1860000000000000096', '1860000000000000097',
'1860000000000000098',
'1860000000000000099', '1860000000000000100', '1860000000000000101', '1860000000000000102', '1860000000000000103', '1860000000000000104',
'1860000000000000105',
'1860000000000000106', '1860000000000000107', '1860000000000000108', '1860000000000000109', '1860000000000000110', '1860000000000000111',
'1860000000000000112',
'1860000000000000113', '1860000000000000114', '1860000000000000115', '1860000000000000116', '1860000000000000117', '1860000000000000118',
'1860000000000000119',
'1860000000000000120', '1860000000000000121', '1860000000000000122', '1860000000000000123', '1860000000000000124', '1860000000000000125',
'1860000000000000126',
'1860000000000000127', '1860000000000000128', '1860000000000000129', '1860000000000000130', '1860000000000000131', '1860000000000000132',
'1860000000000000135', '1860000000000000136', '1860000000000000137', '1860000000000000138', '1860000000000000139', '1860000000000000140'
)
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
);

View File

@@ -0,0 +1,10 @@
-- 设备管理目录及指定子菜单图标 db/mes-xsl-equipment-menus-icon.sql 一致
SET NAMES utf8mb4;
UPDATE `sys_permission` SET `icon` = 'ant-design:tool-outlined' WHERE `id` = '1860000000000000133' AND `del_flag` = 0;
UPDATE `sys_permission` SET `icon` = 'ant-design:apartment-outlined' WHERE `id` = '1860000000000000091' AND `del_flag` = 0;
UPDATE `sys_permission` SET `icon` = 'ant-design:tags-outlined' WHERE `id` = '1860000000000000098' AND `del_flag` = 0;
UPDATE `sys_permission` SET `icon` = 'ant-design:shopping-outlined' WHERE `id` = '1860000000000000105' AND `del_flag` = 0;
UPDATE `sys_permission` SET `icon` = 'ant-design:shop-outlined' WHERE `id` = '1860000000000000112' AND `del_flag` = 0;
UPDATE `sys_permission` SET `icon` = 'ant-design:partition-outlined' WHERE `id` = '1860000000000000119' AND `del_flag` = 0;
UPDATE `sys_permission` SET `icon` = 'ant-design:pause-circle-outlined' WHERE `id` = '1860000000000000126' AND `del_flag` = 0;

View File

@@ -0,0 +1,11 @@
-- MES 物料信息改造为胶料信息补充胶料业务字段并更新菜单名称
ALTER TABLE `mes_material`
ADD COLUMN `erp_code` varchar(64) DEFAULT NULL COMMENT 'ERP编号' AFTER `customer_id`,
ADD COLUMN `final_shelf_life_days` int DEFAULT NULL COMMENT '终炼胶保质期' AFTER `erp_code`,
ADD COLUMN `master_shelf_life_days` int DEFAULT NULL COMMENT '母炼胶保质期' AFTER `final_shelf_life_days`,
ADD COLUMN `min_standing_hours` int DEFAULT NULL COMMENT '最小停放时间' AFTER `master_shelf_life_days`,
ADD COLUMN `is_special_rubber` tinyint DEFAULT 0 COMMENT '是否为特种胶0否1是' AFTER `enable_flag`;
UPDATE `sys_permission`
SET `name` = '胶料信息'
WHERE `component` = 'mes/materialinfo/index';

View File

@@ -0,0 +1,27 @@
-- 一级菜单MES密炼工程目录子菜单可后续挂接
SET NAMES utf8mb4;
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`)
SELECT '1900000000000000800', '', 'MES密炼工程', '/xslmesMixerEngineering', 'layouts/RouteView', 1, 'MesMixerEngineeringRoot', NULL, 0, NULL, '0', 82.00, 0, 'ant-design:experiment-outlined', 0, 0, 0, 0, 'MES 密炼工程一级目录子菜单可后续挂接或从系统管理中调整', 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
FROM DUAL
WHERE NOT EXISTS (
SELECT 1 FROM `sys_permission`
WHERE `id` = '1900000000000000800'
OR (`del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES密炼工程' AND IFNULL(`parent_id`, '') = '')
);
-- admin 角色授权幂等
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
SELECT REPLACE(UUID(), '-', ''), r.id, '1900000000000000800', NULL, NOW(), '127.0.0.1'
FROM `sys_role` r
WHERE r.`role_code` = 'admin'
AND EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000800')
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.id AND rp.`permission_id` = '1900000000000000800'
);
-- 目录有子菜单时 is_leaf 必须为 0幂等修正
UPDATE `sys_permission`
SET `is_leaf` = 0, `component` = 'layouts/RouteView', `menu_type` = 0, `update_time` = NOW()
WHERE `id` = '1900000000000000800' AND `del_flag` = 0;

View File

@@ -0,0 +1,49 @@
-- 一级菜单MES技术管理MES能源管理目录子菜单可后续挂接
SET NAMES utf8mb4;
-- MES技术管理
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`)
SELECT '1900000000000000810', '', 'MES技术管理', '/xslmesTechManagement', 'layouts/RouteView', 1, 'MesTechManagementRoot', NULL, 0, NULL, '0', 82.50, 0, 'ant-design:tool-outlined', 0, 0, 0, 0, 'MES 技术管理一级目录子菜单可后续挂接或从系统管理中调整', 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
FROM DUAL
WHERE NOT EXISTS (
SELECT 1 FROM `sys_permission`
WHERE `id` = '1900000000000000810'
OR (`del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES技术管理' AND IFNULL(`parent_id`, '') = '')
);
-- MES能源管理
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`)
SELECT '1900000000000000820', '', 'MES能源管理', '/xslmesEnergyManagement', 'layouts/RouteView', 1, 'MesEnergyManagementRoot', NULL, 0, NULL, '0', 83.00, 0, 'ant-design:thunderbolt-outlined', 0, 0, 0, 0, 'MES 能源管理一级目录子菜单可后续挂接或从系统管理中调整', 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
FROM DUAL
WHERE NOT EXISTS (
SELECT 1 FROM `sys_permission`
WHERE `id` = '1900000000000000820'
OR (`del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES能源管理' AND IFNULL(`parent_id`, '') = '')
);
-- admin 角色授权MES技术管理幂等
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
SELECT REPLACE(UUID(), '-', ''), r.id, '1900000000000000810', NULL, NOW(), '127.0.0.1'
FROM `sys_role` r
WHERE r.`role_code` = 'admin'
AND EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000810')
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.id AND rp.`permission_id` = '1900000000000000810'
);
-- admin 角色授权MES能源管理幂等
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
SELECT REPLACE(UUID(), '-', ''), r.id, '1900000000000000820', NULL, NOW(), '127.0.0.1'
FROM `sys_role` r
WHERE r.`role_code` = 'admin'
AND EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000820')
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.id AND rp.`permission_id` = '1900000000000000820'
);
-- 目录有子菜单时 is_leaf 必须为 0幂等修正
UPDATE `sys_permission`
SET `is_leaf` = 0, `component` = 'layouts/RouteView', `menu_type` = 0, `update_time` = NOW()
WHERE `id` IN ('1900000000000000810', '1900000000000000820') AND `del_flag` = 0;

View File

@@ -0,0 +1,116 @@
-- MES 点检及保养项目字典 + 建表 + 菜单 + 按钮 + 租户 admin 授权 jeecg-boot/db/mes-xsl-inspect-maintain-item-menu-permission.sql 一致
-- 权限前缀mes:mes_xsl_inspect_maintain_item:*父菜单设备管理
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_im_item_category', 'inspect点检/maintain保养', 0, 'admin', NOW(), 0, 0
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_item_category' 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, '点检', 'inspect', 1, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_item_category' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'inspect');
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
SELECT REPLACE(UUID(), '-', ''), d.id, '保养', 'maintain', 2, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_item_category' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'maintain');
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
SELECT REPLACE(UUID(), '-', ''), 'MES点检保养项目类型', 'xslmes_im_item_type', 'mechanical机械类/electrical电气类', 0, 'admin', NOW(), 0, 0
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_item_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, '机械类', 'mechanical', 1, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_item_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'mechanical');
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
SELECT REPLACE(UUID(), '-', ''), d.id, '电气类', 'electrical', 2, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_item_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'electrical');
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
SELECT REPLACE(UUID(), '-', ''), 'MES点检方式', 'xslmes_im_inspect_method', 'visual视觉/sight目测/hearing听觉', 0, 'admin', NOW(), 0, 0
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_inspect_method' 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, '视觉', 'visual', 1, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_inspect_method' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'visual');
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
SELECT REPLACE(UUID(), '-', ''), d.id, '目测', 'sight', 2, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_inspect_method' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'sight');
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
SELECT REPLACE(UUID(), '-', ''), d.id, '听觉', 'hearing', 3, 1, 'admin', NOW() FROM `sys_dict` d
WHERE d.`dict_code` = 'xslmes_im_inspect_method' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'hearing');
CREATE TABLE IF NOT EXISTS `mes_xsl_inspect_maintain_item` (
`id` varchar(32) NOT NULL COMMENT '主键',
`item_name` varchar(500) NOT NULL COMMENT '项目名称同租户未删除数据中唯一',
`item_code` varchar(500) NOT NULL COMMENT '项目编号同租户未删除数据中唯一',
`equipment_category_id` varchar(32) NOT NULL COMMENT '设备类别主键 mes_xsl_equipment_category.id',
`equipment_category_name` varchar(500) DEFAULT NULL COMMENT '设备类别名称冗余',
`equipment_type_id` varchar(32) NOT NULL COMMENT '设备类型主键 mes_xsl_equipment_type.id',
`equipment_type_name` varchar(500) DEFAULT NULL COMMENT '设备类型名称冗余',
`equipment_part_id` varchar(32) NOT NULL COMMENT '设备部位主键 mes_xsl_equipment_part.id',
`equipment_part_name` varchar(500) DEFAULT NULL COMMENT '设备部位名称冗余',
`equipment_sub_part_id` varchar(32) NOT NULL COMMENT '设备小部位主键 mes_xsl_equipment_sub_part.id',
`equipment_sub_part_name` varchar(500) DEFAULT NULL COMMENT '设备小部位名称冗余',
`item_category` varchar(500) NOT NULL COMMENT '项目类别字典xslmes_im_item_categoryinspect点检/maintain保养',
`item_type` varchar(500) NOT NULL COMMENT '项目类型字典xslmes_im_item_typemechanical机械类/electrical电气类',
`inspect_method` varchar(500) NOT NULL COMMENT '点检方式字典xslmes_im_inspect_methodvisual视觉/sight目测/hearing听觉',
`judgment_criteria` varchar(500) NOT NULL COMMENT '判断基准',
`maintain_cycle_days` int DEFAULT NULL COMMENT '保养周期',
`tenant_id` int DEFAULT NULL COMMENT '租户',
`sys_org_code` varchar(500) DEFAULT NULL COMMENT '部门',
`create_by` varchar(500) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(500) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`del_flag` int DEFAULT '0' COMMENT '删除标记0正常1删除',
PRIMARY KEY (`id`),
KEY `idx_mimi_tenant_name` (`tenant_id`, `item_name`),
KEY `idx_mimi_tenant_code` (`tenant_id`, `item_code`),
KEY `idx_mimi_category` (`equipment_category_id`),
KEY `idx_mimi_type` (`equipment_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES点检及保养项目';
SET @mes_tenant_id = 1002;
SET @mes_equip_pid = (
SELECT `id` FROM `sys_permission`
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
LIMIT 1
);
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
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 ('1860000000000000141', @mes_equip_pid, '点检及保养项目', '/xslmes/mesXslInspectMaintainItem', 'xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItemList', NULL, 1, NULL, '1', 11, 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` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`), `icon` = 'ant-design:audit-outlined';
UPDATE `sys_permission` SET `icon` = 'ant-design:audit-outlined' WHERE `id` = '1860000000000000141' AND `del_flag` = 0;
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
('1860000000000000142', '1860000000000000141', '新增', 2, 'mes:mes_xsl_inspect_maintain_item:add', '1', '1', 0, 'admin', NOW()),
('1860000000000000143', '1860000000000000141', '编辑', 2, 'mes:mes_xsl_inspect_maintain_item:edit', '1', '1', 0, 'admin', NOW()),
('1860000000000000144', '1860000000000000141', '删除', 2, 'mes:mes_xsl_inspect_maintain_item:delete', '1', '1', 0, 'admin', NOW()),
('1860000000000000145', '1860000000000000141', '批量删除', 2, 'mes:mes_xsl_inspect_maintain_item:deleteBatch', '1', '1', 0, 'admin', NOW()),
('1860000000000000146', '1860000000000000141', '导出', 2, 'mes:mes_xsl_inspect_maintain_item:exportXls', '1', '1', 0, 'admin', NOW()),
('1860000000000000147', '1860000000000000141', '导入', 2, 'mes:mes_xsl_inspect_maintain_item:importExcel', '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`),
`status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`);
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 (
'1860000000000000141',
'1860000000000000142', '1860000000000000143', '1860000000000000144', '1860000000000000145',
'1860000000000000146', '1860000000000000147'
)
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
);

View File

@@ -0,0 +1,20 @@
-- MES 密炼机动作维护
CREATE TABLE IF NOT EXISTS `mes_xsl_mixer_action` (
`id` varchar(32) NOT NULL COMMENT '主键',
`equipment_id` varchar(32) NOT NULL COMMENT '设备台账IDmes_xsl_equipment_ledger.id',
`equipment_name` varchar(500) NOT NULL COMMENT '设备名称冗余',
`action_name` varchar(500) NOT NULL COMMENT '动作名称同租户未删除数据中唯一',
`action_code` varchar(500) NOT NULL COMMENT '动作代号同租户未删除数据中唯一',
`remark` varchar(1000) DEFAULT NULL COMMENT '备注',
`tenant_id` int DEFAULT NULL COMMENT '租户',
`sys_org_code` varchar(500) DEFAULT NULL COMMENT '部门',
`create_by` varchar(500) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(500) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`del_flag` int DEFAULT '0' COMMENT '删除标记0正常1删除',
PRIMARY KEY (`id`),
KEY `idx_mxma_equipment` (`equipment_id`),
KEY `idx_mxma_tenant_action_name` (`tenant_id`, `action_name`, `del_flag`),
KEY `idx_mxma_tenant_action_code` (`tenant_id`, `action_code`, `del_flag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES密炼机动作维护';

View File

@@ -0,0 +1,24 @@
-- MES 日罐物料对应信息
CREATE TABLE IF NOT EXISTS `mes_xsl_day_tank_material_map` (
`id` varchar(32) NOT NULL COMMENT '主键',
`equipment_id` varchar(32) NOT NULL COMMENT '设备台账IDmes_xsl_equipment_ledger.id',
`machine_code` varchar(500) DEFAULT NULL COMMENT '机台代码设备编号冗余',
`machine_name` varchar(500) DEFAULT NULL COMMENT '机台名称冗余',
`silo_category_id` varchar(32) DEFAULT NULL COMMENT '料仓分类IDsys_category.id',
`station` varchar(500) DEFAULT NULL COMMENT '工位',
`silo_no` varchar(500) DEFAULT NULL COMMENT '料仓号',
`material_id` varchar(32) NOT NULL COMMENT '物料IDmes_material.id',
`material_name` varchar(500) DEFAULT NULL COMMENT '物料名称冗余',
`use_status` int DEFAULT 1 COMMENT '使用状态1使用中 0停用',
`allow_sync` int DEFAULT 1 COMMENT '是否允许同步1允许 0不允许',
`tenant_id` int DEFAULT NULL COMMENT '租户',
`sys_org_code` varchar(500) DEFAULT NULL COMMENT '部门',
`create_by` varchar(500) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(500) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`del_flag` int DEFAULT '0' COMMENT '删除标记0正常1删除',
PRIMARY KEY (`id`),
KEY `idx_mxdtm_equipment` (`equipment_id`),
KEY `idx_mxdtm_material` (`material_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES日罐物料对应信息';

View File

@@ -0,0 +1,96 @@
-- 开炼机参数维护建表 + 菜单 MES技术管理+ admin 授权
SET NAMES utf8mb4;
CREATE TABLE IF NOT EXISTS `mes_xsl_open_mill_param` (
`id` varchar(32) NOT NULL COMMENT '主键',
`material_id` varchar(32) NOT NULL COMMENT '胶料ID关联 mes_material.id',
`material_name` varchar(200) DEFAULT NULL COMMENT '胶料名称冗余',
`material_code` varchar(100) DEFAULT NULL COMMENT '胶料编码冗余',
`r0_feed_time` decimal(10,2) DEFAULT NULL COMMENT 'R0进胶时间',
`r0_ring_time` decimal(10,2) DEFAULT NULL COMMENT 'R0成环时间',
`r0_break_time` decimal(10,2) DEFAULT NULL COMMENT 'R0拉断时间',
`r0_discharge_time` decimal(10,2) DEFAULT NULL COMMENT 'R0排胶时间',
`r1_feed_time` decimal(10,2) DEFAULT NULL COMMENT 'R1进胶时间',
`r1_ring_time` decimal(10,2) DEFAULT NULL COMMENT 'R1成环时间',
`r1_break_time` decimal(10,2) DEFAULT NULL COMMENT 'R1拉断时间',
`r1_discharge_time` decimal(10,2) DEFAULT NULL COMMENT 'R1排胶时间',
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`del_flag` int NOT NULL DEFAULT 0 COMMENT '逻辑删除0正常 1已删除',
PRIMARY KEY (`id`),
KEY `idx_momp_material_id` (`material_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES开炼机参数维护';
-- 父级目录有子菜单时必须 is_leaf=0否则菜单管理树/侧边栏不会展开子节点
UPDATE `sys_permission`
SET `is_leaf` = 0, `update_time` = NOW()
WHERE `id` = '1900000000000000810' AND `is_leaf` = 1;
-- 二级菜单开炼机参数维护父级 MES技术管理 1900000000000000810
INSERT INTO `sys_permission` (
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
`del_flag`, `rule_flag`, `status`, `internal_or_external`
)
SELECT
'177925970995501', '1900000000000000810', '开炼机参数维护', '/xslmes/mesXslOpenMillParam',
'xslmes/mesXslOpenMillParam/MesXslOpenMillParamList', 1, 'MesXslOpenMillParamList', NULL,
1, NULL, '0', 1.00, 0, 'ant-design:setting-outlined', 0, 1,
0, 0, 'MES开炼机参数维护', 'admin', NOW(), 'admin', NOW(),
0, 0, '1', 0
FROM DUAL
WHERE NOT EXISTS (
SELECT 1 FROM `sys_permission`
WHERE `id` = '177925970995501'
OR (`del_flag` = 0 AND `menu_type` = 1 AND `name` = '开炼机参数维护' AND `parent_id` = '1900000000000000810')
);
-- 按钮权限
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
SELECT '177925970995502', '177925970995501', '新增', 2, 'xslmes:mes_xsl_open_mill_param:add', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995502');
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
SELECT '177925970995503', '177925970995501', '编辑', 2, 'xslmes:mes_xsl_open_mill_param:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995503');
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
SELECT '177925970995504', '177925970995501', '删除', 2, 'xslmes:mes_xsl_open_mill_param:delete', '1', 3.00, 0, 1, 0, '1', 0, 'admin', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995504');
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
SELECT '177925970995505', '177925970995501', '批量删除', 2, 'xslmes:mes_xsl_open_mill_param:deleteBatch', '1', 4.00, 0, 1, 0, '1', 0, 'admin', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995505');
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
SELECT '177925970995506', '177925970995501', '导出', 2, 'xslmes:mes_xsl_open_mill_param:exportXls', '1', 5.00, 0, 1, 0, '1', 0, 'admin', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995506');
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
SELECT '177925970995507', '177925970995501', '导入', 2, 'xslmes:mes_xsl_open_mill_param:importExcel', '1', 6.00, 0, 1, 0, '1', 0, 'admin', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995507');
-- admin 角色授权
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
FROM `sys_role` r
CROSS JOIN `sys_permission` p
WHERE r.`role_code` = 'admin'
AND p.`id` IN (
'177925970995501',
'177925970995502',
'177925970995503',
'177925970995504',
'177925970995505',
'177925970995506',
'177925970995507'
)
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
);

View File

@@ -0,0 +1,12 @@
-- 修复 MES 一级目录菜单目录节点 is_leaf 必须为 0否则侧边栏/菜单管理树无法展开子菜单
SET NAMES utf8mb4;
UPDATE `sys_permission`
SET
`is_leaf` = 0,
`component` = 'layouts/RouteView',
`menu_type` = 0,
`update_by` = 'admin',
`update_time` = NOW()
WHERE `id` IN ('1900000000000000800', '1900000000000000810', '1900000000000000820')
AND `del_flag` = 0;

View File

@@ -0,0 +1,130 @@
-- MES胶料分类分类字典 sys_category
-- 前端 JCategorySelect 使用 pcode = XSLMES_RUBBER
SET NAMES utf8mb4;
-- 根节点MES胶料分类
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000001', '0', 'MES胶料分类', 'XSLMES_RUBBER', '1', 'admin', NOW()
FROM DUAL
WHERE NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER');
-- 胶料类别叶子节点顺序与业务下拉一致
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000101', root.`id`, '胎面胶', 'XSLMES_RUBBER_TMJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_TMJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000102', root.`id`, '包布胶', 'XSLMES_RUBBER_BBJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_BBJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000103', root.`id`, '子口胶片', 'XSLMES_RUBBER_ZKKJP', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_ZKKJP');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000104', root.`id`, '三角胶', 'XSLMES_RUBBER_SJJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_SJJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000105', root.`id`, '带束层胶', 'XSLMES_RUBBER_DSJC', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_DSJC');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000106', root.`id`, '输送带胶', 'XSLMES_RUBBER_SSDJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_SSDJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000107', root.`id`, '胶糊胶', 'XSLMES_RUBBER_JHJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JHJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000108', root.`id`, '过渡层', 'XSLMES_RUBBER_GDC', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GDC');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000109', root.`id`, '终炼返炼', 'XSLMES_RUBBER_ZLFL', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_ZLFL');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000110', root.`id`, '塑炼胶', 'XSLMES_RUBBER_SLJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_SLJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000111', root.`id`, '注射胶', 'XSLMES_RUBBER_ZSJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_ZSJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000112', root.`id`, '胎侧胶', 'XSLMES_RUBBER_TCJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_TCJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000113', root.`id`, '缠绕胶', 'XSLMES_RUBBER_CRJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_CRJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000114', root.`id`, '骨板胶', 'XSLMES_RUBBER_GBJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GBJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000115', root.`id`, '外层胶', 'XSLMES_RUBBER_WCJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_WCJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000116', root.`id`, '胶芯胶', 'XSLMES_RUBBER_JXJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JXJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000117', root.`id`, '胶囊胶', 'XSLMES_RUBBER_JNJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JNJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000118', root.`id`, '冠带条', 'XSLMES_RUBBER_GDT', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GDT');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000119', root.`id`, '子口耐磨胶', 'XSLMES_RUBBER_ZKNMJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_ZKNMJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000120', root.`id`, '缓冲胶', 'XSLMES_RUBBER_HCJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_HCJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000121', root.`id`, '钢丝胶', 'XSLMES_RUBBER_GSJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GSJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000122', root.`id`, '出口胎面', 'XSLMES_RUBBER_CKTM', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_CKTM');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000123', root.`id`, '帘线胶', 'XSLMES_RUBBER_LXJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_LXJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000124', root.`id`, '基部胶', 'XSLMES_RUBBER_JBJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JBJ');

View File

@@ -0,0 +1,27 @@
-- MES胶料分类追加 5 已执行 V3.9.2_80 的环境增量脚本
SET NAMES utf8mb4;
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000120', root.`id`, '缓冲胶', 'XSLMES_RUBBER_HCJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_HCJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000121', root.`id`, '钢丝胶', 'XSLMES_RUBBER_GSJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GSJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000122', root.`id`, '出口胎面', 'XSLMES_RUBBER_CKTM', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_CKTM');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000123', root.`id`, '帘线胶', 'XSLMES_RUBBER_LXJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_LXJ');
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
SELECT '1994000000000000124', root.`id`, '基部胶', 'XSLMES_RUBBER_JBJ', '0', 'admin', NOW()
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JBJ');

View File

@@ -0,0 +1,28 @@
-- 修复 MES胶料分类名称乱码PowerShell 管道导入时中文被替换成 ?
SET NAMES utf8mb4;
UPDATE `sys_category` SET `name` = 'MES胶料分类', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER';
UPDATE `sys_category` SET `name` = '胎面胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_TMJ';
UPDATE `sys_category` SET `name` = '包布胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_BBJ';
UPDATE `sys_category` SET `name` = '子口胶片', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_ZKKJP';
UPDATE `sys_category` SET `name` = '三角胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_SJJ';
UPDATE `sys_category` SET `name` = '带束层胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_DSJC';
UPDATE `sys_category` SET `name` = '输送带胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_SSDJ';
UPDATE `sys_category` SET `name` = '胶糊胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_JHJ';
UPDATE `sys_category` SET `name` = '过渡层', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_GDC';
UPDATE `sys_category` SET `name` = '终炼返炼', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_ZLFL';
UPDATE `sys_category` SET `name` = '塑炼胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_SLJ';
UPDATE `sys_category` SET `name` = '注射胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_ZSJ';
UPDATE `sys_category` SET `name` = '胎侧胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_TCJ';
UPDATE `sys_category` SET `name` = '缠绕胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_CRJ';
UPDATE `sys_category` SET `name` = '骨板胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_GBJ';
UPDATE `sys_category` SET `name` = '外层胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_WCJ';
UPDATE `sys_category` SET `name` = '胶芯胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_JXJ';
UPDATE `sys_category` SET `name` = '胶囊胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_JNJ';
UPDATE `sys_category` SET `name` = '冠带条', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_GDT';
UPDATE `sys_category` SET `name` = '子口耐磨胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_ZKNMJ';
UPDATE `sys_category` SET `name` = '缓冲胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_HCJ';
UPDATE `sys_category` SET `name` = '钢丝胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_GSJ';
UPDATE `sys_category` SET `name` = '出口胎面', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_CKTM';
UPDATE `sys_category` SET `name` = '帘线胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_LXJ';
UPDATE `sys_category` SET `name` = '基部胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_JBJ';

View File

@@ -0,0 +1,90 @@
-- 密炼物料替代对应关系建表 + 菜单 MES技术管理+ admin 授权
SET NAMES utf8mb4;
CREATE TABLE IF NOT EXISTS `mes_xsl_mixer_material_substitute` (
`id` varchar(32) NOT NULL COMMENT '主键',
`serial_no` int DEFAULT NULL COMMENT '编号租户内自动累加从1开始',
`mixer_material_id` varchar(32) NOT NULL COMMENT '密炼物料ID关联 mes_mixer_material.id',
`mixer_material_code` varchar(100) DEFAULT NULL COMMENT '密炼物料编码冗余',
`mixer_material_name` varchar(200) DEFAULT NULL COMMENT '密炼物料名称冗余',
`substitute_material_id` varchar(32) NOT NULL COMMENT '替代密炼物料ID关联 mes_mixer_material.id',
`substitute_material_code` varchar(100) DEFAULT NULL COMMENT '替代密炼物料编码冗余',
`substitute_material_name` varchar(200) DEFAULT NULL COMMENT '替代密炼物料名称冗余',
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`del_flag` int NOT NULL DEFAULT 0 COMMENT '逻辑删除0正常 1已删除',
PRIMARY KEY (`id`),
KEY `idx_mxmms_mixer_material_id` (`mixer_material_id`),
KEY `idx_mxmms_substitute_material_id` (`substitute_material_id`),
KEY `idx_mxmms_tenant_serial` (`tenant_id`, `serial_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES密炼物料替代对应关系';
UPDATE `sys_permission`
SET `is_leaf` = 0, `update_time` = NOW()
WHERE `id` = '1900000000000000810' AND `is_leaf` = 1;
INSERT INTO `sys_permission` (
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
`del_flag`, `rule_flag`, `status`, `internal_or_external`
)
SELECT
'177925970995511', '1900000000000000810', '密炼物料替代对应关系', '/xslmes/mesXslMixerMaterialSubstitute',
'xslmes/mesXslMixerMaterialSubstitute/MesXslMixerMaterialSubstituteList', 1, 'MesXslMixerMaterialSubstituteList', NULL,
1, NULL, '0', 2.00, 0, 'ant-design:swap-outlined', 0, 1,
0, 0, 'MES密炼物料替代对应关系', 'admin', NOW(), 'admin', NOW(),
0, 0, '1', 0
FROM DUAL
WHERE NOT EXISTS (
SELECT 1 FROM `sys_permission`
WHERE `id` = '177925970995511'
OR (`del_flag` = 0 AND `menu_type` = 1 AND `name` = '密炼物料替代对应关系' AND `parent_id` = '1900000000000000810')
);
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
SELECT '177925970995512', '177925970995511', '新增', 2, 'xslmes:mes_xsl_mixer_material_substitute:add', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995512');
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
SELECT '177925970995513', '177925970995511', '编辑', 2, 'xslmes:mes_xsl_mixer_material_substitute:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995513');
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
SELECT '177925970995514', '177925970995511', '删除', 2, 'xslmes:mes_xsl_mixer_material_substitute:delete', '1', 3.00, 0, 1, 0, '1', 0, 'admin', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995514');
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
SELECT '177925970995515', '177925970995511', '批量删除', 2, 'xslmes:mes_xsl_mixer_material_substitute:deleteBatch', '1', 4.00, 0, 1, 0, '1', 0, 'admin', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995515');
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
SELECT '177925970995516', '177925970995511', '导出', 2, 'xslmes:mes_xsl_mixer_material_substitute:exportXls', '1', 5.00, 0, 1, 0, '1', 0, 'admin', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995516');
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
SELECT '177925970995517', '177925970995511', '导入', 2, 'xslmes:mes_xsl_mixer_material_substitute:importExcel', '1', 6.00, 0, 1, 0, '1', 0, 'admin', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995517');
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
FROM `sys_role` r
CROSS JOIN `sys_permission` p
WHERE r.`role_code` = 'admin'
AND p.`id` IN (
'177925970995511',
'177925970995512',
'177925970995513',
'177925970995514',
'177925970995515',
'177925970995516',
'177925970995517'
)
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
);

View File

@@ -0,0 +1,52 @@
-- 密炼物料替代对应关系菜单补跑脚本 1213 死锁时单独执行
-- 说明建表已成功时可只跑本脚本建议先暂停后端逐条执行或整段执行一次
SET NAMES utf8mb4;
UPDATE `sys_permission`
SET `is_leaf` = 0, `update_time` = NOW()
WHERE `id` = '1900000000000000810';
INSERT IGNORE INTO `sys_permission` (
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
`del_flag`, `rule_flag`, `status`, `internal_or_external`
) VALUES (
'177925970995511', '1900000000000000810', '密炼物料替代对应关系', '/xslmes/mesXslMixerMaterialSubstitute',
'xslmes/mesXslMixerMaterialSubstitute/MesXslMixerMaterialSubstituteList', 1, 'MesXslMixerMaterialSubstituteList', NULL,
1, NULL, '0', 2.00, 0, 'ant-design:swap-outlined', 0, 1,
0, 0, 'MES密炼物料替代对应关系', 'admin', NOW(), 'admin', NOW(),
0, 0, '1', 0
);
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995512', '177925970995511', '新增', 2, 'xslmes:mes_xsl_mixer_material_substitute:add', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995513', '177925970995511', '编辑', 2, 'xslmes:mes_xsl_mixer_material_substitute:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995514', '177925970995511', '删除', 2, 'xslmes:mes_xsl_mixer_material_substitute:delete', '1', 3.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995515', '177925970995511', '批量删除', 2, 'xslmes:mes_xsl_mixer_material_substitute:deleteBatch', '1', 4.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995516', '177925970995511', '导出', 2, 'xslmes:mes_xsl_mixer_material_substitute:exportXls', '1', 5.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995517', '177925970995511', '导入', 2, 'xslmes:mes_xsl_mixer_material_substitute:importExcel', '1', 6.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
FROM `sys_role` r
CROSS JOIN `sys_permission` p
WHERE r.`role_code` = 'admin'
AND p.`id` IN (
'177925970995511', '177925970995512', '177925970995513', '177925970995514',
'177925970995515', '177925970995516', '177925970995517'
)
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
);

View File

@@ -0,0 +1,39 @@
-- mes_material 胶料字段补全幂等可重复执行
SET NAMES utf8mb4;
SET @db = DATABASE();
SET @sql = IF(
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_material' AND COLUMN_NAME = 'erp_code') = 0,
'ALTER TABLE `mes_material` ADD COLUMN `erp_code` varchar(64) DEFAULT NULL COMMENT ''ERP编号'' AFTER `customer_id`',
'SELECT 1'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_material' AND COLUMN_NAME = 'final_shelf_life_days') = 0,
'ALTER TABLE `mes_material` ADD COLUMN `final_shelf_life_days` int DEFAULT NULL COMMENT ''终炼胶保质期'' AFTER `erp_code`',
'SELECT 1'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_material' AND COLUMN_NAME = 'master_shelf_life_days') = 0,
'ALTER TABLE `mes_material` ADD COLUMN `master_shelf_life_days` int DEFAULT NULL COMMENT ''母炼胶保质期'' AFTER `final_shelf_life_days`',
'SELECT 1'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_material' AND COLUMN_NAME = 'min_standing_hours') = 0,
'ALTER TABLE `mes_material` ADD COLUMN `min_standing_hours` int DEFAULT NULL COMMENT ''最小停放时间'' AFTER `master_shelf_life_days`',
'SELECT 1'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_material' AND COLUMN_NAME = 'is_special_rubber') = 0,
'ALTER TABLE `mes_material` ADD COLUMN `is_special_rubber` tinyint DEFAULT 0 COMMENT ''是否为特种胶0否1是'' AFTER `enable_flag`',
'SELECT 1'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;

View File

@@ -0,0 +1,47 @@
-- MES 字典PS归属施工代号租户 1002
SET NAMES utf8mb4;
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
VALUES ('1995000000000000001', 'PS归属', 'xslmes_ps_belong', 'MES PS归属', 0, 'admin', NOW(), 0, 1002);
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000101', '1995000000000000001', '密炼示方', 'ml_formula', 1, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000102', '1995000000000000001', '原材料检验标准', 'raw_inspect_std', 2, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000103', '1995000000000000001', '密炼作业指导书', 'ml_work_instruction', 3, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
VALUES ('1995000000000000002', '施工代号', 'xslmes_construction_code', 'MES 施工代号', 0, 'admin', NOW(), 0, 1002);
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000201', '1995000000000000002', '实验施工', 'exp_construction', 1, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000202', '1995000000000000002', '量试施工', 'trial_construction', 2, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000203', '1995000000000000002', '正规施工', 'formal_construction', 3, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000204', '1995000000000000002', '混配合', 'mixing_compound', 4, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000205', '1995000000000000002', '药品计量', 'chemical_dosing', 5, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000206', '1995000000000000002', '硫化施工', 'vulcanization_construction', 6, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000207', '1995000000000000002', '原材料检测标准', 'raw_test_std', 7, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000208', '1995000000000000002', '硫化作业指导书', 'vulcanization_work_instruction', 8, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000209', '1995000000000000002', '密炼作业指导书', 'ml_work_instruction', 9, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000210', '1995000000000000002', '半制品作业指导书', 'semi_product_work_instruction', 10, 1, 'admin', NOW());

View File

@@ -0,0 +1,96 @@
-- 密炼PS编制状态字典 + 建表 + 菜单 MES技术管理+ admin 授权
SET NAMES utf8mb4;
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
VALUES ('1995000000000000003', '密炼PS状态', 'xslmes_mixer_ps_status', 'MES密炼PS编制状态', 0, 'admin', NOW(), 0, 1002);
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000301', '1995000000000000003', '编制', 'compile', 1, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000302', '1995000000000000003', '校对', 'proofread', 2, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000303', '1995000000000000003', '审核', 'audit', 3, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000304', '1995000000000000003', '批准', 'approve', 4, 1, 'admin', NOW());
CREATE TABLE IF NOT EXISTS `mes_xsl_mixer_ps_compile` (
`id` varchar(32) NOT NULL COMMENT '主键',
`factory_id` varchar(32) DEFAULT NULL COMMENT '所属工厂IDsys_depart.id公司',
`factory_name` varchar(200) DEFAULT NULL COMMENT '所属工厂名称冗余',
`ps_code` varchar(100) DEFAULT NULL COMMENT 'PS编码',
`ps_type` varchar(64) DEFAULT NULL COMMENT '类型字典xslmes_ps_belong',
`construction_code` varchar(64) DEFAULT NULL COMMENT '施工代号字典xslmes_construction_code',
`issue_date` date DEFAULT NULL COMMENT '发放日期',
`send_dept_id` varchar(32) DEFAULT NULL COMMENT '发送部门ID',
`receive_dept_id` varchar(32) DEFAULT NULL COMMENT '收信部门ID',
`reference_dept_id` varchar(32) DEFAULT NULL COMMENT '参照部门ID',
`title` varchar(500) DEFAULT NULL COMMENT '标题',
`purpose` text COMMENT '目的',
`basis` text COMMENT '依据',
`content` text COMMENT '内容',
`responsible_person` varchar(100) DEFAULT NULL COMMENT '担当',
`status` varchar(32) DEFAULT 'compile' COMMENT '状态字典xslmes_mixer_ps_status',
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`del_flag` int NOT NULL DEFAULT 0 COMMENT '逻辑删除0正常 1已删除',
PRIMARY KEY (`id`),
KEY `idx_mxmps_ps_code` (`ps_code`),
KEY `idx_mxmps_issue_date` (`issue_date`),
KEY `idx_mxmps_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES密炼PS编制';
UPDATE `sys_permission`
SET `is_leaf` = 0, `update_time` = NOW()
WHERE `id` = '1900000000000000810' AND `is_leaf` = 1;
INSERT IGNORE INTO `sys_permission` (
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
`del_flag`, `rule_flag`, `status`, `internal_or_external`
) VALUES (
'177925970995518', '1900000000000000810', '密炼PS编制', '/xslmes/mesXslMixerPsCompile',
'xslmes/mesXslMixerPsCompile/MesXslMixerPsCompileList', 1, 'MesXslMixerPsCompileList', NULL,
1, NULL, '0', 3.00, 0, 'ant-design:file-text-outlined', 0, 1,
0, 0, 'MES密炼PS编制', 'admin', NOW(), 'admin', NOW(),
0, 0, '1', 0
);
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995519', '177925970995518', '新增', 2, 'xslmes:mes_xsl_mixer_ps_compile:add', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995520', '177925970995518', '编辑', 2, 'xslmes:mes_xsl_mixer_ps_compile:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995521', '177925970995518', '删除', 2, 'xslmes:mes_xsl_mixer_ps_compile:delete', '1', 3.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995522', '177925970995518', '批量删除', 2, 'xslmes:mes_xsl_mixer_ps_compile:deleteBatch', '1', 4.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995523', '177925970995518', '导出', 2, 'xslmes:mes_xsl_mixer_ps_compile:exportXls', '1', 5.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995524', '177925970995518', '导入', 2, 'xslmes:mes_xsl_mixer_ps_compile:importExcel', '1', 6.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
FROM `sys_role` r
CROSS JOIN `sys_permission` p
WHERE r.`role_code` = 'admin'
AND p.`id` IN (
'177925970995518', '177925970995519', '177925970995520',
'177925970995521', '177925970995522', '177925970995523', '177925970995524'
)
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
);

View File

@@ -0,0 +1,36 @@
-- 密炼PS编制状态字典调整为 编制校对审核批准并增加按钮权限
SET NAMES utf8mb4;
UPDATE `sys_dict_item`
SET `item_text` = '校对', `item_value` = 'proofread', `sort_order` = 2, `update_by` = 'admin', `update_time` = NOW()
WHERE `dict_id` = '1995000000000000003' AND (`item_value` = 'submitted' OR `id` = '1995000000000000302');
UPDATE `sys_dict_item`
SET `item_text` = '审核', `item_value` = 'audit', `sort_order` = 3, `update_by` = 'admin', `update_time` = NOW()
WHERE `dict_id` = '1995000000000000003' AND (`item_value` = 'approved' OR `id` = '1995000000000000303');
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000304', '1995000000000000003', '批准', 'approve', 4, 1, 'admin', NOW());
UPDATE `mes_xsl_mixer_ps_compile` SET `status` = 'proofread' WHERE `status` = 'submitted';
UPDATE `mes_xsl_mixer_ps_compile` SET `status` = 'audit' WHERE `status` = 'approved';
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995525', '177925970995518', '校对', 2, 'xslmes:mes_xsl_mixer_ps_compile:proofread', '1', 7.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995526', '177925970995518', '审核', 2, 'xslmes:mes_xsl_mixer_ps_compile:audit', '1', 8.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995527', '177925970995518', '批准', 2, 'xslmes:mes_xsl_mixer_ps_compile:approve', '1', 9.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
FROM `sys_role` r
CROSS JOIN `sys_permission` p
WHERE r.`role_code` = 'admin'
AND p.`id` IN ('177925970995525', '177925970995526', '177925970995527')
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
);

View File

@@ -0,0 +1,52 @@
-- 密炼PS编制校对/审核/批准人时间字段收信/参照部门支持多选逗号分隔存储
SET NAMES utf8mb4;
SET @db = DATABASE();
SET @sql = IF(
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_xsl_mixer_ps_compile' AND COLUMN_NAME = 'proofread_by') = 0,
'ALTER TABLE `mes_xsl_mixer_ps_compile` ADD COLUMN `proofread_by` varchar(50) DEFAULT NULL COMMENT ''校对人'' AFTER `status`',
'SELECT 1'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_xsl_mixer_ps_compile' AND COLUMN_NAME = 'proofread_time') = 0,
'ALTER TABLE `mes_xsl_mixer_ps_compile` ADD COLUMN `proofread_time` datetime DEFAULT NULL COMMENT ''校对时间'' AFTER `proofread_by`',
'SELECT 1'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_xsl_mixer_ps_compile' AND COLUMN_NAME = 'audit_by') = 0,
'ALTER TABLE `mes_xsl_mixer_ps_compile` ADD COLUMN `audit_by` varchar(50) DEFAULT NULL COMMENT ''审核人'' AFTER `proofread_time`',
'SELECT 1'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_xsl_mixer_ps_compile' AND COLUMN_NAME = 'audit_time') = 0,
'ALTER TABLE `mes_xsl_mixer_ps_compile` ADD COLUMN `audit_time` datetime DEFAULT NULL COMMENT ''审核时间'' AFTER `audit_by`',
'SELECT 1'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_xsl_mixer_ps_compile' AND COLUMN_NAME = 'approve_by') = 0,
'ALTER TABLE `mes_xsl_mixer_ps_compile` ADD COLUMN `approve_by` varchar(50) DEFAULT NULL COMMENT ''批准人'' AFTER `audit_time`',
'SELECT 1'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_xsl_mixer_ps_compile' AND COLUMN_NAME = 'approve_time') = 0,
'ALTER TABLE `mes_xsl_mixer_ps_compile` ADD COLUMN `approve_time` datetime DEFAULT NULL COMMENT ''批准时间'' AFTER `approve_by`',
'SELECT 1'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
ALTER TABLE `mes_xsl_mixer_ps_compile`
MODIFY COLUMN `receive_dept_id` varchar(500) DEFAULT NULL COMMENT '收信部门ID多个逗号分隔';
ALTER TABLE `mes_xsl_mixer_ps_compile`
MODIFY COLUMN `reference_dept_id` varchar(500) DEFAULT NULL COMMENT '参照部门ID多个逗号分隔';

View File

@@ -0,0 +1,44 @@
-- PS审批历史状态展示字典键值与原状态一致批准改为正式发布+ 菜单
SET NAMES utf8mb4;
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
VALUES ('1995000000000000004', '密炼PS审批历史状态', 'xslmes_mixer_ps_history_status', 'PS审批历史状态展示approve显示为正式发布', 0, 'admin', NOW(), 0, 1002);
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000401', '1995000000000000004', '编制', 'compile', 1, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000402', '1995000000000000004', '校对', 'proofread', 2, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000403', '1995000000000000004', '审核', 'audit', 3, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000000404', '1995000000000000004', '正式发布', 'approve', 4, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
`del_flag`, `rule_flag`, `status`, `internal_or_external`
) VALUES (
'177925970995528', '1900000000000000810', 'PS审批历史', '/xslmes/mesXslMixerPsHistory',
'xslmes/mesXslMixerPsHistory/MesXslMixerPsHistoryList', 1, 'MesXslMixerPsHistoryList', NULL,
1, NULL, '0', 4.00, 0, 'ant-design:history-outlined', 0, 1,
0, 0, '查询密炼PS编制已批准记录', 'admin', NOW(), 'admin', NOW(),
0, 0, '1', 0
);
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995529', '177925970995528', '导出', 2, 'xslmes:mes_xsl_mixer_ps_history:exportXls', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
FROM `sys_role` r
CROSS JOIN `sys_permission` p
WHERE r.`role_code` = 'admin'
AND p.`id` IN ('177925970995528', '177925970995529')
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
);

View File

@@ -7,10 +7,10 @@ VITE_PUBLIC_PATH = /
# 跨域代理:前缀需与 VITE_GLOB_API_URL 一致,且 rewrite 后路径需包含后端 context-path/jeecg-boot
# 详见 build/vite/proxy.ts
VITE_PROXY = [["/jeecg-boot","http://localhost:8888/jeecg-boot"],["/upload","http://localhost:3300/upload"]]
VITE_PROXY = [["/jeecg-boot","http://localhost:8888"],["/upload","http://localhost:3300/upload"]]
#后台接口全路径地址(必填)
VITE_GLOB_DOMAIN_URL=http://localhost:8888/jeecg-boot
VITE_GLOB_DOMAIN_URL=http://localhost:8888
#后台接口父地址(必填),与 server.servlet.context-path 一致,避免仅去掉别名前缀后缺少 /jeecg-boot
VITE_GLOB_API_URL=/jeecg-boot

View File

@@ -13,10 +13,10 @@ VITE_BUILD_COMPRESS = 'gzip'
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
#后台接口父地址(必填)
VITE_GLOB_API_URL=/jeecgboot
VITE_GLOB_API_URL=/jeecg-boot
#后台接口全路径地址(必填)
VITE_GLOB_DOMAIN_URL=http://127.0.0.1:8080/jeecg-boot
VITE_GLOB_DOMAIN_URL=http://127.0.0.1:8888/jeecg-boot
# 接口父路径前缀
VITE_GLOB_API_URL_PREFIX=

View File

@@ -0,0 +1,7 @@
<template>
<MesXslDayTankMaterialMapList />
</template>
<script lang="ts" setup>
import MesXslDayTankMaterialMapList from '../../xslmes/mesXslDayTankMaterialMap/MesXslDayTankMaterialMapList.vue';
</script>

View File

@@ -1,67 +1,143 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
import { loadTreeData } from '/@/api/common/api';
function useStatusText(v: unknown) {
if (v === 1) return '使用中';
if (v === 0) return '停用';
return '-';
}
function specialRubberText(v: unknown) {
if (v === 1) return '是';
if (v === 0) return '否';
return '-';
}
const useStatusOptions = [
{ label: '使用中', value: 1 },
{ label: '停用', value: 0 },
];
const specialRubberOptions = [
{ label: '是', value: 1 },
{ label: '否', value: 0 },
];
const glueCategoryProps = {
api: loadTreeData,
params: { pcode: 'XSLMES_RUBBER' },
resultField: '',
labelField: 'title',
valueField: 'key',
placeholder: '请选择胶料类别',
};
export const columns: BasicColumn[] = [
{ title: '物料编码', align: 'center', dataIndex: 'materialCode' },
{ title: '物料名称', align: 'center', dataIndex: 'materialName' },
{ title: '分类', align: 'center', dataIndex: 'categoryId_dictText' },
{ title: '基础单位', align: 'center', dataIndex: 'baseUnitId_dictText' },
{ title: '状态', align: 'center', dataIndex: 'enableFlag' },
{ title: '创建时间', align: 'center', dataIndex: 'createTime' },
{ title: '胶料名称', align: 'center', width: 160, dataIndex: 'materialName' },
{ title: '胶料类别', align: 'center', width: 140, dataIndex: 'categoryId_dictText' },
{ title: '胶料别名', align: 'center', width: 140, dataIndex: 'aliasName' },
{ title: '胶料客户', align: 'center', width: 140, dataIndex: 'customerId_dictText' },
{ title: 'ERP编号', align: 'center', width: 140, dataIndex: 'erpCode' },
{ title: '终炼胶保质期(天)', align: 'center', width: 150, dataIndex: 'finalShelfLifeDays' },
{ title: '母炼胶保质期(天)', align: 'center', width: 150, dataIndex: 'masterShelfLifeDays' },
{ title: '最小停放时间(时)', align: 'center', width: 150, dataIndex: 'minStandingHours' },
{
title: '使用状态',
align: 'center',
width: 110,
dataIndex: 'enableFlag',
customRender: ({ text }) => useStatusText(text),
},
{
title: '是否为特种胶',
align: 'center',
width: 120,
dataIndex: 'isSpecialRubber',
customRender: ({ text }) => specialRubberText(text),
},
];
export const searchFormSchema: FormSchema[] = [
{ label: '物料编码', field: 'materialCode', component: 'Input', colProps: { span: 6 } },
{ label: '物料名称', field: 'materialName', component: 'Input', colProps: { span: 6 } },
{ label: '胶料名称', field: 'materialName', component: 'Input', colProps: { span: 6 } },
{
label: '分类',
label: '胶料类别',
field: 'categoryId',
component: 'ApiSelect',
componentProps: glueCategoryProps,
colProps: { span: 6 },
},
{
label: '胶料客户',
field: 'customerId',
component: 'JDictSelectTag',
componentProps: { dictCode: 'mes_material_category,category_name,id' },
componentProps: { dictCode: 'mes_xsl_customer,customer_name,id' },
colProps: { span: 6 },
},
{ label: 'ERP编号', field: 'erpCode', component: 'Input', colProps: { span: 6 } },
{
label: '使用状态',
field: 'enableFlag',
component: 'Select',
componentProps: { options: useStatusOptions },
colProps: { span: 6 },
},
{
label: '是否为特种胶',
field: 'isSpecialRubber',
component: 'Select',
componentProps: { options: specialRubberOptions },
colProps: { span: 6 },
},
];
export const formSchema: FormSchema[] = [
{ label: '', field: 'id', component: 'Input', show: false },
{ label: '物料编码', field: 'materialCode', component: 'Input', required: true },
{ label: '物料名称', field: 'materialName', component: 'Input', required: true },
{ label: '别名', field: 'aliasName', component: 'Input' },
{ label: '简称', field: 'shortName', component: 'Input' },
{ label: '胶料名称', field: 'materialName', component: 'Input', required: true },
{
label: '分类',
label: '胶料类别',
field: 'categoryId',
component: 'JDictSelectTag',
component: 'ApiSelect',
required: true,
componentProps: { dictCode: 'mes_material_category,category_name,id' },
componentProps: glueCategoryProps,
},
{ label: '胶料别名', field: 'aliasName', component: 'Input' },
{
label: '基础单位',
field: 'baseUnitId',
label: '胶料客户',
field: 'customerId',
component: 'JDictSelectTag',
required: true,
componentProps: { dictCode: 'mes_unit,unit_name,id' },
componentProps: { dictCode: 'mes_xsl_customer,customer_name,id', placeholder: '请选择胶料客户' },
},
{ label: 'ERP编号', field: 'erpCode', component: 'Input' },
{
label: '终炼胶保质期(天)',
field: 'finalShelfLifeDays',
component: 'InputNumber',
componentProps: { min: 0, precision: 0 },
},
{
label: '统计单位',
field: 'statUnitId',
component: 'JDictSelectTag',
componentProps: { dictCode: 'mes_unit,unit_name,id' },
label: '母炼胶保质期(天)',
field: 'masterShelfLifeDays',
component: 'InputNumber',
componentProps: { min: 0, precision: 0 },
},
{ label: '计划价格', field: 'planPrice', component: 'InputNumber' },
{ label: '最小库存', field: 'minStock', component: 'InputNumber' },
{ label: '最大库存', field: 'maxStock', component: 'InputNumber' },
{ label: '换算系数', field: 'unitConvertRate', component: 'InputNumber', defaultValue: 1 },
{
label: '状态',
label: '最小停放时间(时)',
field: 'minStandingHours',
component: 'InputNumber',
componentProps: { min: 0, precision: 0 },
},
{
label: '使用状态',
field: 'enableFlag',
component: 'Select',
defaultValue: 1,
componentProps: {
options: [
{ label: '启用', value: 1 },
{ label: '停用', value: 0 },
],
},
componentProps: { options: useStatusOptions },
},
{
label: '是否为特种胶',
field: 'isSpecialRubber',
component: 'Select',
defaultValue: 0,
componentProps: { options: specialRubberOptions },
},
{ label: '备注', field: 'remark', component: 'InputTextArea' },
];

View File

@@ -33,14 +33,14 @@ import { batchDelete, deleteOne, getExportUrl, getImportUrl, list } from './MesM
const [registerModal, { openModal }] = useModal();
const { tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '料信息',
title: '料信息',
api: list,
columns,
canResize: true,
formConfig: { labelWidth: 120, schemas: searchFormSchema, autoSubmitOnEnter: true, showAdvancedButton: true },
actionColumn: { width: 120 },
},
exportConfig: { name: '料信息', url: getExportUrl },
exportConfig: { name: '料信息', url: getExportUrl },
importConfig: { url: getImportUrl, success: handleSuccess },
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;

View File

@@ -30,7 +30,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
setProps({ disabled: !data?.showFooter });
});
const title = computed(() => (!unref(isUpdate) ? '新增料' : '编辑料'));
const title = computed(() => (!unref(isUpdate) ? '新增料' : '编辑料'));
async function handleSubmit() {
try {

View File

@@ -0,0 +1,7 @@
<template>
<MesXslMixerActionList />
</template>
<script lang="ts" setup>
import MesXslMixerActionList from '../../xslmes/mesXslMixerAction/MesXslMixerActionList.vue';
</script>

View File

@@ -0,0 +1,28 @@
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/xslmes/mesXslDayTankMaterialMap/list',
save = '/xslmes/mesXslDayTankMaterialMap/add',
edit = '/xslmes/mesXslDayTankMaterialMap/edit',
deleteOne = '/xslmes/mesXslDayTankMaterialMap/delete',
deleteBatch = '/xslmes/mesXslDayTankMaterialMap/deleteBatch',
queryById = '/xslmes/mesXslDayTankMaterialMap/queryById',
exportXls = '/xslmes/mesXslDayTankMaterialMap/exportXls',
equipmentQueryById = '/xslmes/mesXslEquipmentLedger/queryById',
}
export const list = (params) => defHttp.get({ url: Api.list, params });
export const deleteOne = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const batchDelete = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ? Api.edit : Api.save, params });
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
export const queryEquipmentById = (params: { id: string }) => defHttp.get({ url: Api.equipmentQueryById, params });
export const getExportUrl = Api.exportXls;

Some files were not shown because too many files have changed in this diff Show More