Compare commits
58 Commits
d7fd9c6037
...
生产及设备基础资料
| Author | SHA1 | Date | |
|---|---|---|---|
| cbbbabe4cf | |||
| 457089e271 | |||
|
|
1c5cede957 | ||
|
|
2d142dbc9c | ||
| a65ae7be60 | |||
| 38f22ef8bd | |||
| 69a60ca07b | |||
| a08ca8985a | |||
| 29efd6694f | |||
|
|
e92cab555f | ||
|
|
fef7d25e3c | ||
| b8b06a881a | |||
| 3f2c486f04 | |||
|
|
37239e1b0a | ||
|
|
3586f86ea6 | ||
|
|
bfb00804e6 | ||
|
|
767214b7db | ||
|
|
0ff4a201b0 | ||
| 71f9dab1be | |||
|
|
aefa44b8a9 | ||
| 4aa9952b26 | |||
| c8ce7a6fa3 | |||
|
|
94132ea8da | ||
|
|
e281f7fd92 | ||
|
|
22814cb1a7 | ||
|
|
44a5868349 | ||
| 71f6cfed3d | |||
| 84821955c9 | |||
|
|
a63cd6ad1a | ||
|
|
3539eab924 | ||
|
|
99e574f600 | ||
|
|
f3e0ffca4c | ||
|
|
d2c1d4443b | ||
|
|
9e36435a72 | ||
|
|
c70f7b2b90 | ||
|
|
7786369a63 | ||
|
|
e6241c16c7 | ||
|
|
51cac2c17a | ||
|
|
a579f0e15c | ||
|
|
41f8cef462 | ||
|
|
72aeee0f10 | ||
|
|
441c19e87a | ||
|
|
dc3f305303 | ||
| 589961397c | |||
| 837a85f7ba | |||
| a6579f019a | |||
| af8bf14b5e | |||
|
|
c85657d199 | ||
|
|
f3e3a99ebc | ||
| b56bf74bb8 | |||
| 467c49f432 | |||
| fa1c5c9b42 | |||
|
|
442b31ad37 | ||
| 2496d05349 | |||
| 874e513c90 | |||
| e678276aba | |||
| c09ca584c3 | |||
| 1b45d6124d |
20
.vscode/launch.json
vendored
20
.vscode/launch.json
vendored
@@ -1,6 +1,24 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "jeecgboot-vue3: 调试前端 (Chrome)",
|
||||
"url": "http://localhost:3100",
|
||||
"webRoot": "${workspaceFolder}/jeecgboot-vue3",
|
||||
"preLaunchTask": "jeecgboot-vue3: dev"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "jeecgboot-vue3: dev",
|
||||
"runtimeExecutable": "pnpm",
|
||||
"runtimeArgs": ["run", "dev"],
|
||||
"cwd": "${workspaceFolder}/jeecgboot-vue3",
|
||||
"console": "integratedTerminal",
|
||||
"skipFiles": ["<node_internals>/**", "**/node_modules/**"]
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "JeecgSystemApplication (单体)",
|
||||
@@ -8,7 +26,7 @@
|
||||
"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"
|
||||
"vmArgs": "-Dfile.encoding=UTF-8 -Dspring.main.banner-mode=log -Dspring.banner.charset=UTF-8 -Dlogging.charset.console=GBK"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
15
.vscode/settings.json
vendored
15
.vscode/settings.json
vendored
@@ -4,6 +4,8 @@
|
||||
"java.import.maven.enabled": true,
|
||||
"java.configuration.updateBuildConfiguration": "automatic",
|
||||
"java.autobuild.enabled": true,
|
||||
"java.import.maven.offline.enabled": false,
|
||||
"java.configuration.maven.notCoveredPluginExecutionSeverity": "ignore",
|
||||
"java.jdt.ls.java.home": "C:\\Program Files\\Java\\jdk-17",
|
||||
"java.configuration.runtimes": [
|
||||
{
|
||||
@@ -12,6 +14,10 @@
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"java.maven.downloadSources": true,
|
||||
"java.eclipse.downloadSources": true,
|
||||
"java.project.importOnFirstTimeStartup": "automatic",
|
||||
"java.configuration.checkProjectSettingsExclusions": false,
|
||||
"java.import.exclusions": [
|
||||
"**/jeecg-server-cloud/**",
|
||||
"**/jeecg-boot-platform/**",
|
||||
@@ -27,5 +33,12 @@
|
||||
"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"
|
||||
"java.debug.settings.vmArgs": "-Dfile.encoding=UTF-8 -Dspring.main.banner-mode=log -Dspring.banner.charset=UTF-8 -Dlogging.charset.console=GBK",
|
||||
"terminal.integrated.defaultProfile.windows": "PowerShell",
|
||||
"terminal.integrated.profiles.windows": {
|
||||
"PowerShell": {
|
||||
"source": "PowerShell",
|
||||
"args": ["-NoExit", "-Command", "chcp 936 | Out-Null"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
18
.vscode/tasks.json
vendored
18
.vscode/tasks.json
vendored
@@ -54,6 +54,24 @@
|
||||
"dependsOn": "YY.Admin: build",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "jeecgboot-vue3: dev",
|
||||
"type": "shell",
|
||||
"command": "pnpm run dev",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/jeecgboot-vue3"
|
||||
},
|
||||
"isBackground": true,
|
||||
"problemMatcher": {
|
||||
"owner": "vite",
|
||||
"pattern": { "regexp": "^$" },
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": ".",
|
||||
"endsPattern": "(Local:|ready in|http://localhost)"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "YY.Admin: run (script)",
|
||||
"type": "process",
|
||||
|
||||
@@ -324,17 +324,26 @@ func waitForWindowsPrintCompletion(printerName string, existingIDs map[int]bool,
|
||||
|
||||
queued := false
|
||||
jobID := 0
|
||||
sumatraDone := false
|
||||
|
||||
for {
|
||||
select {
|
||||
case err := <-cmdDone:
|
||||
sumatraDone = true
|
||||
if err != nil && !queued {
|
||||
return fmt.Errorf("sumatra print failed: %v", err)
|
||||
}
|
||||
// Sumatra 已正常退出且 spooler 未出现新任务:部分驱动/打印机直接出纸,不经过队列
|
||||
if err == nil && !queued {
|
||||
return nil
|
||||
}
|
||||
default:
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
if !queued && sumatraDone {
|
||||
return nil
|
||||
}
|
||||
if !queued && now.After(appearDeadline) {
|
||||
return fmt.Errorf("print job not queued within %s", printQueueAppearTimeout)
|
||||
}
|
||||
|
||||
6
jeecg-boot/.vscode/settings.json
vendored
6
jeecg-boot/.vscode/settings.json
vendored
@@ -4,6 +4,8 @@
|
||||
"java.import.maven.enabled": true,
|
||||
"java.configuration.updateBuildConfiguration": "automatic",
|
||||
"java.autobuild.enabled": true,
|
||||
"java.import.maven.offline.enabled": false,
|
||||
"java.configuration.maven.notCoveredPluginExecutionSeverity": "ignore",
|
||||
"java.jdt.ls.java.home": "C:\\Program Files\\Java\\jdk-17",
|
||||
"java.configuration.runtimes": [
|
||||
{
|
||||
@@ -12,6 +14,10 @@
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"java.maven.downloadSources": true,
|
||||
"java.eclipse.downloadSources": true,
|
||||
"java.project.importOnFirstTimeStartup": "automatic",
|
||||
"java.configuration.checkProjectSettingsExclusions": false,
|
||||
"java.import.exclusions": [
|
||||
"**/jeecg-server-cloud/**",
|
||||
"**/jeecg-boot-platform/**",
|
||||
|
||||
18
jeecg-boot/.vscode/tasks.json
vendored
Normal file
18
jeecg-boot/.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Maven: 修复 Java Classpath",
|
||||
"type": "shell",
|
||||
"command": "mvn clean install -DskipTests -pl jeecg-boot-base-core,jeecg-boot-module/jeecg-module-print,jeecg-boot-module/jeecg-module-xslmes -am",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
},
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": false
|
||||
},
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
64
jeecg-boot/db/mes-fix-rubber-category-visible.sql
Normal file
64
jeecg-boot/db/mes-fix-rubber-category-visible.sql
Normal file
@@ -0,0 +1,64 @@
|
||||
-- 修复:胶料分类字典(XSLMES_RUBBER)数据库有数据但页面不展示
|
||||
-- 场景:开启多租户后,sys_category 的 tenant_id 与当前登录租户不一致/为空
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
-- 1) 目标租户:默认取 admin 用户租户;若为空则回退到 0
|
||||
SET @target_tenant_id = (
|
||||
SELECT COALESCE(tenant_id, 0)
|
||||
FROM sys_user
|
||||
WHERE username = 'admin'
|
||||
ORDER BY create_time ASC
|
||||
LIMIT 1
|
||||
);
|
||||
SET @target_tenant_id = IFNULL(@target_tenant_id, 0);
|
||||
|
||||
-- 2) 定位根分类编码
|
||||
SET @rubber_code = 'XSLMES_RUBBER';
|
||||
|
||||
-- 若根节点不存在则补一个最小根节点(避免前端 pcode 查询直接失败)
|
||||
INSERT INTO sys_category (id, pid, name, code, has_child, tenant_id, create_by, create_time, update_by, update_time)
|
||||
SELECT '1994000000000000001', '0', 'MES胶料分类', @rubber_code, '1', @target_tenant_id, 'admin', NOW(), 'admin', NOW()
|
||||
FROM dual
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM sys_category WHERE code = @rubber_code
|
||||
);
|
||||
|
||||
SET @rubber_root_id = (
|
||||
SELECT id
|
||||
FROM sys_category
|
||||
WHERE code = @rubber_code
|
||||
ORDER BY create_time ASC
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
-- 3) 若根节点存在,统一修复租户与父子标记
|
||||
UPDATE sys_category
|
||||
SET tenant_id = @target_tenant_id
|
||||
WHERE id = @rubber_root_id;
|
||||
|
||||
UPDATE sys_category
|
||||
SET tenant_id = @target_tenant_id
|
||||
WHERE pid = @rubber_root_id;
|
||||
|
||||
-- 根节点是否有子节点,按真实数据回写
|
||||
UPDATE sys_category
|
||||
SET has_child = CASE
|
||||
WHEN EXISTS (SELECT 1 FROM (SELECT id FROM sys_category WHERE pid = @rubber_root_id LIMIT 1) t) THEN '1'
|
||||
ELSE '0'
|
||||
END
|
||||
WHERE id = @rubber_root_id;
|
||||
|
||||
-- 子节点统一标记为无子(当前这批分类通常为叶子)
|
||||
UPDATE sys_category
|
||||
SET has_child = '0'
|
||||
WHERE pid = @rubber_root_id;
|
||||
|
||||
-- 4) 结果检查(执行后看返回)
|
||||
SELECT 'ROOT' AS level_tag, id, pid, code, name, tenant_id, has_child
|
||||
FROM sys_category
|
||||
WHERE id = @rubber_root_id
|
||||
UNION ALL
|
||||
SELECT 'CHILD' AS level_tag, id, pid, code, name, tenant_id, has_child
|
||||
FROM sys_category
|
||||
WHERE pid = @rubber_root_id
|
||||
ORDER BY level_tag, code;
|
||||
92
jeecg-boot/db/mes-xsl-day-tank-material-map-menu.sql
Normal file
92
jeecg-boot/db/mes-xsl-day-tank-material-map-menu.sql
Normal 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';
|
||||
82
jeecg-boot/db/mes-xsl-downtime-record-menu-permission.sql
Normal file
82
jeecg-boot/db/mes-xsl-downtime-record-menu-permission.sql
Normal file
@@ -0,0 +1,82 @@
|
||||
-- MES 停机记录:建表 + 菜单 + 按钮 + 租户 admin 授权(可整文件一次执行)
|
||||
-- 权限前缀:mes:mes_xsl_downtime_record:*
|
||||
-- 依赖:mes_xsl_equipment_ledger、mes_xsl_downtime_type;父菜单 设备管理
|
||||
-- Flyway:V3.9.2_117__mes_xsl_downtime_record.sql
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_downtime_record` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`equipment_ledger_id` varchar(32) NOT NULL COMMENT '设备台账主键 mes_xsl_equipment_ledger.id',
|
||||
`equipment_code` varchar(500) DEFAULT NULL COMMENT '设备编号冗余',
|
||||
`equipment_name` varchar(500) DEFAULT NULL COMMENT '设备名称冗余',
|
||||
`downtime_type_id` varchar(32) NOT NULL COMMENT '停机类型主键 mes_xsl_downtime_type.id',
|
||||
`downtime_type_name` varchar(500) DEFAULT NULL COMMENT '停机类型名称冗余',
|
||||
`start_time` datetime NOT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`equipment_part_id` varchar(32) DEFAULT NULL COMMENT '设备部位主键 mes_xsl_equipment_part.id',
|
||||
`equipment_part_name` varchar(500) DEFAULT NULL COMMENT '设备部位名称冗余',
|
||||
`inspect_maintain_item_id` varchar(32) DEFAULT NULL COMMENT '点检及保养项目主键 mes_xsl_inspect_maintain_item.id',
|
||||
`inspect_maintain_item_name` varchar(500) DEFAULT NULL COMMENT '点检项目名称冗余',
|
||||
`maintenance_result` varchar(500) DEFAULT NULL COMMENT '维修结果',
|
||||
`maintainer_user_id` varchar(32) DEFAULT NULL COMMENT '维修人用户ID',
|
||||
`maintainer_username` varchar(500) DEFAULT NULL COMMENT '维修人账号',
|
||||
`maintainer_realname` varchar(500) DEFAULT NULL COMMENT '维修人姓名',
|
||||
`maintenance_filled_flag` varchar(1) DEFAULT '0' COMMENT '是否已录入维修结果(字典yn: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_mdr_equipment` (`equipment_ledger_id`),
|
||||
KEY `idx_mdr_downtime_type` (`downtime_type_id`),
|
||||
KEY `idx_mdr_start_time` (`start_time`)
|
||||
) 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 ('1860000000000000201', @mes_equip_pid, '停机记录', '/xslmes/mesXslDowntimeRecord', 'xslmes/mesXslDowntimeRecord/MesXslDowntimeRecordList', 'MesXslDowntimeRecordList', 1, NULL, '1', 12, 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:history-outlined';
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:history-outlined' WHERE `id` = '1860000000000000201' 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
|
||||
('1860000000000000202', '1860000000000000201', '新增', 2, 'mes:mes_xsl_downtime_record:add', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000203', '1860000000000000201', '编辑', 2, 'mes:mes_xsl_downtime_record:edit', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000204', '1860000000000000201', '删除', 2, 'mes:mes_xsl_downtime_record:delete', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000205', '1860000000000000201', '批量删除', 2, 'mes:mes_xsl_downtime_record:deleteBatch', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000206', '1860000000000000201', '导出', 2, 'mes:mes_xsl_downtime_record:exportXls', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000207', '1860000000000000201', '导入', 2, 'mes:mes_xsl_downtime_record: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 (
|
||||
'1860000000000000201',
|
||||
'1860000000000000202', '1860000000000000203', '1860000000000000204', '1860000000000000205',
|
||||
'1860000000000000206', '1860000000000000207'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
);
|
||||
@@ -0,0 +1,91 @@
|
||||
-- MES 设备点检配置(主子表):建表 + 菜单 + 按钮 + 租户 admin 授权
|
||||
-- 权限前缀:mes:mes_xsl_equip_inspect_config:*
|
||||
-- 父菜单:设备管理;类型字典复用 xslmes_im_item_category(须先有点检及保养项目功能)
|
||||
-- Flyway:V3.9.2_78__mes_xsl_equip_inspect_config.sql
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_equip_inspect_config` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`equipment_ledger_id` varchar(32) NOT NULL COMMENT '设备台账主键 mes_xsl_equipment_ledger.id',
|
||||
`equipment_name` varchar(500) DEFAULT NULL COMMENT '设备名称冗余',
|
||||
`equipment_code` varchar(500) DEFAULT NULL COMMENT '设备编号冗余',
|
||||
`config_type` varchar(500) NOT NULL COMMENT '配置类型(字典xslmes_im_item_category:inspect点检/maintain保养;同设备同类型唯一)',
|
||||
`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_meic_tenant_equip_type` (`tenant_id`, `equipment_ledger_id`, `config_type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES设备点检配置';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_equip_inspect_config_line` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`config_id` varchar(32) NOT NULL COMMENT '主表主键 mes_xsl_equip_inspect_config.id',
|
||||
`inspect_maintain_item_id` varchar(32) NOT NULL COMMENT '点检及保养项目主键 mes_xsl_inspect_maintain_item.id',
|
||||
`item_code` varchar(500) DEFAULT NULL COMMENT '点检项目编号冗余',
|
||||
`item_name` varchar(500) DEFAULT NULL COMMENT '项目名称冗余',
|
||||
`item_category` varchar(500) DEFAULT NULL COMMENT '项目类别冗余',
|
||||
`item_type` varchar(500) DEFAULT NULL COMMENT '项目类型冗余',
|
||||
`equipment_part_name` varchar(500) DEFAULT NULL COMMENT '设备部位名称冗余',
|
||||
`equipment_sub_part_name` varchar(500) DEFAULT NULL COMMENT '设备小部位名称冗余',
|
||||
`inspect_method` varchar(500) DEFAULT NULL COMMENT '点检方式冗余',
|
||||
`judgment_criteria` varchar(500) DEFAULT NULL COMMENT '判断基准冗余',
|
||||
`sort_no` int DEFAULT '0' 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 '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_meicl_config` (`config_id`),
|
||||
KEY `idx_meicl_item` (`inspect_maintain_item_id`),
|
||||
UNIQUE KEY `uk_meicl_config_item` (`config_id`, `inspect_maintain_item_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 ('1860000000000000148', @mes_equip_pid, '设备点检配置', '/xslmes/mesXslEquipInspectConfig', 'xslmes/mesXslEquipInspectConfig/MesXslEquipInspectConfigList', NULL, 1, NULL, '1', 12, 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:control-outlined';
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:control-outlined' WHERE `id` = '1860000000000000148' 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
|
||||
('1860000000000000149', '1860000000000000148', '新增', 2, 'mes:mes_xsl_equip_inspect_config:add', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000150', '1860000000000000148', '编辑', 2, 'mes:mes_xsl_equip_inspect_config:edit', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000151', '1860000000000000148', '删除', 2, 'mes:mes_xsl_equip_inspect_config:delete', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000152', '1860000000000000148', '批量删除', 2, 'mes:mes_xsl_equip_inspect_config:deleteBatch', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000153', '1860000000000000148', '导出', 2, 'mes:mes_xsl_equip_inspect_config:exportXls', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000154', '1860000000000000148', '导入', 2, 'mes:mes_xsl_equip_inspect_config: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 (
|
||||
'1860000000000000148',
|
||||
'1860000000000000149', '1860000000000000150', '1860000000000000151', '1860000000000000152',
|
||||
'1860000000000000153', '1860000000000000154'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
);
|
||||
138
jeecg-boot/db/mes-xsl-equip-inspect-record-menu-permission.sql
Normal file
138
jeecg-boot/db/mes-xsl-equip-inspect-record-menu-permission.sql
Normal file
@@ -0,0 +1,138 @@
|
||||
-- MES 点检/保养记录(主子表):建表 + 字典 + 菜单 + 按钮 + 租户 admin 授权
|
||||
-- 权限前缀:mes:mes_xsl_equip_inspect_record:*
|
||||
-- 父菜单:设备管理;依赖设备点检配置、设备台账
|
||||
-- Flyway:V3.9.2_79__mes_xsl_equip_inspect_record.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_inspect_result', '合格/不合格', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_inspect_result' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.`id`, '合格', 'pass', '', 1, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_inspect_result' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.`id` AND i.`item_value` = 'pass');
|
||||
|
||||
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.`id`, '不合格', 'fail', '', 2, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_inspect_result' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.`id` AND i.`item_value` = 'fail');
|
||||
|
||||
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_record_status', '待点检/已点检', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_im_record_status' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.`id`, '待点检', 'pending', '', 1, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_record_status' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.`id` AND i.`item_value` = 'pending');
|
||||
|
||||
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.`id`, '已点检', 'done', '', 2, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_im_record_status' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.`id` AND i.`item_value` = 'done');
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_equip_inspect_record` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`record_no` varchar(32) NOT NULL COMMENT '记录编号(EC+yyyyMMdd+4位流水,租户内按日递增)',
|
||||
`plan_no` varchar(500) DEFAULT NULL COMMENT '计划单号',
|
||||
`plan_id` varchar(32) DEFAULT NULL COMMENT '计划主键(隐藏)',
|
||||
`equipment_ledger_id` varchar(32) NOT NULL COMMENT '设备台账主键 mes_xsl_equipment_ledger.id',
|
||||
`equipment_code` varchar(500) DEFAULT NULL COMMENT '设备编码冗余',
|
||||
`equipment_name` varchar(500) DEFAULT NULL COMMENT '设备名称冗余',
|
||||
`equip_inspect_config_id` varchar(32) DEFAULT NULL COMMENT '设备点检配置主键 mes_xsl_equip_inspect_config.id',
|
||||
`record_type` varchar(500) NOT NULL COMMENT '类型(字典xslmes_im_item_category:inspect点检/maintain保养)',
|
||||
`inspect_date` date DEFAULT NULL COMMENT '点检日期',
|
||||
`inspector_user_id` varchar(32) DEFAULT NULL COMMENT '点检人用户ID',
|
||||
`inspector_username` varchar(500) DEFAULT NULL COMMENT '点检人账号',
|
||||
`inspector_realname` varchar(500) DEFAULT NULL COMMENT '点检人姓名',
|
||||
`inspect_result` varchar(500) NOT NULL COMMENT '点检结果(字典xslmes_im_inspect_result:pass合格/fail不合格)',
|
||||
`record_status` varchar(500) NOT NULL COMMENT '状态(字典xslmes_im_record_status:pending待点检/done已点检)',
|
||||
`handled_flag` varchar(1) DEFAULT NULL COMMENT '是否已处理(字典yn:1是0否,仅不合格记录使用)',
|
||||
`handler_user_id` varchar(32) DEFAULT NULL COMMENT '处理人用户ID',
|
||||
`handler_username` varchar(500) DEFAULT NULL COMMENT '处理人账号',
|
||||
`handler_realname` varchar(500) DEFAULT NULL COMMENT '处理人姓名',
|
||||
`handle_time` datetime 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`),
|
||||
UNIQUE KEY `uk_meir_tenant_record_no` (`tenant_id`, `record_no`),
|
||||
KEY `idx_meir_equip_type` (`equipment_ledger_id`, `record_type`),
|
||||
KEY `idx_meir_inspect_date` (`inspect_date`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES点检保养记录';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_equip_inspect_record_line` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`record_id` varchar(32) NOT NULL COMMENT '主表主键 mes_xsl_equip_inspect_record.id',
|
||||
`equip_inspect_config_line_id` varchar(32) NOT NULL COMMENT '设备点检配置明细主键 mes_xsl_equip_inspect_config_line.id',
|
||||
`inspect_maintain_item_id` varchar(32) DEFAULT NULL COMMENT '点检及保养项目主键冗余',
|
||||
`item_code` varchar(500) DEFAULT NULL COMMENT '点检项目编号冗余',
|
||||
`item_name` varchar(500) DEFAULT NULL COMMENT '项目名称冗余',
|
||||
`item_category` varchar(500) DEFAULT NULL COMMENT '项目类别冗余',
|
||||
`item_type` varchar(500) DEFAULT NULL COMMENT '项目类型冗余',
|
||||
`equipment_part_name` varchar(500) DEFAULT NULL COMMENT '设备部位冗余',
|
||||
`equipment_sub_part_name` varchar(500) DEFAULT NULL COMMENT '设备小部位冗余',
|
||||
`inspect_method` varchar(500) DEFAULT NULL COMMENT '点检方式冗余',
|
||||
`judgment_criteria` varchar(500) DEFAULT NULL COMMENT '判断基准冗余',
|
||||
`line_inspect_result` varchar(500) DEFAULT NULL COMMENT '明细点检结果(文本)',
|
||||
`picture_files` varchar(2000) DEFAULT NULL COMMENT '图片(上传路径,逗号分隔)',
|
||||
`sort_no` int DEFAULT '0' 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 '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_meirl_record` (`record_id`),
|
||||
KEY `idx_meirl_config_line` (`equip_inspect_config_line_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 ('1860000000000000155', @mes_equip_pid, '点检保养记录', '/xslmes/mesXslEquipInspectRecord', 'xslmes/mesXslEquipInspectRecord/MesXslEquipInspectRecordList', 'MesXslEquipInspectRecordList', 1, NULL, '1', 13, 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:file-done-outlined';
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:file-done-outlined' WHERE `id` = '1860000000000000155' 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
|
||||
('1860000000000000156', '1860000000000000155', '新增', 2, 'mes:mes_xsl_equip_inspect_record:add', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000157', '1860000000000000155', '编辑', 2, 'mes:mes_xsl_equip_inspect_record:edit', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000158', '1860000000000000155', '删除', 2, 'mes:mes_xsl_equip_inspect_record:delete', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000159', '1860000000000000155', '批量删除', 2, 'mes:mes_xsl_equip_inspect_record:deleteBatch', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000160', '1860000000000000155', '导出', 2, 'mes:mes_xsl_equip_inspect_record:exportXls', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000161', '1860000000000000155', '导入', 2, 'mes:mes_xsl_equip_inspect_record: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 (
|
||||
'1860000000000000155',
|
||||
'1860000000000000156', '1860000000000000157', '1860000000000000158', '1860000000000000159',
|
||||
'1860000000000000160', '1860000000000000161'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
);
|
||||
@@ -0,0 +1,60 @@
|
||||
-- MES 设备报警记录、设备停机记录:菜单 + 导出按钮 + 租户 admin 授权(无 MySQL 业务表)
|
||||
-- 权限前缀:mes:mes_xsl_equip_alarm_record:* / mes:mes_xsl_equip_downtime_record:*
|
||||
-- 父菜单:设备管理;Flyway:V3.9.2_124__mes_xsl_equip_mcs_alarm_downtime_menu.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');
|
||||
|
||||
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 ('1860000000000000222', @mes_equip_pid, '设备报警记录', '/xslmes/mesXslEquipAlarmRecord', 'xslmes/mesXslEquipAlarmRecord/MesXslEquipAlarmRecordList', 'MesXslEquipAlarmRecordList', 1, NULL, '1', 13, 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`);
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:alert-outlined' WHERE `id` = '1860000000000000222' 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
|
||||
('1860000000000000223', '1860000000000000222', '导出', 2, 'mes:mes_xsl_equip_alarm_record: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`);
|
||||
|
||||
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 ('1860000000000000224', @mes_equip_pid, '设备停机记录', '/xslmes/mesXslEquipDowntimeRecord', 'xslmes/mesXslEquipDowntimeRecord/MesXslEquipDowntimeRecordList', 'MesXslEquipDowntimeRecordList', 1, NULL, '1', 15, 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`);
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:pause-circle-outlined' WHERE `id` = '1860000000000000224' 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
|
||||
('1860000000000000225', '1860000000000000224', '导出', 2, 'mes:mes_xsl_equip_downtime_record: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`);
|
||||
|
||||
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 (
|
||||
'1860000000000000222', '1860000000000000223',
|
||||
'1860000000000000224', '1860000000000000225'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
);
|
||||
65
jeecg-boot/db/mes-xsl-equip-part-mapping-menu-permission.sql
Normal file
65
jeecg-boot/db/mes-xsl-equip-part-mapping-menu-permission.sql
Normal file
@@ -0,0 +1,65 @@
|
||||
-- MES 设备对应部位:建表 + 菜单 + 按钮 + 租户 admin 授权(可整文件一次执行)
|
||||
-- 权限前缀:mes:mes_xsl_equip_part_mapping:*
|
||||
-- 数据由设备点检配置保存后自动生成,列表无手工新增
|
||||
-- Flyway:V3.9.2_123__mes_xsl_equip_part_mapping.sql
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_equip_part_mapping` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`equipment_ledger_id` varchar(32) NOT NULL COMMENT '设备台账主键 mes_xsl_equipment_ledger.id',
|
||||
`equipment_name` varchar(500) NOT NULL COMMENT '设备名称',
|
||||
`machine_code` 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 '设备大部位名称',
|
||||
`part_code` 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 '设备小部位名称',
|
||||
`sub_part_code` varchar(500) DEFAULT NULL COMMENT '小部位代码',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门',
|
||||
`create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_mepm_ledger_part_sub` (`equipment_ledger_id`, `equipment_part_id`, `equipment_sub_part_id`),
|
||||
KEY `idx_mepm_tenant_equip_name` (`tenant_id`, `equipment_name`)
|
||||
) 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 ('1860000000000000215', @mes_equip_pid, '设备对应部位', '/xslmes/mesXslEquipPartMapping', 'xslmes/mesXslEquipPartMapping/MesXslEquipPartMappingList', 'MesXslEquipPartMappingList', 1, NULL, '1', 14, 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:apartment-outlined';
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:apartment-outlined' WHERE `id` = '1860000000000000215' 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
|
||||
('1860000000000000216', '1860000000000000215', '导出', 2, 'mes:mes_xsl_equip_part_mapping: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`);
|
||||
|
||||
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 ('1860000000000000215', '1860000000000000216')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
);
|
||||
@@ -23,6 +23,7 @@ CREATE TABLE IF NOT EXISTS `mes_xsl_equipment_ledger` (
|
||||
`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 '设备名称(同租户未删除唯一)',
|
||||
`ledger_no` varchar(16) DEFAULT NULL COMMENT '编号(租户内从001递增自动生成,只读)',
|
||||
`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 '设备厂家名称冗余',
|
||||
@@ -59,6 +60,7 @@ CREATE TABLE IF NOT EXISTS `mes_xsl_equipment_ledger` (
|
||||
`del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mel_tenant_code` (`tenant_id`, `equipment_code`),
|
||||
KEY `idx_mel_tenant_ledger_no` (`tenant_id`, `ledger_no`),
|
||||
KEY `idx_mel_tenant_name` (`tenant_id`, `equipment_name`),
|
||||
KEY `idx_mel_process` (`process_operation_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES设备台账';
|
||||
|
||||
@@ -6,7 +6,8 @@ CREATE TABLE IF NOT EXISTS `mes_xsl_equipment_ledger` (
|
||||
`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 '设备编号',
|
||||
`ledger_no` varchar(16) DEFAULT NULL COMMENT '编号(租户内从001递增自动生成,只读)',
|
||||
`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 '设备类别',
|
||||
@@ -42,5 +43,6 @@ CREATE TABLE IF NOT EXISTS `mes_xsl_equipment_ledger` (
|
||||
`del_flag` int DEFAULT '0' COMMENT '删除标记',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mel_tenant_code` (`tenant_id`, `equipment_code`),
|
||||
KEY `idx_mel_tenant_ledger_no` (`tenant_id`, `ledger_no`),
|
||||
KEY `idx_mel_tenant_name` (`tenant_id`, `equipment_name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES设备台账';
|
||||
|
||||
92
jeecg-boot/db/mes-xsl-final-batch-plan-menu.sql
Normal file
92
jeecg-boot/db/mes-xsl-final-batch-plan-menu.sql
Normal 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 (
|
||||
'1860000000000099711', @mixer_parent_id, '终胶计划',
|
||||
'/mes/finalbatchplaninfo',
|
||||
'mes/finalbatchplaninfo/index',
|
||||
'MesXslFinalBatchPlanList', 1, NULL, '1', 35,
|
||||
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
|
||||
('1860000000000099712', '1860000000000099711', '新增', 2, 'xslmes:mes_xsl_final_batch_plan:add', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099713', '1860000000000099711', '编辑', 2, 'xslmes:mes_xsl_final_batch_plan:edit', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099714', '1860000000000099711', '删除', 2, 'xslmes:mes_xsl_final_batch_plan:delete', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099715', '1860000000000099711', '批量删除', 2, 'xslmes:mes_xsl_final_batch_plan:deleteBatch', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099716', '1860000000000099711', '导出', 2, 'xslmes:mes_xsl_final_batch_plan: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 (
|
||||
'1860000000000099711',
|
||||
'1860000000000099712', '1860000000000099713', '1860000000000099714', '1860000000000099715', '1860000000000099716'
|
||||
)
|
||||
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/finalbatchplaninfo',
|
||||
component = 'mes/finalbatchplaninfo/index',
|
||||
component_name = 'MesXslFinalBatchPlanList',
|
||||
menu_type = 1,
|
||||
is_route = 1,
|
||||
is_leaf = 1,
|
||||
hidden = 0,
|
||||
status = '1',
|
||||
del_flag = 0
|
||||
WHERE id = '1860000000000099711';
|
||||
30
jeecg-boot/db/mes-xsl-final-batch-plan-table.sql
Normal file
30
jeecg-boot/db/mes-xsl-final-batch-plan-table.sql
Normal file
@@ -0,0 +1,30 @@
|
||||
-- 终胶计划建表SQL
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_final_batch_plan` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`source_order_id` varchar(32) DEFAULT NULL COMMENT '来源生产订单ID',
|
||||
`order_serial_no` varchar(500) DEFAULT NULL COMMENT '订单流水',
|
||||
`order_no` varchar(500) DEFAULT NULL COMMENT '订单编号',
|
||||
`production_segment_count` int DEFAULT NULL COMMENT '生产段数',
|
||||
`order_date` date DEFAULT NULL COMMENT '订单日期',
|
||||
`material_code` varchar(500) DEFAULT NULL COMMENT '物料编码',
|
||||
`mes_material_name` varchar(500) DEFAULT NULL COMMENT 'MES胶料信息',
|
||||
`plan_weight` decimal(18,4) DEFAULT NULL COMMENT '计划重量',
|
||||
`per_car_weight` decimal(18,4) DEFAULT NULL COMMENT '每车重量',
|
||||
`planned_car_count` int DEFAULT 0 COMMENT '计划车数',
|
||||
`scheduled_car_count` int DEFAULT 0 COMMENT '已排产车数',
|
||||
`finished_car_count` int DEFAULT 0 COMMENT '完成车数',
|
||||
`status` int DEFAULT 0 COMMENT '状态:0未开始 1进行中 2已完成',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门编码',
|
||||
`create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(64) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` int DEFAULT 0 COMMENT '删除标记(0正常1删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mxfb_source_order` (`source_order_id`),
|
||||
KEY `idx_mxfb_material_code` (`material_code`),
|
||||
UNIQUE KEY `uk_mxfb_source_order_del` (`source_order_id`, `del_flag`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES终胶计划';
|
||||
92
jeecg-boot/db/mes-xsl-master-batch-plan-menu.sql
Normal file
92
jeecg-boot/db/mes-xsl-master-batch-plan-menu.sql
Normal 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 (
|
||||
'1860000000000099611', @mixer_parent_id, '母胶计划',
|
||||
'/mes/masterbatchplaninfo',
|
||||
'mes/masterbatchplaninfo/index',
|
||||
'MesXslMasterBatchPlanList', 1, NULL, '1', 34,
|
||||
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
|
||||
('1860000000000099612', '1860000000000099611', '新增', 2, 'xslmes:mes_xsl_master_batch_plan:add', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099613', '1860000000000099611', '编辑', 2, 'xslmes:mes_xsl_master_batch_plan:edit', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099614', '1860000000000099611', '删除', 2, 'xslmes:mes_xsl_master_batch_plan:delete', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099615', '1860000000000099611', '批量删除', 2, 'xslmes:mes_xsl_master_batch_plan:deleteBatch', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099616', '1860000000000099611', '导出', 2, 'xslmes:mes_xsl_master_batch_plan: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 (
|
||||
'1860000000000099611',
|
||||
'1860000000000099612', '1860000000000099613', '1860000000000099614', '1860000000000099615', '1860000000000099616'
|
||||
)
|
||||
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/masterbatchplaninfo',
|
||||
component = 'mes/masterbatchplaninfo/index',
|
||||
component_name = 'MesXslMasterBatchPlanList',
|
||||
menu_type = 1,
|
||||
is_route = 1,
|
||||
is_leaf = 1,
|
||||
hidden = 0,
|
||||
status = '1',
|
||||
del_flag = 0
|
||||
WHERE id = '1860000000000099611';
|
||||
30
jeecg-boot/db/mes-xsl-master-batch-plan-table.sql
Normal file
30
jeecg-boot/db/mes-xsl-master-batch-plan-table.sql
Normal file
@@ -0,0 +1,30 @@
|
||||
-- 母胶计划建表SQL
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_master_batch_plan` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`source_order_id` varchar(32) DEFAULT NULL COMMENT '来源生产订单ID',
|
||||
`order_serial_no` varchar(500) DEFAULT NULL COMMENT '订单流水号',
|
||||
`order_no` varchar(500) DEFAULT NULL COMMENT '订单编号',
|
||||
`production_segment_count` int DEFAULT NULL COMMENT '生产段数',
|
||||
`order_date` date DEFAULT NULL COMMENT '订单日期',
|
||||
`material_code` varchar(500) DEFAULT NULL COMMENT '物料编号',
|
||||
`mes_material_name` varchar(500) DEFAULT NULL COMMENT 'MES胶料名称',
|
||||
`plan_weight` decimal(18,4) DEFAULT NULL COMMENT '计划重量',
|
||||
`per_car_weight` decimal(18,4) DEFAULT NULL COMMENT '每车重量',
|
||||
`planned_car_count` int DEFAULT 0 COMMENT '计划车数',
|
||||
`scheduled_car_count` int DEFAULT 0 COMMENT '已排产车数',
|
||||
`finished_car_count` int DEFAULT 0 COMMENT '完成车数',
|
||||
`status` int DEFAULT 0 COMMENT '状态:0未开始 1进行中 2已完成',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门编码',
|
||||
`create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(64) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` int DEFAULT 0 COMMENT '删除标记(0正常1删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mxmbp_source_order` (`source_order_id`),
|
||||
KEY `idx_mxmbp_material_code` (`material_code`),
|
||||
UNIQUE KEY `uk_mxmbp_source_order_del` (`source_order_id`, `del_flag`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES母胶计划';
|
||||
92
jeecg-boot/db/mes-xsl-mixer-action-menu.sql
Normal file
92
jeecg-boot/db/mes-xsl-mixer-action-menu.sql
Normal 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';
|
||||
92
jeecg-boot/db/mes-xsl-mixer-condition-menu.sql
Normal file
92
jeecg-boot/db/mes-xsl-mixer-condition-menu.sql
Normal 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 (
|
||||
'1860000000000099411', @mixer_parent_id, '密炼机条件维护',
|
||||
'/mes/mixerconditioninfo',
|
||||
'mes/mixerconditioninfo/index',
|
||||
'MesXslMixerConditionList', 1, NULL, '1', 32,
|
||||
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
|
||||
('1860000000000099412', '1860000000000099411', '新增', 2, 'xslmes:mes_xsl_mixer_condition:add', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099413', '1860000000000099411', '编辑', 2, 'xslmes:mes_xsl_mixer_condition:edit', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099414', '1860000000000099411', '删除', 2, 'xslmes:mes_xsl_mixer_condition:delete', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099415', '1860000000000099411', '批量删除', 2, 'xslmes:mes_xsl_mixer_condition:deleteBatch', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099416', '1860000000000099411', '导出', 2, 'xslmes:mes_xsl_mixer_condition: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 (
|
||||
'1860000000000099411',
|
||||
'1860000000000099412', '1860000000000099413', '1860000000000099414', '1860000000000099415', '1860000000000099416'
|
||||
)
|
||||
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/mixerconditioninfo',
|
||||
component = 'mes/mixerconditioninfo/index',
|
||||
component_name = 'MesXslMixerConditionList',
|
||||
menu_type = 1,
|
||||
is_route = 1,
|
||||
is_leaf = 1,
|
||||
hidden = 0,
|
||||
status = '1',
|
||||
del_flag = 0
|
||||
WHERE id = '1860000000000099411';
|
||||
93
jeecg-boot/db/mes-xsl-production-order-menu.sql
Normal file
93
jeecg-boot/db/mes-xsl-production-order-menu.sql
Normal file
@@ -0,0 +1,93 @@
|
||||
-- 生产订单菜单与权限(挂到「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 (
|
||||
'1860000000000099511', @mixer_parent_id, '生产订单',
|
||||
'/mes/productionorderinfo',
|
||||
'mes/productionorderinfo/index',
|
||||
'MesXslProductionOrderList', 1, NULL, '1', 33,
|
||||
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
|
||||
('1860000000000099512', '1860000000000099511', '新增', 2, 'xslmes:mes_xsl_production_order:add', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099513', '1860000000000099511', '编辑', 2, 'xslmes:mes_xsl_production_order:edit', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099514', '1860000000000099511', '删除', 2, 'xslmes:mes_xsl_production_order:delete', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099515', '1860000000000099511', '批量删除', 2, 'xslmes:mes_xsl_production_order:deleteBatch', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099516', '1860000000000099511', '导出', 2, 'xslmes:mes_xsl_production_order:exportXls', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099517', '1860000000000099511', '拆分', 2, 'xslmes:mes_xsl_production_order:split', '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 (
|
||||
'1860000000000099511',
|
||||
'1860000000000099512', '1860000000000099513', '1860000000000099514', '1860000000000099515', '1860000000000099516', '1860000000000099517'
|
||||
)
|
||||
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/productionorderinfo',
|
||||
component = 'mes/productionorderinfo/index',
|
||||
component_name = 'MesXslProductionOrderList',
|
||||
menu_type = 1,
|
||||
is_route = 1,
|
||||
is_leaf = 1,
|
||||
hidden = 0,
|
||||
status = '1',
|
||||
del_flag = 0
|
||||
WHERE id = '1860000000000099511';
|
||||
64
jeecg-boot/db/mes-xsl-production-order-split-permission.sql
Normal file
64
jeecg-boot/db/mes-xsl-production-order-split-permission.sql
Normal file
@@ -0,0 +1,64 @@
|
||||
-- 生产订单「拆分」按钮权限补丁
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
-- 优先按组件路径定位“生产订单”菜单
|
||||
SET @prod_menu_id = (
|
||||
SELECT id
|
||||
FROM sys_permission
|
||||
WHERE component = 'mes/productionorderinfo/index'
|
||||
AND menu_type = 1
|
||||
AND del_flag = 0
|
||||
ORDER BY create_time ASC
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
-- 兜底:按URL定位
|
||||
SET @prod_menu_id = IFNULL(@prod_menu_id, (
|
||||
SELECT id
|
||||
FROM sys_permission
|
||||
WHERE url = '/mes/productionorderinfo'
|
||||
AND menu_type = 1
|
||||
AND del_flag = 0
|
||||
ORDER BY create_time ASC
|
||||
LIMIT 1
|
||||
));
|
||||
|
||||
-- 再兜底:按名称定位
|
||||
SET @prod_menu_id = IFNULL(@prod_menu_id, (
|
||||
SELECT id
|
||||
FROM sys_permission
|
||||
WHERE name = '生产订单'
|
||||
AND menu_type = 1
|
||||
AND del_flag = 0
|
||||
ORDER BY create_time ASC
|
||||
LIMIT 1
|
||||
));
|
||||
|
||||
-- 若找不到页面菜单,回退到约定ID(你现有脚本中使用)
|
||||
SET @prod_menu_id = IFNULL(@prod_menu_id, '1860000000000099511');
|
||||
|
||||
-- 写入/修复“拆分”按钮权限
|
||||
INSERT INTO sys_permission (
|
||||
id, parent_id, name, menu_type, perms, perms_type, status, del_flag, create_by, create_time
|
||||
) VALUES (
|
||||
'1860000000000099517', @prod_menu_id, '拆分', 2, 'xslmes:mes_xsl_production_order:split', '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', '1860000000000099517', NOW(), '127.0.0.1'
|
||||
FROM dual
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM sys_role_permission
|
||||
WHERE role_id = 'f6817f48af4fb3af11b9e8bf182f618b'
|
||||
AND permission_id = '1860000000000099517'
|
||||
);
|
||||
@@ -0,0 +1,66 @@
|
||||
-- MES 胶料快检数据点:建表 + 菜单(质量管理下)+ 按钮 + 租户 admin 授权(可整文件一次执行)
|
||||
-- 权限前缀:mes:mes_xsl_rubber_quick_test_data_point:*
|
||||
-- 依赖:mes_xsl_rubber_quick_test_type;修改租户改 SET @mes_tenant_id
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_data_point` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`point_name` varchar(128) NOT NULL COMMENT '数据点名称(同租户未删除唯一)',
|
||||
`quick_test_type_id` varchar(32) NOT NULL COMMENT '实验类型 mes_xsl_rubber_quick_test_type.id',
|
||||
`quick_test_type_name` varchar(128) DEFAULT NULL COMMENT '实验类型名称冗余',
|
||||
`unit_type` varchar(64) DEFAULT NULL COMMENT '单位类型(手填)',
|
||||
`point_desc` varchar(500) DEFAULT NULL COMMENT '描述',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门',
|
||||
`create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mrqtdp_tenant_type` (`tenant_id`, `quick_test_type_id`),
|
||||
UNIQUE KEY `uk_mrqtdp_tenant_name_del` (`tenant_id`, `point_name`, `del_flag`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检数据点';
|
||||
|
||||
SET @mes_tenant_id = 1002;
|
||||
SET @mes_quality_pid = IFNULL(
|
||||
(SELECT `id` FROM `sys_permission` WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '质量管理' LIMIT 1),
|
||||
'1860000000000000162'
|
||||
);
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
VALUES ('1860000000000000170', @mes_quality_pid, '胶料快检数据点', '/xslmes/mesXslRubberQuickTestDataPoint', 'xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPointList', 'MesXslRubberQuickTestDataPointList', 1, NULL, '1', 2, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`),
|
||||
`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`),
|
||||
`is_route` = VALUES(`is_route`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0,
|
||||
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`);
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:dot-chart-outlined' WHERE `id` = '1860000000000000170' AND `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `is_leaf`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
|
||||
('1860000000000000171', '1860000000000000170', '新增', 2, 'mes:mes_xsl_rubber_quick_test_data_point:add', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000172', '1860000000000000170', '编辑', 2, 'mes:mes_xsl_rubber_quick_test_data_point:edit', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000173', '1860000000000000170', '删除', 2, 'mes:mes_xsl_rubber_quick_test_data_point:delete', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000174', '1860000000000000170', '批量删除', 2, 'mes:mes_xsl_rubber_quick_test_data_point:deleteBatch', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000175', '1860000000000000170', '导出', 2, 'mes:mes_xsl_rubber_quick_test_data_point:exportXls', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000176', '1860000000000000170', '导入', 2, 'mes:mes_xsl_rubber_quick_test_data_point:importExcel', '1', 1, '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`),
|
||||
`is_leaf` = 1, `status` = '1', `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`tenant_id` = @mes_tenant_id
|
||||
AND r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'1860000000000000170',
|
||||
'1860000000000000171', '1860000000000000172', '1860000000000000173', '1860000000000000174',
|
||||
'1860000000000000175', '1860000000000000176'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
);
|
||||
27
jeecg-boot/db/mes-xsl-rubber-quick-test-method-drop.sql
Normal file
27
jeecg-boot/db/mes-xsl-rubber-quick-test-method-drop.sql
Normal file
@@ -0,0 +1,27 @@
|
||||
-- 撤销「胶料快检实验方法」:删除菜单权限、字典、业务表(可整文件一次执行)
|
||||
-- 说明:若仅未执行过 V3.9.2_99 / mes-xsl-rubber-quick-test-method-menu-permission.sql,执行本脚本即可;
|
||||
-- 已 Flyway 执行过 V3.9.2_99 的环境,请同时执行 flyway V3.9.2_100 或本脚本(内容一致)。
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
DELETE FROM `sys_role_permission`
|
||||
WHERE `permission_id` IN (
|
||||
'1860000000000000170',
|
||||
'1860000000000000171', '1860000000000000172', '1860000000000000173',
|
||||
'1860000000000000174', '1860000000000000175', '1860000000000000176'
|
||||
);
|
||||
|
||||
DELETE FROM `sys_permission`
|
||||
WHERE `id` IN (
|
||||
'1860000000000000170',
|
||||
'1860000000000000171', '1860000000000000172', '1860000000000000173',
|
||||
'1860000000000000174', '1860000000000000175', '1860000000000000176'
|
||||
);
|
||||
|
||||
DELETE di FROM `sys_dict_item` di
|
||||
INNER JOIN `sys_dict` d ON di.`dict_id` = d.`id`
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND d.`del_flag` = 0;
|
||||
|
||||
DELETE FROM `sys_dict`
|
||||
WHERE `dict_code` = 'xslmes_rubber_quick_test_rotor_type';
|
||||
|
||||
DROP TABLE IF EXISTS `mes_xsl_rubber_quick_test_method`;
|
||||
@@ -0,0 +1,294 @@
|
||||
-- 胶料快检实验方法(主子表):字典 + 建表 + 菜单(质量管理下)+ 按钮 + 租户 admin 授权
|
||||
|
||||
-- 权限前缀:mes:mes_xsl_rubber_quick_test_method:*
|
||||
|
||||
-- 菜单 ID 段 1860000000000000177(与数据点 170 段区分)
|
||||
|
||||
-- 可与 Flyway V3.9.2_102 重复执行(ON DUPLICATE / IF NOT EXISTS)
|
||||
|
||||
-- SET @mes_tenant_id:多租户 admin 授权目标租户
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检转子类型', 'xslmes_rubber_quick_test_rotor_type', '1大转子2小转子', 0, 'admin', NOW(), 0, 0
|
||||
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND `del_flag` = 0);
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '大转子', '1', 1, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '1');
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '小转子', '2', 2, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_rotor_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '2');
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检扭矩单位', 'xslmes_rubber_quick_test_torque_unit', 'Ib.in、dNm、kg.cm、Nm、mdm', 0, 'admin', NOW(), 0, 0
|
||||
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_torque_unit' AND `del_flag` = 0);
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, v.txt, v.val, v.ord, 1, 'admin', NOW()
|
||||
|
||||
FROM `sys_dict` d
|
||||
|
||||
CROSS JOIN (
|
||||
|
||||
SELECT 'Ib.in' AS txt, 'Ib.in' AS val, 1 AS ord UNION ALL
|
||||
|
||||
SELECT 'dNm', 'dNm', 2 UNION ALL
|
||||
|
||||
SELECT 'kg.cm', 'kg.cm', 3 UNION ALL
|
||||
|
||||
SELECT 'Nm', 'Nm', 4 UNION ALL
|
||||
|
||||
SELECT 'mdm', 'mdm', 5
|
||||
|
||||
) v
|
||||
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_torque_unit'
|
||||
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = v.val);
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检时间单位', 'xslmes_rubber_quick_test_time_unit', 'sec、min、m:s', 0, 'admin', NOW(), 0, 0
|
||||
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_time_unit' AND `del_flag` = 0);
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, v.txt, v.val, v.ord, 1, 'admin', NOW()
|
||||
|
||||
FROM `sys_dict` d
|
||||
|
||||
CROSS JOIN (
|
||||
|
||||
SELECT 'sec' AS txt, 'sec' AS val, 1 AS ord UNION ALL
|
||||
|
||||
SELECT 'min', 'min', 2 UNION ALL
|
||||
|
||||
SELECT 'm:s', 'm:s', 3
|
||||
|
||||
) v
|
||||
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_time_unit'
|
||||
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = v.val);
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检门尼单位', 'xslmes_rubber_quick_test_mooney_unit', 'MU', 0, 'admin', NOW(), 0, 0
|
||||
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_mooney_unit' AND `del_flag` = 0);
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, 'MU', 'MU', 1, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_mooney_unit'
|
||||
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'MU');
|
||||
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_method` (
|
||||
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
|
||||
`method_code` varchar(16) NOT NULL COMMENT '方法编号(租户内从001递增自动生成)',
|
||||
|
||||
`method_name` varchar(128) NOT NULL COMMENT '实验方法名称(同租户未删除唯一)',
|
||||
|
||||
`quick_test_type_id` varchar(32) NOT NULL COMMENT '实验类型 mes_xsl_rubber_quick_test_type.id',
|
||||
|
||||
`quick_test_type_name` varchar(128) DEFAULT NULL COMMENT '实验类型名称冗余',
|
||||
|
||||
`test_temp_c` decimal(12,2) DEFAULT NULL COMMENT '实验温度°C',
|
||||
|
||||
`preheat_time_min` decimal(12,2) DEFAULT NULL COMMENT '预热时间min',
|
||||
|
||||
`test_time_min` decimal(12,2) DEFAULT NULL COMMENT '实验时间min',
|
||||
|
||||
`test_angle_deg` decimal(12,2) DEFAULT NULL COMMENT '实验角度Deg',
|
||||
|
||||
`test_freq_hz` decimal(12,2) DEFAULT NULL COMMENT '实验频率Hz',
|
||||
|
||||
`rotor_type` varchar(2) DEFAULT NULL COMMENT '转子类型(字典xslmes_rubber_quick_test_rotor_type:1大转子2小转子)',
|
||||
|
||||
`rotor_speed_rpm` decimal(12,2) DEFAULT NULL COMMENT '转子速度rpm',
|
||||
|
||||
`method_desc` varchar(500) DEFAULT NULL COMMENT '方法描述',
|
||||
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户',
|
||||
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门',
|
||||
|
||||
`create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
|
||||
`update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
|
||||
`del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)',
|
||||
|
||||
PRIMARY KEY (`id`),
|
||||
|
||||
KEY `idx_mrqtm_tenant_code` (`tenant_id`, `method_code`),
|
||||
|
||||
KEY `idx_mrqtm_type` (`quick_test_type_id`),
|
||||
|
||||
UNIQUE KEY `uk_mrqtm_tenant_name_del` (`tenant_id`, `method_name`, `del_flag`)
|
||||
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检实验方法';
|
||||
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_method_line` (
|
||||
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
|
||||
`method_id` varchar(32) NOT NULL COMMENT '主表 mes_xsl_rubber_quick_test_method.id',
|
||||
|
||||
`data_point_id` varchar(32) NOT NULL COMMENT '数据点 mes_xsl_rubber_quick_test_data_point.id',
|
||||
|
||||
`point_name` varchar(128) DEFAULT NULL COMMENT '数据点名称冗余(只读带出)',
|
||||
|
||||
`unit_type` varchar(64) DEFAULT NULL COMMENT '单位类型冗余(只读带出)',
|
||||
|
||||
`torque_unit_type` varchar(32) DEFAULT NULL COMMENT '扭矩单位类型(字典xslmes_rubber_quick_test_torque_unit)',
|
||||
|
||||
`time_unit_type` varchar(32) DEFAULT NULL COMMENT '时间单位类型(字典xslmes_rubber_quick_test_time_unit)',
|
||||
|
||||
`mooney_unit_type` varchar(32) DEFAULT NULL COMMENT '门尼单位类型(字典xslmes_rubber_quick_test_mooney_unit)',
|
||||
|
||||
`sort_no` int DEFAULT NULL COMMENT '排序号',
|
||||
|
||||
`create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
|
||||
`update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
|
||||
PRIMARY KEY (`id`),
|
||||
|
||||
KEY `idx_mrqtml_method` (`method_id`),
|
||||
|
||||
UNIQUE KEY `uk_mrqtml_method_point` (`method_id`, `data_point_id`)
|
||||
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检实验方法明细';
|
||||
|
||||
|
||||
|
||||
SET @mes_tenant_id = 1002;
|
||||
|
||||
SET @mes_quality_pid = IFNULL(
|
||||
|
||||
(SELECT `id` FROM `sys_permission` WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '质量管理' LIMIT 1),
|
||||
|
||||
'1860000000000000162'
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
|
||||
VALUES ('1860000000000000177', @mes_quality_pid, '胶料快检实验方法', '/xslmes/mesXslRubberQuickTestMethod', 'xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethodList', 'MesXslRubberQuickTestMethodList', 1, NULL, '1', 3, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
|
||||
|
||||
ON DUPLICATE KEY UPDATE
|
||||
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`),
|
||||
|
||||
`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`),
|
||||
|
||||
`is_route` = VALUES(`is_route`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0,
|
||||
|
||||
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`);
|
||||
|
||||
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:profile-outlined' WHERE `id` = '1860000000000000177' AND `del_flag` = 0;
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `is_leaf`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
|
||||
|
||||
('1860000000000000178', '1860000000000000177', '新增', 2, 'mes:mes_xsl_rubber_quick_test_method:add', '1', 1, '1', 0, 'admin', NOW()),
|
||||
|
||||
('1860000000000000179', '1860000000000000177', '编辑', 2, 'mes:mes_xsl_rubber_quick_test_method:edit', '1', 1, '1', 0, 'admin', NOW()),
|
||||
|
||||
('1860000000000000180', '1860000000000000177', '删除', 2, 'mes:mes_xsl_rubber_quick_test_method:delete', '1', 1, '1', 0, 'admin', NOW()),
|
||||
|
||||
('1860000000000000181', '1860000000000000177', '批量删除', 2, 'mes:mes_xsl_rubber_quick_test_method:deleteBatch', '1', 1, '1', 0, 'admin', NOW()),
|
||||
|
||||
('1860000000000000182', '1860000000000000177', '导出', 2, 'mes:mes_xsl_rubber_quick_test_method:exportXls', '1', 1, '1', 0, 'admin', NOW()),
|
||||
|
||||
('1860000000000000183', '1860000000000000177', '导入', 2, 'mes:mes_xsl_rubber_quick_test_method:importExcel', '1', 1, '1', 0, 'admin', NOW())
|
||||
|
||||
ON DUPLICATE KEY UPDATE
|
||||
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`),
|
||||
|
||||
`is_leaf` = 1, `status` = '1', `del_flag` = 0;
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`)
|
||||
|
||||
SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1'
|
||||
|
||||
FROM `sys_role` r
|
||||
|
||||
CROSS JOIN `sys_permission` p
|
||||
|
||||
WHERE r.`tenant_id` = @mes_tenant_id
|
||||
|
||||
AND r.`role_code` = 'admin'
|
||||
|
||||
AND p.`id` IN (
|
||||
|
||||
'1860000000000000177',
|
||||
|
||||
'1860000000000000178', '1860000000000000179', '1860000000000000180', '1860000000000000181',
|
||||
|
||||
'1860000000000000182', '1860000000000000183'
|
||||
|
||||
)
|
||||
|
||||
AND NOT EXISTS (
|
||||
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
|
||||
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
|
||||
);
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
-- 胶料快检记录(主子表):字典 + 建表 + 菜单(质量管理下)+ 按钮 + 胶料信息「检验」按钮 + 租户 admin 授权
|
||||
-- 权限前缀:mes:mes_xsl_rubber_quick_test_record:*
|
||||
-- 菜单 ID 段 1860000000000000192
|
||||
-- SET @mes_tenant_id:多租户 admin 授权目标租户
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检记录检验结果', 'xslmes_rubber_quick_test_record_result', '1合格0不合格', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_record_result' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '合格', '1', 1, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_record_result' 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, '不合格', '0', 2, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_record_result' 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` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检班次', 'xslmes_rubber_quick_test_work_shift', '班次', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_work_shift' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, v.txt, v.val, v.ord, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
CROSS JOIN (
|
||||
SELECT '早班' AS txt, '1' AS val, 1 AS ord UNION ALL
|
||||
SELECT '中班', '2', 2 UNION ALL
|
||||
SELECT '晚班', '3', 3
|
||||
) v
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_work_shift'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = v.val);
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检班组', 'xslmes_rubber_quick_test_work_team', '班组', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_work_team' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, v.txt, v.val, v.ord, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
CROSS JOIN (
|
||||
SELECT '甲班' AS txt, '1' AS val, 1 AS ord UNION ALL
|
||||
SELECT '乙班', '2', 2 UNION ALL
|
||||
SELECT '丙班', '3', 3
|
||||
) v
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_work_team'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = v.val);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_record` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`record_no` varchar(32) DEFAULT NULL COMMENT '单号(JL+日期+4位流水,如JL202605280001)',
|
||||
`rubber_material_id` varchar(32) DEFAULT NULL COMMENT '胶料 mes_material.id',
|
||||
`rubber_material_name` varchar(128) DEFAULT NULL COMMENT '胶料名称冗余',
|
||||
`std_id` varchar(32) DEFAULT NULL COMMENT '引用的实验标准 mes_xsl_rubber_quick_test_std.id',
|
||||
`prod_equipment_ledger_id` varchar(32) DEFAULT NULL COMMENT '生产机台 mes_xsl_equipment_ledger.id',
|
||||
`prod_equipment_name` varchar(128) DEFAULT NULL COMMENT '生产机台名称冗余',
|
||||
`production_date` date DEFAULT NULL COMMENT '生产日期',
|
||||
`train_no` varchar(64) DEFAULT NULL COMMENT '车次编号',
|
||||
`work_shift` varchar(8) DEFAULT NULL COMMENT '班次(字典xslmes_rubber_quick_test_work_shift)',
|
||||
`work_team` varchar(8) DEFAULT NULL COMMENT '班组(字典xslmes_rubber_quick_test_work_team)',
|
||||
`inspect_times` int DEFAULT NULL COMMENT '检验次数',
|
||||
`inspect_time` datetime DEFAULT NULL COMMENT '检验时间',
|
||||
`inspector_user_id` varchar(32) DEFAULT NULL COMMENT '检验人用户ID',
|
||||
`inspector_username` varchar(64) DEFAULT NULL COMMENT '检验人账号冗余',
|
||||
`inspector_realname` varchar(64) DEFAULT NULL COMMENT '检验人姓名冗余',
|
||||
`quick_test_type_id` varchar(32) DEFAULT NULL COMMENT '检验类型 mes_xsl_rubber_quick_test_type.id',
|
||||
`quick_test_type_name` varchar(128) DEFAULT NULL COMMENT '检验类型名称冗余',
|
||||
`inspect_result` varchar(2) DEFAULT NULL COMMENT '检验结果(字典xslmes_rubber_quick_test_record_result:1合格0不合格)',
|
||||
`production_plan_no` varchar(100) DEFAULT NULL COMMENT '生产计划号',
|
||||
`inspect_equipment_ledger_id` varchar(32) DEFAULT NULL COMMENT '检验机台 mes_xsl_equipment_ledger.id',
|
||||
`inspect_equipment_name` varchar(128) DEFAULT NULL COMMENT '检验机台名称冗余',
|
||||
`rubber_card_no` varchar(100) DEFAULT NULL COMMENT '胶料卡片号',
|
||||
`rubber_batch_no` varchar(100) DEFAULT NULL COMMENT '胶料批次',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门',
|
||||
`create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_mrqtr_record_no` (`record_no`),
|
||||
KEY `idx_mrqtr_material` (`rubber_material_id`),
|
||||
KEY `idx_mrqtr_std` (`std_id`),
|
||||
KEY `idx_mrqtr_tenant` (`tenant_id`),
|
||||
KEY `idx_mrqtr_inspect_time` (`inspect_time`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检记录';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_record_line` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`record_id` varchar(32) NOT NULL COMMENT '主表 mes_xsl_rubber_quick_test_record.id',
|
||||
`data_point_id` varchar(32) DEFAULT NULL COMMENT '数据点 mes_xsl_rubber_quick_test_data_point.id',
|
||||
`inspect_item` varchar(128) DEFAULT NULL COMMENT '检验项目(数据点名称,只读带出)',
|
||||
`lower_limit` decimal(18,6) DEFAULT NULL COMMENT '检验下限(只读带出)',
|
||||
`inspect_value` decimal(18,6) DEFAULT NULL COMMENT '检验值',
|
||||
`upper_limit` decimal(18,6) DEFAULT NULL COMMENT '检验上限(只读带出)',
|
||||
`sort_no` int DEFAULT NULL COMMENT '排序号',
|
||||
`create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mrqtrl_record` (`record_id`),
|
||||
UNIQUE KEY `uk_mrqtrl_record_point` (`record_id`, `data_point_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检记录明细';
|
||||
|
||||
SET @mes_tenant_id = 1002;
|
||||
|
||||
SET @mes_quality_pid = IFNULL(
|
||||
(SELECT `id` FROM `sys_permission` WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '质量管理' LIMIT 1),
|
||||
'1860000000000000162'
|
||||
);
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
VALUES ('1860000000000000192', @mes_quality_pid, '胶料快检记录', '/xslmes/mesXslRubberQuickTestRecord', 'xslmes/mesXslRubberQuickTestRecord/MesXslRubberQuickTestRecordList', 'MesXslRubberQuickTestRecordList', 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`), `sort_no` = VALUES(`sort_no`), `is_leaf` = VALUES(`is_leaf`), `keep_alive` = VALUES(`keep_alive`);
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:file-search-outlined' WHERE `id` = '1860000000000000192' 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
|
||||
('1860000000000000193', '1860000000000000192', '新增', 2, 'mes:mes_xsl_rubber_quick_test_record:add', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000194', '1860000000000000192', '编辑', 2, 'mes:mes_xsl_rubber_quick_test_record:edit', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000195', '1860000000000000192', '删除', 2, 'mes:mes_xsl_rubber_quick_test_record:delete', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000196', '1860000000000000192', '批量删除', 2, 'mes:mes_xsl_rubber_quick_test_record:deleteBatch', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000197', '1860000000000000192', '导出', 2, 'mes:mes_xsl_rubber_quick_test_record:exportXls', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000198', '1860000000000000192', '导入', 2, 'mes:mes_xsl_rubber_quick_test_record:importExcel', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000199', '1860000000000000192', '从胶料生成', 2, 'mes:mes_xsl_rubber_quick_test_record:batchFromMaterial', '1', '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE `perms` = VALUES(`perms`), `name` = VALUES(`name`);
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
|
||||
('1860000000000000200', '1860000000000000011', '胶料快检', 2, 'mes:mes_material:rubberQuickTestInspect', '1', '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE `perms` = VALUES(`perms`), `name` = VALUES(`name`);
|
||||
|
||||
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 (
|
||||
'1860000000000000192',
|
||||
'1860000000000000193', '1860000000000000194', '1860000000000000195', '1860000000000000196',
|
||||
'1860000000000000197', '1860000000000000198', '1860000000000000199',
|
||||
'1860000000000000200'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM sys_role_permission rp
|
||||
WHERE rp.role_id = r.id AND rp.permission_id = p.id
|
||||
);
|
||||
130
jeecg-boot/db/mes-xsl-rubber-quick-test-std-menu-permission.sql
Normal file
130
jeecg-boot/db/mes-xsl-rubber-quick-test-std-menu-permission.sql
Normal file
@@ -0,0 +1,130 @@
|
||||
-- 胶料快检实验标准(主子表):字典 + 建表 + 菜单(质量管理下)+ 按钮 + 租户 admin 授权
|
||||
-- 权限前缀:mes:mes_xsl_rubber_quick_test_std:*
|
||||
-- 菜单 ID 段 1860000000000000184(实验方法占用 177-183)
|
||||
-- 可与 Flyway V3.9.2_103 重复执行(ON DUPLICATE / IF NOT EXISTS)
|
||||
-- SET @mes_tenant_id:多租户 admin 授权目标租户
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检密炼机类型', 'xslmes_rubber_quick_test_mixer_type', '1普通密炼机2串密炼机', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_mixer_type' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '普通密炼机', '1', 1, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_mixer_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '1');
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '串密炼机', '2', 2, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_mixer_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '2');
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检标准启用状态', 'xslmes_rubber_quick_test_std_enable_status', '1使用中0已停用', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_std_enable_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, '使用中', '1', 1, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_std_enable_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, '已停用', '0', 2, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_quick_test_std_enable_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` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES胶料快检标准审核状态', 'xslmes_rubber_quick_test_std_audit_status', '0草稿1已批准', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_quick_test_std_audit_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_rubber_quick_test_std_audit_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_rubber_quick_test_std_audit_status' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '1');
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_std` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`std_name` varchar(128) NOT NULL COMMENT '实验标准名称(同租户未删除唯一)',
|
||||
`test_method_id` varchar(32) NOT NULL COMMENT '实验方法 mes_xsl_rubber_quick_test_method.id',
|
||||
`test_method_name` varchar(128) DEFAULT NULL COMMENT '实验方法名称冗余',
|
||||
`mixer_type` varchar(2) DEFAULT NULL COMMENT '密炼机类型(字典xslmes_rubber_quick_test_mixer_type:1普通密炼机2串密炼机)',
|
||||
`rubber_material_id` varchar(32) DEFAULT NULL COMMENT '胶料 mes_material.id',
|
||||
`rubber_material_name` varchar(128) DEFAULT NULL COMMENT '胶料名称冗余',
|
||||
`ps_compile_id` varchar(32) DEFAULT NULL COMMENT '密炼PS编制 mes_xsl_mixer_ps_compile.id',
|
||||
`issue_number` varchar(100) DEFAULT NULL COMMENT '发行编号(密炼PS编码冗余)',
|
||||
`issue_date` date DEFAULT NULL COMMENT '发行日期',
|
||||
`issue_dept_id` varchar(32) DEFAULT NULL COMMENT '发行部门ID',
|
||||
`issue_dept_name` varchar(200) DEFAULT NULL COMMENT '发行部门名称冗余',
|
||||
`enable_status` varchar(2) DEFAULT '1' COMMENT '启用状态(字典xslmes_rubber_quick_test_std_enable_status:1使用中0已停用)',
|
||||
`audit_status` varchar(2) DEFAULT '0' COMMENT '审核状态(字典xslmes_rubber_quick_test_std_audit_status:0草稿1已批准)',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门',
|
||||
`create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mrqts_method` (`test_method_id`),
|
||||
KEY `idx_mrqts_material` (`rubber_material_id`),
|
||||
KEY `idx_mrqts_tenant` (`tenant_id`),
|
||||
UNIQUE KEY `uk_mrqts_tenant_name_del` (`tenant_id`, `std_name`, `del_flag`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检实验标准';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_std_line` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`std_id` varchar(32) NOT NULL COMMENT '主表 mes_xsl_rubber_quick_test_std.id',
|
||||
`data_point_id` varchar(32) NOT NULL COMMENT '数据点 mes_xsl_rubber_quick_test_data_point.id',
|
||||
`point_name` varchar(128) DEFAULT NULL COMMENT '数据点名称冗余(只读带出)',
|
||||
`lower_limit` decimal(18,6) DEFAULT NULL COMMENT '下限值',
|
||||
`lower_warn` decimal(18,6) DEFAULT NULL COMMENT '下警告值',
|
||||
`target_value` decimal(18,6) DEFAULT NULL COMMENT '目标值',
|
||||
`upper_warn` decimal(18,6) DEFAULT NULL COMMENT '上警告值',
|
||||
`upper_limit` decimal(18,6) DEFAULT NULL COMMENT '上限值',
|
||||
`sort_no` int DEFAULT NULL COMMENT '排序号',
|
||||
`create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mrqtsl_std` (`std_id`),
|
||||
UNIQUE KEY `uk_mrqtsl_std_point` (`std_id`, `data_point_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检实验标准明细';
|
||||
|
||||
SET @mes_tenant_id = 1002;
|
||||
|
||||
SET @mes_quality_pid = IFNULL(
|
||||
(SELECT `id` FROM `sys_permission` WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '质量管理' LIMIT 1),
|
||||
'1860000000000000162'
|
||||
);
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
VALUES ('1860000000000000184', @mes_quality_pid, '胶料快检实验标准', '/xslmes/mesXslRubberQuickTestStd', 'xslmes/mesXslRubberQuickTestStd/MesXslRubberQuickTestStdList', 'MesXslRubberQuickTestStdList', 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`), `sort_no` = VALUES(`sort_no`), `is_leaf` = VALUES(`is_leaf`), `keep_alive` = VALUES(`keep_alive`);
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:file-protect-outlined' WHERE `id` = '1860000000000000184' 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
|
||||
('1860000000000000185', '1860000000000000184', '新增', 2, 'mes:mes_xsl_rubber_quick_test_std:add', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000186', '1860000000000000184', '编辑', 2, 'mes:mes_xsl_rubber_quick_test_std:edit', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000187', '1860000000000000184', '删除', 2, 'mes:mes_xsl_rubber_quick_test_std:delete', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000188', '1860000000000000184', '批量删除', 2, 'mes:mes_xsl_rubber_quick_test_std:deleteBatch', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000189', '1860000000000000184', '导出', 2, 'mes:mes_xsl_rubber_quick_test_std:exportXls', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000190', '1860000000000000184', '导入', 2, 'mes:mes_xsl_rubber_quick_test_std:importExcel', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000000191', '1860000000000000184', '启用停用', 2, 'mes:mes_xsl_rubber_quick_test_std:updateStatus', '1', '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE `perms` = VALUES(`perms`), `name` = VALUES(`name`);
|
||||
|
||||
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 (
|
||||
'1860000000000000184',
|
||||
'1860000000000000185', '1860000000000000186', '1860000000000000187', '1860000000000000188',
|
||||
'1860000000000000189', '1860000000000000190', '1860000000000000191'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM sys_role_permission rp
|
||||
WHERE rp.role_id = r.id AND rp.permission_id = p.id
|
||||
);
|
||||
@@ -0,0 +1,87 @@
|
||||
-- MES 胶料快检实验类型:建表 + 质量管理目录 + 子菜单 + 按钮 + 租户 admin 授权(可整文件一次执行)
|
||||
-- 权限前缀与 Controller、前端 v-auth 一致:mes:mes_xsl_rubber_quick_test_type:*
|
||||
-- 修改租户:改 SET @mes_tenant_id
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_quick_test_type` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`type_code` varchar(16) NOT NULL COMMENT '实验类型编号(租户内从001递增自动生成)',
|
||||
`type_name` varchar(128) NOT NULL COMMENT '实验类型名称',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门',
|
||||
`create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mrqtt_tenant_code` (`tenant_id`, `type_code`),
|
||||
KEY `idx_mrqtt_tenant_name` (`tenant_id`, `type_name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料快检实验类型';
|
||||
|
||||
SET @mes_tenant_id = 1002;
|
||||
|
||||
SET @mes_root_parent = (
|
||||
SELECT `parent_id` FROM `sys_permission`
|
||||
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES基础资料'
|
||||
LIMIT 1
|
||||
);
|
||||
SET @mes_root_parent = IFNULL(@mes_root_parent, (
|
||||
SELECT `parent_id` FROM `sys_permission`
|
||||
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES资料'
|
||||
LIMIT 1
|
||||
));
|
||||
SET @mes_root_parent = IFNULL(@mes_root_parent, '1860000000000000001');
|
||||
|
||||
SET @mes_quality_sort = IFNULL((
|
||||
SELECT `sort_no` + 1 FROM `sys_permission`
|
||||
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` IN ('MES基础资料', 'MES资料', '设备管理')
|
||||
ORDER BY `sort_no` DESC
|
||||
LIMIT 1
|
||||
), 52);
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
VALUES ('1860000000000000162', @mes_root_parent, '质量管理', '/xslmes/quality', 'layouts/RouteView', 'MesQualityLayout', 0, NULL, '1', @mes_quality_sort, 1, 0, 0, '1', 0, 0, 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`),
|
||||
`menu_type` = VALUES(`menu_type`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0;
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:safety-certificate-outlined' WHERE `id` = '1860000000000000162' AND `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
VALUES ('1860000000000000163', '1860000000000000162', '胶料快检实验类型', '/xslmes/mesXslRubberQuickTestType', 'xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestTypeList', 'MesXslRubberQuickTestTypeList', 1, NULL, '1', 1, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`),
|
||||
`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`),
|
||||
`is_route` = VALUES(`is_route`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0,
|
||||
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`);
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:experiment-outlined' WHERE `id` = '1860000000000000163' AND `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `is_leaf`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
|
||||
('1860000000000000164', '1860000000000000163', '新增', 2, 'mes:mes_xsl_rubber_quick_test_type:add', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000165', '1860000000000000163', '编辑', 2, 'mes:mes_xsl_rubber_quick_test_type:edit', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000166', '1860000000000000163', '删除', 2, 'mes:mes_xsl_rubber_quick_test_type:delete', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000167', '1860000000000000163', '批量删除', 2, 'mes:mes_xsl_rubber_quick_test_type:deleteBatch', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000168', '1860000000000000163', '导出', 2, 'mes:mes_xsl_rubber_quick_test_type:exportXls', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000169', '1860000000000000163', '导入', 2, 'mes:mes_xsl_rubber_quick_test_type:importExcel', '1', 1, '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`),
|
||||
`is_leaf` = 1, `status` = '1', `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`tenant_id` = @mes_tenant_id
|
||||
AND r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'1860000000000000162',
|
||||
'1860000000000000163',
|
||||
'1860000000000000164', '1860000000000000165', '1860000000000000166', '1860000000000000167',
|
||||
'1860000000000000168', '1860000000000000169'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
);
|
||||
@@ -0,0 +1,85 @@
|
||||
-- MES 胶料小料锁定日志 + 锁定原因字段 reason_desc:可整文件一次执行
|
||||
-- 若已执行 V3.9.2_119 Flyway 可只跑本脚本补菜单/字段(幂等)
|
||||
-- 权限前缀:mes:mes_xsl_rubber_small_lock_log:*
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
SET @reason_desc_exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'mes_xsl_rubber_small_lock_reason'
|
||||
AND COLUMN_NAME = 'reason_desc'
|
||||
);
|
||||
SET @ddl_reason_desc := IF(
|
||||
@reason_desc_exists = 0,
|
||||
'ALTER TABLE `mes_xsl_rubber_small_lock_reason` ADD COLUMN `reason_desc` varchar(500) NOT NULL DEFAULT '''' COMMENT ''原因(手动输入,必填)'' AFTER `barcode_type`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt_reason_desc FROM @ddl_reason_desc;
|
||||
EXECUTE stmt_reason_desc;
|
||||
DEALLOCATE PREPARE stmt_reason_desc;
|
||||
|
||||
UPDATE `mes_xsl_rubber_small_lock_reason` SET `reason_desc` = CONCAT('原因', `reason_code`) WHERE `reason_desc` = '' OR `reason_desc` IS NULL;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_small_lock_log` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`lock_reason_id` varchar(32) NOT NULL COMMENT '锁定原因ID',
|
||||
`barcode_type` varchar(16) NOT NULL COMMENT '条码类型',
|
||||
`barcode` varchar(128) NOT NULL COMMENT '条码',
|
||||
`lock_type` varchar(16) NOT NULL COMMENT '状态',
|
||||
`reason_desc` varchar(500) NOT NULL COMMENT '原因',
|
||||
`log_date` date NOT NULL COMMENT '日期',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门',
|
||||
`create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(32) DEFAULT NULL COMMENT '修改人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mrsl_log_tenant_date` (`tenant_id`, `log_date`),
|
||||
KEY `idx_mrsl_log_barcode` (`tenant_id`, `barcode_type`, `barcode`),
|
||||
KEY `idx_mrsl_log_reason` (`lock_reason_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料小料锁定日志';
|
||||
|
||||
SET @mes_tenant_id = 1002;
|
||||
|
||||
SET @mes_quality_pid = IFNULL(
|
||||
(SELECT `id` FROM `sys_permission` WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '质量管理' LIMIT 1),
|
||||
'1860000000000000162'
|
||||
);
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
VALUES ('1860000000000000215', @mes_quality_pid, '胶料小料锁定日志', '/xslmes/mesXslRubberSmallLockLog', 'xslmes/mesXslRubberSmallLockLog/MesXslRubberSmallLockLogList', 'MesXslRubberSmallLockLogList', 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`),
|
||||
`sort_no` = VALUES(`sort_no`), `is_leaf` = 0, `status` = '1', `del_flag` = 0, `keep_alive` = VALUES(`keep_alive`);
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:file-text-outlined' WHERE `id` = '1860000000000000215' AND `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `is_leaf`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
|
||||
('1860000000000000216', '1860000000000000215', '新增', 2, 'mes:mes_xsl_rubber_small_lock_log:add', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000217', '1860000000000000215', '编辑', 2, 'mes:mes_xsl_rubber_small_lock_log:edit', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000218', '1860000000000000215', '删除', 2, 'mes:mes_xsl_rubber_small_lock_log:delete', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000219', '1860000000000000215', '批量删除', 2, 'mes:mes_xsl_rubber_small_lock_log:deleteBatch', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000220', '1860000000000000215', '导出', 2, 'mes:mes_xsl_rubber_small_lock_log:exportXls', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000221', '1860000000000000215', '导入', 2, 'mes:mes_xsl_rubber_small_lock_log:importExcel', '1', 1, '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`),
|
||||
`is_leaf` = 1, `status` = '1', `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`tenant_id` = @mes_tenant_id
|
||||
AND r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'1860000000000000215',
|
||||
'1860000000000000216', '1860000000000000217', '1860000000000000218', '1860000000000000219',
|
||||
'1860000000000000220', '1860000000000000221'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
);
|
||||
@@ -0,0 +1,87 @@
|
||||
-- MES 胶料小料锁定原因:字典 + 建表 + 菜单(质量管理下)+ 按钮 + 租户 admin 授权(可整文件一次执行)
|
||||
-- 权限前缀:mes:mes_xsl_rubber_small_lock_reason:*
|
||||
-- 菜单 ID 段:1860000000000000208(按钮 209-214)
|
||||
-- 修改租户:改 SET @mes_tenant_id
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES胶料小料锁定类型', 'xslmes_rubber_small_lock_type', '锁定/解锁', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_small_lock_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, '锁定', 'lock', 1, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_small_lock_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'lock');
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '解锁', 'unlock', 2, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_small_lock_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'unlock');
|
||||
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES胶料小料锁定条码类型', 'xslmes_rubber_small_lock_barcode_type', '小料/胶料', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_rubber_small_lock_barcode_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, '小料', 'small', 1, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_small_lock_barcode_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'small');
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '胶料', 'rubber', 2, 1, 'admin', NOW() FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_rubber_small_lock_barcode_type' AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = 'rubber');
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_rubber_small_lock_reason` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`reason_code` varchar(16) NOT NULL COMMENT '编号(租户内从001递增自动生成,只读)',
|
||||
`lock_type` varchar(16) NOT NULL COMMENT '类型(字典xslmes_rubber_small_lock_type:lock锁定unlock解锁)',
|
||||
`barcode_type` varchar(16) NOT NULL COMMENT '条码类型(字典xslmes_rubber_small_lock_barcode_type:small小料rubber胶料)',
|
||||
`reason_desc` varchar(500) NOT NULL COMMENT '原因(手动输入,必填)',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门',
|
||||
`create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mrslr_tenant_code` (`tenant_id`, `reason_code`),
|
||||
KEY `idx_mrslr_tenant_lock` (`tenant_id`, `lock_type`, `barcode_type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES胶料小料锁定原因';
|
||||
|
||||
SET @mes_tenant_id = 1002;
|
||||
|
||||
SET @mes_quality_pid = IFNULL(
|
||||
(SELECT `id` FROM `sys_permission` WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '质量管理' LIMIT 1),
|
||||
'1860000000000000162'
|
||||
);
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
VALUES ('1860000000000000208', @mes_quality_pid, '胶料小料锁定原因', '/xslmes/mesXslRubberSmallLockReason', 'xslmes/mesXslRubberSmallLockReason/MesXslRubberSmallLockReasonList', 'MesXslRubberSmallLockReasonList', 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`), `sort_no` = VALUES(`sort_no`), `is_route` = VALUES(`is_route`), `is_leaf` = 0, `hidden` = 0, `status` = '1', `del_flag` = 0, `keep_alive` = VALUES(`keep_alive`);
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:lock-outlined' WHERE `id` = '1860000000000000208' AND `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `is_leaf`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
|
||||
('1860000000000000209', '1860000000000000208', '新增', 2, 'mes:mes_xsl_rubber_small_lock_reason:add', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000210', '1860000000000000208', '编辑', 2, 'mes:mes_xsl_rubber_small_lock_reason:edit', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000211', '1860000000000000208', '删除', 2, 'mes:mes_xsl_rubber_small_lock_reason:delete', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000212', '1860000000000000208', '批量删除', 2, 'mes:mes_xsl_rubber_small_lock_reason:deleteBatch', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000213', '1860000000000000208', '导出', 2, 'mes:mes_xsl_rubber_small_lock_reason:exportXls', '1', 1, '1', 0, 'admin', NOW()),
|
||||
('1860000000000000214', '1860000000000000208', '导入', 2, 'mes:mes_xsl_rubber_small_lock_reason:importExcel', '1', 1, '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`),
|
||||
`is_leaf` = 1, `status` = '1', `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`tenant_id` = @mes_tenant_id
|
||||
AND r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'1860000000000000208',
|
||||
'1860000000000000209', '1860000000000000210', '1860000000000000211', '1860000000000000212',
|
||||
'1860000000000000213', '1860000000000000214'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
);
|
||||
@@ -22,6 +22,7 @@ import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.*;
|
||||
import java.sql.Date;
|
||||
import java.util.*;
|
||||
@@ -1046,7 +1047,7 @@ public class oConvertUtils {
|
||||
BigDecimal bigDecimal = new BigDecimal(uploadCount);
|
||||
//换算成MB
|
||||
BigDecimal divide = bigDecimal.divide(new BigDecimal(1048576));
|
||||
count = divide.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
count = divide.setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
return count;
|
||||
}
|
||||
return count;
|
||||
|
||||
@@ -211,6 +211,10 @@ public class ShiroConfig {
|
||||
filterChainDefinitionMap.put("/xslmes/mesXslWarehouse/anon/**", "anon");
|
||||
// MES库区管理免密接口(供桌面端调用)
|
||||
filterChainDefinitionMap.put("/xslmes/mesXslWarehouseArea/anon/**", "anon");
|
||||
// MES密炼物料皮重策略免密接口(供桌面端调用)
|
||||
filterChainDefinitionMap.put("/xslmes/mesXslMixerMaterialTareStrategy/anon/**", "anon");
|
||||
// MES单位只读免密接口(供桌面端单位下拉调用)
|
||||
filterChainDefinitionMap.put("/xslmes/mesXslUnit/anon/**", "anon");
|
||||
// MES密炼物料管理免密接口(供桌面端调用)
|
||||
filterChainDefinitionMap.put("/mes/material/mixerMaterial/anon/**", "anon");
|
||||
// 打印模板免密接口(供桌面端调用)
|
||||
|
||||
@@ -132,3 +132,634 @@ jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpecList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
|
||||
-- author:cursor---date:20260522--for: 【XSLMES-20260522-A33】新增混炼示方主表/明细字段交互优化 ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/components/MesXslMixerActionSelectModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixerCondition/components/MesXslMixerConditionSelectModal.vue
|
||||
|
||||
-- author:cursor---date:20260522--for: 【XSLMES-20260522-A34】混炼示方动作/组合改为下拉选择 ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
|
||||
-- author:cursor---date:20260522--for: 【XSLMES-20260522-A35】混炼示方动作/组合列常显下拉倒三角 ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingStepSelectCell.vue
|
||||
|
||||
-- author:cursor---date:20260522--for: 【XSLMES-20260522-A38】F段明细加入最后一段B炼好胶(如三段用B2)+Q列配合剂 ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
|
||||
-- author:cursor---date:20260522--for: 【XSLMES-20260522-A38】B2/Bn明细改为上一段胶料一条(B{n-1}+胶料名)+本段列配合剂 ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
|
||||
-- author:cursor---date:20260522--for: 【XSLMES-20260522-A38】修复B2与B1相同:按列增量拼接并支持列2+非Q配合剂 ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslFormulaMixingGenerateRowVO.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaGenerateMixingModal.vue
|
||||
|
||||
-- author:cursor---date:20260522--for: 【XSLMES-20260522-A38】生成混炼示方B段改为Bn=B(n-1)+第n列有值配合剂增量拼接 ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
|
||||
-- author:cursor---date:20260522--for: 【XSLMES-20260522-A38】生成混炼示方明细种类按分类字典is_rubber显示胶料或小类名 ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
|
||||
-- author:cursor---date:20260522--for: 【XSLMES-20260522-A38】生成混炼示方编号原样追加胶料代号中胶料名称后的后缀 ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
|
||||
-- author:cursor---date:20260522--for: 【XSLMES-20260522-A38】生成混炼示方明细按STEP过滤:B段仅A物料、F段仅Q物料 ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
|
||||
-- author:cursor---date:20260522--for: 【XSLMES-20260522-A38】配合示方生成混炼示方(预览段×机台批量创建) ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslFormulaMixingGenerate*.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslFormulaSpecService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslFormulaSpecController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpecList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaGenerateMixingModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipInspectConfig/components/MesXslEquipmentLedgerMultiSelectModal.vue
|
||||
|
||||
-- author:cursor---date:20260522--for: 【XSLMES-20260522-A36】混炼示方动作/组合下拉列表被表格裁切修复 ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingStepSelectCell.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A43】混炼示方换算系数联动橡胶及配合剂单重实时计算 ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A42】混炼示方橡胶及配合剂明细底部固定合计行 ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A41】混炼示方橡胶及配合剂明细累计按种类分组合计 ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixingSpecServiceImpl.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A44】配合示方生成混炼示方时按设备台账有效体积自动计算填充体积 ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipInspectConfig/components/MesXslEquipmentLedgerMultiSelectModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A45】混炼示方保存/批量生成子表改批量插入并延长前端超时 ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixingSpecServiceImpl.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.api.ts
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A46】混炼示方换算系数/单重/机台有效体积联动填充体积 ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipInspectConfig/components/MesXslEquipmentLedgerSelectModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A47】混炼示方保存分步骤性能诊断日志 ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixingSpecServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslMixingSpecController.java
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A48】生成混炼示方时同步B/F段胶至密炼物料(母炼胶/A胶、终炼胶/Q胶) ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A49】删除混炼示方时同步删除B/F段胶密炼物料 ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixingSpecServiceImpl.java
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A50】MES物料小类胶料标记/生成混炼示方种类映射/混炼示方选料弹窗 ---
|
||||
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysCategoryServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
jeecgboot-vue3/src/views/system/category/category.constants.ts
|
||||
jeecgboot-vue3/src/views/system/category/category.data.ts
|
||||
jeecgboot-vue3/src/views/system/category/components/CategoryModal.vue
|
||||
jeecgboot-vue3/src/views/mes/material/modules/MesMixerMaterialSysCategoryModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialCategorySetting.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A50】选料弹窗左侧小类树为空修复(对齐密炼物料列表树加载/异步展开/隐藏配置重置) ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A50】选料弹窗小类设置无明细/统一分类加载函数 -----------
|
||||
jeecgboot-vue3/src/views/system/category/category.constants.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialCategorySetting.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A50】选料弹窗分类加载改为getChildListBatch两级查询 -----------
|
||||
jeecgboot-vue3/src/views/system/category/category.constants.ts
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A50】选料弹窗openModal未传data导致初始化未执行 -----------
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A50】选料弹窗移出父Modal+useModalInner初始化 -----------
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A50】小类展示分组勾选互不覆盖 -----------
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialCategorySetting.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A50】选料弹窗隐藏ERP列并新增自动/人工称量列 -----------
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A51】密炼物料种类配置表及列表批量新增 -----------
|
||||
jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_102__mes_xsl_mixer_material_kind_cfg.sql
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslMixerMaterialKindCfg.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslMixerMaterialKindCfgMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixerMaterialKindCfgService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixerMaterialKindCfgServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslMixerMaterialKindCfgController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialKindCfg/MesXslMixerMaterialKindCfgList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialKindCfg/MesXslMixerMaterialKindCfg.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialKindCfg/MesXslMixerMaterialKindCfg.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialKindCfg/components/MesXslMixerMaterialKindCfgBatchModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialKindCfg/components/MesXslMixerMaterialKindCfgEditModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A51】密炼物料种类配置菜单ID冲突修复 -----------
|
||||
jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_102__mes_xsl_mixer_material_kind_cfg.sql
|
||||
jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_103__mes_xsl_mixer_material_kind_cfg_menu_fix.sql
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A52】混炼示方种类改读密炼物料种类配置(生成/选料弹窗) -----------
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslMixerMaterialKindLookupVO.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixerMaterialKindCfgService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixerMaterialKindCfgServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslMixerMaterialKindCfgController.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialKindCfg/MesXslMixerMaterialKindCfg.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A52】选料弹窗层级修复及关闭父弹窗时同步关闭 -----------
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A52】选料弹窗左侧物料小类树会话缓存 -----------
|
||||
jeecgboot-vue3/src/views/system/category/category.constants.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A52】选料弹窗小类设置按钮 Popover 层级修复 -----------
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialCategorySetting.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A52】选料弹窗小类设置新增刷新分类字典 -----------
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialCategorySetting.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A52】高层级弹窗内 Message 提示层级修复 -----------
|
||||
jeecgboot-vue3/src/design/public.less
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A53】种类解析移除小类名兜底/通用选料弹窗接配置/配置变更清缓存 -----------
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixerMaterialKindCfgService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixerMaterialKindCfgServiceImpl.java
|
||||
jeecgboot-vue3/src/views/mes/material/modules/MesMixerMaterialSelectModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialKindCfg/MesXslMixerMaterialKindCfgList.vue
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A54】母炼胶明细行绑定已同步密炼物料主数据及种类配置解析 -----------
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A55】混炼示方明细新增密炼物料ID字段 -----------
|
||||
jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_104__mes_xsl_mixing_spec_material_mixer_material_id.sql
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslMixingSpecMaterial.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixingSpecServiceImpl.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A56】混炼示方批量删除性能优化(子表批量删+去重同步删密炼物料) -----------
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixingSpecServiceImpl.java
|
||||
|
||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A57】混合步骤动作/组合下拉最多展示20条 -----------
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingStepSelectCell.vue
|
||||
|
||||
-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验类型:质量管理目录、001自动编号、CRUD与菜单权限 ---
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_97__mes_xsl_rubber_quick_test_type.sql
|
||||
jeecg-boot/db/mes-xsl-rubber-quick-test-type-menu-permission.sql
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestType.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestTypeMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestTypeService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestTypeServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestTypeController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestTypeList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/components/MesXslRubberQuickTestTypeModal.vue
|
||||
|
||||
-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验方法:质量管理菜单、001编号、名称唯一、关联实验类型 ---
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_99__mes_xsl_rubber_quick_test_method.sql
|
||||
jeecg-boot/db/mes-xsl-rubber-quick-test-method-menu-permission.sql
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestMethod.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestMethodMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestMethodService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestMethodServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestMethodController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethodList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestMethodModal.vue
|
||||
|
||||
-- author:jiangxh---date:20260522--for: 【MES】撤销胶料快检实验方法功能(删代码+库清理脚本)---
|
||||
jeecg-boot/db/mes-xsl-rubber-quick-test-method-drop.sql
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_100__drop_mes_xsl_rubber_quick_test_method.sql
|
||||
|
||||
-- author:jiangxh---date:20260522--for: 【MES】胶料快检数据点:质量管理菜单、名称唯一、关联实验类型、单位手填 ---
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_101__mes_xsl_rubber_quick_test_data_point.sql
|
||||
jeecg-boot/db/mes-xsl-rubber-quick-test-data-point-menu-permission.sql
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestDataPoint.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestDataPointMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestDataPointService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestDataPointServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestDataPointController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPointList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPoint.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/MesXslRubberQuickTestDataPoint.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestDataPoint/components/MesXslRubberQuickTestDataPointModal.vue
|
||||
|
||||
-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验类型名称同租户不可重复(Service兜底+唯一索引)---
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_98__mes_xsl_rubber_quick_test_type_name_unique.sql
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestTypeServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestTypeController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestType/MesXslRubberQuickTestType.data.ts
|
||||
|
||||
-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验方法主子表:质量管理菜单177段、001编号、名称唯一、选择数据点明细 ---
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_102__mes_xsl_rubber_quick_test_method.sql
|
||||
jeecg-boot/db/mes-xsl-rubber-quick-test-method-menu-permission.sql
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestMethod.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestMethodLine.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslRubberQuickTestMethodPage.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestMethodMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestMethodLineMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestMethodService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestMethodServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestMethodController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethodList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestMethodModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestDataPointSelectModal.vue
|
||||
|
||||
-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验方法明细字典单位必选、不可清空 ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestMethodModal.vue
|
||||
|
||||
-- author:jiangxh---date:20260522--for: 【MES】胶料快检实验方法明细单位字典默认取首项(非空选)---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTestMethod.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestMethodModal.vue
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestMethodController.java
|
||||
jeecgboot-vue3/src/components/jeecg/JVxeTable/src/components/cells/JVxeSelectCell.vue
|
||||
|
||||
-- author:cursor---date:20260526--for: 【XSLMES-20260526-A61】混炼示方密炼PS校对/审核/批准联动同步审批人 -----------
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixingSpecService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixingSpecServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixerPsCompileServiceImpl.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpecList.vue
|
||||
|
||||
-- author:cursor---date:20260526--for: 【配方日志查询】配合示方/混炼示方修改日志记录与查询接口 -----------
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_107__mes_xsl_formula_spec_edit_log.sql
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslFormulaSpecEditLog.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslFormulaSpecEditChangeItemVO.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslFormulaSpecEditLogDetailVO.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslFormulaSpecEditLogMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/common/MesXslFormulaSpecEditLogDiffUtil.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslFormulaSpecEditLogService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecEditLogServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslFormulaSpecEditLogController.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixingSpecServiceImpl.java
|
||||
|
||||
-- author:cursor---date:20260526--for: 【配方日志查询】前端列表页与修改对比弹窗 -----------
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpecEditLog/MesXslFormulaSpecEditLog.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpecEditLog/MesXslFormulaSpecEditLog.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpecEditLog/MesXslFormulaSpecEditLogList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpecEditLog/components/MesXslFormulaSpecEditLogCompareModal.vue
|
||||
|
||||
-- author:cursor---date:20260526--for: 【配方日志查询】明细对比展示逐行逐字段变更内容 -----------
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/common/MesXslFormulaSpecEditLogDiffUtil.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpecEditLog/MesXslFormulaSpecEditLog.data.ts
|
||||
|
||||
-- author:jiangxh---date:20260525--for: 【MES】胶料快检记录主子表、质量管理菜单、胶料信息批量检验生成 ---
|
||||
jeecg-boot/db/mes-xsl-rubber-quick-test-record-menu-permission.sql
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_108__mes_xsl_rubber_quick_test_record.sql
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestRecord.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestRecordLine.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslRubberQuickTestRecordPage.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslRubberQuickTestRecordBatchFromMaterialVO.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestRecordMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberQuickTestRecordLineMapper.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestRecordService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestRecordServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestRecordController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestRecord/MesXslRubberQuickTestRecordList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestRecord/MesXslRubberQuickTestRecord.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestRecord/MesXslRubberQuickTestRecord.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestRecord/components/MesXslRubberQuickTestRecordModal.vue
|
||||
jeecgboot-vue3/src/views/mes/material/MesMaterialList.vue
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_109__mes_xsl_rubber_quick_test_record_no.sql
|
||||
|
||||
-- author:jiangxh---date:20260528--for: 【MES】胶料快检记录单号、无弹窗直接生成、列表去掉新增、明细不可增删 ---
|
||||
jeecg-boot/db/mes-xsl-rubber-quick-test-record-menu-permission.sql
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberQuickTestRecord.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberQuickTestRecordService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestRecordServiceImpl.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestRecord/MesXslRubberQuickTestRecordList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestRecord/MesXslRubberQuickTestRecord.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestRecord/components/MesXslRubberQuickTestRecordModal.vue
|
||||
jeecgboot-vue3/src/views/mes/material/MesMaterialList.vue
|
||||
|
||||
-- author:GHT---date:20260529--for: 【QH-MES审批流设计】我的租户下新增审批流设计,钉钉式可视化拖拽设计(先选单据再设计流程),本期实现设计器 ---
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_111__mes_xsl_approval_flow.sql
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/entity/MesXslApprovalFlow.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/mapper/MesXslApprovalFlowMapper.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/service/IMesXslApprovalFlowService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/service/impl/MesXslApprovalFlowServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/controller/MesXslApprovalFlowController.java
|
||||
jeecgboot-vue3/src/views/approval/flow/approvalFlow.api.ts
|
||||
jeecgboot-vue3/src/views/approval/flow/approvalFlow.data.ts
|
||||
jeecgboot-vue3/src/views/approval/flow/ApprovalFlowList.vue
|
||||
jeecgboot-vue3/src/views/approval/flow/ApprovalFlowModal.vue
|
||||
jeecgboot-vue3/src/views/approval/flow/components/flowTypes.ts
|
||||
jeecgboot-vue3/src/views/approval/flow/components/FlowNode.vue
|
||||
jeecgboot-vue3/src/views/approval/flow/components/NodeConfigDrawer.vue
|
||||
jeecgboot-vue3/src/views/approval/flow/components/FlowDesign.vue
|
||||
jeecgboot-vue3/src/views/approval/flow/components/flow.less
|
||||
|
||||
-- author:GHT---date:20260529--for: 【QH-MES审批流设计】发起审批运行时:全局悬浮按钮(选单据类型->选单据->发起),本期仅发起(生成审批实例+解析首节点处理人),不办理/不回写业务表 ---
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_112__mes_xsl_approval_instance.sql
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/entity/MesXslApprovalFlow.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/entity/MesXslApprovalInstance.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/mapper/MesXslApprovalInstanceMapper.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/service/IMesXslApprovalInstanceService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/service/impl/MesXslApprovalInstanceServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/controller/MesXslApprovalLaunchController.java
|
||||
jeecgboot-vue3/src/views/approval/flow/approvalFlow.data.ts
|
||||
jeecgboot-vue3/src/views/approval/flow/launch.api.ts
|
||||
jeecgboot-vue3/src/components/ApprovalLaunch/index.vue
|
||||
jeecgboot-vue3/src/layouts/default/index.vue
|
||||
|
||||
-- author:GHT---date:20260529--for: 【QH-MES审批流设计】发起审批悬浮按钮仅在配置了审批流的功能页显示:审批流定义增加route_path(功能页路由),前端按当前路由匹配后才显示按钮 ---
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_113__mes_xsl_approval_flow_route.sql
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/entity/MesXslApprovalFlow.java
|
||||
jeecgboot-vue3/src/views/approval/flow/approvalFlow.data.ts
|
||||
jeecgboot-vue3/src/components/ApprovalLaunch/index.vue
|
||||
|
||||
-- author:GHT---date:20260529--for: 【QH-MES审批流设计】取消手填功能页路由:publishedList按单据表名自动反查sys_permission菜单url填入routePath,设计表单去掉路由字段 ---
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/controller/MesXslApprovalLaunchController.java
|
||||
jeecgboot-vue3/src/views/approval/flow/approvalFlow.data.ts
|
||||
|
||||
-- author:GHT---date:20260529--for: 【QH-MES审批流设计】发起审批支持列表多选联动:useListPage自动同步选中行到全局上下文,悬浮按钮发起弹窗自动带入选中单据并批量发起 ---
|
||||
jeecgboot-vue3/src/components/ApprovalLaunch/useApprovalSelection.ts
|
||||
jeecgboot-vue3/src/hooks/system/useListPage.ts
|
||||
jeecgboot-vue3/src/components/ApprovalLaunch/index.vue
|
||||
jeecgboot-vue3/src/views/approval/flow/launch.api.ts
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/controller/MesXslApprovalLaunchController.java
|
||||
|
||||
-- author:GHT---date:20260529--for: 【QH-MES审批流设计】发起审批与IM聊天结合:IM新增系统单聊消息(绕过同部门校验),发起后把审批消息发给当前节点处理人 ---
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/im/service/ISysImChatService.java
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/im/service/impl/SysImChatServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/controller/MesXslApprovalLaunchController.java
|
||||
|
||||
-- author:GHT---date:20260529--for: 【QH-MES审批流设计】审批IM消息升级为可跳转业务卡片(biz_record):点击可定位到对应单据,无法定位功能页时退回纯文本 ---
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/approval/controller/MesXslApprovalLaunchController.java
|
||||
|
||||
-- author:cursor---date:20250602--for: 【密炼物料皮重策略】桌面端同步 ---
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/MesXslStompNotifyService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslDesktopAnonController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslMixerMaterialTareStrategyController.java
|
||||
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
|
||||
|
||||
-- author:cursor---date:20250602--for: 【密炼物料皮重策略】新增物料规格/托盘重量,皮重改名为包装物重量 ---
|
||||
jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_118__mes_xsl_mixer_material_tare_strategy_fields.sql
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslMixerMaterialTareStrategy.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixerMaterialTareStrategyServiceImpl.java
|
||||
yy-admin-master/YY.Admin.Core/Entity/MesXslMixerMaterialTareStrategy.cs
|
||||
yy-admin-master/YY.Admin.Services/Service/MixerMaterialTareStrategy/MixerMaterialTareStrategyService.cs
|
||||
yy-admin-master/YY.Admin/Views/MixerMaterialTareStrategy/MixerMaterialTareStrategyListView.xaml
|
||||
yy-admin-master/YY.Admin/Views/MixerMaterialTareStrategy/MixerMaterialTareStrategyEditDialogView.xaml
|
||||
yy-admin-master/YY.Admin/ViewModels/MixerMaterialTareStrategy/MixerMaterialTareStrategyEditDialogViewModel.cs
|
||||
yy-admin-master/YY.Admin/ViewModels/MixerMaterialTareStrategy/MixerMaterialTareStrategyListViewModel.cs
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialTareStrategy/MesXslMixerMaterialTareStrategy.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialTareStrategy/components/MesXslMixerMaterialTareStrategyModal.vue
|
||||
|
||||
-- author:cursor---date:20250602--for: 【原料入场/原材料卡片】皮重字段落库 ---
|
||||
jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_119__mes_xsl_raw_material_entry_tare_fields.sql
|
||||
jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_120__mes_xsl_raw_material_card_tare_fields.sql
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRawMaterialEntry.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRawMaterialCard.java
|
||||
yy-admin-master/YY.Admin.Core/Entity/MesXslRawMaterialEntry.cs
|
||||
yy-admin-master/YY.Admin.Core/Entity/MesXslRawMaterialCard.cs
|
||||
yy-admin-master/YY.Admin.Services/Service/RawMaterialEntry/RawMaterialEntryService.cs
|
||||
yy-admin-master/YY.Admin.Services/Service/RawMaterialCard/RawMaterialCardService.cs
|
||||
yy-admin-master/YY.Admin/ViewModels/RawMaterialEntry/RawMaterialEntryEditDialogViewModel.cs
|
||||
yy-admin-master/YY.Admin/ViewModels/RawMaterialEntry/RawMaterialEntryOperationViewModel.cs
|
||||
yy-admin-master/YY.Admin/ViewModels/RawMaterialCard/RawMaterialCardEditDialogViewModel.cs
|
||||
|
||||
-- author:cursor---date:20250602--for: 【原料入场/原材料卡片】列表展示皮重相关字段 ---
|
||||
yy-admin-master/YY.Admin/Views/RawMaterialEntry/RawMaterialEntryListView.xaml
|
||||
yy-admin-master/YY.Admin/Views/RawMaterialCard/RawMaterialCardListView.xaml
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRawMaterialEntry/MesXslRawMaterialEntry.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRawMaterialCard/MesXslRawMaterialCard.data.ts
|
||||
|
||||
-- author:cursor---date:20250602--for: 【原料入场/原材料卡片】后端列表与详情展示皮重字段 ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRawMaterialWorkshopRemain.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRawMaterialEntry/MesXslRawMaterialEntry.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRawMaterialCard/MesXslRawMaterialCard.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRawMaterialWorkshopRemain/MesXslRawMaterialWorkshopRemain.data.ts
|
||||
|
||||
-- author:cursor---date:20250602--for: 【磅单记录】列表展示货物皮重(关联入场记录托盘及皮重合计,不落库) ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslWeightRecord.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRawMaterialEntryService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRawMaterialEntryServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslWeightRecordController.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslDesktopAnonController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslWeightRecord/MesXslWeightRecord.data.ts
|
||||
yy-admin-master/YY.Admin.Core/Entity/MesXslWeightRecord.cs
|
||||
yy-admin-master/YY.Admin.Core/Util/CargoTareWeightCalculator.cs
|
||||
yy-admin-master/YY.Admin.Services/Service/WeightRecord/WeightRecordService.cs
|
||||
yy-admin-master/YY.Admin/Views/WeightRecord/WeightRecordListView.xaml
|
||||
yy-admin-master/YY.Admin/Views/RawMaterialEntry/WeightRecordPickerDialogView.xaml
|
||||
|
||||
-- author:cursor---date:20250602--for: 【磅单记录】列表展示原料重量(净重-货物皮重,不落库) ---
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslWeightRecord.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRawMaterialEntryServiceImpl.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslWeightRecord/MesXslWeightRecord.data.ts
|
||||
yy-admin-master/YY.Admin.Core/Entity/MesXslWeightRecord.cs
|
||||
yy-admin-master/YY.Admin.Services/Service/WeightRecord/WeightRecordService.cs
|
||||
yy-admin-master/YY.Admin/Views/WeightRecord/WeightRecordListView.xaml
|
||||
|
||||
-- author:jiangxh---date:20250602--for: 【MES】停机记录:建表+菜单+CRUD+列表录入维修结果弹窗 ---
|
||||
jeecg-boot/db/mes-xsl-downtime-record-menu-permission.sql
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_117__mes_xsl_downtime_record.sql
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslDowntimeRecord.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslDowntimeRecordMaintenanceDTO.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslDowntimeRecordMapper.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslDowntimeRecordService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslDowntimeRecordServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslDowntimeRecordController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslInspectMaintainItemController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeRecord/MesXslDowntimeRecord.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeRecord/MesXslDowntimeRecord.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeRecord/MesXslDowntimeRecordList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeRecord/components/MesXslDowntimeRecordModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeRecord/components/MesXslDowntimeRecordMaintenanceModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeRecord/components/MesXslDowntimeTypeSelectModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeRecord/components/MesXslInspectMaintainItemSelectModal.vue
|
||||
|
||||
-- author:jiangxh---date:20250602--for: 【MES】停机记录弹窗日期时间选择器下拉被裁剪导致点击无反应 ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeRecord/MesXslDowntimeRecord.data.ts
|
||||
|
||||
-- author:jiangxh---date:20250602--for: 【MES】停机记录维修项目按设备部位筛选(点检保养项目均含小部位) ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeRecord/components/MesXslInspectMaintainItemSelectModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeRecord/components/MesXslDowntimeRecordMaintenanceModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeRecord/MesXslDowntimeRecord.data.ts
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslDowntimeRecordServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslInspectMaintainItemController.java
|
||||
|
||||
-- author:jiangxh---date:20250602--for: 【MES】设备台账列表所属工序查询改为工序选择器 ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/MesXslEquipmentLedger.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/MesXslEquipmentLedgerList.vue
|
||||
|
||||
-- author:jiangxh---date:20250602--for: 【MES】设备管理各功能列表查询与表单一致改为选择器 ---
|
||||
jeecgboot-vue3/src/views/xslmes/components/MesSearchPickerInput.vue
|
||||
jeecgboot-vue3/src/views/xslmes/utils/mesSearchPickerUtil.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentCategory/MesXslEquipmentCategory.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentCategory/MesXslEquipmentCategoryList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentType/MesXslEquipmentType.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentType/MesXslEquipmentTypeList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentPart/MesXslEquipmentPart.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentPart/MesXslEquipmentPartList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentSubPart/MesXslEquipmentSubPart.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentSubPart/MesXslEquipmentSubPartList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/MesXslEquipmentLedger.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/MesXslEquipmentLedgerList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslSparePart/MesXslSparePart.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslSparePart/MesXslSparePartList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeMainType/MesXslDowntimeMainType.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeMainType/MesXslDowntimeMainTypeList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeType/MesXslDowntimeType.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeType/MesXslDowntimeTypeList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItem.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslInspectMaintainItem/MesXslInspectMaintainItemList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipInspectConfig/MesXslEquipInspectConfig.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipInspectConfig/MesXslEquipInspectConfigList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipInspectRecord/MesXslEquipInspectRecord.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipInspectRecord/MesXslEquipInspectRecordList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeRecord/MesXslDowntimeRecord.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslDowntimeRecord/MesXslDowntimeRecordList.vue
|
||||
|
||||
-- author:jiangxh---date:20250602--for: 【MES】胶料小料锁定原因(质量管理菜单、编号001自增、类型与条码类型字典) ---
|
||||
jeecg-boot/db/mes-xsl-rubber-small-lock-reason-menu-permission.sql
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_118__mes_xsl_rubber_small_lock_reason.sql
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberSmallLockReason.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberSmallLockReasonMapper.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberSmallLockReasonService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberSmallLockReasonServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberSmallLockReasonController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberSmallLockReason/MesXslRubberSmallLockReason.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberSmallLockReason/MesXslRubberSmallLockReason.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberSmallLockReason/MesXslRubberSmallLockReasonList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberSmallLockReason/components/MesXslRubberSmallLockReasonModal.vue
|
||||
|
||||
-- author:jiangxh---date:20250602--for: 【MES】锁定原因增加原因字段、新增胶料小料锁定日志 ---
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_119__mes_xsl_rubber_small_lock_reason_desc_and_log.sql
|
||||
jeecg-boot/db/mes-xsl-rubber-small-lock-log-menu-permission.sql
|
||||
jeecg-boot/db/mes-xsl-rubber-small-lock-reason-menu-permission.sql
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberSmallLockReason.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberSmallLockReasonServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberSmallLockReasonController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslRubberSmallLockLog.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslRubberSmallLockLogMapper.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRubberSmallLockLogService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberSmallLockLogServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberSmallLockLogController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberSmallLockReason/MesXslRubberSmallLockReason.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberSmallLockReason/MesXslRubberSmallLockReason.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberSmallLockLog/MesXslRubberSmallLockLog.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberSmallLockLog/MesXslRubberSmallLockLog.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberSmallLockLog/MesXslRubberSmallLockLogList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRubberSmallLockLog/components/MesXslRubberSmallLockLogModal.vue
|
||||
|
||||
-- author:jiangxh---date:20250602--for: 【MES】设备台账原设备编号改为自定义编号、新增001自增只读系统编号 ---
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_122__mes_xsl_equipment_ledger_ledger_no.sql
|
||||
jeecg-boot/db/mes-xsl-equipment-ledger.sql
|
||||
jeecg-boot/db/mes-xsl-equipment-ledger-menu-permission.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
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/MesXslEquipmentLedger.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/MesXslEquipmentLedger.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/components/MesXslEquipmentLedgerModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipInspectConfig/components/MesXslEquipmentLedgerSelectModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipInspectConfig/components/MesXslEquipmentLedgerMultiSelectModal.vue
|
||||
|
||||
-- author:jiangxh---date:20250602--for: 【MES】设备台账设备类别、设备类型必填 ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/MesXslEquipmentLedger.data.ts
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipmentLedgerController.java
|
||||
|
||||
-- author:jiangxh---date:20250602--for: 【MES】设备台账 ledgerNo 显示名改为设备编号 ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/MesXslEquipmentLedger.data.ts
|
||||
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/controller/MesXslEquipmentLedgerController.java
|
||||
|
||||
-- author:jiangxh---date:20250602--for: 【MES】设备台账 ledgerNo 显示名改为系统编号、equipmentCode 改为设备编号 ---
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipmentLedger/MesXslEquipmentLedger.data.ts
|
||||
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/controller/MesXslEquipmentLedgerController.java
|
||||
|
||||
-- author:jiangxh---date:20250603--for: 【MES】设备对应部位:点检配置保存后按大部位+小部位去重生成,列表只读无新增 ---
|
||||
jeecg-boot/db/mes-xsl-equip-part-mapping-menu-permission.sql
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_123__mes_xsl_equip_part_mapping.sql
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslEquipPartMapping.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslEquipPartMappingMapper.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslEquipPartMappingService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslEquipPartMappingServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipPartMappingController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslEquipInspectConfigServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/package-info.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipPartMapping/MesXslEquipPartMappingList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipPartMapping/MesXslEquipPartMapping.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipPartMapping/MesXslEquipPartMapping.api.ts
|
||||
|
||||
-- author:jiangxh---date:20250603--for: 【MES】设备/质量管理主数据删除前引用校验(统一点检配置等下游阻断) ---
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslDeleteReferenceService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslDeleteReferenceServiceImpl.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/controller/MesXslEquipmentCategoryController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipmentTypeController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipmentPartController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipmentSubPartController.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/controller/MesXslManufacturerController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslSparePartsCategoryController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslDowntimeMainTypeController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslDowntimeTypeController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipInspectConfigController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestTypeController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestDataPointController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestMethodController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestStdController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberSmallLockReasonController.java
|
||||
|
||||
-- author:jiangxh---date:20250604--for: 【MES】设备报警记录与设备停机记录(SQL Server MCSToMES_MixAlarm 只读、列表回写 ReadTime/MES_Flag) ---
|
||||
jeecg-boot/db/mes-xsl-equip-mcs-alarm-downtime-menu-permission.sql
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_124__mes_xsl_equip_mcs_alarm_downtime_menu.sql
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/vo/MesXslEquipAlarmRecordVO.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/vo/MesXslEquipDowntimeRecordVO.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/util/MesXslMcsMixAlarmConvertUtil.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/service/IMesXslEquipAlarmRecordService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/service/IMesXslEquipDowntimeRecordService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/service/impl/MesXslMcsMixAlarmReadMarker.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/service/impl/MesXslEquipAlarmRecordServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/service/impl/MesXslEquipDowntimeRecordServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipAlarmRecordController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipDowntimeRecordController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipAlarmRecord/MesXslEquipAlarmRecord.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipAlarmRecord/MesXslEquipAlarmRecord.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipAlarmRecord/MesXslEquipAlarmRecordList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipAlarmRecord/components/MesXslEquipAlarmRecordModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipDowntimeRecord/MesXslEquipDowntimeRecord.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipDowntimeRecord/MesXslEquipDowntimeRecord.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipDowntimeRecord/MesXslEquipDowntimeRecordList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipDowntimeRecord/components/MesXslEquipDowntimeRecordModal.vue
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot3</groupId>
|
||||
<artifactId>jeecg-boot-base-core</artifactId>
|
||||
<version>${jeecgboot.version}</version>
|
||||
</dependency>
|
||||
<!-- 复用打印模板模块:打印机枚举、业务绑定、PDF 提交队列 -->
|
||||
<dependency>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.jeecg.modules.xslmes.approval.action;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 审批联动业务动作标注。
|
||||
*
|
||||
* <p>把本注解打在业务 Controller 的处理方法上,即声明「该按钮/接口可被审批流程作为回调动作选择」。
|
||||
* 系统启动时会反射扫描所有带本注解的接口方法,取其 {@code @RequestMapping} 真实路径与 HTTP 方法,
|
||||
* 按 {@link #table()} 归类,供审批流设计器的节点「回调接口」下拉选择。</p>
|
||||
*
|
||||
* <p>因为基于 Spring 运行时反射 + 真实映射路径,生产环境天然可用,URL 绝对准确,无需任何源码解析。</p>
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】审批联动业务动作注解
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface ApprovalBizAction {
|
||||
|
||||
/** 动作展示名(如「批准」「反审核」「启用」),供设计器下拉显示 */
|
||||
String name();
|
||||
|
||||
/** 所属业务表名(如 mes_xsl_rubber_quick_test_std),与审批流绑定的 bizTable 对应 */
|
||||
String table();
|
||||
|
||||
/**
|
||||
* 适用触发时机,可多选;为空表示三种时机均可选用。
|
||||
* 取值:onNodeApprove(本节点通过) / onApprove(最终通过) / onReject(驳回)
|
||||
*/
|
||||
String[] phase() default {};
|
||||
|
||||
/** 排序,越小越靠前 */
|
||||
int order() default 0;
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
package org.jeecg.modules.xslmes.approval.action;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.mvc.condition.RequestMethodsRequestCondition;
|
||||
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* 审批联动业务动作注册表。
|
||||
*
|
||||
* <p>容器启动完成后,反射扫描所有带 {@link ApprovalBizAction} 的接口方法,
|
||||
* 取真实映射路径 + HTTP 方法,按业务表归类缓存,供设计器查询选择。</p>
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】审批联动业务动作注册表
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ApprovalBizActionRegistry {
|
||||
|
||||
@Resource
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
/** 业务表 -> 动作列表 */
|
||||
private final Map<String, List<ApprovalBizActionVo>> byTable = new ConcurrentHashMap<>();
|
||||
|
||||
@EventListener(ContextRefreshedEvent.class)
|
||||
public void onContextRefreshed() {
|
||||
try {
|
||||
scan();
|
||||
} catch (Exception e) {
|
||||
log.warn("[审批联动] 扫描 @ApprovalBizAction 失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void scan() {
|
||||
byTable.clear();
|
||||
RequestMappingHandlerMapping mapping;
|
||||
try {
|
||||
mapping = applicationContext.getBean(RequestMappingHandlerMapping.class);
|
||||
} catch (Exception e) {
|
||||
log.warn("[审批联动] 未取到 RequestMappingHandlerMapping,跳过扫描", e);
|
||||
return;
|
||||
}
|
||||
Map<RequestMappingInfo, HandlerMethod> handlerMethods = mapping.getHandlerMethods();
|
||||
for (Map.Entry<RequestMappingInfo, HandlerMethod> entry : handlerMethods.entrySet()) {
|
||||
HandlerMethod hm = entry.getValue();
|
||||
ApprovalBizAction ann = hm.getMethodAnnotation(ApprovalBizAction.class);
|
||||
if (ann == null || ann.table() == null || ann.table().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
RequestMappingInfo info = entry.getKey();
|
||||
String url = resolveUrl(info);
|
||||
if (url == null || url.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
ApprovalBizActionVo vo = new ApprovalBizActionVo();
|
||||
vo.setName(ann.name());
|
||||
vo.setTable(ann.table());
|
||||
vo.setPhase(ann.phase());
|
||||
vo.setOrder(ann.order());
|
||||
vo.setUrl(url);
|
||||
vo.setMethod(resolveMethod(info));
|
||||
vo.setPerms(resolvePerms(hm));
|
||||
byTable.computeIfAbsent(ann.table(), k -> new ArrayList<>()).add(vo);
|
||||
}
|
||||
// 排序
|
||||
for (List<ApprovalBizActionVo> list : byTable.values()) {
|
||||
list.sort(Comparator.comparingInt(ApprovalBizActionVo::getOrder));
|
||||
}
|
||||
int total = byTable.values().stream().mapToInt(List::size).sum();
|
||||
log.info("[审批联动] 已注册业务动作 {} 个,覆盖 {} 张业务表", total, byTable.size());
|
||||
}
|
||||
|
||||
/** 取第一个映射路径(不含 context-path) */
|
||||
private String resolveUrl(RequestMappingInfo info) {
|
||||
Set<String> patterns = info.getPatternValues();
|
||||
if (patterns == null || patterns.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return patterns.iterator().next();
|
||||
}
|
||||
|
||||
/** 取 HTTP 方法,默认 POST */
|
||||
private String resolveMethod(RequestMappingInfo info) {
|
||||
RequestMethodsRequestCondition cond = info.getMethodsCondition();
|
||||
if (cond == null || cond.getMethods().isEmpty()) {
|
||||
return "POST";
|
||||
}
|
||||
return cond.getMethods().iterator().next().name();
|
||||
}
|
||||
|
||||
/** 取接口权限标识(@RequiresPermissions) */
|
||||
private String resolvePerms(HandlerMethod hm) {
|
||||
RequiresPermissions rp = hm.getMethodAnnotation(RequiresPermissions.class);
|
||||
if (rp != null && rp.value().length > 0) {
|
||||
return rp.value()[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** 按业务表取可选动作 */
|
||||
public List<ApprovalBizActionVo> getByTable(String table) {
|
||||
if (table == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<ApprovalBizActionVo> list = byTable.get(table);
|
||||
return list == null ? Collections.emptyList() : new ArrayList<>(list);
|
||||
}
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】驳回统一回退:按表+时机自动取业务动作-----------
|
||||
/**
|
||||
* 按业务表 + 时机取动作(如驳回统一执行 onReject 动作,无需在每个流程节点手动配置)。
|
||||
*/
|
||||
public List<ApprovalBizActionVo> getByTableAndPhase(String table, String phase) {
|
||||
if (table == null || phase == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<ApprovalBizActionVo> list = byTable.get(table);
|
||||
if (list == null || list.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<ApprovalBizActionVo> result = new ArrayList<>();
|
||||
for (ApprovalBizActionVo vo : list) {
|
||||
String[] phases = vo.getPhase();
|
||||
if (phases == null) {
|
||||
continue;
|
||||
}
|
||||
for (String p : phases) {
|
||||
if (phase.equals(p)) {
|
||||
result.add(vo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】驳回统一回退:按表+时机自动取业务动作-----------
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.jeecg.modules.xslmes.approval.action;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 审批联动业务动作(供设计器节点「回调接口」下拉选择)。
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】审批联动业务动作VO
|
||||
*/
|
||||
@Data
|
||||
public class ApprovalBizActionVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 动作名(如「批准」) */
|
||||
private String name;
|
||||
|
||||
/** 接口真实路径(取自 @RequestMapping,不含 context-path),如 /xslmes/xxx/updateStatus */
|
||||
private String url;
|
||||
|
||||
/** HTTP 方法:GET/POST/PUT/DELETE */
|
||||
private String method;
|
||||
|
||||
/** 所属业务表 */
|
||||
private String table;
|
||||
|
||||
/** 适用时机:onNodeApprove/onApprove/onReject,空表示均可 */
|
||||
private String[] phase;
|
||||
|
||||
/** 接口权限标识(取自 @RequiresPermissions,可空) */
|
||||
private String perms;
|
||||
|
||||
/** 排序 */
|
||||
private int order;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.jeecg.modules.xslmes.approval.callback;
|
||||
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
/**
|
||||
* 审批动作领域事件。
|
||||
* 与 {@link IApprovalBizCallback} 等价的另一种接入方式:
|
||||
* 偏好松耦合的业务可使用 {@code @EventListener} 监听本事件(同步、同事务)。
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】审批与业务单据联动回调
|
||||
*/
|
||||
public class ApprovalActionEvent extends ApplicationEvent {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final ApprovalCallbackContext context;
|
||||
|
||||
public ApprovalActionEvent(Object source, ApprovalCallbackContext context) {
|
||||
super(source);
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public ApprovalCallbackContext getContext() {
|
||||
return context;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
package org.jeecg.modules.xslmes.approval.callback;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.approval.entity.MesXslApprovalInstance;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 审批节点「回调接口」HTTP 执行器。
|
||||
*
|
||||
* 审批到对应时机时,读取节点配置中录制好的业务接口(url+method),
|
||||
* 以「当前审批处理人」的登录态(透传当前请求的 X-Access-Token)内部调用该接口,
|
||||
* 自动带上单据ID(覆盖 id 参数),从而真实执行业务页面按钮背后的逻辑。
|
||||
*
|
||||
* 限制:自动流转 / 无人值守节点(无登录态请求上下文)时降级跳过并记录日志。
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】节点回调接口内部调用执行
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ApprovalActionHttpExecutor {
|
||||
|
||||
@Value("${server.port:8080}")
|
||||
private int serverPort;
|
||||
|
||||
@Value("${server.servlet.context-path:}")
|
||||
private String contextPath;
|
||||
|
||||
private final RestTemplate restTemplate = new RestTemplate();
|
||||
|
||||
/**
|
||||
* 执行某节点在指定时机配置的所有回调接口。
|
||||
*
|
||||
* @param node 流程节点 JSON(含 props.callbackActions)
|
||||
* @param phase 时机:onNodeApprove / onApprove / onReject
|
||||
* @param inst 审批实例
|
||||
*/
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】判断节点某阶段是否配置了业务回调-----------
|
||||
/**
|
||||
* 判断节点在指定时机是否配置了回调接口(用于决定是否由业务回调全权负责回退)。
|
||||
*/
|
||||
public boolean hasActions(JSONObject node, String phase) {
|
||||
if (node == null) {
|
||||
return false;
|
||||
}
|
||||
JSONObject propsObj = node.getJSONObject("props");
|
||||
if (propsObj == null) {
|
||||
return false;
|
||||
}
|
||||
JSONObject callbackActions = propsObj.getJSONObject("callbackActions");
|
||||
if (callbackActions == null) {
|
||||
return false;
|
||||
}
|
||||
JSONArray actions = callbackActions.getJSONArray(phase);
|
||||
return actions != null && !actions.isEmpty();
|
||||
}
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】判断节点某阶段是否配置了业务回调-----------
|
||||
|
||||
public void run(JSONObject node, String phase, MesXslApprovalInstance inst) {
|
||||
if (node == null || inst == null) {
|
||||
return;
|
||||
}
|
||||
JSONObject propsObj = node.getJSONObject("props");
|
||||
if (propsObj == null) {
|
||||
return;
|
||||
}
|
||||
JSONObject callbackActions = propsObj.getJSONObject("callbackActions");
|
||||
if (callbackActions == null) {
|
||||
return;
|
||||
}
|
||||
JSONArray actions = callbackActions.getJSONArray(phase);
|
||||
if (actions == null || actions.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
String token = currentToken();
|
||||
for (int i = 0; i < actions.size(); i++) {
|
||||
JSONObject action = actions.getJSONObject(i);
|
||||
if (action == null) {
|
||||
continue;
|
||||
}
|
||||
String url = action.getString("url");
|
||||
if (oConvertUtils.isEmpty(url)) {
|
||||
continue;
|
||||
}
|
||||
if (oConvertUtils.isEmpty(token)) {
|
||||
// 无登录态(自动流转/无人值守) -> 降级跳过
|
||||
log.warn("[审批回调] 无当前处理人登录态,跳过接口调用 phase={}, url={}, bizId={}", phase, url, inst.getBizDataId());
|
||||
continue;
|
||||
}
|
||||
String method = oConvertUtils.getString(action.getString("method"), "POST").toUpperCase();
|
||||
invoke(method, url, action.getJSONObject("body"), inst.getBizDataId(), token);
|
||||
}
|
||||
}
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】驳回统一回退:按表注解自动调用业务接口-----------
|
||||
/**
|
||||
* 直接按 url+method 调用业务接口(用于驳回统一回退,动作来自 @ApprovalBizAction 注解而非节点配置)。
|
||||
* 无当前处理人登录态时降级跳过。
|
||||
*/
|
||||
public void runByUrl(String method, String url, MesXslApprovalInstance inst) {
|
||||
if (oConvertUtils.isEmpty(url) || inst == null) {
|
||||
return;
|
||||
}
|
||||
String token = currentToken();
|
||||
if (oConvertUtils.isEmpty(token)) {
|
||||
log.warn("[审批回调] 无当前处理人登录态,跳过驳回业务回退 url={}, bizId={}", url, inst.getBizDataId());
|
||||
return;
|
||||
}
|
||||
String httpMethod = oConvertUtils.getString(method, "POST").toUpperCase();
|
||||
invoke(httpMethod, url, null, inst.getBizDataId(), token);
|
||||
}
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】驳回统一回退:按表注解自动调用业务接口-----------
|
||||
|
||||
private void invoke(String method, String url, JSONObject recordedBody, String bizDataId, String token) {
|
||||
String fullUrl = buildFullUrl(url);
|
||||
HttpMethod httpMethod = HttpMethod.valueOf(method);
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
headers.add(CommonConstant.X_ACCESS_TOKEN, token);
|
||||
headers.add(HttpHeaders.AUTHORIZATION, token);
|
||||
|
||||
// 统一在 url 上附带单据ID的常见参数名,兼容 @RequestParam(id/ids/dataId) 形式的接口
|
||||
// (如密炼PS的 /proofread、/audit、/approve 用的是 @RequestParam ids)
|
||||
String idValue = oConvertUtils.getString(bizDataId, "");
|
||||
String sep = fullUrl.contains("?") ? "&" : "?";
|
||||
fullUrl = fullUrl + sep + "id=" + idValue + "&ids=" + idValue + "&dataId=" + idValue;
|
||||
|
||||
Object bodyToSend = null;
|
||||
if (!("GET".equals(method) || "DELETE".equals(method))) {
|
||||
// 写操作:合并录制的 body,并用单据ID覆盖 id(兼容 @RequestBody 形式)
|
||||
JSONObject body = recordedBody == null ? new JSONObject() : new JSONObject(recordedBody);
|
||||
body.put("id", bizDataId);
|
||||
bodyToSend = body;
|
||||
}
|
||||
|
||||
try {
|
||||
HttpEntity<Object> entity = new HttpEntity<>(bodyToSend, headers);
|
||||
ResponseEntity<String> resp = restTemplate.exchange(fullUrl, httpMethod, entity, String.class);
|
||||
String respBody = resp.getBody();
|
||||
if (!resp.getStatusCode().is2xxSuccessful()) {
|
||||
throw new RuntimeException("回调接口返回非2xx:" + resp.getStatusCode());
|
||||
}
|
||||
// Jeecg 统一返回 {success:false,...} 视为业务失败
|
||||
if (oConvertUtils.isNotEmpty(respBody)) {
|
||||
try {
|
||||
JSONObject r = JSONObject.parseObject(respBody);
|
||||
if (r != null && r.containsKey("success") && Boolean.FALSE.equals(r.getBoolean("success"))) {
|
||||
throw new RuntimeException("回调接口业务失败:" + oConvertUtils.getString(r.getString("message"), "未知错误"));
|
||||
}
|
||||
} catch (RuntimeException re) {
|
||||
throw re;
|
||||
} catch (Exception ignore) {
|
||||
// 非JSON响应不强校验
|
||||
}
|
||||
}
|
||||
log.info("[审批回调] 已调用业务接口成功 {} {} bizId={}", method, fullUrl, bizDataId);
|
||||
} catch (RuntimeException e) {
|
||||
log.error("[审批回调] 调用业务接口失败 {} {} bizId={}", method, fullUrl, bizDataId, e);
|
||||
// 抛出以回滚整个审批动作,保证审批与业务一致
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/** 构建内部调用绝对地址:http://127.0.0.1:port + context-path + url */
|
||||
private String buildFullUrl(String url) {
|
||||
String ctx = oConvertUtils.getString(contextPath, "");
|
||||
if (oConvertUtils.isNotEmpty(ctx) && !ctx.startsWith("/")) {
|
||||
ctx = "/" + ctx;
|
||||
}
|
||||
String path = url.startsWith("/") ? url : "/" + url;
|
||||
// 录制到的路径已含 context-path 时不重复拼接
|
||||
if (oConvertUtils.isNotEmpty(ctx) && (path.equals(ctx) || path.startsWith(ctx + "/"))) {
|
||||
ctx = "";
|
||||
}
|
||||
return "http://127.0.0.1:" + serverPort + ctx + path;
|
||||
}
|
||||
|
||||
/** 取当前请求的登录 token(处理人身份) */
|
||||
private String currentToken() {
|
||||
try {
|
||||
ServletRequestAttributes attrs = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (attrs == null) {
|
||||
return null;
|
||||
}
|
||||
HttpServletRequest request = attrs.getRequest();
|
||||
String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
|
||||
if (oConvertUtils.isEmpty(token)) {
|
||||
token = request.getHeader(HttpHeaders.AUTHORIZATION);
|
||||
}
|
||||
return token;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package org.jeecg.modules.xslmes.approval.callback;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.modules.xslmes.approval.entity.MesXslApprovalInstance;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 审批回调上下文。
|
||||
* 由审批引擎在「节点通过 / 最终通过 / 驳回」时构建并传给业务回调,
|
||||
* 业务模块据此调用自身已有的审核/回写接口,实现审批与业务功能的统一联动。
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】审批与业务单据联动回调
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ApprovalCallbackContext implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 回调动作类型 */
|
||||
public enum Action {
|
||||
/** 单个审批节点通过(中间态,每个节点都会触发一次) */
|
||||
NODE_APPROVED,
|
||||
/** 整个流程最终通过 */
|
||||
APPROVED,
|
||||
/** 被驳回(任一节点驳回即终止) */
|
||||
REJECTED
|
||||
}
|
||||
|
||||
/** 回调动作 */
|
||||
private Action action;
|
||||
|
||||
/** 审批实例ID */
|
||||
private String instanceId;
|
||||
|
||||
/** 审批流定义ID */
|
||||
private String flowId;
|
||||
|
||||
/** 审批流名称 */
|
||||
private String flowName;
|
||||
|
||||
/** 业务单据表名 */
|
||||
private String bizTable;
|
||||
|
||||
/** 业务单据中文名 */
|
||||
private String bizTableName;
|
||||
|
||||
/** 业务单据记录ID(业务表主键) */
|
||||
private String bizDataId;
|
||||
|
||||
/** 业务单据展示标题 */
|
||||
private String bizTitle;
|
||||
|
||||
/** 当前/刚处理的节点ID */
|
||||
private String nodeId;
|
||||
|
||||
/** 当前/刚处理的节点名称 */
|
||||
private String nodeName;
|
||||
|
||||
/** 操作人 username(系统自动处理时为 null/system) */
|
||||
private String operatorUsername;
|
||||
|
||||
/** 操作人姓名 */
|
||||
private String operatorName;
|
||||
|
||||
/** 审批意见 / 驳回理由 */
|
||||
private String comment;
|
||||
|
||||
/** 发起人 username */
|
||||
private String applyUser;
|
||||
|
||||
/** 是否为流程最终结束(APPROVED/REJECTED 时为 true) */
|
||||
private boolean finalResult;
|
||||
|
||||
/** 完整审批实例(供业务读取租户、发起信息等) */
|
||||
private transient MesXslApprovalInstance instance;
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package org.jeecg.modules.xslmes.approval.callback;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 审批业务回调分发器。
|
||||
* 统一在审批引擎流转关键点调用:
|
||||
* <ol>
|
||||
* <li>按业务表名路由到对应的 {@link IApprovalBizCallback} 实现(强类型,业务直接调用自身接口);</li>
|
||||
* <li>同时发布 {@link ApprovalActionEvent} 供 {@code @EventListener} 松耦合监听。</li>
|
||||
* </ol>
|
||||
* 回调与审批状态变更同事务执行,回调异常将向上抛出以回滚整个审批动作。
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】审批与业务单据联动回调
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ApprovalCallbackDispatcher {
|
||||
|
||||
/** 监听所有业务表的通配符 */
|
||||
private static final String ANY_TABLE = "*";
|
||||
|
||||
private final ObjectProvider<List<IApprovalBizCallback>> callbacksProvider;
|
||||
private final ApplicationEventPublisher eventPublisher;
|
||||
|
||||
public ApprovalCallbackDispatcher(ObjectProvider<List<IApprovalBizCallback>> callbacksProvider,
|
||||
ApplicationEventPublisher eventPublisher) {
|
||||
this.callbacksProvider = callbacksProvider;
|
||||
this.eventPublisher = eventPublisher;
|
||||
}
|
||||
|
||||
/** 节点通过(中间态) */
|
||||
public void fireNodeApproved(ApprovalCallbackContext ctx) {
|
||||
ctx.setAction(ApprovalCallbackContext.Action.NODE_APPROVED);
|
||||
ctx.setFinalResult(false);
|
||||
dispatch(ctx);
|
||||
}
|
||||
|
||||
/** 流程最终通过 */
|
||||
public void fireApproved(ApprovalCallbackContext ctx) {
|
||||
ctx.setAction(ApprovalCallbackContext.Action.APPROVED);
|
||||
ctx.setFinalResult(true);
|
||||
dispatch(ctx);
|
||||
}
|
||||
|
||||
/** 驳回 */
|
||||
public void fireRejected(ApprovalCallbackContext ctx) {
|
||||
ctx.setAction(ApprovalCallbackContext.Action.REJECTED);
|
||||
ctx.setFinalResult(true);
|
||||
dispatch(ctx);
|
||||
}
|
||||
|
||||
private void dispatch(ApprovalCallbackContext ctx) {
|
||||
if (ctx == null || oConvertUtils.isEmpty(ctx.getBizTable())) {
|
||||
return;
|
||||
}
|
||||
// 1) 强类型回调:按表路由 + 通配
|
||||
for (IApprovalBizCallback cb : matchedCallbacks(ctx.getBizTable())) {
|
||||
invoke(cb, ctx);
|
||||
}
|
||||
// 2) 领域事件:松耦合监听(同步、同事务)
|
||||
try {
|
||||
eventPublisher.publishEvent(new ApprovalActionEvent(this, ctx));
|
||||
} catch (RuntimeException e) {
|
||||
log.error("审批领域事件处理失败 table={}, bizId={}, action={}", ctx.getBizTable(), ctx.getBizDataId(), ctx.getAction(), e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private List<IApprovalBizCallback> matchedCallbacks(String bizTable) {
|
||||
List<IApprovalBizCallback> all = callbacksProvider.getIfAvailable();
|
||||
List<IApprovalBizCallback> matched = new ArrayList<>();
|
||||
if (all == null) {
|
||||
return matched;
|
||||
}
|
||||
for (IApprovalBizCallback cb : all) {
|
||||
String support = cb.supportTable();
|
||||
if (ANY_TABLE.equals(support) || (support != null && support.equalsIgnoreCase(bizTable))) {
|
||||
matched.add(cb);
|
||||
}
|
||||
}
|
||||
return matched;
|
||||
}
|
||||
|
||||
private void invoke(IApprovalBizCallback cb, ApprovalCallbackContext ctx) {
|
||||
try {
|
||||
switch (ctx.getAction()) {
|
||||
case NODE_APPROVED:
|
||||
cb.onNodeApproved(ctx);
|
||||
break;
|
||||
case APPROVED:
|
||||
cb.onApproved(ctx);
|
||||
break;
|
||||
case REJECTED:
|
||||
cb.onRejected(ctx);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error("审批业务回调执行失败 callback={}, table={}, bizId={}, action={}",
|
||||
cb.getClass().getSimpleName(), ctx.getBizTable(), ctx.getBizDataId(), ctx.getAction(), e);
|
||||
// 抛出以回滚整个审批动作,保证审批与业务数据一致
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.jeecg.modules.xslmes.approval.callback;
|
||||
|
||||
/**
|
||||
* 业务审批回调扩展点(SPI)。
|
||||
*
|
||||
* 各业务模块按需实现本接口并声明 {@link #supportTable()}(绑定的业务表名),
|
||||
* 审批引擎会在审批流转的关键节点自动回调对应实现,业务模块在回调里
|
||||
* 调用自己「已有的」审核/回写接口(如更新审核状态、扣减库存、生成下游单据等),
|
||||
* 从而把审批流程与业务单据的功能统一串联起来。
|
||||
*
|
||||
* <p>事务说明:回调与审批状态变更处于同一事务内,
|
||||
* 若回调抛出异常,整个审批动作回滚(审批失败),保证审批与业务数据一致。</p>
|
||||
*
|
||||
* <p>使用方式:实现类标注为 Spring Bean(@Component / @Service)即可被自动收集。</p>
|
||||
*
|
||||
* <pre>{@code
|
||||
* @Component
|
||||
* public class RubberStdApprovalCallback implements IApprovalBizCallback {
|
||||
* @Override public String supportTable() { return "mes_xsl_rubber_quick_test_std"; }
|
||||
* @Override public void onApproved(ApprovalCallbackContext ctx) {
|
||||
* // 调用业务自身已有接口完成回写
|
||||
* stdService.lambdaUpdate()
|
||||
* .eq(MesXslRubberQuickTestStd::getId, ctx.getBizDataId())
|
||||
* .set(MesXslRubberQuickTestStd::getAuditStatus, "1").update();
|
||||
* }
|
||||
* }
|
||||
* }</pre>
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】审批与业务单据联动回调
|
||||
*/
|
||||
public interface IApprovalBizCallback {
|
||||
|
||||
/**
|
||||
* 绑定的业务表名(与审批流定义 bizTable 一致)。
|
||||
* 返回 "*" 表示监听所有业务表。
|
||||
*/
|
||||
String supportTable();
|
||||
|
||||
/**
|
||||
* 单个审批节点通过(中间态)。每经过一个审批节点通过都会触发一次。
|
||||
* 适合更新中间状态(如「审核中」「已校对」等)。
|
||||
* 默认空实现,业务按需重写。
|
||||
*/
|
||||
default void onNodeApproved(ApprovalCallbackContext ctx) {
|
||||
// 默认不处理
|
||||
}
|
||||
|
||||
/**
|
||||
* 整个审批流程最终通过。适合执行终态业务(如置为「已批准」、生效、扣库存等)。
|
||||
* 默认空实现,业务按需重写。
|
||||
*/
|
||||
default void onApproved(ApprovalCallbackContext ctx) {
|
||||
// 默认不处理
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批被驳回(流程终止)。适合回退业务状态(如置回「草稿」、释放占用等)。
|
||||
* 默认空实现,业务按需重写。
|
||||
*/
|
||||
default void onRejected(ApprovalCallbackContext ctx) {
|
||||
// 默认不处理
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.jeecg.modules.xslmes.approval.callback.impl;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.approval.callback.ApprovalCallbackContext;
|
||||
import org.jeecg.modules.xslmes.approval.callback.IApprovalBizCallback;
|
||||
import org.jeecg.modules.xslmes.common.XslMesBizConstants;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStd;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestStdService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 胶料快检实验标准 审批回调示例。
|
||||
* 演示如何把审批流转结果联动到业务单据已有功能:
|
||||
* 审批最终通过 -> 审核状态置「已批准」;驳回 -> 回退「草稿」。
|
||||
*
|
||||
* 业务在回调里直接调用自身的 service(此处用 lambdaUpdate 更新审核状态字段),
|
||||
* 与原有「批准/反审核」逻辑保持统一。
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】审批与业务单据联动回调-示例
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class RubberQuickTestStdApprovalCallback implements IApprovalBizCallback {
|
||||
|
||||
private final IMesXslRubberQuickTestStdService stdService;
|
||||
|
||||
public RubberQuickTestStdApprovalCallback(IMesXslRubberQuickTestStdService stdService) {
|
||||
this.stdService = stdService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String supportTable() {
|
||||
return "mes_xsl_rubber_quick_test_std";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onApproved(ApprovalCallbackContext ctx) {
|
||||
updateAuditStatus(ctx.getBizDataId(), XslMesBizConstants.RUBBER_QUICK_TEST_STD_AUDIT_APPROVED);
|
||||
log.info("[审批联动] 实验标准 {} 审批通过,审核状态置为已批准", ctx.getBizDataId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRejected(ApprovalCallbackContext ctx) {
|
||||
updateAuditStatus(ctx.getBizDataId(), XslMesBizConstants.RUBBER_QUICK_TEST_STD_AUDIT_DRAFT);
|
||||
log.info("[审批联动] 实验标准 {} 被驳回,审核状态回退为草稿", ctx.getBizDataId());
|
||||
}
|
||||
|
||||
private void updateAuditStatus(String bizDataId, String auditStatus) {
|
||||
if (oConvertUtils.isEmpty(bizDataId)) {
|
||||
return;
|
||||
}
|
||||
stdService.lambdaUpdate()
|
||||
.eq(MesXslRubberQuickTestStd::getId, bizDataId)
|
||||
.set(MesXslRubberQuickTestStd::getAuditStatus, auditStatus)
|
||||
.update();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,458 @@
|
||||
package org.jeecg.modules.xslmes.approval.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 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.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.approval.action.ApprovalBizActionRegistry;
|
||||
import org.jeecg.modules.xslmes.approval.action.ApprovalBizActionVo;
|
||||
import org.jeecg.modules.xslmes.approval.entity.MesXslApprovalFlow;
|
||||
import org.jeecg.modules.xslmes.approval.service.IMesXslApprovalFlowService;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* MES 审批流设计
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】新增审批流可视化设计
|
||||
*/
|
||||
@Tag(name = "MES审批流设计")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/approvalFlow")
|
||||
@Slf4j
|
||||
public class MesXslApprovalFlowController extends JeecgController<MesXslApprovalFlow, IMesXslApprovalFlowService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslApprovalFlowService mesXslApprovalFlowService;
|
||||
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】审批联动业务动作注册表-----
|
||||
@Autowired
|
||||
private ApprovalBizActionRegistry approvalBizActionRegistry;
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】审批联动业务动作注册表-----
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】当前页字段解析-----
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
/** 合法标识符(表名/字段名)白名单校验,防 SQL 注入 */
|
||||
private static final Pattern IDENTIFIER = Pattern.compile("^[A-Za-z0-9_]+$");
|
||||
|
||||
/**
|
||||
* 审批阶段关键字配置(有序):key=阶段标识,name=阶段中文,nodeType=对应节点类型,keywords=列注释匹配关键字。
|
||||
* 解析顺序即默认流程顺序:校对 -> 审核 -> 审批 -> 分发 -> 抄送。
|
||||
*/
|
||||
private static final String[][] STAGE_DEFS = new String[][]{
|
||||
{"proofread", "校对", "approver", "校对"},
|
||||
{"review", "审核", "approver", "审核|审查"},
|
||||
{"approve", "审批", "approver", "审批|批准|核准"},
|
||||
{"distribute", "分发", "approver", "分发|发放"},
|
||||
{"cc", "抄送", "cc", "抄送"},
|
||||
};
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】当前页字段解析-----
|
||||
|
||||
/**
|
||||
* 根据所选单据表名翻译字典,回填单据中文名
|
||||
*/
|
||||
private void fillBizTableName(MesXslApprovalFlow flow) {
|
||||
if (oConvertUtils.isEmpty(flow.getBizTable())) {
|
||||
return;
|
||||
}
|
||||
List<DictModel> items = sysBaseAPI.getDictItems("mes_xsl_approval_biz_doc");
|
||||
if (items != null) {
|
||||
for (DictModel item : items) {
|
||||
if (flow.getBizTable().equals(item.getValue())) {
|
||||
flow.setBizTableName(item.getText());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "审批流设计-分页列表查询")
|
||||
@RequiresPermissions("approval:flow:list")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslApprovalFlow>> queryPageList(
|
||||
MesXslApprovalFlow mesXslApprovalFlow,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslApprovalFlow> queryWrapper = QueryGenerator.initQueryWrapper(mesXslApprovalFlow, req.getParameterMap());
|
||||
// 列表查询不返回大字段 flowConfig,避免传输冗余
|
||||
queryWrapper.select(MesXslApprovalFlow.class, info -> !"flow_config".equals(info.getColumn()));
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<MesXslApprovalFlow> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslApprovalFlow> pageList = mesXslApprovalFlowService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "审批流设计-添加")
|
||||
@Operation(summary = "审批流设计-添加")
|
||||
@RequiresPermissions("approval:flow:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslApprovalFlow mesXslApprovalFlow) {
|
||||
if (oConvertUtils.isEmpty(mesXslApprovalFlow.getFlowName())) {
|
||||
return Result.error("审批流名称不能为空");
|
||||
}
|
||||
if (oConvertUtils.isEmpty(mesXslApprovalFlow.getBizTable())) {
|
||||
return Result.error("请先选择绑定单据");
|
||||
}
|
||||
if (oConvertUtils.isEmpty(mesXslApprovalFlow.getStatus())) {
|
||||
mesXslApprovalFlow.setStatus("0");
|
||||
}
|
||||
fillBizTableName(mesXslApprovalFlow);
|
||||
mesXslApprovalFlowService.save(mesXslApprovalFlow);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "审批流设计-编辑")
|
||||
@Operation(summary = "审批流设计-编辑")
|
||||
@RequiresPermissions("approval:flow:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslApprovalFlow mesXslApprovalFlow) {
|
||||
if (oConvertUtils.isEmpty(mesXslApprovalFlow.getId())) {
|
||||
return Result.error("主键不能为空");
|
||||
}
|
||||
fillBizTableName(mesXslApprovalFlow);
|
||||
mesXslApprovalFlowService.updateById(mesXslApprovalFlow);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "审批流设计-保存流程设计")
|
||||
@Operation(summary = "审批流设计-保存流程设计")
|
||||
@RequiresPermissions("approval:flow:design")
|
||||
@PostMapping(value = "/saveDesign")
|
||||
public Result<String> saveDesign(@RequestBody MesXslApprovalFlow mesXslApprovalFlow) {
|
||||
if (oConvertUtils.isEmpty(mesXslApprovalFlow.getId())) {
|
||||
return Result.error("主键不能为空");
|
||||
}
|
||||
MesXslApprovalFlow update = new MesXslApprovalFlow();
|
||||
update.setId(mesXslApprovalFlow.getId());
|
||||
update.setFlowConfig(mesXslApprovalFlow.getFlowConfig());
|
||||
// 设计保存时若仍为草稿则置为已发布
|
||||
if (oConvertUtils.isNotEmpty(mesXslApprovalFlow.getStatus())) {
|
||||
update.setStatus(mesXslApprovalFlow.getStatus());
|
||||
}
|
||||
mesXslApprovalFlowService.updateById(update);
|
||||
return Result.OK("流程设计已保存!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "审批流设计-发布/停用")
|
||||
@Operation(summary = "审批流设计-发布/停用")
|
||||
@RequiresPermissions("approval:flow:design")
|
||||
@PostMapping(value = "/updateStatus")
|
||||
public Result<String> updateStatus(
|
||||
@RequestParam(name = "id") String id,
|
||||
@RequestParam(name = "status") String status) {
|
||||
if (!"0".equals(status) && !"1".equals(status) && !"2".equals(status)) {
|
||||
return Result.error("状态参数非法");
|
||||
}
|
||||
boolean ok = mesXslApprovalFlowService.lambdaUpdate()
|
||||
.eq(MesXslApprovalFlow::getId, id)
|
||||
.set(MesXslApprovalFlow::getStatus, status)
|
||||
.update();
|
||||
return ok ? Result.OK("操作成功") : Result.error("操作失败");
|
||||
}
|
||||
|
||||
@AutoLog(value = "审批流设计-删除")
|
||||
@Operation(summary = "审批流设计-删除")
|
||||
@RequiresPermissions("approval:flow:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id") String id) {
|
||||
mesXslApprovalFlowService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "审批流设计-批量删除")
|
||||
@Operation(summary = "审批流设计-批量删除")
|
||||
@RequiresPermissions("approval:flow:delete")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids") String ids) {
|
||||
mesXslApprovalFlowService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "审批流设计-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslApprovalFlow> queryById(@RequestParam(name = "id") String id) {
|
||||
MesXslApprovalFlow entity = mesXslApprovalFlowService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】全局审批流程设计悬浮按钮-当前页字段解析-----
|
||||
/**
|
||||
* 设计上下文:供全局"审批流程设计"悬浮按钮调用。
|
||||
* 1) 根据当前功能页路由反查绑定的业务表;
|
||||
* 2) 解析该表的字段,识别"校对/审核/审批/分发/抄送"等阶段字段(不存在不报错,存在即解析);
|
||||
* 3) 取/建该业务表的草稿审批流,返回流程记录(含id)供直接进入设计器。
|
||||
*
|
||||
* @param routePath 当前功能页前端路由(如 /xslmes/mesXslFormulaSpec/MesXslFormulaSpecList)
|
||||
*/
|
||||
@Operation(summary = "审批流设计-当前页设计上下文")
|
||||
@RequiresPermissions("approval:flow:design")
|
||||
@GetMapping(value = "/designContext")
|
||||
public Result<Map<String, Object>> designContext(@RequestParam(name = "routePath") String routePath) {
|
||||
Map<String, Object> data = new LinkedHashMap<>();
|
||||
data.put("routePath", routePath);
|
||||
data.put("bizTable", null);
|
||||
data.put("bizTableName", null);
|
||||
data.put("stages", new ArrayList<>());
|
||||
data.put("flow", null);
|
||||
|
||||
// 1) 路由 -> 业务表名(无法反查时不报错,返回空上下文,前端提示)
|
||||
String table = resolveTableByRoutePath(routePath);
|
||||
if (oConvertUtils.isEmpty(table) || !tableExists(table)) {
|
||||
return Result.OK(data);
|
||||
}
|
||||
data.put("bizTable", table);
|
||||
|
||||
// 2) 业务表中文名:优先字典,其次表注释
|
||||
String bizTableName = resolveBizTableName(table);
|
||||
data.put("bizTableName", bizTableName);
|
||||
|
||||
// 3) 解析阶段字段
|
||||
data.put("stages", parseStageFields(table));
|
||||
|
||||
// 4) 取/建草稿审批流
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(null);
|
||||
MesXslApprovalFlow flow = findFlowByTable(table, tenantId);
|
||||
if (flow == null) {
|
||||
flow = new MesXslApprovalFlow();
|
||||
flow.setFlowName((oConvertUtils.isNotEmpty(bizTableName) ? bizTableName : table) + "审批流");
|
||||
flow.setBizTable(table);
|
||||
flow.setBizTableName(bizTableName);
|
||||
flow.setRoutePath(routePath);
|
||||
flow.setStatus("0");
|
||||
if (tenantId != null) {
|
||||
flow.setTenantId(tenantId);
|
||||
}
|
||||
mesXslApprovalFlowService.save(flow);
|
||||
} else if (oConvertUtils.isEmpty(flow.getRoutePath())) {
|
||||
// 历史数据未记录路由,回填一次便于后续发起按钮匹配
|
||||
mesXslApprovalFlowService.lambdaUpdate()
|
||||
.eq(MesXslApprovalFlow::getId, flow.getId())
|
||||
.set(MesXslApprovalFlow::getRoutePath, routePath)
|
||||
.update();
|
||||
flow.setRoutePath(routePath);
|
||||
}
|
||||
data.put("flow", flow);
|
||||
return Result.OK(data);
|
||||
}
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】按业务表查可选回调动作-----
|
||||
/**
|
||||
* 查询某业务表已标注 @ApprovalBizAction 的可选回调动作,供设计器节点「回调接口」下拉选择。
|
||||
*
|
||||
* @param table 业务表名(审批流绑定的 bizTable)
|
||||
*/
|
||||
@Operation(summary = "审批流设计-业务表可选回调动作")
|
||||
@RequiresPermissions("approval:flow:design")
|
||||
@GetMapping(value = "/bizActions")
|
||||
public Result<List<ApprovalBizActionVo>> bizActions(@RequestParam(name = "table") String table) {
|
||||
return Result.OK(approvalBizActionRegistry.getByTable(table));
|
||||
}
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】按业务表查可选回调动作-----
|
||||
|
||||
/**
|
||||
* 根据前端路由反查业务表名。
|
||||
* 约定:jeecg 代码生成的列表组件名为 表名驼峰 + List,sys_permission.component 形如
|
||||
* xslmes/mesXslFormulaSpec/MesXslFormulaSpecList,url 即路由。
|
||||
* 反查:url=routePath -> component -> 末段组件名去掉 List -> 驼峰转下划线得到表名。
|
||||
*/
|
||||
/** 根据前端路由反查页面组件路径(sys_permission.component),用于前端按 key 取该页面按钮接口映射 */
|
||||
private String resolveComponentByRoutePath(String routePath) {
|
||||
if (oConvertUtils.isEmpty(routePath)) {
|
||||
return null;
|
||||
}
|
||||
String path = routePath.trim().replaceAll("/+$", "");
|
||||
String sql = "SELECT component FROM sys_permission WHERE menu_type IN (0,1) "
|
||||
+ "AND (del_flag = 0 OR del_flag IS NULL) AND url = ? "
|
||||
+ "ORDER BY menu_type DESC LIMIT 1";
|
||||
try {
|
||||
List<String> list = jdbcTemplate.queryForList(sql, String.class, path);
|
||||
return list.isEmpty() ? null : list.get(0);
|
||||
} catch (Exception e) {
|
||||
log.warn("反查菜单组件失败 routePath={}", routePath, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private String resolveTableByRoutePath(String routePath) {
|
||||
if (oConvertUtils.isEmpty(routePath)) {
|
||||
return null;
|
||||
}
|
||||
String component = resolveComponentByRoutePath(routePath);
|
||||
if (oConvertUtils.isEmpty(component)) {
|
||||
return null;
|
||||
}
|
||||
// 取组件路径末段:xslmes/mesXslFormulaSpec/MesXslFormulaSpecList -> MesXslFormulaSpecList
|
||||
String comp = component.contains("/") ? component.substring(component.lastIndexOf('/') + 1) : component;
|
||||
if (comp.endsWith("List")) {
|
||||
comp = comp.substring(0, comp.length() - "List".length());
|
||||
}
|
||||
return camelToUnderline(comp);
|
||||
}
|
||||
|
||||
/** 驼峰转下划线小写:MesXslFormulaSpec -> mes_xsl_formula_spec */
|
||||
private String camelToUnderline(String camel) {
|
||||
if (oConvertUtils.isEmpty(camel)) {
|
||||
return null;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < camel.length(); i++) {
|
||||
char c = camel.charAt(i);
|
||||
if (Character.isUpperCase(c)) {
|
||||
if (i > 0) {
|
||||
sb.append('_');
|
||||
}
|
||||
sb.append(Character.toLowerCase(c));
|
||||
} else {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/** 校验表是否存在于当前库 */
|
||||
private boolean tableExists(String table) {
|
||||
if (!IDENTIFIER.matcher(table).matches()) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
Integer cnt = jdbcTemplate.queryForObject(
|
||||
"SELECT COUNT(1) FROM information_schema.tables WHERE table_schema = (SELECT DATABASE()) AND table_name = ?",
|
||||
Integer.class, table);
|
||||
return cnt != null && cnt > 0;
|
||||
} catch (Exception e) {
|
||||
log.warn("校验表存在失败 table={}", table, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/** 业务表中文名:优先字典 mes_xsl_approval_biz_doc,其次表注释 */
|
||||
private String resolveBizTableName(String table) {
|
||||
List<DictModel> items = sysBaseAPI.getDictItems("mes_xsl_approval_biz_doc");
|
||||
if (items != null) {
|
||||
for (DictModel item : items) {
|
||||
if (table.equals(item.getValue())) {
|
||||
return item.getText();
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
List<String> comments = jdbcTemplate.queryForList(
|
||||
"SELECT table_comment FROM information_schema.tables WHERE table_schema = (SELECT DATABASE()) AND table_name = ?",
|
||||
String.class, table);
|
||||
if (!comments.isEmpty() && oConvertUtils.isNotEmpty(comments.get(0))) {
|
||||
return comments.get(0);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("查询表注释失败 table={}", table, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析表字段,识别审批阶段字段。每个阶段最多取一个字段(优先列注释含"人/员"的人员字段)。
|
||||
* 返回有序列表:[{stageKey, stageName, nodeType, field, fieldComment}]
|
||||
*/
|
||||
private List<Map<String, Object>> parseStageFields(String table) {
|
||||
List<Map<String, Object>> stages = new ArrayList<>();
|
||||
List<Map<String, Object>> columns;
|
||||
try {
|
||||
columns = jdbcTemplate.queryForList(
|
||||
"SELECT column_name AS name, column_comment AS comment FROM information_schema.columns "
|
||||
+ "WHERE table_schema = (SELECT DATABASE()) AND table_name = ? ORDER BY ordinal_position",
|
||||
table);
|
||||
} catch (Exception e) {
|
||||
log.warn("查询表字段失败 table={}", table, e);
|
||||
return stages;
|
||||
}
|
||||
for (String[] def : STAGE_DEFS) {
|
||||
String stageKey = def[0];
|
||||
String stageName = def[1];
|
||||
String nodeType = def[2];
|
||||
String[] keywords = def[3].split("\\|");
|
||||
Map<String, Object> hit = matchStageColumn(columns, keywords);
|
||||
if (hit != null) {
|
||||
Map<String, Object> stage = new LinkedHashMap<>();
|
||||
stage.put("stageKey", stageKey);
|
||||
stage.put("stageName", stageName);
|
||||
stage.put("nodeType", nodeType);
|
||||
stage.put("field", hit.get("name"));
|
||||
stage.put("fieldComment", hit.get("comment"));
|
||||
stages.add(stage);
|
||||
}
|
||||
}
|
||||
return stages;
|
||||
}
|
||||
|
||||
/** 在列集合中按关键字匹配阶段字段,优先返回注释含"人/员"的人员字段 */
|
||||
private Map<String, Object> matchStageColumn(List<Map<String, Object>> columns, String[] keywords) {
|
||||
Map<String, Object> firstMatch = null;
|
||||
for (Map<String, Object> col : columns) {
|
||||
String comment = col.get("comment") == null ? "" : String.valueOf(col.get("comment"));
|
||||
if (oConvertUtils.isEmpty(comment)) {
|
||||
continue;
|
||||
}
|
||||
boolean matched = false;
|
||||
for (String kw : keywords) {
|
||||
if (comment.contains(kw)) {
|
||||
matched = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!matched) {
|
||||
continue;
|
||||
}
|
||||
if (firstMatch == null) {
|
||||
firstMatch = col;
|
||||
}
|
||||
// 人员字段优先(如"校对人""审核员")
|
||||
if (comment.contains("人") || comment.contains("员")) {
|
||||
return col;
|
||||
}
|
||||
}
|
||||
return firstMatch;
|
||||
}
|
||||
|
||||
/** 按业务表+租户查找审批流(取最近一条) */
|
||||
private MesXslApprovalFlow findFlowByTable(String table, Integer tenantId) {
|
||||
QueryWrapper<MesXslApprovalFlow> qw = new QueryWrapper<>();
|
||||
qw.eq("biz_table", table);
|
||||
if (tenantId != null) {
|
||||
qw.eq("tenant_id", tenantId);
|
||||
}
|
||||
qw.orderByDesc("create_time");
|
||||
qw.last("LIMIT 1");
|
||||
return mesXslApprovalFlowService.getOne(qw, false);
|
||||
}
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】全局审批流程设计悬浮按钮-当前页字段解析-----
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package org.jeecg.modules.xslmes.approval.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.approval.service.IMesXslApprovalHandleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* MES 审批办理(运行时-流转)。
|
||||
* 供 IM 审批卡片按钮调用:查看详情 / 审批通过 / 驳回。
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】审批办理/流转
|
||||
*/
|
||||
@Tag(name = "MES审批办理")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/approvalHandle")
|
||||
@Slf4j
|
||||
public class MesXslApprovalHandleController {
|
||||
|
||||
@Autowired
|
||||
private IMesXslApprovalHandleService approvalHandleService;
|
||||
|
||||
@Operation(summary = "审批办理-单据详情")
|
||||
@GetMapping("/detail")
|
||||
public Result<Map<String, Object>> detail(@RequestParam("instanceId") String instanceId) {
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
Map<String, Object> data = approvalHandleService.detail(instanceId, user);
|
||||
if (data == null || data.isEmpty()) {
|
||||
return Result.error("审批实例不存在");
|
||||
}
|
||||
return Result.OK(data);
|
||||
}
|
||||
|
||||
@Operation(summary = "审批办理-实时状态(卡片置灰判断)")
|
||||
@GetMapping("/status")
|
||||
public Result<Map<String, Object>> status(@RequestParam("instanceId") String instanceId) {
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
Map<String, Object> data = approvalHandleService.statusInfo(instanceId, user);
|
||||
return Result.OK(data);
|
||||
}
|
||||
|
||||
@Operation(summary = "审批办理-通过")
|
||||
@PostMapping("/approve")
|
||||
public Result<String> approve(@RequestBody Map<String, Object> body) {
|
||||
String instanceId = (String) body.get("instanceId");
|
||||
String comment = body.get("comment") == null ? null : String.valueOf(body.get("comment"));
|
||||
if (oConvertUtils.isEmpty(instanceId)) {
|
||||
return Result.error("缺少审批实例ID");
|
||||
}
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
return approvalHandleService.approve(instanceId, comment, user);
|
||||
}
|
||||
|
||||
@Operation(summary = "审批办理-驳回")
|
||||
@PostMapping("/reject")
|
||||
public Result<String> reject(@RequestBody Map<String, Object> body) {
|
||||
String instanceId = (String) body.get("instanceId");
|
||||
String reason = body.get("reason") == null ? null : String.valueOf(body.get("reason"));
|
||||
if (oConvertUtils.isEmpty(instanceId)) {
|
||||
return Result.error("缺少审批实例ID");
|
||||
}
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
return approvalHandleService.reject(instanceId, reason, user);
|
||||
}
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】发起人撤销-----
|
||||
@Operation(summary = "审批办理-撤销(发起人撤回)")
|
||||
@PostMapping("/cancel")
|
||||
public Result<String> cancel(@RequestBody Map<String, Object> body) {
|
||||
String instanceId = (String) body.get("instanceId");
|
||||
String reason = body.get("reason") == null ? null : String.valueOf(body.get("reason"));
|
||||
if (oConvertUtils.isEmpty(instanceId)) {
|
||||
return Result.error("缺少审批实例ID");
|
||||
}
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
return approvalHandleService.cancel(instanceId, reason, user);
|
||||
}
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】发起人撤销-----
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】催办接口-----
|
||||
@Operation(summary = "审批办理-催办(发起人催处理人)")
|
||||
@PostMapping("/urge")
|
||||
public Result<String> urge(@RequestBody Map<String, Object> body) {
|
||||
String instanceId = (String) body.get("instanceId");
|
||||
if (oConvertUtils.isEmpty(instanceId)) {
|
||||
return Result.error("缺少审批实例ID");
|
||||
}
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
return approvalHandleService.urge(instanceId, user);
|
||||
}
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】催办接口-----
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】待办列表-----
|
||||
@Operation(summary = "审批办理-我的待办列表")
|
||||
@GetMapping("/pendingList")
|
||||
public Result<List<Map<String, Object>>> pendingList() {
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
return Result.OK(approvalHandleService.pendingList(user));
|
||||
}
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】待办列表-----
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
package org.jeecg.modules.xslmes.approval.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.approval.entity.MesXslApprovalFlow;
|
||||
import org.jeecg.modules.xslmes.approval.entity.MesXslApprovalInstance;
|
||||
import org.jeecg.modules.xslmes.approval.service.IMesXslApprovalFlowService;
|
||||
import org.jeecg.modules.xslmes.approval.service.IMesXslApprovalHandleService;
|
||||
import org.jeecg.modules.xslmes.approval.service.IMesXslApprovalInstanceService;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* MES 审批发起(运行时-本期仅发起)
|
||||
* 供全局"发起审批"悬浮按钮调用:选单据类型 -> 选单据记录 -> 发起。
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】发起审批运行时
|
||||
*/
|
||||
@Tag(name = "MES审批发起")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/approvalLaunch")
|
||||
@Slf4j
|
||||
public class MesXslApprovalLaunchController {
|
||||
|
||||
/** 合法标识符(表名/字段名)白名单校验,防 SQL 注入 */
|
||||
private static final Pattern IDENTIFIER = Pattern.compile("^[A-Za-z0-9_]+$");
|
||||
|
||||
@Autowired
|
||||
private IMesXslApprovalFlowService approvalFlowService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslApprovalInstanceService approvalInstanceService;
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】发起改用流转引擎进入首节点-----
|
||||
@Autowired
|
||||
private IMesXslApprovalHandleService approvalHandleService;
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】发起改用流转引擎进入首节点-----
|
||||
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
/**
|
||||
* 已发布审批流列表(按租户隔离),即"可发起的单据类型"。
|
||||
* 同时按"功能模块(单据表)"自动反查其菜单路由填入 routePath,供前端控制悬浮按钮仅在该功能页显示,无需手工配置。
|
||||
*/
|
||||
@Operation(summary = "发起审批-已发布审批流列表")
|
||||
@GetMapping("/publishedList")
|
||||
public Result<List<MesXslApprovalFlow>> publishedList() {
|
||||
QueryWrapper<MesXslApprovalFlow> qw = new QueryWrapper<>();
|
||||
qw.eq("status", "1");
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(null);
|
||||
if (tenantId != null) {
|
||||
qw.eq("tenant_id", tenantId);
|
||||
}
|
||||
qw.orderByDesc("create_time");
|
||||
List<MesXslApprovalFlow> list = approvalFlowService.list(qw);
|
||||
// 未手工指定 route_path 时,按单据表名自动反查菜单路由
|
||||
for (MesXslApprovalFlow flow : list) {
|
||||
if (oConvertUtils.isEmpty(flow.getRoutePath())) {
|
||||
flow.setRoutePath(resolveRoutePathByTable(flow.getBizTable()));
|
||||
}
|
||||
}
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单据表名反查对应功能菜单的前端路由。
|
||||
* 约定:jeecg 代码生成的列表组件名为 表名驼峰 + List(如 mes_xsl_formula_spec -> MesXslFormulaSpecList),
|
||||
* 对应 sys_permission.component 形如 xslmes/mesXslFormulaSpec/MesXslFormulaSpecList,取其 url 即路由。
|
||||
*/
|
||||
private String resolveRoutePathByTable(String table) {
|
||||
if (oConvertUtils.isEmpty(table) || !IDENTIFIER.matcher(table).matches()) {
|
||||
return null;
|
||||
}
|
||||
StringBuilder comp = new StringBuilder();
|
||||
for (String p : table.split("_")) {
|
||||
if (oConvertUtils.isEmpty(p)) {
|
||||
continue;
|
||||
}
|
||||
comp.append(Character.toUpperCase(p.charAt(0))).append(p.substring(1));
|
||||
}
|
||||
comp.append("List");
|
||||
String sql = "SELECT url FROM sys_permission WHERE menu_type IN (0,1) "
|
||||
+ "AND (del_flag = 0 OR del_flag IS NULL) "
|
||||
+ "AND (component LIKE ? OR component LIKE ?) "
|
||||
+ "ORDER BY menu_type DESC LIMIT 1";
|
||||
try {
|
||||
List<String> urls = jdbcTemplate.queryForList(sql, String.class, "%/" + comp, "%" + comp);
|
||||
return urls.isEmpty() ? null : urls.get(0);
|
||||
} catch (Exception e) {
|
||||
log.warn("反查菜单路由失败 table={}", table, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据审批流绑定的单据表,查询业务单据记录(id + 标题),供发起时选择
|
||||
*/
|
||||
@Operation(summary = "发起审批-业务单据记录列表")
|
||||
@GetMapping("/bizRecords")
|
||||
public Result<List<Map<String, Object>>> bizRecords(
|
||||
@RequestParam("flowId") String flowId,
|
||||
@RequestParam(value = "keyword", required = false) String keyword) {
|
||||
MesXslApprovalFlow flow = approvalFlowService.getById(flowId);
|
||||
if (flow == null) {
|
||||
return Result.error("审批流不存在");
|
||||
}
|
||||
String table = flow.getBizTable();
|
||||
String titleField = flow.getTitleField();
|
||||
if (oConvertUtils.isEmpty(table) || !IDENTIFIER.matcher(table).matches()) {
|
||||
return Result.error("单据表名非法");
|
||||
}
|
||||
boolean hasTitle = oConvertUtils.isNotEmpty(titleField) && IDENTIFIER.matcher(titleField).matches();
|
||||
|
||||
StringBuilder sql = new StringBuilder("SELECT id, ");
|
||||
sql.append(hasTitle ? titleField : "id").append(" AS title FROM ").append(table);
|
||||
List<Object> args = new ArrayList<>();
|
||||
if (hasTitle && oConvertUtils.isNotEmpty(keyword)) {
|
||||
sql.append(" WHERE ").append(titleField).append(" LIKE CONCAT('%', ?, '%')");
|
||||
args.add(keyword);
|
||||
}
|
||||
// 主键一定存在,按 id 倒序近似最新;限制条数防全表
|
||||
sql.append(" ORDER BY id DESC LIMIT 100");
|
||||
try {
|
||||
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.toString(), args.toArray());
|
||||
return Result.OK(list);
|
||||
} catch (Exception e) {
|
||||
log.error("查询业务单据失败 table={}, field={}", table, titleField, e);
|
||||
return Result.error("查询业务单据失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起审批:根据审批流定义创建审批实例,解析首个审批节点处理人
|
||||
*/
|
||||
@Operation(summary = "发起审批-发起")
|
||||
@PostMapping("/launch")
|
||||
public Result<String> launch(@RequestBody Map<String, Object> body) {
|
||||
String flowId = (String) body.get("flowId");
|
||||
String bizDataId = (String) body.get("bizDataId");
|
||||
String bizTitle = (String) body.get("bizTitle");
|
||||
if (oConvertUtils.isEmpty(flowId) || oConvertUtils.isEmpty(bizDataId)) {
|
||||
return Result.error("请选择审批流和单据");
|
||||
}
|
||||
MesXslApprovalFlow flow = approvalFlowService.getById(flowId);
|
||||
if (flow == null) {
|
||||
return Result.error("审批流不存在");
|
||||
}
|
||||
if (!"1".equals(flow.getStatus())) {
|
||||
return Result.error("该审批流未发布,无法发起");
|
||||
}
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】防止同一单据重复发起审批-----
|
||||
long active = approvalInstanceService.count(new LambdaQueryWrapper<MesXslApprovalInstance>()
|
||||
.eq(MesXslApprovalInstance::getBizTable, flow.getBizTable())
|
||||
.eq(MesXslApprovalInstance::getBizDataId, bizDataId)
|
||||
.eq(MesXslApprovalInstance::getStatus, "0"));
|
||||
if (active > 0) {
|
||||
return Result.error("该单据已有审批中的流程,请勿重复发起");
|
||||
}
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】防止同一单据重复发起审批-----
|
||||
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】发起后由引擎进入首节点(解析处理人/建进度/发可办理卡片)-----
|
||||
MesXslApprovalInstance inst = buildInstance(flow, bizDataId, bizTitle, loginUser);
|
||||
approvalInstanceService.save(inst);
|
||||
approvalHandleService.enterFirstNode(inst, loginUser);
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】发起后由引擎进入首节点(解析处理人/建进度/发可办理卡片)-----
|
||||
return Result.OK("发起成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量发起审批:用于列表多选后一次性发起
|
||||
*/
|
||||
@Operation(summary = "发起审批-批量发起")
|
||||
@PostMapping("/launchBatch")
|
||||
public Result<String> launchBatch(@RequestBody Map<String, Object> body) {
|
||||
String flowId = (String) body.get("flowId");
|
||||
Object itemsObj = body.get("items");
|
||||
if (oConvertUtils.isEmpty(flowId) || !(itemsObj instanceof List) || ((List<?>) itemsObj).isEmpty()) {
|
||||
return Result.error("请选择审批流和单据");
|
||||
}
|
||||
MesXslApprovalFlow flow = approvalFlowService.getById(flowId);
|
||||
if (flow == null) {
|
||||
return Result.error("审批流不存在");
|
||||
}
|
||||
if (!"1".equals(flow.getStatus())) {
|
||||
return Result.error("该审批流未发布,无法发起");
|
||||
}
|
||||
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】批量发起逐条进入首节点(支持按单据字段解析处理人/会签)-----
|
||||
int count = 0;
|
||||
int skipCount = 0;
|
||||
for (Object o : (List<?>) itemsObj) {
|
||||
if (!(o instanceof Map)) {
|
||||
continue;
|
||||
}
|
||||
Map<?, ?> item = (Map<?, ?>) o;
|
||||
String bizDataId = item.get("bizDataId") == null ? null : String.valueOf(item.get("bizDataId"));
|
||||
String bizTitle = item.get("bizTitle") == null ? null : String.valueOf(item.get("bizTitle"));
|
||||
if (oConvertUtils.isEmpty(bizDataId)) {
|
||||
continue;
|
||||
}
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】批量发起防重:跳过已有审批中实例的单据-----
|
||||
long active = approvalInstanceService.count(new LambdaQueryWrapper<MesXslApprovalInstance>()
|
||||
.eq(MesXslApprovalInstance::getBizTable, flow.getBizTable())
|
||||
.eq(MesXslApprovalInstance::getBizDataId, bizDataId)
|
||||
.eq(MesXslApprovalInstance::getStatus, "0"));
|
||||
if (active > 0) {
|
||||
skipCount++;
|
||||
continue;
|
||||
}
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】批量发起防重:跳过已有审批中实例的单据-----
|
||||
MesXslApprovalInstance inst = buildInstance(flow, bizDataId, bizTitle, loginUser);
|
||||
approvalInstanceService.save(inst);
|
||||
approvalHandleService.enterFirstNode(inst, loginUser);
|
||||
count++;
|
||||
}
|
||||
if (count == 0) {
|
||||
return Result.error(skipCount > 0 ? "所选单据均已有审批中的流程,无需重复发起" : "没有有效的单据数据");
|
||||
}
|
||||
String msg = "已发起 " + count + " 条审批!";
|
||||
if (skipCount > 0) {
|
||||
msg += "(" + skipCount + " 条已有审批中流程,已跳过)";
|
||||
}
|
||||
return Result.OK(msg);
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】批量发起逐条进入首节点(支持按单据字段解析处理人/会签)-----
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建一条审批实例(基础字段;处理人解析/卡片由流转引擎完成)
|
||||
*/
|
||||
private MesXslApprovalInstance buildInstance(MesXslApprovalFlow flow, String bizDataId, String bizTitle, LoginUser loginUser) {
|
||||
MesXslApprovalInstance inst = new MesXslApprovalInstance();
|
||||
inst.setFlowId(flow.getId());
|
||||
inst.setFlowName(flow.getFlowName());
|
||||
inst.setBizTable(flow.getBizTable());
|
||||
inst.setBizTableName(flow.getBizTableName());
|
||||
inst.setBizDataId(bizDataId);
|
||||
inst.setBizTitle(oConvertUtils.isNotEmpty(bizTitle) ? bizTitle : bizDataId);
|
||||
inst.setStatus("0");
|
||||
if (loginUser != null) {
|
||||
inst.setApplyUser(loginUser.getUsername());
|
||||
inst.setApplyUserName(loginUser.getRealname());
|
||||
}
|
||||
inst.setApplyTime(new Date());
|
||||
inst.setTenantId(MesXslTenantUtils.resolveTenantId(flow.getTenantId()));
|
||||
// 处理人解析、节点进度初始化、卡片发送统一由 IMesXslApprovalHandleService.enterFirstNode 完成
|
||||
return inst;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package org.jeecg.modules.xslmes.approval.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* MES 审批流定义
|
||||
* 钉钉式可视化审批流设计,绑定 MES 业务单据。
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】新增审批流可视化设计
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("mes_xsl_approval_flow")
|
||||
@Schema(description = "MES审批流定义")
|
||||
public class MesXslApprovalFlow extends JeecgEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "审批流名称")
|
||||
private String flowName;
|
||||
|
||||
@Schema(description = "绑定单据表名")
|
||||
@Dict(dicCode = "mes_xsl_approval_biz_doc")
|
||||
private String bizTable;
|
||||
|
||||
@Schema(description = "绑定单据中文名(冗余展示)")
|
||||
private String bizTableName;
|
||||
|
||||
@Schema(description = "单据标题字段名(发起选单据时展示)")
|
||||
private String titleField;
|
||||
|
||||
@Schema(description = "对应功能页面前端路由(发起审批悬浮按钮仅在该页显示)")
|
||||
private String routePath;
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】驳回/撤销恢复初始状态-----
|
||||
@Schema(description = "业务单据状态字段名(驳回/撤销时回写其发起时原值)")
|
||||
private String statusField;
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】驳回/撤销恢复初始状态-----
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】超时提醒配置-----
|
||||
@Schema(description = "超时提醒小时数(0=不提醒),默认24")
|
||||
private Integer timeoutHours;
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】超时提醒配置-----
|
||||
|
||||
@Schema(description = "流程设计JSON(钉钉式节点树)")
|
||||
private String flowConfig;
|
||||
|
||||
@Schema(description = "状态:0草稿 1已发布 2已停用")
|
||||
@Dict(dicCode = "mes_xsl_approval_flow_status")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Double sortNo;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "逻辑删除:0正常 1已删除")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "所属部门编码")
|
||||
private String sysOrgCode;
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package org.jeecg.modules.xslmes.approval.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* MES 审批实例(本期仅记录发起,不含办理)
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】发起审批运行时
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("mes_xsl_approval_instance")
|
||||
@Schema(description = "MES审批实例")
|
||||
public class MesXslApprovalInstance extends JeecgEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "审批流定义ID")
|
||||
private String flowId;
|
||||
|
||||
@Schema(description = "审批流名称")
|
||||
private String flowName;
|
||||
|
||||
@Schema(description = "业务单据表名")
|
||||
private String bizTable;
|
||||
|
||||
@Schema(description = "业务单据中文名")
|
||||
private String bizTableName;
|
||||
|
||||
@Schema(description = "业务单据记录ID")
|
||||
private String bizDataId;
|
||||
|
||||
@Schema(description = "业务单据展示标题")
|
||||
private String bizTitle;
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】驳回/撤销恢复初始状态-----
|
||||
@Schema(description = "业务单据状态字段名(发起时快照)")
|
||||
private String statusField;
|
||||
|
||||
@Schema(description = "发起审批时业务状态原值(驳回/撤销回写)")
|
||||
private String originStatus;
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】驳回/撤销恢复初始状态-----
|
||||
|
||||
@Schema(description = "当前节点ID")
|
||||
private String currentNodeId;
|
||||
|
||||
@Schema(description = "当前节点名称")
|
||||
private String currentNodeName;
|
||||
|
||||
@Schema(description = "当前处理人(username逗号分隔)")
|
||||
private String currentHandlers;
|
||||
|
||||
@Schema(description = "当前处理人展示文本")
|
||||
private String currentHandlersText;
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】审批办理/流转(会签/或签/依次)进度与历史-----
|
||||
@Schema(description = "当前节点处理进度JSON(nodeId/mode/tasks)")
|
||||
private String nodeProgress;
|
||||
|
||||
@Schema(description = "审批历史JSON数组")
|
||||
private String history;
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】审批办理/流转(会签/或签/依次)进度与历史-----
|
||||
|
||||
@Schema(description = "状态:0审批中 1已通过 2已驳回 3已撤销")
|
||||
@Dict(dicCode = "mes_xsl_approval_instance_status")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "发起人username")
|
||||
private String applyUser;
|
||||
|
||||
@Schema(description = "发起人姓名")
|
||||
private String applyUserName;
|
||||
|
||||
@Schema(description = "发起时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date applyTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】乐观锁防并发写-----
|
||||
@com.baomidou.mybatisplus.annotation.Version
|
||||
@Schema(description = "乐观锁版本号")
|
||||
private Integer version;
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】乐观锁防并发写-----
|
||||
|
||||
@Schema(description = "逻辑删除:0正常 1已删除")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "所属部门编码")
|
||||
private String sysOrgCode;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.jeecg.modules.xslmes.approval.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.xslmes.approval.entity.MesXslApprovalFlow;
|
||||
|
||||
/**
|
||||
* MES 审批流定义 Mapper
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】新增审批流可视化设计
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslApprovalFlowMapper extends BaseMapper<MesXslApprovalFlow> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.jeecg.modules.xslmes.approval.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.xslmes.approval.entity.MesXslApprovalInstance;
|
||||
|
||||
/**
|
||||
* MES 审批实例 Mapper
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】发起审批运行时
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslApprovalInstanceMapper extends BaseMapper<MesXslApprovalInstance> {
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.jeecg.modules.xslmes.approval.scheduler;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.modules.xslmes.approval.service.IMesXslApprovalHandleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 审批超时提醒定时任务。
|
||||
* 每小时扫描一次所有审批中的实例,对超过各流程配置 timeout_hours 仍未处理的节点
|
||||
* 向当前处理人发送 IM 提醒,同一实例在同一超时周期内只提醒一次。
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流完善】超时提醒调度器
|
||||
*/
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】超时提醒调度器-----
|
||||
@Component
|
||||
@Slf4j
|
||||
public class MesXslApprovalTimeoutScheduler {
|
||||
|
||||
@Autowired
|
||||
private IMesXslApprovalHandleService approvalHandleService;
|
||||
|
||||
/**
|
||||
* 每小时整点执行:扫描超时未处理的审批实例并发送提醒。
|
||||
* 使用 fixedDelay 避免并发执行;应用启动 5 分钟后开始首次执行。
|
||||
*/
|
||||
@Scheduled(initialDelayString = "PT5M", fixedDelayString = "PT1H")
|
||||
public void remindTimeout() {
|
||||
log.info("开始扫描审批超时实例...");
|
||||
try {
|
||||
approvalHandleService.remindTimeoutInstances();
|
||||
} catch (Exception e) {
|
||||
log.warn("审批超时扫描异常", e);
|
||||
}
|
||||
log.info("审批超时实例扫描完成");
|
||||
}
|
||||
}
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】超时提醒调度器-----
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.jeecg.modules.xslmes.approval.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.approval.entity.MesXslApprovalFlow;
|
||||
|
||||
/**
|
||||
* MES 审批流定义 Service
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】新增审批流可视化设计
|
||||
*/
|
||||
public interface IMesXslApprovalFlowService extends IService<MesXslApprovalFlow> {
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package org.jeecg.modules.xslmes.approval.service;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.modules.xslmes.approval.entity.MesXslApprovalInstance;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* MES 审批办理/流转引擎。
|
||||
* 负责:发起后进入首节点、审批通过/驳回的流转推进(支持会签/或签/依次)、查看单据全字段详情。
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】审批办理/流转
|
||||
*/
|
||||
public interface IMesXslApprovalHandleService {
|
||||
|
||||
/**
|
||||
* 发起后进入首个审批节点:解析处理人、初始化节点进度、发送审批卡片。
|
||||
* 实例需已先行 save(带 id)。
|
||||
*/
|
||||
void enterFirstNode(MesXslApprovalInstance inst, LoginUser applyUser);
|
||||
|
||||
/**
|
||||
* 审批通过:标记当前处理人任务完成,按节点 multiMode 判断是否流转到下一节点。
|
||||
*/
|
||||
Result<String> approve(String instanceId, String comment, LoginUser user);
|
||||
|
||||
/**
|
||||
* 驳回:任一处理人驳回即终止流程,通知发起人。
|
||||
*/
|
||||
Result<String> reject(String instanceId, String reason, LoginUser user);
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】发起人撤销-----
|
||||
/**
|
||||
* 撤销:仅发起人本人在审批中可撤回,流程终止并将业务单据恢复到发起时状态。
|
||||
*/
|
||||
Result<String> cancel(String instanceId, String reason, LoginUser user);
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】发起人撤销-----
|
||||
|
||||
/**
|
||||
* 查看单据全部字段 + 审批进度/历史,供 IM 卡片"查看详情"弹窗使用。
|
||||
*/
|
||||
Map<String, Object> detail(String instanceId, LoginUser user);
|
||||
|
||||
/**
|
||||
* 轻量状态查询:供 IM 卡片实时判断是否仍可办理(旧节点卡片置灰)。
|
||||
* 返回 status/statusText/currentNodeId/currentNodeName/canApprove。
|
||||
*/
|
||||
Map<String, Object> statusInfo(String instanceId, LoginUser user);
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】催办接口-----
|
||||
/**
|
||||
* 催办:发起人向当前处理人发送一次性催办提醒,同一实例每小时最多催一次。
|
||||
*/
|
||||
Result<String> urge(String instanceId, LoginUser user);
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】催办接口-----
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】待办列表查询-----
|
||||
/**
|
||||
* 查询当前用户的待办审批列表(状态为审批中且当前处理人包含该用户)。
|
||||
*/
|
||||
List<Map<String, Object>> pendingList(LoginUser user);
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】待办列表查询-----
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】超时提醒(调度器调用)-----
|
||||
/**
|
||||
* 扫描超时未处理的审批实例并向当前处理人发送提醒(由定时任务调用)。
|
||||
*/
|
||||
void remindTimeoutInstances();
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】超时提醒(调度器调用)-----
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.jeecg.modules.xslmes.approval.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.approval.entity.MesXslApprovalInstance;
|
||||
|
||||
/**
|
||||
* MES 审批实例 Service
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】发起审批运行时
|
||||
*/
|
||||
public interface IMesXslApprovalInstanceService extends IService<MesXslApprovalInstance> {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.xslmes.approval.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.approval.entity.MesXslApprovalFlow;
|
||||
import org.jeecg.modules.xslmes.approval.mapper.MesXslApprovalFlowMapper;
|
||||
import org.jeecg.modules.xslmes.approval.service.IMesXslApprovalFlowService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* MES 审批流定义 ServiceImpl
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】新增审批流可视化设计
|
||||
*/
|
||||
@Service
|
||||
public class MesXslApprovalFlowServiceImpl extends ServiceImpl<MesXslApprovalFlowMapper, MesXslApprovalFlow> implements IMesXslApprovalFlowService {
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.xslmes.approval.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.approval.entity.MesXslApprovalInstance;
|
||||
import org.jeecg.modules.xslmes.approval.mapper.MesXslApprovalInstanceMapper;
|
||||
import org.jeecg.modules.xslmes.approval.service.IMesXslApprovalInstanceService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* MES 审批实例 ServiceImpl
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流设计】发起审批运行时
|
||||
*/
|
||||
@Service
|
||||
public class MesXslApprovalInstanceServiceImpl extends ServiceImpl<MesXslApprovalInstanceMapper, MesXslApprovalInstance> implements IMesXslApprovalInstanceService {
|
||||
}
|
||||
@@ -0,0 +1,546 @@
|
||||
package org.jeecg.modules.xslmes.common;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpec;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpecLine;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslFormulaSpecEditChangeItemVO;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslMixingSpecPage;
|
||||
|
||||
/**
|
||||
* 配方示方修改日志:快照序列化与差异对比
|
||||
*/
|
||||
public final class MesXslFormulaSpecEditLogDiffUtil {
|
||||
|
||||
public static final String SECTION_MAIN = "main";
|
||||
public static final String SECTION_LINE = "line";
|
||||
public static final String SECTION_MATERIAL = "material";
|
||||
public static final String SECTION_STEP = "step";
|
||||
public static final String SECTION_DOWN_STEP = "downStep";
|
||||
public static final String SECTION_TCU = "tcu";
|
||||
|
||||
private static final Set<String> IGNORE_FIELDS = Set.of(
|
||||
"id",
|
||||
"createBy",
|
||||
"createTime",
|
||||
"updateBy",
|
||||
"updateTime",
|
||||
"delFlag",
|
||||
"tenantId",
|
||||
"sysOrgCode",
|
||||
"createBy_dictText",
|
||||
"lineList",
|
||||
"materialList",
|
||||
"stepList",
|
||||
"downStepList",
|
||||
"tcuList");
|
||||
|
||||
private static final Map<String, String> FORMULA_MAIN_LABELS = buildFormulaMainLabels();
|
||||
private static final Map<String, String> MIXING_MAIN_LABELS = buildMixingMainLabels();
|
||||
private static final Map<String, String> SECTION_LABELS = Map.of(
|
||||
SECTION_MAIN, "主表",
|
||||
SECTION_LINE, "配合明细",
|
||||
SECTION_MATERIAL, "橡胶及配合剂",
|
||||
SECTION_STEP, "混合步骤",
|
||||
SECTION_DOWN_STEP, "下密炼机条件",
|
||||
SECTION_TCU, "TCU温度条件");
|
||||
|
||||
private static final Map<String, Map<String, String>> SECTION_FIELD_LABELS = buildSectionFieldLabels();
|
||||
private static final Map<String, String[]> SECTION_SUMMARY_FIELDS = buildSectionSummaryFields();
|
||||
|
||||
private MesXslFormulaSpecEditLogDiffUtil() {}
|
||||
|
||||
public static String buildFormulaSnapshotJson(MesXslFormulaSpec main, List<MesXslFormulaSpecLine> lineList) {
|
||||
Map<String, Object> snapshot = new LinkedHashMap<>(2);
|
||||
snapshot.put(SECTION_MAIN, toJsonObject(main));
|
||||
snapshot.put(SECTION_LINE, lineList == null ? List.of() : lineList);
|
||||
return toJson(snapshot);
|
||||
}
|
||||
|
||||
public static String buildMixingSnapshotJson(MesXslMixingSpecPage page) {
|
||||
if (page == null) {
|
||||
return null;
|
||||
}
|
||||
Map<String, Object> snapshot = new LinkedHashMap<>(5);
|
||||
snapshot.put(SECTION_MAIN, toJsonObject(page));
|
||||
snapshot.put(SECTION_MATERIAL, page.getMaterialList() == null ? List.of() : page.getMaterialList());
|
||||
snapshot.put(SECTION_STEP, page.getStepList() == null ? List.of() : page.getStepList());
|
||||
snapshot.put(SECTION_DOWN_STEP, page.getDownStepList() == null ? List.of() : page.getDownStepList());
|
||||
snapshot.put(SECTION_TCU, page.getTcuList() == null ? List.of() : page.getTcuList());
|
||||
return toJson(snapshot);
|
||||
}
|
||||
|
||||
public static List<MesXslFormulaSpecEditChangeItemVO> compare(
|
||||
String specType, String beforeSnapshot, String afterSnapshot) {
|
||||
List<MesXslFormulaSpecEditChangeItemVO> items = new ArrayList<>();
|
||||
JSONObject before = parseObject(beforeSnapshot);
|
||||
JSONObject after = parseObject(afterSnapshot);
|
||||
Map<String, String> mainLabels = SPEC_TYPE_MIXING.equals(specType) ? MIXING_MAIN_LABELS : FORMULA_MAIN_LABELS;
|
||||
compareMainSection(items, before == null ? null : before.getJSONObject(SECTION_MAIN),
|
||||
after == null ? null : after.getJSONObject(SECTION_MAIN), mainLabels);
|
||||
if (SPEC_TYPE_FORMULA.equals(specType)) {
|
||||
compareChildListSection(items, SECTION_LINE, before, after);
|
||||
} else {
|
||||
compareChildListSection(items, SECTION_MATERIAL, before, after);
|
||||
compareChildListSection(items, SECTION_STEP, before, after);
|
||||
compareChildListSection(items, SECTION_DOWN_STEP, before, after);
|
||||
compareChildListSection(items, SECTION_TCU, before, after);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
public static String buildSummary(String actionType, List<MesXslFormulaSpecEditChangeItemVO> items) {
|
||||
if ("create".equals(actionType)) {
|
||||
return "新增示方";
|
||||
}
|
||||
if ("delete".equals(actionType)) {
|
||||
return "删除示方";
|
||||
}
|
||||
if (items == null || items.isEmpty()) {
|
||||
return "内容无变化";
|
||||
}
|
||||
Set<String> labels = new LinkedHashSet<>();
|
||||
for (MesXslFormulaSpecEditChangeItemVO item : items) {
|
||||
if (SECTION_MAIN.equals(item.getSection()) && StringUtils.isNotBlank(item.getFieldLabel())) {
|
||||
labels.add(item.getFieldLabel());
|
||||
} else if (StringUtils.isNotBlank(item.getSectionLabel())) {
|
||||
labels.add(item.getSectionLabel());
|
||||
}
|
||||
}
|
||||
if (labels.isEmpty()) {
|
||||
return "内容有变更";
|
||||
}
|
||||
String joined = String.join("、", labels);
|
||||
if (joined.length() > 180) {
|
||||
joined = joined.substring(0, 177) + "...";
|
||||
}
|
||||
return "修改:" + joined;
|
||||
}
|
||||
|
||||
private static void compareMainSection(
|
||||
List<MesXslFormulaSpecEditChangeItemVO> items,
|
||||
JSONObject before,
|
||||
JSONObject after,
|
||||
Map<String, String> labels) {
|
||||
Set<String> keys = new LinkedHashSet<>();
|
||||
if (before != null) {
|
||||
keys.addAll(before.keySet());
|
||||
}
|
||||
if (after != null) {
|
||||
keys.addAll(after.keySet());
|
||||
}
|
||||
for (String key : keys) {
|
||||
if (IGNORE_FIELDS.contains(key)) {
|
||||
continue;
|
||||
}
|
||||
String beforeVal = formatValue(before == null ? null : before.get(key));
|
||||
String afterVal = formatValue(after == null ? null : after.get(key));
|
||||
if (Objects.equals(beforeVal, afterVal)) {
|
||||
continue;
|
||||
}
|
||||
MesXslFormulaSpecEditChangeItemVO item = new MesXslFormulaSpecEditChangeItemVO();
|
||||
item.setSection(SECTION_MAIN);
|
||||
item.setSectionLabel(SECTION_LABELS.get(SECTION_MAIN));
|
||||
item.setFieldKey(key);
|
||||
item.setFieldLabel(labels.getOrDefault(key, key));
|
||||
item.setBeforeValue(beforeVal);
|
||||
item.setAfterValue(afterVal);
|
||||
items.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
private static void compareChildListSection(
|
||||
List<MesXslFormulaSpecEditChangeItemVO> items, String section, JSONObject before, JSONObject after) {
|
||||
List<JSONObject> beforeList = toJsonObjectList(before == null ? null : before.get(section));
|
||||
List<JSONObject> afterList = toJsonObjectList(after == null ? null : after.get(section));
|
||||
if (Objects.equals(normalizeListJson(beforeList), normalizeListJson(afterList))) {
|
||||
return;
|
||||
}
|
||||
Map<String, String> fieldLabels = SECTION_FIELD_LABELS.getOrDefault(section, Map.of());
|
||||
String[] summaryFields = SECTION_SUMMARY_FIELDS.getOrDefault(section, new String[0]);
|
||||
Map<String, JSONObject> beforeMap = indexRows(beforeList);
|
||||
Map<String, JSONObject> afterMap = indexRows(afterList);
|
||||
Set<String> rowKeys = new LinkedHashSet<>();
|
||||
rowKeys.addAll(beforeMap.keySet());
|
||||
rowKeys.addAll(afterMap.keySet());
|
||||
for (String rowKey : rowKeys) {
|
||||
JSONObject beforeRow = beforeMap.get(rowKey);
|
||||
JSONObject afterRow = afterMap.get(rowKey);
|
||||
String rowLabel = formatRowLabel(rowKey);
|
||||
if (beforeRow == null && afterRow != null) {
|
||||
addChangeItem(items, section, rowKey + "_add", rowLabel + "(新增)", "",
|
||||
formatRowSummary(afterRow, fieldLabels, summaryFields));
|
||||
continue;
|
||||
}
|
||||
if (beforeRow != null && afterRow == null) {
|
||||
addChangeItem(items, section, rowKey + "_del", rowLabel + "(删除)",
|
||||
formatRowSummary(beforeRow, fieldLabels, summaryFields), "");
|
||||
continue;
|
||||
}
|
||||
compareRowFields(items, section, rowKey, rowLabel, beforeRow, afterRow, fieldLabels);
|
||||
}
|
||||
}
|
||||
|
||||
private static void compareRowFields(
|
||||
List<MesXslFormulaSpecEditChangeItemVO> items,
|
||||
String section,
|
||||
String rowKey,
|
||||
String rowLabel,
|
||||
JSONObject beforeRow,
|
||||
JSONObject afterRow,
|
||||
Map<String, String> fieldLabels) {
|
||||
Set<String> keys = new LinkedHashSet<>();
|
||||
keys.addAll(beforeRow.keySet());
|
||||
keys.addAll(afterRow.keySet());
|
||||
for (String key : keys) {
|
||||
if (IGNORE_FIELDS.contains(key) || isRowMetaField(key)) {
|
||||
continue;
|
||||
}
|
||||
String beforeVal = formatValue(beforeRow.get(key));
|
||||
String afterVal = formatValue(afterRow.get(key));
|
||||
if (Objects.equals(beforeVal, afterVal)) {
|
||||
continue;
|
||||
}
|
||||
addChangeItem(
|
||||
items,
|
||||
section,
|
||||
rowKey + "_" + key,
|
||||
rowLabel + "·" + fieldLabels.getOrDefault(key, key),
|
||||
beforeVal,
|
||||
afterVal);
|
||||
}
|
||||
}
|
||||
|
||||
private static void addChangeItem(
|
||||
List<MesXslFormulaSpecEditChangeItemVO> items,
|
||||
String section,
|
||||
String fieldKey,
|
||||
String fieldLabel,
|
||||
String beforeValue,
|
||||
String afterValue) {
|
||||
MesXslFormulaSpecEditChangeItemVO item = new MesXslFormulaSpecEditChangeItemVO();
|
||||
item.setSection(section);
|
||||
item.setSectionLabel(SECTION_LABELS.getOrDefault(section, section));
|
||||
item.setFieldKey(fieldKey);
|
||||
item.setFieldLabel(fieldLabel);
|
||||
item.setBeforeValue(beforeValue);
|
||||
item.setAfterValue(afterValue);
|
||||
items.add(item);
|
||||
}
|
||||
|
||||
/** 按 sortNo 优先、否则按列表序号建立行索引 */
|
||||
private static Map<String, JSONObject> indexRows(List<JSONObject> rows) {
|
||||
Map<String, JSONObject> map = new LinkedHashMap<>();
|
||||
if (rows == null) {
|
||||
return map;
|
||||
}
|
||||
int index = 0;
|
||||
for (JSONObject row : rows) {
|
||||
index++;
|
||||
if (row == null) {
|
||||
continue;
|
||||
}
|
||||
Integer sortNo = row.getInteger("sortNo");
|
||||
String key = sortNo != null ? "sort_" + sortNo : "idx_" + index;
|
||||
map.put(key, row);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private static String formatRowLabel(String rowKey) {
|
||||
if (rowKey.startsWith("sort_")) {
|
||||
return "第" + rowKey.substring(5) + "行";
|
||||
}
|
||||
if (rowKey.startsWith("idx_")) {
|
||||
return "第" + rowKey.substring(4) + "行";
|
||||
}
|
||||
return rowKey;
|
||||
}
|
||||
|
||||
private static String formatRowSummary(JSONObject row, Map<String, String> fieldLabels, String[] summaryFields) {
|
||||
if (row == null || row.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
List<String> parts = new ArrayList<>();
|
||||
for (String key : summaryFields) {
|
||||
String val = formatValue(row.get(key));
|
||||
if (StringUtils.isBlank(val)) {
|
||||
continue;
|
||||
}
|
||||
parts.add(fieldLabels.getOrDefault(key, key) + "=" + val);
|
||||
}
|
||||
if (parts.isEmpty()) {
|
||||
for (String key : fieldLabels.keySet()) {
|
||||
String val = formatValue(row.get(key));
|
||||
if (StringUtils.isBlank(val)) {
|
||||
continue;
|
||||
}
|
||||
parts.add(fieldLabels.get(key) + "=" + val);
|
||||
if (parts.size() >= 4) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return String.join(",", parts);
|
||||
}
|
||||
|
||||
private static boolean isRowMetaField(String key) {
|
||||
return "formulaSpecId".equals(key) || "mixingSpecId".equals(key);
|
||||
}
|
||||
|
||||
private static List<JSONObject> toJsonObjectList(Object listObj) {
|
||||
if (listObj == null) {
|
||||
return List.of();
|
||||
}
|
||||
JSONArray array = listObj instanceof JSONArray jsonArray ? jsonArray : JSON.parseArray(toJson(listObj));
|
||||
if (array == null || array.isEmpty()) {
|
||||
return List.of();
|
||||
}
|
||||
List<JSONObject> rows = new ArrayList<>(array.size());
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
Object element = array.get(i);
|
||||
if (element instanceof JSONObject jsonObject) {
|
||||
rows.add(jsonObject);
|
||||
} else if (element != null) {
|
||||
rows.add(JSON.parseObject(toJson(element)));
|
||||
}
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
private static Map<String, Map<String, String>> buildSectionFieldLabels() {
|
||||
Map<String, Map<String, String>> map = new LinkedHashMap<>();
|
||||
map.put(SECTION_LINE, buildFormulaLineLabels());
|
||||
map.put(SECTION_MATERIAL, buildMixingMaterialLabels());
|
||||
map.put(SECTION_STEP, buildMixingStepLabels());
|
||||
map.put(SECTION_DOWN_STEP, buildMixingStepLabels());
|
||||
map.put(SECTION_TCU, buildMixingTcuLabels());
|
||||
return map;
|
||||
}
|
||||
|
||||
private static Map<String, String[]> buildSectionSummaryFields() {
|
||||
Map<String, String[]> map = new LinkedHashMap<>();
|
||||
map.put(SECTION_LINE, new String[] {"mixerMaterialName", "mixerMaterialCode", "phr", "step"});
|
||||
map.put(SECTION_MATERIAL, new String[] {"mixerMaterialName", "unitWeight", "accumWeight", "seqNo"});
|
||||
map.put(SECTION_STEP, new String[] {"actionName", "actionSec", "tempC", "speedRpm"});
|
||||
map.put(SECTION_DOWN_STEP, new String[] {"actionName", "actionSec", "tempC", "speedRpm"});
|
||||
map.put(SECTION_TCU, new String[] {"sectionType", "frontRotorTemp", "rearRotorTemp", "drugWeighPos"});
|
||||
return map;
|
||||
}
|
||||
|
||||
private static Map<String, String> buildFormulaLineLabels() {
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
map.put("sortNo", "序号");
|
||||
map.put("phr", "PHR");
|
||||
map.put("mixerMaterialCode", "物料编码");
|
||||
map.put("mixerMaterialName", "物料名称");
|
||||
map.put("materialDesc", "物料描述");
|
||||
map.put("step", "STEP");
|
||||
map.put("weighMode", "称量方式");
|
||||
map.put("weightPercent", "重量%");
|
||||
map.put("volume", "体积");
|
||||
map.put("remark", "备注");
|
||||
for (int i = 1; i <= 7; i++) {
|
||||
map.put("stage" + i, "混合段" + i);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private static Map<String, String> buildMixingMaterialLabels() {
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
map.put("sortNo", "序号");
|
||||
map.put("materialMajor", "物料大类");
|
||||
map.put("materialMinor", "物料小类");
|
||||
map.put("materialKind", "种类");
|
||||
map.put("mixerMaterialName", "物料名称");
|
||||
map.put("mixerMaterialDesc", "物料描述");
|
||||
map.put("unitWeight", "单重");
|
||||
map.put("accumWeight", "累计");
|
||||
map.put("seqNo", "顺序");
|
||||
return map;
|
||||
}
|
||||
|
||||
private static Map<String, String> buildMixingStepLabels() {
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
map.put("sortNo", "序号");
|
||||
map.put("actionName", "动作");
|
||||
map.put("actionSec", "时间(秒)");
|
||||
map.put("protectSec", "保护时间");
|
||||
map.put("tempC", "温度(℃)");
|
||||
map.put("powerKw", "功率(Kw)");
|
||||
map.put("energyKwh", "能量(Kwh)");
|
||||
map.put("comboMode", "组合");
|
||||
map.put("speedRpm", "转速(rpm)");
|
||||
map.put("pressureMpa", "压力(Mpa)");
|
||||
map.put("boltPercent", "栓(%)");
|
||||
return map;
|
||||
}
|
||||
|
||||
private static Map<String, String> buildMixingTcuLabels() {
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
map.put("sortNo", "序号");
|
||||
map.put("sectionType", "区分");
|
||||
map.put("frontRotorTemp", "前转子温度");
|
||||
map.put("rearRotorTemp", "后转子温度");
|
||||
map.put("frontChamberTemp", "前混炼室温度");
|
||||
map.put("rearChamberTemp", "后混炼室温度");
|
||||
map.put("topPlugTemp", "上下顶栓温度");
|
||||
map.put("drugWeighPos", "药品称量位置");
|
||||
return map;
|
||||
}
|
||||
|
||||
private static JSONObject parseObject(String json) {
|
||||
if (StringUtils.isBlank(json)) {
|
||||
return null;
|
||||
}
|
||||
return JSON.parseObject(json);
|
||||
}
|
||||
|
||||
private static JSONObject toJsonObject(Object obj) {
|
||||
if (obj == null) {
|
||||
return new JSONObject();
|
||||
}
|
||||
JSONObject jsonObject = JSON.parseObject(toJson(obj));
|
||||
for (String ignore : IGNORE_FIELDS) {
|
||||
jsonObject.remove(ignore);
|
||||
}
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
private static String toJson(Object obj) {
|
||||
return JSON.toJSONStringWithDateFormat(
|
||||
obj, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue);
|
||||
}
|
||||
|
||||
private static String normalizeListJson(Object listObj) {
|
||||
if (listObj == null) {
|
||||
return "[]";
|
||||
}
|
||||
if (listObj instanceof List<?> list) {
|
||||
return normalizeListJson(list);
|
||||
}
|
||||
return toJson(listObj);
|
||||
}
|
||||
|
||||
private static String normalizeListJson(List<JSONObject> rows) {
|
||||
if (rows == null || rows.isEmpty()) {
|
||||
return "[]";
|
||||
}
|
||||
List<JSONObject> normalized = new ArrayList<>(rows.size());
|
||||
for (JSONObject row : rows) {
|
||||
if (row == null) {
|
||||
continue;
|
||||
}
|
||||
JSONObject copy = new JSONObject(row);
|
||||
for (String ignore : IGNORE_FIELDS) {
|
||||
copy.remove(ignore);
|
||||
}
|
||||
copy.remove("formulaSpecId");
|
||||
copy.remove("mixingSpecId");
|
||||
normalized.add(copy);
|
||||
}
|
||||
return toJson(normalized);
|
||||
}
|
||||
|
||||
private static String formatValue(Object value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
if (value instanceof BigDecimal decimal) {
|
||||
return decimal.stripTrailingZeros().toPlainString();
|
||||
}
|
||||
if (value instanceof Date date) {
|
||||
return toJson(date).replace("\"", "");
|
||||
}
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
private static Map<String, String> buildFormulaMainLabels() {
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
map.put("category", "分类");
|
||||
map.put("specCode", "示方编号");
|
||||
map.put("rubberCode", "胶料代号");
|
||||
map.put("rubberMaterialId", "胶料ID");
|
||||
map.put("basicFormula", "基本配合");
|
||||
map.put("issueDate", "发行日期");
|
||||
map.put("purpose", "用途");
|
||||
map.put("issueNumber", "发行编号");
|
||||
map.put("mixingStages", "混合段数");
|
||||
map.put("mixingMachine", "混合机器");
|
||||
map.put("issueDeptId", "发行部门ID");
|
||||
map.put("issueDeptName", "发行部门");
|
||||
map.put("status", "状态");
|
||||
map.put("aRubberTotalPhr", "A胶合计PHR");
|
||||
map.put("totalPhr", "总PHR");
|
||||
map.put("naturalRubber", "天然橡胶");
|
||||
map.put("syntheticRubber", "合成橡胶");
|
||||
map.put("totalAmount", "总量");
|
||||
map.put("weightUnitPrice", "重量单价");
|
||||
map.put("volumeUnitPrice", "体积单价");
|
||||
map.put("qRubberSg", "Q胶比重");
|
||||
map.put("aRubberSg", "A胶比重");
|
||||
map.put("proofreadBy", "校对人");
|
||||
map.put("proofreadTime", "校对时间");
|
||||
map.put("auditBy", "审核人");
|
||||
map.put("auditTime", "审核时间");
|
||||
map.put("approveBy", "批准人");
|
||||
map.put("approveTime", "批准时间");
|
||||
for (int i = 1; i <= 7; i++) {
|
||||
map.put("stage" + i + "Total", "混合段" + i + "合计");
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private static Map<String, String> buildMixingMainLabels() {
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
map.put("specName", "规格");
|
||||
map.put("purpose", "用途");
|
||||
map.put("machineId", "机台ID");
|
||||
map.put("machineName", "机台");
|
||||
map.put("makeDate", "制作日期");
|
||||
map.put("issueNumber", "发行编号");
|
||||
map.put("convertFactor", "换算系数");
|
||||
map.put("fillVolume", "填充体积");
|
||||
map.put("recycleCarbonSec", "回收炭黑(秒)");
|
||||
map.put("motherRubberSg", "母胶比重");
|
||||
map.put("finalRubberSg", "终炼胶比重");
|
||||
map.put("applyFactory", "适用工厂");
|
||||
map.put("stageCount", "段数");
|
||||
map.put("pureMixSec", "纯混炼时间(秒)");
|
||||
map.put("recycleCarbonKg", "回收炭黑(kg)");
|
||||
map.put("autoSmallPrintSetting", "自动小票打印设置");
|
||||
map.put("setTrainCount", "设定车次");
|
||||
map.put("sideWallWaterTemp", "侧壁水温");
|
||||
map.put("overtimeDischargeSec", "超时排胶(秒)");
|
||||
map.put("overtempDischargeSec", "超温排胶(秒)");
|
||||
map.put("overtempDischargeTemp", "超温排胶温度");
|
||||
map.put("doorWaterTemp", "门水温");
|
||||
map.put("rotorWaterTemp", "转子水温");
|
||||
map.put("maxFeedTemp", "最高投料温度");
|
||||
map.put("draftBy", "编制人");
|
||||
map.put("draftTime", "编制时间");
|
||||
map.put("proofreadBy", "校对人");
|
||||
map.put("proofreadTime", "校对时间");
|
||||
map.put("auditBy", "审核人");
|
||||
map.put("auditTime", "审核时间");
|
||||
map.put("approveBy", "批准人");
|
||||
map.put("approveTime", "批准时间");
|
||||
map.put("changeDate", "变更日期");
|
||||
return map;
|
||||
}
|
||||
|
||||
public static final String SPEC_TYPE_FORMULA = "formula";
|
||||
public static final String SPEC_TYPE_MIXING = "mixing";
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.jeecg.modules.xslmes.common;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.TenantConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
|
||||
/**
|
||||
* MES 租户解析工具(xslmes 模块内统一入口,避免各 Service 重复依赖 TokenUtils)
|
||||
*/
|
||||
public final class MesXslTenantUtils {
|
||||
|
||||
private MesXslTenantUtils() {}
|
||||
|
||||
/**
|
||||
* 解析租户 ID:优先实体上下文,其次 TenantContext,最后从当前请求头/参数读取
|
||||
*/
|
||||
public static Integer resolveTenantId(Integer contextTenantId) {
|
||||
if (contextTenantId != null) {
|
||||
return contextTenantId;
|
||||
}
|
||||
String tenantId = getTenantIdString();
|
||||
if (oConvertUtils.isEmpty(tenantId)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(tenantId.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** 尽力解析租户 ID,无法解析时返回 0 */
|
||||
public static int resolveTenantIdBestEffort() {
|
||||
return oConvertUtils.getInt(getTenantIdString(), 0);
|
||||
}
|
||||
|
||||
private static String getTenantIdString() {
|
||||
String tenantId = TenantContext.getTenant();
|
||||
if (oConvertUtils.isNotEmpty(tenantId)) {
|
||||
return tenantId;
|
||||
}
|
||||
try {
|
||||
HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
|
||||
if (request != null) {
|
||||
tenantId = getTenantIdByRequest(request);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
// 非 Web 请求上下文时忽略
|
||||
}
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
/** 与 TokenUtils.getTenantIdByRequest 行为一致 */
|
||||
private static String getTenantIdByRequest(HttpServletRequest request) {
|
||||
String tenantId = request.getParameter(TenantConstant.TENANT_ID);
|
||||
if (tenantId == null) {
|
||||
tenantId = oConvertUtils.getString(request.getHeader(CommonConstant.TENANT_ID));
|
||||
}
|
||||
if (oConvertUtils.isNotEmpty(tenantId) && "undefined".equals(tenantId)) {
|
||||
return null;
|
||||
}
|
||||
return tenantId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.jeecg.modules.xslmes.common;
|
||||
|
||||
/**
|
||||
* MES xslmes 业务常量
|
||||
*/
|
||||
public final class XslMesBizConstants {
|
||||
|
||||
/** 密炼PS类型:原材料检验标准(字典 xslmes_ps_belong) */
|
||||
public static final String PS_TYPE_RAW_INSPECT_STD = "raw_inspect_std";
|
||||
|
||||
/** 胶料快检实验标准审核状态:已批准 */
|
||||
public static final String RUBBER_QUICK_TEST_STD_AUDIT_APPROVED = "1";
|
||||
|
||||
/** 胶料快检实验标准审核状态:草稿 */
|
||||
public static final String RUBBER_QUICK_TEST_STD_AUDIT_DRAFT = "0";
|
||||
|
||||
private XslMesBizConstants() {}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.xslmes.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 启用 Spring @Scheduled,用于审批超时提醒等定时任务。
|
||||
*
|
||||
* @author GHT
|
||||
* @date 2026-05-29 for:【QH-MES审批流完善】启用定时任务支持
|
||||
*/
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】启用定时任务支持-----
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
public class XslMesSchedulingConfig {
|
||||
}
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流完善】启用定时任务支持-----
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,8 @@ import org.jeecg.modules.xslmes.entity.MesXslCustomer;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRawMaterialCard;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRawMaterialEntry;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslSupplier;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialTareStrategy;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslUnit;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslVehicle;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslWarehouse;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslWarehouseArea;
|
||||
@@ -35,6 +37,8 @@ import org.jeecg.modules.xslmes.service.IMesXslCustomerService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRawMaterialCardService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRawMaterialEntryService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslSupplierService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerMaterialTareStrategyService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslUnitService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslVehicleService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslWarehouseAreaService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslWarehouseService;
|
||||
@@ -60,6 +64,8 @@ import org.apache.commons.lang3.StringUtils;
|
||||
* ShiroConfig 白名单:
|
||||
* /xslmes/mesXslVehicle/anon/**
|
||||
* /xslmes/mesXslCustomer/anon/**
|
||||
* /xslmes/mesXslMixerMaterialTareStrategy/anon/**
|
||||
* /xslmes/mesXslUnit/anon/**
|
||||
*/
|
||||
@Tag(name = "桌面端免密接口")
|
||||
@RestController
|
||||
@@ -75,6 +81,8 @@ public class MesXslDesktopAnonController {
|
||||
private final IMesXslRawMaterialCardService rawMaterialCardService;
|
||||
private final IMesXslWarehouseService warehouseService;
|
||||
private final IMesXslWarehouseAreaService warehouseAreaService;
|
||||
private final IMesXslMixerMaterialTareStrategyService tareStrategyService;
|
||||
private final IMesXslUnitService unitService;
|
||||
private final MesXslStompNotifyService stompNotify;
|
||||
private final IPrintBizTemplateBindService printBizTemplateBindService;
|
||||
private final IPrintTemplateService printTemplateService;
|
||||
@@ -390,6 +398,7 @@ public class MesXslDesktopAnonController {
|
||||
QueryWrapper<MesXslWeightRecord> qw = QueryGenerator.initQueryWrapper(mesXslWeightRecord, req.getParameterMap());
|
||||
qw.orderByDesc("create_time");
|
||||
IPage<MesXslWeightRecord> page = weightRecordService.page(new Page<>(pageNo, pageSize), qw);
|
||||
rawMaterialEntryService.fillWeightRecordDerivedFields(page.getRecords());
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@@ -397,7 +406,11 @@ public class MesXslDesktopAnonController {
|
||||
@GetMapping("/xslmes/mesXslWeightRecord/anon/queryById")
|
||||
public Result<MesXslWeightRecord> weightRecordAnonQueryById(@RequestParam(name = "id") String id) {
|
||||
MesXslWeightRecord entity = weightRecordService.getById(id);
|
||||
return entity != null ? Result.OK(entity) : Result.error("未找到对应数据");
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
rawMaterialEntryService.fillWeightRecordDerivedFields(Collections.singletonList(entity));
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@Operation(summary = "磅单-免密添加")
|
||||
@@ -828,6 +841,90 @@ public class MesXslDesktopAnonController {
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
|
||||
// ═══════════════════════════ 密炼物料皮重策略 ═══════════════════════════
|
||||
|
||||
//update-begin---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端免密CRUD-----------
|
||||
@Operation(summary = "密炼物料皮重策略-免密分页列表查询")
|
||||
@GetMapping("/xslmes/mesXslMixerMaterialTareStrategy/anon/list")
|
||||
public Result<IPage<MesXslMixerMaterialTareStrategy>> tareStrategyAnonList(
|
||||
MesXslMixerMaterialTareStrategy model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslMixerMaterialTareStrategy> qw = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
qw.orderByDesc("effective_start_date", "create_time");
|
||||
IPage<MesXslMixerMaterialTareStrategy> page = tareStrategyService.page(new Page<>(pageNo, pageSize), qw);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@Operation(summary = "密炼物料皮重策略-免密通过id查询")
|
||||
@GetMapping("/xslmes/mesXslMixerMaterialTareStrategy/anon/queryById")
|
||||
public Result<MesXslMixerMaterialTareStrategy> tareStrategyAnonQueryById(@RequestParam(name = "id") String id) {
|
||||
MesXslMixerMaterialTareStrategy entity = tareStrategyService.getById(id);
|
||||
return entity != null ? Result.OK(entity) : Result.error("未找到对应数据");
|
||||
}
|
||||
|
||||
@Operation(summary = "密炼物料皮重策略-免密添加")
|
||||
@PostMapping("/xslmes/mesXslMixerMaterialTareStrategy/anon/add")
|
||||
public Result<String> tareStrategyAnonAdd(@RequestBody MesXslMixerMaterialTareStrategy model) {
|
||||
String err = tareStrategyService.validateBeforeSave(model, false);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
tareStrategyService.save(model);
|
||||
stompNotify.publishMixerMaterialTareStrategyChanged("add", model.getId());
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "密炼物料皮重策略-免密编辑")
|
||||
@RequestMapping(value = "/xslmes/mesXslMixerMaterialTareStrategy/anon/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> tareStrategyAnonEdit(@RequestBody MesXslMixerMaterialTareStrategy model) {
|
||||
if (oConvertUtils.isEmpty(model.getId())) {
|
||||
return Result.error("主键不能为空");
|
||||
}
|
||||
String err = tareStrategyService.validateBeforeSave(model, true);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
boolean ok = tareStrategyService.updateById(model);
|
||||
if (!ok) {
|
||||
return Result.error("数据已被他人修改,请刷新后重试");
|
||||
}
|
||||
stompNotify.publishMixerMaterialTareStrategyChanged("edit", model.getId());
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "密炼物料皮重策略-免密删除")
|
||||
@DeleteMapping("/xslmes/mesXslMixerMaterialTareStrategy/anon/delete")
|
||||
public Result<String> tareStrategyAnonDelete(@RequestParam(name = "id") String id) {
|
||||
tareStrategyService.removeById(id);
|
||||
stompNotify.publishMixerMaterialTareStrategyChanged("delete", id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "密炼物料皮重策略-免密批量删除")
|
||||
@DeleteMapping("/xslmes/mesXslMixerMaterialTareStrategy/anon/deleteBatch")
|
||||
public Result<String> tareStrategyAnonDeleteBatch(@RequestParam(name = "ids") String ids) {
|
||||
tareStrategyService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
stompNotify.publishMixerMaterialTareStrategyChanged("batchDelete", ids);
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
//update-end---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端免密CRUD-----------
|
||||
|
||||
//update-begin---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端单位下拉只读-----------
|
||||
@Operation(summary = "单位-免密分页列表查询(供桌面端单位下拉)")
|
||||
@GetMapping("/xslmes/mesXslUnit/anon/list")
|
||||
public Result<IPage<MesXslUnit>> unitAnonList(
|
||||
MesXslUnit mesXslUnit,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslUnit> qw = QueryGenerator.initQueryWrapper(mesXslUnit, req.getParameterMap());
|
||||
IPage<MesXslUnit> page = unitService.page(new Page<>(pageNo, pageSize), qw);
|
||||
return Result.OK(page);
|
||||
}
|
||||
//update-end---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端单位下拉只读-----------
|
||||
|
||||
// ─────────────────────────── 车辆私有辅助 ────────────────────────────
|
||||
|
||||
private void applyWeightNetAndBillType(MesXslWeightRecord record) {
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslDowntimeMainType;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslProcessOperation;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDowntimeMainTypeService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslProcessOperationService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
@@ -53,6 +54,9 @@ public class MesXslDowntimeMainTypeController extends JeecgController<MesXslDown
|
||||
@Autowired
|
||||
private IMesXslProcessOperationService mesXslProcessOperationService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES停机主类型-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslDowntimeMainType>> queryPageList(
|
||||
@@ -104,6 +108,10 @@ public class MesXslDowntimeMainTypeController extends JeecgController<MesXslDown
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_main_type:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateDowntimeMainTypeDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslDowntimeMainTypeService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -113,6 +121,10 @@ public class MesXslDowntimeMainTypeController extends JeecgController<MesXslDown
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_main_type:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateDowntimeMainTypeDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslDowntimeMainTypeService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
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.Date;
|
||||
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.MesXslDowntimeRecord;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslDowntimeType;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDowntimeRecordService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDowntimeTypeService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentLedgerService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslDowntimeRecordMaintenanceDTO;
|
||||
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/mesXslDowntimeRecord")
|
||||
@Slf4j
|
||||
public class MesXslDowntimeRecordController extends JeecgController<MesXslDowntimeRecord, IMesXslDowntimeRecordService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslDowntimeRecordService mesXslDowntimeRecordService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipmentLedgerService mesXslEquipmentLedgerService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDowntimeTypeService mesXslDowntimeTypeService;
|
||||
|
||||
@Operation(summary = "MES停机记录-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslDowntimeRecord>> queryPageList(
|
||||
MesXslDowntimeRecord model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslDowntimeRecord> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
//update-begin---author:jiangxh ---date:20250602 for:【MES】停机记录列表默认按开始时间倒序-----------
|
||||
queryWrapper.orderByDesc("start_time").orderByDesc("create_time");
|
||||
//update-end---author:jiangxh ---date:20250602 for:【MES】停机记录列表默认按开始时间倒序-----------
|
||||
Page<MesXslDowntimeRecord> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslDowntimeRecord> pageList = mesXslDowntimeRecordService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES停机记录-添加")
|
||||
@Operation(summary = "MES停机记录-添加")
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_record:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslDowntimeRecord model) {
|
||||
//update-begin---author:jiangxh ---date:20250602 for:【MES】停机记录保存前校验-----------
|
||||
String err = validateForSave(model);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
clearMaintenanceFieldsForFormSave(model);
|
||||
//update-end---author:jiangxh ---date:20250602 for:【MES】停机记录保存前校验-----------
|
||||
mesXslDowntimeRecordService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES停机记录-编辑")
|
||||
@Operation(summary = "MES停机记录-编辑")
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_record:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslDowntimeRecord model) {
|
||||
//update-begin---author:jiangxh ---date:20250602 for:【MES】停机记录保存前校验-----------
|
||||
String err = validateForSave(model);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
MesXslDowntimeRecord old = mesXslDowntimeRecordService.getById(model.getId());
|
||||
if (old == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
preserveMaintenanceFields(model, old);
|
||||
//update-end---author:jiangxh ---date:20250602 for:【MES】停机记录保存前校验-----------
|
||||
mesXslDowntimeRecordService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES停机记录-录入维修结果")
|
||||
@Operation(summary = "MES停机记录-录入维修结果")
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_record:edit")
|
||||
@PostMapping(value = "/saveMaintenanceResult")
|
||||
public Result<String> saveMaintenanceResult(@RequestBody MesXslDowntimeRecordMaintenanceDTO dto) {
|
||||
//update-begin---author:jiangxh ---date:20250602 for:【MES】停机记录录入维修结果-----------
|
||||
mesXslDowntimeRecordService.saveMaintenanceResult(dto);
|
||||
//update-end---author:jiangxh ---date:20250602 for:【MES】停机记录录入维修结果-----------
|
||||
return Result.OK("录入成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES停机记录-删除")
|
||||
@Operation(summary = "MES停机记录-通过id删除")
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_record:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslDowntimeRecordService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES停机记录-批量删除")
|
||||
@Operation(summary = "MES停机记录-批量删除")
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_record:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslDowntimeRecordService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES停机记录-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslDowntimeRecord> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslDowntimeRecord entity = mesXslDowntimeRecordService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_record:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslDowntimeRecord model) {
|
||||
return super.exportXls(request, model, MesXslDowntimeRecord.class, "MES停机记录");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_record:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslDowntimeRecord.class);
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20250602 for:【MES】停机记录保存前校验、关联设备与停机类型回填-----------
|
||||
private String validateForSave(MesXslDowntimeRecord model) {
|
||||
if (model == null) {
|
||||
return "参数无效";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getEquipmentLedgerId())) {
|
||||
return "请选择机台";
|
||||
}
|
||||
MesXslEquipmentLedger ledger = mesXslEquipmentLedgerService.getById(model.getEquipmentLedgerId());
|
||||
if (ledger == null
|
||||
|| (ledger.getDelFlag() != null && CommonConstant.DEL_FLAG_1.equals(ledger.getDelFlag()))) {
|
||||
return "所选设备不存在";
|
||||
}
|
||||
model.setEquipmentCode(ledger.getEquipmentCode());
|
||||
model.setEquipmentName(ledger.getEquipmentName());
|
||||
|
||||
if (oConvertUtils.isEmpty(model.getDowntimeTypeId())) {
|
||||
return "请选择停机原因";
|
||||
}
|
||||
MesXslDowntimeType downtimeType = mesXslDowntimeTypeService.getById(model.getDowntimeTypeId());
|
||||
if (downtimeType == null
|
||||
|| (downtimeType.getDelFlag() != null && CommonConstant.DEL_FLAG_1.equals(downtimeType.getDelFlag()))) {
|
||||
return "所选停机类型不存在";
|
||||
}
|
||||
if (!"0".equals(downtimeType.getStatus())) {
|
||||
return "所选停机类型未启用";
|
||||
}
|
||||
model.setDowntimeTypeName(downtimeType.getDowntimeType());
|
||||
|
||||
if (model.getStartTime() == null) {
|
||||
return "开始时间不能为空";
|
||||
}
|
||||
Date endTime = model.getEndTime();
|
||||
if (endTime != null && endTime.before(model.getStartTime())) {
|
||||
return "结束时间不能早于开始时间";
|
||||
}
|
||||
|
||||
if (oConvertUtils.isEmpty(model.getMaintenanceFilledFlag())) {
|
||||
model.setMaintenanceFilledFlag("0");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void clearMaintenanceFieldsForFormSave(MesXslDowntimeRecord model) {
|
||||
model.setEquipmentPartId(null);
|
||||
model.setEquipmentPartName(null);
|
||||
model.setInspectMaintainItemId(null);
|
||||
model.setInspectMaintainItemName(null);
|
||||
model.setMaintenanceResult(null);
|
||||
model.setMaintainerUserId(null);
|
||||
model.setMaintainerUsername(null);
|
||||
model.setMaintainerRealname(null);
|
||||
model.setMaintenanceFilledFlag("0");
|
||||
}
|
||||
|
||||
private void preserveMaintenanceFields(MesXslDowntimeRecord model, MesXslDowntimeRecord old) {
|
||||
model.setEquipmentPartId(old.getEquipmentPartId());
|
||||
model.setEquipmentPartName(old.getEquipmentPartName());
|
||||
model.setInspectMaintainItemId(old.getInspectMaintainItemId());
|
||||
model.setInspectMaintainItemName(old.getInspectMaintainItemName());
|
||||
model.setMaintenanceResult(old.getMaintenanceResult());
|
||||
model.setMaintainerUserId(old.getMaintainerUserId());
|
||||
model.setMaintainerUsername(old.getMaintainerUsername());
|
||||
model.setMaintainerRealname(old.getMaintainerRealname());
|
||||
model.setMaintenanceFilledFlag(
|
||||
oConvertUtils.isEmpty(old.getMaintenanceFilledFlag()) ? "0" : old.getMaintenanceFilledFlag());
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20250602 for:【MES】停机记录保存前校验、关联设备与停机类型回填-----------
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslDowntimeMainType;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslDowntimeType;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslProcessOperation;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDowntimeMainTypeService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDowntimeTypeService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslProcessOperationService;
|
||||
@@ -59,6 +60,9 @@ public class MesXslDowntimeTypeController extends JeecgController<MesXslDowntime
|
||||
@Autowired
|
||||
private IMesXslDowntimeMainTypeService mesXslDowntimeMainTypeService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES停机类型-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslDowntimeType>> queryPageList(
|
||||
@@ -110,6 +114,10 @@ public class MesXslDowntimeTypeController extends JeecgController<MesXslDowntime
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_type:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateDowntimeTypeDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslDowntimeTypeService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -119,6 +127,10 @@ public class MesXslDowntimeTypeController extends JeecgController<MesXslDowntime
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_type:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateDowntimeTypeDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslDowntimeTypeService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.mcs.entity.McsToMesMixAlarm;
|
||||
import org.jeecg.modules.xslmes.mcs.service.IMesXslEquipAlarmRecordService;
|
||||
import org.jeecg.modules.xslmes.mcs.vo.MesXslEquipAlarmRecordVO;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* 设备报警记录(只读,数据来自 SQL Server MCSToMES_MixAlarm)
|
||||
*/
|
||||
@Tag(name = "MES设备报警记录")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslEquipAlarmRecord")
|
||||
@Slf4j
|
||||
public class MesXslEquipAlarmRecordController {
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipAlarmRecordService mesXslEquipAlarmRecordService;
|
||||
|
||||
@Operation(summary = "MES设备报警记录-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipAlarmRecordVO>> queryPageList(
|
||||
McsToMesMixAlarm query,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<MesXslEquipAlarmRecordVO> pageList =
|
||||
mesXslEquipAlarmRecordService.queryPage(query, req.getParameterMap(), pageNo, pageSize);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@Operation(summary = "MES设备报警记录-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslEquipAlarmRecordVO> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslEquipAlarmRecordVO entity = mesXslEquipAlarmRecordService.queryById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_equip_alarm_record:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, McsToMesMixAlarm query) {
|
||||
List<MesXslEquipAlarmRecordVO> exportList =
|
||||
mesXslEquipAlarmRecordService.listForExport(query, request.getParameterMap());
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
LoginUser sysUser = subject != null && subject.getPrincipal() instanceof LoginUser
|
||||
? (LoginUser) subject.getPrincipal()
|
||||
: null;
|
||||
String exporter = sysUser == null || oConvertUtils.isEmpty(sysUser.getRealname()) ? "admin" : sysUser.getRealname();
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "设备报警记录");
|
||||
mv.addObject(NormalExcelConstants.CLASS, MesXslEquipAlarmRecordVO.class);
|
||||
mv.addObject(
|
||||
NormalExcelConstants.PARAMS,
|
||||
new ExportParams("设备报警记录", "导出人:" + exporter, "设备报警记录", ExcelType.XSSF));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
||||
String exportFields = request.getParameter(NormalExcelConstants.EXPORT_FIELDS);
|
||||
if (oConvertUtils.isNotEmpty(exportFields)) {
|
||||
mv.addObject(NormalExcelConstants.EXPORT_FIELDS, exportFields);
|
||||
}
|
||||
return mv;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.mcs.entity.McsToMesMixAlarm;
|
||||
import org.jeecg.modules.xslmes.mcs.service.IMesXslEquipDowntimeRecordService;
|
||||
import org.jeecg.modules.xslmes.mcs.vo.MesXslEquipDowntimeRecordVO;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* 设备停机记录(只读,数据来自 SQL Server MCSToMES_MixAlarm)
|
||||
*/
|
||||
@Tag(name = "MES设备停机记录")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslEquipDowntimeRecord")
|
||||
@Slf4j
|
||||
public class MesXslEquipDowntimeRecordController {
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipDowntimeRecordService mesXslEquipDowntimeRecordService;
|
||||
|
||||
@Operation(summary = "MES设备停机记录-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipDowntimeRecordVO>> queryPageList(
|
||||
McsToMesMixAlarm query,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<MesXslEquipDowntimeRecordVO> pageList =
|
||||
mesXslEquipDowntimeRecordService.queryPage(query, req.getParameterMap(), pageNo, pageSize);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@Operation(summary = "MES设备停机记录-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslEquipDowntimeRecordVO> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslEquipDowntimeRecordVO entity = mesXslEquipDowntimeRecordService.queryById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_equip_downtime_record:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, McsToMesMixAlarm query) {
|
||||
List<MesXslEquipDowntimeRecordVO> exportList =
|
||||
mesXslEquipDowntimeRecordService.listForExport(query, request.getParameterMap());
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
LoginUser sysUser = subject != null && subject.getPrincipal() instanceof LoginUser
|
||||
? (LoginUser) subject.getPrincipal()
|
||||
: null;
|
||||
String exporter = sysUser == null || oConvertUtils.isEmpty(sysUser.getRealname()) ? "admin" : sysUser.getRealname();
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "设备停机记录");
|
||||
mv.addObject(NormalExcelConstants.CLASS, MesXslEquipDowntimeRecordVO.class);
|
||||
mv.addObject(
|
||||
NormalExcelConstants.PARAMS,
|
||||
new ExportParams("设备停机记录", "导出人:" + exporter, "设备停机记录", ExcelType.XSSF));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
||||
String exportFields = request.getParameter(NormalExcelConstants.EXPORT_FIELDS);
|
||||
if (oConvertUtils.isNotEmpty(exportFields)) {
|
||||
mv.addObject(NormalExcelConstants.EXPORT_FIELDS, exportFields);
|
||||
}
|
||||
return mv;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectConfig;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectConfigLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipInspectConfigService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentLedgerService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslInspectMaintainItemService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslEquipInspectConfigPage;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 设备点检配置(主子表)
|
||||
*/
|
||||
@Tag(name = "MES设备点检配置")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslEquipInspectConfig")
|
||||
@Slf4j
|
||||
public class MesXslEquipInspectConfigController
|
||||
extends JeecgController<MesXslEquipInspectConfig, IMesXslEquipInspectConfigService> {
|
||||
|
||||
private static final Set<String> CONFIG_TYPE = Set.of("inspect", "maintain");
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipInspectConfigService mesXslEquipInspectConfigService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipmentLedgerService mesXslEquipmentLedgerService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslInspectMaintainItemService mesXslInspectMaintainItemService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES设备点检配置-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipInspectConfig>> queryPageList(
|
||||
MesXslEquipInspectConfig model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslEquipInspectConfig> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<MesXslEquipInspectConfig> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslEquipInspectConfig> pageList = mesXslEquipInspectConfigService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES设备点检配置-添加")
|
||||
@Operation(summary = "MES设备点检配置-添加")
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_config:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslEquipInspectConfigPage page) {
|
||||
MesXslEquipInspectConfig main = new MesXslEquipInspectConfig();
|
||||
BeanUtils.copyProperties(page, main);
|
||||
//update-begin---author:jiangxh ---date:20260519 for:【MES】设备点检配置保存校验-----------
|
||||
String err = validateForSave(main, page.getLineList(), null);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260519 for:【MES】设备点检配置保存校验-----------
|
||||
mesXslEquipInspectConfigService.saveMain(main, page.getLineList());
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES设备点检配置-编辑")
|
||||
@Operation(summary = "MES设备点检配置-编辑")
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_config:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslEquipInspectConfigPage page) {
|
||||
MesXslEquipInspectConfig main = new MesXslEquipInspectConfig();
|
||||
BeanUtils.copyProperties(page, main);
|
||||
//update-begin---author:jiangxh ---date:20260519 for:【MES】设备点检配置保存校验-----------
|
||||
String err = validateForSave(main, page.getLineList(), main.getId());
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260519 for:【MES】设备点检配置保存校验-----------
|
||||
mesXslEquipInspectConfigService.updateMain(main, page.getLineList());
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES设备点检配置-删除")
|
||||
@Operation(summary = "MES设备点检配置-通过id删除")
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_config:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipInspectConfigDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipInspectConfigService.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES设备点检配置-批量删除")
|
||||
@Operation(summary = "MES设备点检配置-批量删除")
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_config:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipInspectConfigDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipInspectConfigService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES设备点检配置-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslEquipInspectConfig> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslEquipInspectConfig entity = mesXslEquipInspectConfigService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@Operation(summary = "MES设备点检配置-查询明细")
|
||||
@GetMapping(value = "/queryLineListByConfigId")
|
||||
public Result<List<MesXslEquipInspectConfigLine>> queryLineListByConfigId(
|
||||
@RequestParam(name = "id", required = true) String id) {
|
||||
return Result.OK(mesXslEquipInspectConfigService.selectLinesByConfigId(id));
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_config:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslEquipInspectConfig model) {
|
||||
return super.exportXls(request, model, MesXslEquipInspectConfig.class, "MES设备点检配置");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_config:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslEquipInspectConfig.class);
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260519 for:【MES】设备点检配置:主表唯一、明细项目不重复、从点检保养项目带出-----------
|
||||
private String validateForSave(
|
||||
MesXslEquipInspectConfig main, List<MesXslEquipInspectConfigLine> lineList, String excludeId) {
|
||||
if (main == null) {
|
||||
return "参数不能为空";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(main.getEquipmentLedgerId())) {
|
||||
return "请选择设备台账";
|
||||
}
|
||||
MesXslEquipmentLedger ledger = mesXslEquipmentLedgerService.getById(main.getEquipmentLedgerId());
|
||||
if (ledger == null || isDeleted(ledger.getDelFlag())) {
|
||||
return "设备台账不存在或已删除";
|
||||
}
|
||||
main.setEquipmentName(ledger.getEquipmentName());
|
||||
main.setEquipmentCode(ledger.getEquipmentCode());
|
||||
|
||||
String configType = main.getConfigType();
|
||||
if (configType != null) {
|
||||
configType = configType.trim();
|
||||
}
|
||||
if (oConvertUtils.isEmpty(configType) || !CONFIG_TYPE.contains(configType)) {
|
||||
return "类型无效,请选择点检或保养";
|
||||
}
|
||||
main.setConfigType(configType);
|
||||
|
||||
if (mesXslEquipInspectConfigService.isConfigDuplicated(
|
||||
main.getEquipmentLedgerId(), configType, excludeId, main)) {
|
||||
return "该设备在此类型(点检/保养)下已存在配置,不能重复添加";
|
||||
}
|
||||
|
||||
if (lineList == null || lineList.isEmpty()) {
|
||||
return "请至少添加一条点检项目明细";
|
||||
}
|
||||
|
||||
Set<String> itemIds = new HashSet<>();
|
||||
int sort = 0;
|
||||
for (int i = 0; i < lineList.size(); i++) {
|
||||
MesXslEquipInspectConfigLine line = lineList.get(i);
|
||||
if (line == null) {
|
||||
continue;
|
||||
}
|
||||
int rowNo = i + 1;
|
||||
if (oConvertUtils.isEmpty(line.getInspectMaintainItemId())) {
|
||||
return "第 " + rowNo + " 行未选择点检及保养项目";
|
||||
}
|
||||
String itemId = line.getInspectMaintainItemId().trim();
|
||||
if (!itemIds.add(itemId)) {
|
||||
return "第 " + rowNo + " 行点检项目与前面行重复,同一配置中点检项目不能重复";
|
||||
}
|
||||
MesXslInspectMaintainItem item = mesXslInspectMaintainItemService.getById(itemId);
|
||||
if (item == null || isDeleted(item.getDelFlag())) {
|
||||
return "第 " + rowNo + " 行点检及保养项目不存在或已删除";
|
||||
}
|
||||
if (!configType.equals(item.getItemCategory())) {
|
||||
return "第 " + rowNo + " 行项目类别与配置类型不一致(配置为"
|
||||
+ ("inspect".equals(configType) ? "点检" : "保养")
|
||||
+ ")";
|
||||
}
|
||||
line.setInspectMaintainItemId(itemId);
|
||||
line.setItemCode(item.getItemCode());
|
||||
line.setItemName(item.getItemName());
|
||||
line.setItemCategory(item.getItemCategory());
|
||||
line.setItemType(item.getItemType());
|
||||
line.setEquipmentPartName(item.getEquipmentPartName());
|
||||
line.setEquipmentSubPartName(item.getEquipmentSubPartName());
|
||||
line.setInspectMethod(item.getInspectMethod());
|
||||
line.setJudgmentCriteria(item.getJudgmentCriteria());
|
||||
line.setSortNo(sort++);
|
||||
}
|
||||
if (itemIds.isEmpty()) {
|
||||
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】设备点检配置:主表唯一、明细项目不重复、从点检保养项目带出-----------
|
||||
}
|
||||
@@ -0,0 +1,411 @@
|
||||
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.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
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.constant.CommonConstant;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectConfig;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectRecord;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectRecordLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipInspectConfigService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipInspectRecordService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentLedgerService;
|
||||
import org.jeecg.modules.xslmes.util.MesXslEquipInspectBizMsg;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslEquipInspectRecordBatchCreateDTO;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslEquipInspectRecordBatchCreateResult;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslEquipInspectRecordHandleDTO;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslEquipInspectRecordPage;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
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/mesXslEquipInspectRecord")
|
||||
@Slf4j
|
||||
public class MesXslEquipInspectRecordController
|
||||
extends JeecgController<MesXslEquipInspectRecord, IMesXslEquipInspectRecordService> {
|
||||
|
||||
private static final Set<String> RECORD_TYPE = Set.of("inspect", "maintain");
|
||||
private static final Set<String> INSPECT_RESULT = Set.of("pass", "fail");
|
||||
private static final Set<String> RECORD_STATUS = Set.of("pending", "done");
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipInspectRecordService mesXslEquipInspectRecordService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipmentLedgerService mesXslEquipmentLedgerService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipInspectConfigService mesXslEquipInspectConfigService;
|
||||
|
||||
@Operation(summary = "MES点检保养记录-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipInspectRecord>> queryPageList(
|
||||
MesXslEquipInspectRecord model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslEquipInspectRecord> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<MesXslEquipInspectRecord> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslEquipInspectRecord> pageList = mesXslEquipInspectRecordService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES点检保养记录-添加")
|
||||
@Operation(summary = "MES点检保养记录-添加")
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_record:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslEquipInspectRecordPage page) {
|
||||
MesXslEquipInspectRecord main = new MesXslEquipInspectRecord();
|
||||
BeanUtils.copyProperties(page, main);
|
||||
String err = validateForSave(main, page.getLineList(), null);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
fillRecordNoIfEmpty(main);
|
||||
fillInspector(main);
|
||||
mesXslEquipInspectRecordService.saveMain(main, page.getLineList());
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES点检保养记录-编辑")
|
||||
@Operation(summary = "MES点检保养记录-编辑")
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_record:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslEquipInspectRecordPage page) {
|
||||
MesXslEquipInspectRecord main = new MesXslEquipInspectRecord();
|
||||
BeanUtils.copyProperties(page, main);
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【MES】仅待点检可录入,保存后变已点检-----------
|
||||
if (oConvertUtils.isEmpty(main.getId())) {
|
||||
return Result.error("记录主键不能为空");
|
||||
}
|
||||
MesXslEquipInspectRecord existing = mesXslEquipInspectRecordService.getById(main.getId());
|
||||
if (existing == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
if ("done".equals(existing.getRecordStatus())) {
|
||||
return Result.error("已点检记录不可修改,仅可查看");
|
||||
}
|
||||
main.setRecordStatus("done");
|
||||
String err = validateForEntry(main, page.getLineList());
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
fillInspector(main);
|
||||
mesXslEquipInspectRecordService.updateMain(main, page.getLineList());
|
||||
return Result.OK("录入成功!");
|
||||
//update-end---author:jiangxh ---date:20260520 for:【MES】仅待点检可录入,保存后变已点检-----------
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES点检保养记录-删除")
|
||||
@Operation(summary = "MES点检保养记录-通过id删除")
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_record:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslEquipInspectRecordService.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES点检保养记录-批量删除")
|
||||
@Operation(summary = "MES点检保养记录-批量删除")
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_record:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslEquipInspectRecordService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES点检保养记录-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslEquipInspectRecord> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslEquipInspectRecord entity = mesXslEquipInspectRecordService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@Operation(summary = "MES点检保养记录-查询明细")
|
||||
@GetMapping(value = "/queryLineListByRecordId")
|
||||
public Result<List<MesXslEquipInspectRecordLine>> queryLineListByRecordId(
|
||||
@RequestParam(name = "id", required = true) String id) {
|
||||
return Result.OK(mesXslEquipInspectRecordService.selectLinesByRecordId(id));
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260521 for:【MES】不合格点检记录登记处理人及处理时间-----------
|
||||
@AutoLog(value = "MES点检保养记录-不合格处理")
|
||||
@Operation(summary = "MES点检保养记录-不合格处理")
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_record:edit")
|
||||
@PostMapping(value = "/handleFail")
|
||||
public Result<String> handleFail(@RequestBody MesXslEquipInspectRecordHandleDTO dto) {
|
||||
try {
|
||||
mesXslEquipInspectRecordService.handleFailRecord(dto);
|
||||
return Result.OK("处理成功!");
|
||||
} catch (IllegalArgumentException ex) {
|
||||
return Result.error(ex.getMessage());
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260521 for:【MES】不合格点检记录登记处理人及处理时间-----------
|
||||
|
||||
@Operation(summary = "MES点检保养记录-生成记录编号")
|
||||
@GetMapping(value = "/generateRecordNo")
|
||||
public Result<String> generateRecordNo() {
|
||||
MesXslEquipInspectRecord ctx = new MesXslEquipInspectRecord();
|
||||
return Result.OK(mesXslEquipInspectRecordService.generateRecordNo(ctx));
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES点检保养记录-从设备台账批量生成")
|
||||
@Operation(summary = "MES点检保养记录-从设备台账批量生成")
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_record:add")
|
||||
@PostMapping(value = "/batchCreateFromEquipment")
|
||||
public Result<MesXslEquipInspectRecordBatchCreateResult> batchCreateFromEquipment(
|
||||
@RequestBody MesXslEquipInspectRecordBatchCreateDTO dto) {
|
||||
if (dto == null || CollectionUtils.isEmpty(dto.getEquipmentLedgerIds())) {
|
||||
return Result.error("请先选择设备");
|
||||
}
|
||||
String recordType = dto.getRecordType();
|
||||
if (recordType != null) {
|
||||
recordType = recordType.trim();
|
||||
}
|
||||
if (oConvertUtils.isEmpty(recordType) || !RECORD_TYPE.contains(recordType)) {
|
||||
return Result.error("类型无效,请使用点检或保养");
|
||||
}
|
||||
MesXslEquipInspectRecord inspectorCtx = new MesXslEquipInspectRecord();
|
||||
fillInspector(inspectorCtx);
|
||||
MesXslEquipInspectRecordBatchCreateResult result =
|
||||
mesXslEquipInspectRecordService.batchCreateFromEquipment(
|
||||
dto.getEquipmentLedgerIds(), recordType, inspectorCtx);
|
||||
if (result.getSuccessCount() <= 0 && !result.getFailMessages().isEmpty()) {
|
||||
return Result.error(String.join(";", result.getFailMessages()));
|
||||
}
|
||||
String msg = "成功生成 " + result.getSuccessCount() + " 条记录";
|
||||
if (!result.getFailMessages().isEmpty()) {
|
||||
msg = msg + ";" + String.join(";", result.getFailMessages());
|
||||
}
|
||||
return Result.OK(msg, result);
|
||||
}
|
||||
|
||||
@Operation(summary = "MES点检保养记录-按设备与类型带出配置明细")
|
||||
@GetMapping(value = "/loadLinesByEquipment")
|
||||
public Result<List<MesXslEquipInspectRecordLine>> loadLinesByEquipment(
|
||||
@RequestParam(name = "equipmentLedgerId") String equipmentLedgerId,
|
||||
@RequestParam(name = "recordType") String recordType) {
|
||||
String type = recordType != null ? recordType.trim() : "";
|
||||
if (oConvertUtils.isEmpty(equipmentLedgerId) || !RECORD_TYPE.contains(type)) {
|
||||
return Result.error("请选择设备与类型(点检/保养)");
|
||||
}
|
||||
List<MesXslEquipInspectRecordLine> lines =
|
||||
mesXslEquipInspectRecordService.buildLinesFromEquipConfig(equipmentLedgerId, type);
|
||||
if (lines.isEmpty()) {
|
||||
MesXslEquipmentLedger ledger = mesXslEquipmentLedgerService.getById(equipmentLedgerId);
|
||||
String equipName =
|
||||
ledger != null && oConvertUtils.isNotEmpty(ledger.getEquipmentName())
|
||||
? ledger.getEquipmentName()
|
||||
: (ledger != null ? ledger.getEquipmentCode() : equipmentLedgerId);
|
||||
return Result.error(MesXslEquipInspectBizMsg.noConfigMessage(equipName, type));
|
||||
}
|
||||
return Result.OK(lines);
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_record:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslEquipInspectRecord model) {
|
||||
return super.exportXls(request, model, MesXslEquipInspectRecord.class, "MES点检保养记录");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_record:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslEquipInspectRecord.class);
|
||||
}
|
||||
|
||||
private void fillRecordNoIfEmpty(MesXslEquipInspectRecord main) {
|
||||
if (oConvertUtils.isEmpty(main.getRecordNo())) {
|
||||
main.setRecordNo(mesXslEquipInspectRecordService.generateRecordNo(main));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillInspector(MesXslEquipInspectRecord main) {
|
||||
if (SecurityUtils.getSubject() == null || SecurityUtils.getSubject().getPrincipal() == null) {
|
||||
return;
|
||||
}
|
||||
if (!(SecurityUtils.getSubject().getPrincipal() instanceof LoginUser user)) {
|
||||
return;
|
||||
}
|
||||
main.setInspectorUserId(user.getId());
|
||||
main.setInspectorUsername(user.getUsername());
|
||||
main.setInspectorRealname(user.getRealname());
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【MES】录入点检结果:必填项校验,保存为已点检-----------
|
||||
private String validateForEntry(MesXslEquipInspectRecord main, List<MesXslEquipInspectRecordLine> lineList) {
|
||||
String err = validateForSave(main, lineList, main.getId());
|
||||
if (err != null) {
|
||||
return err;
|
||||
}
|
||||
if (main.getInspectDate() == null) {
|
||||
return "请选择点检日期";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(main.getInspectorUserId()) && oConvertUtils.isEmpty(main.getInspectorRealname())) {
|
||||
return "点检人不能为空";
|
||||
}
|
||||
String inspectResult = main.getInspectResult();
|
||||
if (inspectResult != null) {
|
||||
inspectResult = inspectResult.trim();
|
||||
}
|
||||
if (oConvertUtils.isEmpty(inspectResult) || !INSPECT_RESULT.contains(inspectResult)) {
|
||||
return "请选择点检结果(合格/不合格)";
|
||||
}
|
||||
main.setInspectResult(inspectResult);
|
||||
main.setRecordStatus("done");
|
||||
//update-begin---author:jiangxh ---date:20260521 for:【MES】不合格记录默认未处理-----------
|
||||
if ("fail".equals(inspectResult)) {
|
||||
main.setHandledFlag("0");
|
||||
} else {
|
||||
main.setHandledFlag(null);
|
||||
main.setHandlerUserId(null);
|
||||
main.setHandlerUsername(null);
|
||||
main.setHandlerRealname(null);
|
||||
main.setHandleTime(null);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260521 for:【MES】不合格记录默认未处理-----------
|
||||
return null;
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【MES】录入点检结果:必填项校验,保存为已点检-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【MES】点检保养记录保存校验与配置明细关联-----------
|
||||
private String validateForSave(
|
||||
MesXslEquipInspectRecord main, List<MesXslEquipInspectRecordLine> lineList, String excludeId) {
|
||||
if (main == null) {
|
||||
return "参数不能为空";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(main.getEquipmentLedgerId())) {
|
||||
return "请选择设备";
|
||||
}
|
||||
MesXslEquipmentLedger ledger = mesXslEquipmentLedgerService.getById(main.getEquipmentLedgerId());
|
||||
if (ledger == null || isDeleted(ledger.getDelFlag())) {
|
||||
return "设备台账不存在或已删除";
|
||||
}
|
||||
main.setEquipmentName(ledger.getEquipmentName());
|
||||
main.setEquipmentCode(ledger.getEquipmentCode());
|
||||
|
||||
String recordType = main.getRecordType();
|
||||
if (recordType != null) {
|
||||
recordType = recordType.trim();
|
||||
}
|
||||
if (oConvertUtils.isEmpty(recordType) || !RECORD_TYPE.contains(recordType)) {
|
||||
return "类型无效,请选择点检或保养";
|
||||
}
|
||||
main.setRecordType(recordType);
|
||||
|
||||
if (main.getInspectDate() == null) {
|
||||
main.setInspectDate(new Date());
|
||||
}
|
||||
|
||||
String recordStatus = main.getRecordStatus();
|
||||
if (recordStatus != null) {
|
||||
recordStatus = recordStatus.trim();
|
||||
}
|
||||
if (oConvertUtils.isEmpty(recordStatus) || !RECORD_STATUS.contains(recordStatus)) {
|
||||
return "请选择状态(待点检/已点检)";
|
||||
}
|
||||
main.setRecordStatus(recordStatus);
|
||||
|
||||
String inspectResult = main.getInspectResult();
|
||||
if (inspectResult != null) {
|
||||
inspectResult = inspectResult.trim();
|
||||
}
|
||||
if ("done".equals(recordStatus)) {
|
||||
if (oConvertUtils.isEmpty(inspectResult) || !INSPECT_RESULT.contains(inspectResult)) {
|
||||
return "已点检时请选择点检结果(合格/不合格)";
|
||||
}
|
||||
main.setInspectResult(inspectResult);
|
||||
} else {
|
||||
if (oConvertUtils.isNotEmpty(inspectResult) && !INSPECT_RESULT.contains(inspectResult)) {
|
||||
return "点检结果无效";
|
||||
}
|
||||
main.setInspectResult(oConvertUtils.isEmpty(inspectResult) ? null : inspectResult);
|
||||
}
|
||||
|
||||
if (oConvertUtils.isEmpty(main.getRecordNo())) {
|
||||
return "记录编号不能为空";
|
||||
}
|
||||
|
||||
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<MesXslEquipInspectConfig> cw =
|
||||
new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<>();
|
||||
cw.eq(MesXslEquipInspectConfig::getEquipmentLedgerId, main.getEquipmentLedgerId());
|
||||
cw.eq(MesXslEquipInspectConfig::getConfigType, recordType);
|
||||
cw.and(
|
||||
q ->
|
||||
q.eq(MesXslEquipInspectConfig::getDelFlag, CommonConstant.DEL_FLAG_0)
|
||||
.or()
|
||||
.isNull(MesXslEquipInspectConfig::getDelFlag));
|
||||
MesXslEquipInspectConfig config = mesXslEquipInspectConfigService.getOne(cw, false);
|
||||
if (config == null) {
|
||||
String equipName =
|
||||
oConvertUtils.isNotEmpty(ledger.getEquipmentName())
|
||||
? ledger.getEquipmentName()
|
||||
: ledger.getEquipmentCode();
|
||||
return MesXslEquipInspectBizMsg.noConfigMessage(equipName, recordType);
|
||||
}
|
||||
main.setEquipInspectConfigId(config.getId());
|
||||
|
||||
if (lineList == null || lineList.isEmpty()) {
|
||||
return "明细不能为空,请选择设备后自动带出点检项目";
|
||||
}
|
||||
|
||||
Set<String> configLineIds = new HashSet<>();
|
||||
int sort = 0;
|
||||
for (int i = 0; i < lineList.size(); i++) {
|
||||
MesXslEquipInspectRecordLine line = lineList.get(i);
|
||||
if (line == null) {
|
||||
continue;
|
||||
}
|
||||
int rowNo = i + 1;
|
||||
if (oConvertUtils.isEmpty(line.getEquipInspectConfigLineId())) {
|
||||
return "第 " + rowNo + " 行未关联点检配置明细";
|
||||
}
|
||||
String lineId = line.getEquipInspectConfigLineId().trim();
|
||||
if (!configLineIds.add(lineId)) {
|
||||
return "第 " + rowNo + " 行点检配置明细重复";
|
||||
}
|
||||
line.setEquipInspectConfigLineId(lineId);
|
||||
line.setSortNo(sort++);
|
||||
}
|
||||
if (configLineIds.isEmpty()) {
|
||||
return "明细不能为空";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isDeleted(Integer delFlag) {
|
||||
return delFlag != null && delFlag.equals(CommonConstant.DEL_FLAG_1);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【MES】点检保养记录保存校验与配置明细关联-----------
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipPartMapping;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipPartMappingService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 设备对应部位(只读列表,数据由设备点检配置保存后自动生成)
|
||||
*/
|
||||
@Tag(name = "MES设备对应部位")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslEquipPartMapping")
|
||||
@Slf4j
|
||||
public class MesXslEquipPartMappingController
|
||||
extends JeecgController<MesXslEquipPartMapping, IMesXslEquipPartMappingService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipPartMappingService mesXslEquipPartMappingService;
|
||||
|
||||
@Operation(summary = "MES设备对应部位-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipPartMapping>> queryPageList(
|
||||
MesXslEquipPartMapping model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslEquipPartMapping> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
//update-begin---author:jiangxh ---date:20250603 for:【MES】设备对应部位列表按设备名称、机台代号、大部位代码排序-----------
|
||||
queryWrapper.orderByAsc("equipment_name", "machine_code", "part_code", "sub_part_code");
|
||||
//update-end---author:jiangxh ---date:20250603 for:【MES】设备对应部位列表按设备名称、机台代号、大部位代码排序-----------
|
||||
Page<MesXslEquipPartMapping> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslEquipPartMapping> pageList = mesXslEquipPartMappingService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_equip_part_mapping:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslEquipPartMapping model) {
|
||||
return super.exportXls(request, model, MesXslEquipPartMapping.class, "MES设备对应部位");
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ 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.MesXslProcessOperation;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentCategoryService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslProcessOperationService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
@@ -52,6 +53,9 @@ public class MesXslEquipmentCategoryController extends JeecgController<MesXslEqu
|
||||
@Autowired
|
||||
private IMesXslProcessOperationService mesXslProcessOperationService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES设备类别-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipmentCategory>> queryPageList(
|
||||
@@ -100,6 +104,10 @@ public class MesXslEquipmentCategoryController extends JeecgController<MesXslEqu
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_category:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentCategoryDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentCategoryService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -109,6 +117,10 @@ public class MesXslEquipmentCategoryController extends JeecgController<MesXslEqu
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_category:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentCategoryDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentCategoryService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ 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.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentLedgerService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
@@ -45,6 +46,9 @@ public class MesXslEquipmentLedgerController extends JeecgController<MesXslEquip
|
||||
@Autowired
|
||||
private IMesXslEquipmentLedgerService mesXslEquipmentLedgerService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES设备台账-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipmentLedger>> queryPageList(
|
||||
@@ -69,6 +73,9 @@ public class MesXslEquipmentLedgerController extends JeecgController<MesXslEquip
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260518 for:【MES】设备台账保存前校验-----------
|
||||
//update-begin---author:jiangxh ---date:20250602 for:【MES】设备台账新增时系统编号由服务端生成-----------
|
||||
model.setLedgerNo(null);
|
||||
//update-end---author:jiangxh ---date:20250602 for:【MES】设备台账新增时系统编号由服务端生成-----------
|
||||
mesXslEquipmentLedgerService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
@@ -93,6 +100,10 @@ public class MesXslEquipmentLedgerController extends JeecgController<MesXslEquip
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_ledger:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentLedgerDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentLedgerService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -102,6 +113,10 @@ public class MesXslEquipmentLedgerController extends JeecgController<MesXslEquip
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_ledger:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentLedgerDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentLedgerService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
@@ -131,6 +146,13 @@ public class MesXslEquipmentLedgerController extends JeecgController<MesXslEquip
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
|
||||
@Operation(summary = "预览下一系统编号(001起)")
|
||||
@GetMapping(value = "/nextLedgerNo")
|
||||
public Result<String> nextLedgerNo() {
|
||||
MesXslEquipmentLedger ctx = new MesXslEquipmentLedger();
|
||||
return Result.OK(mesXslEquipmentLedgerService.generateNextLedgerNo(ctx));
|
||||
}
|
||||
|
||||
@Operation(summary = "校验设备名称是否重复")
|
||||
@GetMapping(value = "/checkEquipmentName")
|
||||
public Result<String> checkEquipmentName(
|
||||
@@ -225,6 +247,14 @@ public class MesXslEquipmentLedgerController extends JeecgController<MesXslEquip
|
||||
if (mesXslEquipmentLedgerService.isEquipmentCodeDuplicated(code, excludeId, model)) {
|
||||
return "设备编号不能重复";
|
||||
}
|
||||
//update-begin---author:jiangxh ---date:20250602 for:【MES】设备台账设备类别、设备类型必填-----------
|
||||
if (oConvertUtils.isEmpty(model.getEquipmentCategoryId())) {
|
||||
return "请选择设备类别";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getEquipmentTypeId())) {
|
||||
return "请选择设备类型";
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20250602 for:【MES】设备台账设备类别、设备类型必填-----------
|
||||
trimRelationNames(model);
|
||||
String status = model.getEquipmentStatus();
|
||||
if (oConvertUtils.isEmpty(status)) {
|
||||
@@ -258,6 +288,7 @@ public class MesXslEquipmentLedgerController extends JeecgController<MesXslEquip
|
||||
return "文件导入失败:第 " + rowNo + " 条设备编号不能为空";
|
||||
}
|
||||
row.setEquipmentCode(code);
|
||||
row.setLedgerNo(null);
|
||||
if (!codesInFile.add(code)) {
|
||||
return "文件导入失败:设备编号【" + code + "】在导入文件中重复";
|
||||
}
|
||||
@@ -279,6 +310,14 @@ public class MesXslEquipmentLedgerController extends JeecgController<MesXslEquip
|
||||
return "文件导入失败:第 " + rowNo + " 条设备名称【" + name + "】不能重复";
|
||||
}
|
||||
trimRelationNames(row);
|
||||
//update-begin---author:jiangxh ---date:20250602 for:【MES】设备台账导入设备类别、设备类型必填-----------
|
||||
if (oConvertUtils.isEmpty(row.getEquipmentCategoryId()) && oConvertUtils.isEmpty(row.getEquipmentCategoryName())) {
|
||||
return "文件导入失败:第 " + rowNo + " 条设备类别不能为空";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(row.getEquipmentTypeId()) && oConvertUtils.isEmpty(row.getEquipmentTypeName())) {
|
||||
return "文件导入失败:第 " + rowNo + " 条设备类型不能为空";
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20250602 for:【MES】设备台账导入设备类别、设备类型必填-----------
|
||||
String status = row.getEquipmentStatus();
|
||||
if (oConvertUtils.isEmpty(status)) {
|
||||
row.setEquipmentStatus("0");
|
||||
|
||||
@@ -22,6 +22,7 @@ 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.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentCategoryService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentPartService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
@@ -49,6 +50,9 @@ public class MesXslEquipmentPartController extends JeecgController<MesXslEquipme
|
||||
@Autowired
|
||||
private IMesXslEquipmentCategoryService mesXslEquipmentCategoryService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES设备部位-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipmentPart>> queryPageList(
|
||||
@@ -97,6 +101,10 @@ public class MesXslEquipmentPartController extends JeecgController<MesXslEquipme
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_part:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentPartDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentPartService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -106,6 +114,10 @@ public class MesXslEquipmentPartController extends JeecgController<MesXslEquipme
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_part:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentPartDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentPartService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ 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.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentCategoryService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentPartService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentSubPartService;
|
||||
@@ -54,6 +55,9 @@ public class MesXslEquipmentSubPartController extends JeecgController<MesXslEqui
|
||||
@Autowired
|
||||
private IMesXslEquipmentPartService mesXslEquipmentPartService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES设备小部位-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipmentSubPart>> queryPageList(
|
||||
@@ -102,6 +106,10 @@ public class MesXslEquipmentSubPartController extends JeecgController<MesXslEqui
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_sub_part:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentSubPartDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentSubPartService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -111,6 +119,10 @@ public class MesXslEquipmentSubPartController extends JeecgController<MesXslEqui
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_sub_part:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentSubPartDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentSubPartService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentCategory;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentType;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslProcessOperation;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentCategoryService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentTypeService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslProcessOperationService;
|
||||
@@ -54,6 +55,9 @@ public class MesXslEquipmentTypeController extends JeecgController<MesXslEquipme
|
||||
@Autowired
|
||||
private IMesXslEquipmentCategoryService mesXslEquipmentCategoryService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES设备类型-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipmentType>> queryPageList(
|
||||
@@ -102,6 +106,10 @@ public class MesXslEquipmentTypeController extends JeecgController<MesXslEquipme
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_type:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentTypeDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentTypeService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -111,6 +119,10 @@ public class MesXslEquipmentTypeController extends JeecgController<MesXslEquipme
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_type:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentTypeDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentTypeService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
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.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Arrays;
|
||||
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.modules.xslmes.entity.MesXslFinalBatchPlan;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslFinalBatchPlanService;
|
||||
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/mesXslFinalBatchPlan")
|
||||
public class MesXslFinalBatchPlanController
|
||||
extends JeecgController<MesXslFinalBatchPlan, IMesXslFinalBatchPlanService> {
|
||||
|
||||
@Autowired private IMesXslFinalBatchPlanService finalBatchPlanService;
|
||||
|
||||
@Operation(summary = "终胶计划-分页列表查询")
|
||||
@GetMapping("/list")
|
||||
public Result<IPage<MesXslFinalBatchPlan>> queryPageList(
|
||||
MesXslFinalBatchPlan model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslFinalBatchPlan> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<MesXslFinalBatchPlan> pageList = finalBatchPlanService.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "终胶计划-添加")
|
||||
@Operation(summary = "终胶计划-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_final_batch_plan:add")
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody MesXslFinalBatchPlan model) {
|
||||
fillDerivedFields(model);
|
||||
finalBatchPlanService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "终胶计划-编辑")
|
||||
@Operation(summary = "终胶计划-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_final_batch_plan:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslFinalBatchPlan model) {
|
||||
fillDerivedFields(model);
|
||||
finalBatchPlanService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "终胶计划-通过id删除")
|
||||
@Operation(summary = "终胶计划-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_final_batch_plan:delete")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
finalBatchPlanService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "终胶计划-批量删除")
|
||||
@Operation(summary = "终胶计划-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_final_batch_plan:deleteBatch")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
finalBatchPlanService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "终胶计划-通过id查询")
|
||||
@GetMapping("/queryById")
|
||||
public Result<MesXslFinalBatchPlan> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslFinalBatchPlan entity = finalBatchPlanService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_final_batch_plan:exportXls")
|
||||
@RequestMapping("/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslFinalBatchPlan model) {
|
||||
return super.exportXls(request, model, MesXslFinalBatchPlan.class, "终胶计划");
|
||||
}
|
||||
|
||||
private void fillDerivedFields(MesXslFinalBatchPlan model) {
|
||||
BigDecimal planWeight = model.getPlanWeight();
|
||||
BigDecimal perCarWeight = model.getPerCarWeight();
|
||||
if (planWeight == null || perCarWeight == null || perCarWeight.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
model.setPlannedCarCount(0);
|
||||
return;
|
||||
}
|
||||
model.setPlannedCarCount(planWeight.divide(perCarWeight, 0, RoundingMode.CEILING).intValue());
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,8 @@ import org.jeecg.modules.xslmes.entity.MesXslFormulaSpec;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpecLine;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslFormulaSpecService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslFormulaSpecSettingService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslFormulaMixingGeneratePreviewVO;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslFormulaMixingGenerateRequestVO;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslFormulaRubberContentSettingVO;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslFormulaSpecPage;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -173,6 +175,32 @@ public class MesXslFormulaSpecController extends JeecgController<MesXslFormulaSp
|
||||
}
|
||||
//update-end---author:cursor ---date:20260521 for:【配合示方】含胶率物料小类可配置-----------
|
||||
|
||||
//update-begin---author:cursor ---date:20260522 for:【XSLMES-20260522-A38】配合示方生成混炼示方-----------
|
||||
@Operation(summary = "MES配合示方-生成混炼示方预览")
|
||||
@GetMapping(value = "/buildMixingGeneratePreview")
|
||||
public Result<MesXslFormulaMixingGeneratePreviewVO> buildMixingGeneratePreview(
|
||||
@RequestParam(name = "formulaSpecId", required = true) String formulaSpecId) {
|
||||
try {
|
||||
return Result.OK(mesXslFormulaSpecService.buildMixingGeneratePreview(formulaSpecId));
|
||||
} catch (IllegalArgumentException ex) {
|
||||
return Result.error(ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES配合示方-生成混炼示方")
|
||||
@Operation(summary = "MES配合示方-生成混炼示方")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixing_spec:add")
|
||||
@PostMapping(value = "/generateMixingSpec")
|
||||
public Result<Map<String, Object>> generateMixingSpec(@RequestBody MesXslFormulaMixingGenerateRequestVO request) {
|
||||
try {
|
||||
int count = mesXslFormulaSpecService.generateMixingSpecFromFormula(request);
|
||||
return Result.OK("成功生成 " + count + " 条混炼示方", Map.of("count", count));
|
||||
} catch (IllegalArgumentException ex) {
|
||||
return Result.error(ex.getMessage());
|
||||
}
|
||||
}
|
||||
//update-end---author:cursor ---date:20260522 for:【XSLMES-20260522-A38】配合示方生成混炼示方-----------
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_formula_spec:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslFormulaSpec model) {
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpecEditLog;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslFormulaSpecEditLogService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslFormulaSpecEditLogDetailVO;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
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/mesXslFormulaSpecEditLog")
|
||||
@Slf4j
|
||||
public class MesXslFormulaSpecEditLogController
|
||||
extends JeecgController<MesXslFormulaSpecEditLog, IMesXslFormulaSpecEditLogService> {
|
||||
|
||||
@Operation(summary = "配方日志查询-分页列表")
|
||||
@RequiresPermissions("xslmes:mes_xsl_formula_spec_edit_log:list")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslFormulaSpecEditLog>> queryPageList(
|
||||
MesXslFormulaSpecEditLog entity,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslFormulaSpecEditLog> qw = QueryGenerator.initQueryWrapper(entity, req.getParameterMap());
|
||||
qw.orderByDesc("modify_time");
|
||||
Page<MesXslFormulaSpecEditLog> page = new Page<>(pageNo, pageSize);
|
||||
return Result.OK(service.page(page, qw));
|
||||
}
|
||||
|
||||
@Operation(summary = "配方日志查询-详情(含对比项)")
|
||||
@RequiresPermissions("xslmes:mes_xsl_formula_spec_edit_log:list")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslFormulaSpecEditLogDetailVO> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslFormulaSpecEditLogDetailVO detail = service.getDetail(id);
|
||||
if (detail == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(detail);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_formula_spec_edit_log:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslFormulaSpecEditLog entity) {
|
||||
return super.exportXls(request, entity, MesXslFormulaSpecEditLog.class, "配方日志查询");
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ 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.List;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
@@ -26,6 +27,7 @@ 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.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslInspectMaintainItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -60,6 +62,9 @@ public class MesXslInspectMaintainItemController
|
||||
@Autowired
|
||||
private IMesXslEquipmentSubPartService mesXslEquipmentSubPartService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES点检及保养项目-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslInspectMaintainItem>> queryPageList(
|
||||
@@ -109,6 +114,12 @@ public class MesXslInspectMaintainItemController
|
||||
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
//update-begin---author:jiangxh ---date:20250603 for:【MES】点检及保养项目删除前校验设备点检配置等引用-----------
|
||||
String err = mesXslDeleteReferenceService.validateInspectMaintainItemDelete(List.of(id));
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20250603 for:【MES】点检及保养项目删除前校验设备点检配置等引用-----------
|
||||
mesXslInspectMaintainItemService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -118,6 +129,12 @@ public class MesXslInspectMaintainItemController
|
||||
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
//update-begin---author:jiangxh ---date:20250603 for:【MES】点检及保养项目删除前校验设备点检配置等引用-----------
|
||||
String err = mesXslDeleteReferenceService.validateInspectMaintainItemDelete(Arrays.asList(ids.split(",")));
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20250603 for:【MES】点检及保养项目删除前校验设备点检配置等引用-----------
|
||||
mesXslInspectMaintainItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ 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.MesXslManufacturer;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslManufacturerService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
@@ -45,6 +46,9 @@ public class MesXslManufacturerController extends JeecgController<MesXslManufact
|
||||
@Autowired
|
||||
private IMesXslManufacturerService mesXslManufacturerService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES厂家信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslManufacturer>> queryPageList(
|
||||
@@ -93,6 +97,10 @@ public class MesXslManufacturerController extends JeecgController<MesXslManufact
|
||||
@RequiresPermissions("mes:mes_xsl_manufacturer:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateManufacturerDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslManufacturerService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -102,6 +110,10 @@ public class MesXslManufacturerController extends JeecgController<MesXslManufact
|
||||
@RequiresPermissions("mes:mes_xsl_manufacturer:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateManufacturerDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslManufacturerService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
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.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Arrays;
|
||||
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.modules.xslmes.entity.MesXslMasterBatchPlan;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMasterBatchPlanService;
|
||||
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/mesXslMasterBatchPlan")
|
||||
public class MesXslMasterBatchPlanController
|
||||
extends JeecgController<MesXslMasterBatchPlan, IMesXslMasterBatchPlanService> {
|
||||
|
||||
@Autowired private IMesXslMasterBatchPlanService masterBatchPlanService;
|
||||
|
||||
@Operation(summary = "母胶计划-分页列表查询")
|
||||
@GetMapping("/list")
|
||||
public Result<IPage<MesXslMasterBatchPlan>> queryPageList(
|
||||
MesXslMasterBatchPlan model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslMasterBatchPlan> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<MesXslMasterBatchPlan> pageList = masterBatchPlanService.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "母胶计划-添加")
|
||||
@Operation(summary = "母胶计划-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_master_batch_plan:add")
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody MesXslMasterBatchPlan model) {
|
||||
fillDerivedFields(model);
|
||||
masterBatchPlanService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "母胶计划-编辑")
|
||||
@Operation(summary = "母胶计划-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_master_batch_plan:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslMasterBatchPlan model) {
|
||||
fillDerivedFields(model);
|
||||
masterBatchPlanService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "母胶计划-通过id删除")
|
||||
@Operation(summary = "母胶计划-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_master_batch_plan:delete")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
masterBatchPlanService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "母胶计划-批量删除")
|
||||
@Operation(summary = "母胶计划-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_master_batch_plan:deleteBatch")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
masterBatchPlanService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "母胶计划-通过id查询")
|
||||
@GetMapping("/queryById")
|
||||
public Result<MesXslMasterBatchPlan> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslMasterBatchPlan entity = masterBatchPlanService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_master_batch_plan:exportXls")
|
||||
@RequestMapping("/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslMasterBatchPlan model) {
|
||||
return super.exportXls(request, model, MesXslMasterBatchPlan.class, "母胶计划");
|
||||
}
|
||||
|
||||
private void fillDerivedFields(MesXslMasterBatchPlan model) {
|
||||
BigDecimal planWeight = model.getPlanWeight();
|
||||
BigDecimal perCarWeight = model.getPerCarWeight();
|
||||
if (planWeight == null || perCarWeight == null || perCarWeight.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
model.setPlannedCarCount(0);
|
||||
return;
|
||||
}
|
||||
model.setPlannedCarCount(planWeight.divide(perCarWeight, 0, RoundingMode.CEILING).intValue());
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
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.MesXslMixerCondition;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerConditionService;
|
||||
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/mesXslMixerCondition")
|
||||
public class MesXslMixerConditionController
|
||||
extends JeecgController<MesXslMixerCondition, IMesXslMixerConditionService> {
|
||||
|
||||
@Autowired private IMesXslMixerConditionService mesXslMixerConditionService;
|
||||
|
||||
@Operation(summary = "密炼机条件维护-分页列表查询")
|
||||
@GetMapping("/list")
|
||||
public Result<IPage<MesXslMixerCondition>> queryPageList(
|
||||
MesXslMixerCondition model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslMixerCondition> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<MesXslMixerCondition> pageList = mesXslMixerConditionService.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "密炼机条件维护-添加")
|
||||
@Operation(summary = "密炼机条件维护-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_condition:add")
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody MesXslMixerCondition model) {
|
||||
String err = validateForSave(model, null);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
mesXslMixerConditionService.fillEquipmentName(model);
|
||||
if (StringUtils.isBlank(model.getEquipmentName())) {
|
||||
return Result.error("请选择有效的设备名称");
|
||||
}
|
||||
mesXslMixerConditionService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "密炼机条件维护-编辑")
|
||||
@Operation(summary = "密炼机条件维护-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_condition:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslMixerCondition model) {
|
||||
String err = validateForSave(model, model.getId());
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
mesXslMixerConditionService.fillEquipmentName(model);
|
||||
if (StringUtils.isBlank(model.getEquipmentName())) {
|
||||
return Result.error("请选择有效的设备名称");
|
||||
}
|
||||
mesXslMixerConditionService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "密炼机条件维护-通过id删除")
|
||||
@Operation(summary = "密炼机条件维护-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_condition:delete")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslMixerConditionService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "密炼机条件维护-批量删除")
|
||||
@Operation(summary = "密炼机条件维护-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_condition:deleteBatch")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslMixerConditionService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "密炼机条件维护-通过id查询")
|
||||
@GetMapping("/queryById")
|
||||
public Result<MesXslMixerCondition> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslMixerCondition entity = mesXslMixerConditionService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@Operation(summary = "校验条件名称是否重复")
|
||||
@GetMapping("/checkConditionName")
|
||||
public Result<String> checkConditionName(
|
||||
@RequestParam(name = "conditionName", required = true) String conditionName,
|
||||
@RequestParam(name = "dataId", required = false) String dataId) {
|
||||
if (oConvertUtils.isEmpty(conditionName) || conditionName.trim().isEmpty()) {
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
if (mesXslMixerConditionService.isConditionNameDuplicated(conditionName, dataId)) {
|
||||
return Result.error("条件名称不能重复");
|
||||
}
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
|
||||
@Operation(summary = "校验条件代码是否重复")
|
||||
@GetMapping("/checkConditionCode")
|
||||
public Result<String> checkConditionCode(
|
||||
@RequestParam(name = "conditionCode", required = true) String conditionCode,
|
||||
@RequestParam(name = "dataId", required = false) String dataId) {
|
||||
if (oConvertUtils.isEmpty(conditionCode) || conditionCode.trim().isEmpty()) {
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
if (mesXslMixerConditionService.isConditionCodeDuplicated(conditionCode, dataId)) {
|
||||
return Result.error("条件代码不能重复");
|
||||
}
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_condition:exportXls")
|
||||
@RequestMapping("/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslMixerCondition model) {
|
||||
return super.exportXls(request, model, MesXslMixerCondition.class, "密炼机条件维护");
|
||||
}
|
||||
|
||||
private String validateForSave(MesXslMixerCondition model, String excludeId) {
|
||||
if (oConvertUtils.isEmpty(model.getEquipmentId()) || StringUtils.isBlank(model.getEquipmentId())) {
|
||||
return "设备名称不能为空";
|
||||
}
|
||||
model.setEquipmentId(model.getEquipmentId().trim());
|
||||
if (oConvertUtils.isEmpty(model.getConditionName()) || StringUtils.isBlank(model.getConditionName())) {
|
||||
return "条件名称不能为空";
|
||||
}
|
||||
model.setConditionName(model.getConditionName().trim());
|
||||
if (mesXslMixerConditionService.isConditionNameDuplicated(model.getConditionName(), excludeId)) {
|
||||
return "条件名称不能重复";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getConditionCode()) || StringUtils.isBlank(model.getConditionCode())) {
|
||||
return "条件代码不能为空";
|
||||
}
|
||||
model.setConditionCode(model.getConditionCode().trim());
|
||||
if (mesXslMixerConditionService.isConditionCodeDuplicated(model.getConditionCode(), excludeId)) {
|
||||
return "条件代码不能重复";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
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.List;
|
||||
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.MesXslMixerMaterialKindCfg;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerMaterialKindCfgService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslMixerMaterialKindLookupVO;
|
||||
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/mesXslMixerMaterialKindCfg")
|
||||
@Slf4j
|
||||
public class MesXslMixerMaterialKindCfgController
|
||||
extends JeecgController<MesXslMixerMaterialKindCfg, IMesXslMixerMaterialKindCfgService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslMixerMaterialKindCfgService mesXslMixerMaterialKindCfgService;
|
||||
|
||||
@Operation(summary = "MES密炼物料种类配置-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslMixerMaterialKindCfg>> queryPageList(
|
||||
MesXslMixerMaterialKindCfg model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslMixerMaterialKindCfg> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
queryWrapper.orderByAsc("priority").orderByDesc("create_time");
|
||||
Page<MesXslMixerMaterialKindCfg> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslMixerMaterialKindCfg> pageList = mesXslMixerMaterialKindCfgService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A51】密炼物料种类配置展开与批量保存-----------
|
||||
@Operation(summary = "MES密炼物料种类配置-按根字典/分类展开明细")
|
||||
@GetMapping(value = "/expandLines")
|
||||
public Result<List<MesXslMixerMaterialKindCfg>> expandLines(
|
||||
@RequestParam(name = "sourceType") String sourceType,
|
||||
@RequestParam(name = "sourceRootCode") String sourceRootCode,
|
||||
@RequestParam(name = "tenantId", required = false) Integer tenantId) {
|
||||
List<MesXslMixerMaterialKindCfg> lines =
|
||||
mesXslMixerMaterialKindCfgService.expandLines(sourceType, sourceRootCode, tenantId);
|
||||
return Result.OK(lines);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料种类配置-批量添加")
|
||||
@Operation(summary = "MES密炼物料种类配置-批量添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_kind_cfg:add")
|
||||
@PostMapping(value = "/addBatch")
|
||||
public Result<String> addBatch(@RequestBody List<MesXslMixerMaterialKindCfg> lines) {
|
||||
mesXslMixerMaterialKindCfgService.saveBatchLines(lines, null);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A51】密炼物料种类配置展开与批量保存-----------
|
||||
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A52】密炼物料种类配置关联解析-----------
|
||||
@Operation(summary = "MES密炼物料种类配置-加载种类查找表")
|
||||
@GetMapping(value = "/kindLookup")
|
||||
public Result<MesXslMixerMaterialKindLookupVO> kindLookup(
|
||||
@RequestParam(name = "tenantId", required = false) Integer tenantId) {
|
||||
return Result.OK(mesXslMixerMaterialKindCfgService.loadKindLookup(tenantId));
|
||||
}
|
||||
|
||||
@Operation(summary = "MES密炼物料种类配置-解析混炼示方明细种类")
|
||||
@GetMapping(value = "/resolveKind")
|
||||
public Result<String> resolveKind(
|
||||
@RequestParam(name = "minorCategoryId", required = false) String minorCategoryId,
|
||||
@RequestParam(name = "weighMode", required = false) String weighMode,
|
||||
@RequestParam(name = "minorCategoryName", required = false) String minorCategoryName,
|
||||
@RequestParam(name = "tenantId", required = false) Integer tenantId) {
|
||||
MesXslMixerMaterialKindLookupVO lookup = mesXslMixerMaterialKindCfgService.loadKindLookup(tenantId);
|
||||
String kind = mesXslMixerMaterialKindCfgService.resolveMixingMaterialKind(
|
||||
lookup, minorCategoryId, weighMode, minorCategoryName);
|
||||
return Result.OK(kind);
|
||||
}
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A52】密炼物料种类配置关联解析-----------
|
||||
|
||||
@AutoLog(value = "MES密炼物料种类配置-添加")
|
||||
@Operation(summary = "MES密炼物料种类配置-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_kind_cfg:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslMixerMaterialKindCfg model) {
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A51】密炼物料种类配置保存校验-----------
|
||||
String err = validateForSave(model, false);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
model.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
mesXslMixerMaterialKindCfgService.save(model);
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A51】密炼物料种类配置保存校验-----------
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料种类配置-编辑")
|
||||
@Operation(summary = "MES密炼物料种类配置-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_kind_cfg:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslMixerMaterialKindCfg model) {
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A51】密炼物料种类配置保存校验-----------
|
||||
String err = validateForSave(model, true);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
mesXslMixerMaterialKindCfgService.updateById(model);
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A51】密炼物料种类配置保存校验-----------
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料种类配置-删除")
|
||||
@Operation(summary = "MES密炼物料种类配置-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_kind_cfg:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslMixerMaterialKindCfgService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料种类配置-批量删除")
|
||||
@Operation(summary = "MES密炼物料种类配置-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_kind_cfg:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslMixerMaterialKindCfgService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES密炼物料种类配置-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslMixerMaterialKindCfg> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslMixerMaterialKindCfg entity = mesXslMixerMaterialKindCfgService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_kind_cfg:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslMixerMaterialKindCfg model) {
|
||||
return super.exportXls(request, model, MesXslMixerMaterialKindCfg.class, "密炼物料种类配置");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_kind_cfg:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslMixerMaterialKindCfg.class);
|
||||
}
|
||||
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A51】密炼物料种类配置保存校验-----------
|
||||
private String validateForSave(MesXslMixerMaterialKindCfg model, boolean isUpdate) {
|
||||
if (model == null) {
|
||||
return "参数不能为空";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getKindKey())) {
|
||||
return "种类键值不能为空";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getKindName())) {
|
||||
return "种类名称不能为空";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getSourceType())) {
|
||||
return "数据源类型不能为空";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getCategoryRefId())) {
|
||||
return "对应分类不能为空";
|
||||
}
|
||||
if (model.getPriority() == null) {
|
||||
model.setPriority(999);
|
||||
}
|
||||
if (isUpdate && oConvertUtils.isEmpty(model.getId())) {
|
||||
return "主键不能为空";
|
||||
}
|
||||
try {
|
||||
mesXslMixerMaterialKindCfgService.checkDuplicate(model, isUpdate ? model.getId() : null);
|
||||
} catch (Exception e) {
|
||||
return e.getMessage();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A51】密炼物料种类配置保存校验-----------
|
||||
}
|
||||
@@ -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 jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
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.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialTareStrategy;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerMaterialTareStrategyService;
|
||||
import org.jeecg.modules.xslmes.service.MesXslStompNotifyService;
|
||||
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/mesXslMixerMaterialTareStrategy")
|
||||
@Slf4j
|
||||
public class MesXslMixerMaterialTareStrategyController
|
||||
extends JeecgController<MesXslMixerMaterialTareStrategy, IMesXslMixerMaterialTareStrategyService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslMixerMaterialTareStrategyService mesXslMixerMaterialTareStrategyService;
|
||||
|
||||
@Autowired
|
||||
private MesXslStompNotifyService stompNotify;
|
||||
|
||||
@Operation(summary = "MES密炼物料皮重策略-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslMixerMaterialTareStrategy>> queryPageList(
|
||||
MesXslMixerMaterialTareStrategy model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslMixerMaterialTareStrategy> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("effective_start_date", "create_time");
|
||||
Page<MesXslMixerMaterialTareStrategy> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslMixerMaterialTareStrategy> pageList = mesXslMixerMaterialTareStrategyService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料皮重策略-添加")
|
||||
@Operation(summary = "MES密炼物料皮重策略-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_tare_strategy:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslMixerMaterialTareStrategy model) {
|
||||
fillMaintainBy(model);
|
||||
String err = mesXslMixerMaterialTareStrategyService.validateBeforeSave(model, false);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
mesXslMixerMaterialTareStrategyService.save(model);
|
||||
//update-begin---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端同步-----------
|
||||
stompNotify.publishMixerMaterialTareStrategyChanged("add", model.getId());
|
||||
//update-end---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端同步-----------
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料皮重策略-编辑")
|
||||
@Operation(summary = "MES密炼物料皮重策略-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_tare_strategy:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslMixerMaterialTareStrategy model) {
|
||||
fillMaintainBy(model);
|
||||
String err = mesXslMixerMaterialTareStrategyService.validateBeforeSave(model, true);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
mesXslMixerMaterialTareStrategyService.updateById(model);
|
||||
//update-begin---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端同步-----------
|
||||
stompNotify.publishMixerMaterialTareStrategyChanged("edit", model.getId());
|
||||
//update-end---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端同步-----------
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料皮重策略-删除")
|
||||
@Operation(summary = "MES密炼物料皮重策略-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_tare_strategy:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslMixerMaterialTareStrategyService.removeById(id);
|
||||
//update-begin---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端同步-----------
|
||||
stompNotify.publishMixerMaterialTareStrategyChanged("delete", id);
|
||||
//update-end---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端同步-----------
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料皮重策略-批量删除")
|
||||
@Operation(summary = "MES密炼物料皮重策略-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_tare_strategy:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslMixerMaterialTareStrategyService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
//update-begin---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端同步-----------
|
||||
stompNotify.publishMixerMaterialTareStrategyChanged("batchDelete", ids);
|
||||
//update-end---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端同步-----------
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES密炼物料皮重策略-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslMixerMaterialTareStrategy> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslMixerMaterialTareStrategy entity = mesXslMixerMaterialTareStrategyService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_tare_strategy:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslMixerMaterialTareStrategy model) {
|
||||
return super.exportXls(request, model, MesXslMixerMaterialTareStrategy.class, "密炼物料皮重策略");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_tare_strategy:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslMixerMaterialTareStrategy.class);
|
||||
}
|
||||
|
||||
//update-begin---author:cursor ---date:20250602 for:【密炼物料皮重策略】维护人自动回填当前登录用户-----------
|
||||
private void fillMaintainBy(MesXslMixerMaterialTareStrategy model) {
|
||||
LoginUser loginUser = null;
|
||||
try {
|
||||
loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
} catch (Exception e) {
|
||||
log.debug("获取登录用户失败", e);
|
||||
}
|
||||
if (loginUser != null && oConvertUtils.isNotEmpty(loginUser.getUsername())) {
|
||||
model.setMaintainBy(loginUser.getUsername());
|
||||
}
|
||||
}
|
||||
//update-end---author:cursor ---date:20250602 for:【密炼物料皮重策略】维护人自动回填当前登录用户-----------
|
||||
}
|
||||
@@ -22,6 +22,7 @@ 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.approval.action.ApprovalBizAction;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerPsCompile;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerPsCompileService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -168,6 +169,9 @@ public class MesXslMixerPsCompileController extends JeecgController<MesXslMixerP
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼PS编制】校对/审核/批准-----------
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】标注为审批可选回调动作-----
|
||||
@ApprovalBizAction(name = "校对", table = "mes_xsl_mixer_ps_compile", phase = {"onNodeApprove", "onApprove"}, order = 1)
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】标注为审批可选回调动作-----
|
||||
@AutoLog(value = "MES密炼PS编制-校对")
|
||||
@Operation(summary = "MES密炼PS编制-校对")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:proofread")
|
||||
@@ -176,6 +180,9 @@ public class MesXslMixerPsCompileController extends JeecgController<MesXslMixerP
|
||||
return doChangeStatus(ids, "compile", "proofread", "校对");
|
||||
}
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】标注为审批可选回调动作-----
|
||||
@ApprovalBizAction(name = "审核", table = "mes_xsl_mixer_ps_compile", phase = {"onNodeApprove", "onApprove"}, order = 2)
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】标注为审批可选回调动作-----
|
||||
@AutoLog(value = "MES密炼PS编制-审核")
|
||||
@Operation(summary = "MES密炼PS编制-审核")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:audit")
|
||||
@@ -184,6 +191,9 @@ public class MesXslMixerPsCompileController extends JeecgController<MesXslMixerP
|
||||
return doChangeStatus(ids, "proofread", "audit", "审核");
|
||||
}
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】标注为审批可选回调动作-----
|
||||
@ApprovalBizAction(name = "批准", table = "mes_xsl_mixer_ps_compile", phase = {"onNodeApprove", "onApprove"}, order = 3)
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】标注为审批可选回调动作-----
|
||||
@AutoLog(value = "MES密炼PS编制-批准")
|
||||
@Operation(summary = "MES密炼PS编制-批准")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:approve")
|
||||
@@ -201,6 +211,34 @@ public class MesXslMixerPsCompileController extends JeecgController<MesXslMixerP
|
||||
return Result.OK(actionLabel + "成功!");
|
||||
}
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】密炼PS拒绝/撤回逆向回退-----------
|
||||
@ApprovalBizAction(name = "拒绝", table = "mes_xsl_mixer_ps_compile", phase = {"onReject"}, order = 4)
|
||||
@AutoLog(value = "MES密炼PS编制-拒绝")
|
||||
@Operation(summary = "MES密炼PS编制-拒绝(一步退回编制并撤销关联操作)")
|
||||
// 拒绝主要由审批流 onReject 回调触发(执行人为当前审批节点处理人),不强制要求其具备密炼PS业务权限码;
|
||||
// 是否允许驳回已由审批节点本身控制,故此处不加 @RequiresPermissions。
|
||||
@PostMapping(value = "/reject")
|
||||
public Result<String> reject(@RequestParam(name = "ids") String ids) {
|
||||
String err = mesXslMixerPsCompileService.rejectBatch(ids, getOperatorName());
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
return Result.OK("拒绝成功,已退回编制状态!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼PS编制-撤回")
|
||||
@Operation(summary = "MES密炼PS编制-撤回(退回上一环节并撤销关联操作)")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:withdraw")
|
||||
@PostMapping(value = "/withdraw")
|
||||
public Result<String> withdraw(@RequestParam(name = "ids") String ids) {
|
||||
String err = mesXslMixerPsCompileService.withdrawBatch(ids, getOperatorName());
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
return Result.OK("撤回成功!");
|
||||
}
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】密炼PS拒绝/撤回逆向回退-----------
|
||||
|
||||
private String getOperatorName() {
|
||||
LoginUser loginUser = null;
|
||||
try {
|
||||
|
||||
@@ -10,6 +10,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
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;
|
||||
@@ -30,6 +31,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
@Tag(name = "MES混炼示方")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslMixingSpec")
|
||||
@Slf4j
|
||||
public class MesXslMixingSpecController extends JeecgController<MesXslMixingSpec, IMesXslMixingSpecService> {
|
||||
|
||||
@Autowired
|
||||
@@ -59,13 +61,36 @@ public class MesXslMixingSpecController extends JeecgController<MesXslMixingSpec
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixing_spec:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslMixingSpecPage page) {
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A47】混炼示方保存分步骤性能日志-----------
|
||||
long requestStartMs = System.currentTimeMillis();
|
||||
log.info(
|
||||
"[混炼示方保存性能] 接口/add 收到请求 specName={}, payload=[material={}, step={}, downStep={}, tcu={}]",
|
||||
page != null ? page.getSpecName() : null,
|
||||
countChildRows(page != null ? page.getMaterialList() : null),
|
||||
countChildRows(page != null ? page.getStepList() : null),
|
||||
countChildRows(page != null ? page.getDownStepList() : null),
|
||||
countChildRows(page != null ? page.getTcuList() : null));
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A47】混炼示方保存分步骤性能日志-----------
|
||||
String err = validateMain(page);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
long validateMs = System.currentTimeMillis();
|
||||
MesXslMixingSpec main = new MesXslMixingSpec();
|
||||
BeanUtils.copyProperties(page, main);
|
||||
long copyMs = System.currentTimeMillis();
|
||||
mesXslMixingSpecService.saveMain(main, page.getMaterialList(), page.getStepList(), page.getDownStepList(), page.getTcuList());
|
||||
long serviceMs = System.currentTimeMillis();
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A47】混炼示方保存分步骤性能日志-----------
|
||||
log.info(
|
||||
"[混炼示方保存性能] 接口/add 完成 specName={}, mainId={}, validate={}ms, copy={}ms, service={}ms, total={}ms(返回响应前,不含AutoLog等切面)",
|
||||
main.getSpecName(),
|
||||
main.getId(),
|
||||
validateMs - requestStartMs,
|
||||
copyMs - validateMs,
|
||||
serviceMs - copyMs,
|
||||
serviceMs - requestStartMs);
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A47】混炼示方保存分步骤性能日志-----------
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@@ -74,13 +99,37 @@ public class MesXslMixingSpecController extends JeecgController<MesXslMixingSpec
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixing_spec:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslMixingSpecPage page) {
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A47】混炼示方保存分步骤性能日志-----------
|
||||
long requestStartMs = System.currentTimeMillis();
|
||||
log.info(
|
||||
"[混炼示方保存性能] 接口/edit 收到请求 id={}, specName={}, payload=[material={}, step={}, downStep={}, tcu={}]",
|
||||
page != null ? page.getId() : null,
|
||||
page != null ? page.getSpecName() : null,
|
||||
countChildRows(page != null ? page.getMaterialList() : null),
|
||||
countChildRows(page != null ? page.getStepList() : null),
|
||||
countChildRows(page != null ? page.getDownStepList() : null),
|
||||
countChildRows(page != null ? page.getTcuList() : null));
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A47】混炼示方保存分步骤性能日志-----------
|
||||
String err = validateMain(page);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
long validateMs = System.currentTimeMillis();
|
||||
MesXslMixingSpec main = new MesXslMixingSpec();
|
||||
BeanUtils.copyProperties(page, main);
|
||||
long copyMs = System.currentTimeMillis();
|
||||
mesXslMixingSpecService.updateMain(main, page.getMaterialList(), page.getStepList(), page.getDownStepList(), page.getTcuList());
|
||||
long serviceMs = System.currentTimeMillis();
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A47】混炼示方保存分步骤性能日志-----------
|
||||
log.info(
|
||||
"[混炼示方保存性能] 接口/edit 完成 id={}, specName={}, validate={}ms, copy={}ms, service={}ms, total={}ms(返回响应前,不含AutoLog等切面)",
|
||||
main.getId(),
|
||||
main.getSpecName(),
|
||||
validateMs - requestStartMs,
|
||||
copyMs - validateMs,
|
||||
serviceMs - copyMs,
|
||||
serviceMs - requestStartMs);
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A47】混炼示方保存分步骤性能日志-----------
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@@ -151,5 +200,11 @@ public class MesXslMixingSpecController extends JeecgController<MesXslMixingSpec
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A47】混炼示方保存分步骤性能日志-----------
|
||||
private static int countChildRows(List<?> rows) {
|
||||
return rows == null ? 0 : rows.size();
|
||||
}
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A47】混炼示方保存分步骤性能日志-----------
|
||||
//update-end---author:cursor ---date:20260522 for:【XSLMES-20260522-A17】混炼示方主子保存校验-----------
|
||||
}
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
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.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.modules.xslmes.entity.MesXslProductionOrder;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslProductionOrderService;
|
||||
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;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMasterBatchPlan;
|
||||
|
||||
@Tag(name = "生产订单")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslProductionOrder")
|
||||
public class MesXslProductionOrderController
|
||||
extends JeecgController<MesXslProductionOrder, IMesXslProductionOrderService> {
|
||||
|
||||
@Autowired private IMesXslProductionOrderService mesXslProductionOrderService;
|
||||
|
||||
@Operation(summary = "生产订单-分页列表查询")
|
||||
@GetMapping("/list")
|
||||
public Result<IPage<MesXslProductionOrder>> queryPageList(
|
||||
MesXslProductionOrder model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslProductionOrder> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<MesXslProductionOrder> pageList = mesXslProductionOrderService.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "生产订单-添加")
|
||||
@Operation(summary = "生产订单-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_production_order:add")
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody MesXslProductionOrder model) {
|
||||
mesXslProductionOrderService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "生产订单-编辑")
|
||||
@Operation(summary = "生产订单-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_production_order:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslProductionOrder model) {
|
||||
mesXslProductionOrderService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "生产订单-通过id删除")
|
||||
@Operation(summary = "生产订单-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_production_order:delete")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslProductionOrderService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "生产订单-批量删除")
|
||||
@Operation(summary = "生产订单-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_production_order:deleteBatch")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslProductionOrderService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "生产订单-通过id查询")
|
||||
@GetMapping("/queryById")
|
||||
public Result<MesXslProductionOrder> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslProductionOrder entity = mesXslProductionOrderService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@AutoLog(value = "生产订单-拆分生成母胶计划")
|
||||
@Operation(summary = "生产订单-拆分生成母胶计划")
|
||||
@RequiresPermissions("xslmes:mes_xsl_production_order:split")
|
||||
@PostMapping("/split")
|
||||
public Result<MesXslMasterBatchPlan> split(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslMasterBatchPlan plan = mesXslProductionOrderService.splitToMasterBatchPlan(id);
|
||||
return Result.OK("拆分成功", plan);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_production_order:exportXls")
|
||||
@RequestMapping("/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslProductionOrder model) {
|
||||
return super.exportXls(request, model, MesXslProductionOrder.class, "生产订单");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
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.modules.xslmes.service.IMesXslRackTrainCountSettingService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslRackTrainCountSettingVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 架子车数设定(数据来源于混炼示方,不建独立业务表)
|
||||
*/
|
||||
@Tag(name = "架子车数设定")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslRackTrainCountSetting")
|
||||
@Slf4j
|
||||
public class MesXslRackTrainCountSettingController {
|
||||
|
||||
@Autowired
|
||||
private IMesXslRackTrainCountSettingService rackTrainCountSettingService;
|
||||
|
||||
//update-begin---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定分页列表-----------
|
||||
@Operation(summary = "架子车数设定-分页列表查询")
|
||||
@RequiresPermissions("xslmes:mes_xsl_rack_train_count_setting:list")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRackTrainCountSettingVO>> queryPageList(
|
||||
MesXslRackTrainCountSettingVO query,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "keyword", required = false) String keyword) {
|
||||
return Result.OK(rackTrainCountSettingService.queryPage(pageNo, pageSize, query, keyword));
|
||||
}
|
||||
//update-end---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定分页列表-----------
|
||||
|
||||
//update-begin---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定详情查询-----------
|
||||
@Operation(summary = "架子车数设定-通过id查询")
|
||||
@RequiresPermissions("xslmes:mes_xsl_rack_train_count_setting:list")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslRackTrainCountSettingVO> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslRackTrainCountSettingVO detail = rackTrainCountSettingService.queryById(id);
|
||||
if (detail == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(detail);
|
||||
}
|
||||
//update-end---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定详情查询-----------
|
||||
|
||||
//update-begin---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定保存-----------
|
||||
@AutoLog(value = "架子车数设定-保存")
|
||||
@Operation(summary = "架子车数设定-保存设定车数")
|
||||
@RequiresPermissions("xslmes:mes_xsl_rack_train_count_setting:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslRackTrainCountSettingVO setting) {
|
||||
try {
|
||||
rackTrainCountSettingService.saveSetting(setting);
|
||||
return Result.OK("保存成功!");
|
||||
} catch (IllegalArgumentException ex) {
|
||||
return Result.error(ex.getMessage());
|
||||
}
|
||||
}
|
||||
//update-end---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定保存-----------
|
||||
}
|
||||
@@ -0,0 +1,309 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestDataPoint;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestDataPointService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 胶料快检数据点
|
||||
*/
|
||||
@Tag(name = "MES胶料快检数据点")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslRubberQuickTestDataPoint")
|
||||
@Slf4j
|
||||
public class MesXslRubberQuickTestDataPointController
|
||||
extends JeecgController<MesXslRubberQuickTestDataPoint, IMesXslRubberQuickTestDataPointService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslRubberQuickTestDataPointService mesXslRubberQuickTestDataPointService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslRubberQuickTestTypeService mesXslRubberQuickTestTypeService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料快检数据点-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberQuickTestDataPoint>> queryPageList(
|
||||
MesXslRubberQuickTestDataPoint model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslRubberQuickTestDataPoint> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
Page<MesXslRubberQuickTestDataPoint> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslRubberQuickTestDataPoint> pageList = mesXslRubberQuickTestDataPointService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检数据点-添加")
|
||||
@Operation(summary = "MES胶料快检数据点-添加")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslRubberQuickTestDataPoint model) {
|
||||
//update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点保存校验、实验类型回填-----------
|
||||
String err = validateForSave(model, null);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
try {
|
||||
mesXslRubberQuickTestDataPointService.save(model);
|
||||
} catch (JeecgBootException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点保存校验、实验类型回填-----------
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检数据点-编辑")
|
||||
@Operation(summary = "MES胶料快检数据点-编辑")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslRubberQuickTestDataPoint model) {
|
||||
//update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点编辑校验-----------
|
||||
if (oConvertUtils.isEmpty(model.getId())) {
|
||||
return Result.error("缺少主键");
|
||||
}
|
||||
MesXslRubberQuickTestDataPoint old = mesXslRubberQuickTestDataPointService.getById(model.getId());
|
||||
if (old == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
String err = validateForSave(model, model.getId());
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
old.setPointName(model.getPointName());
|
||||
old.setQuickTestTypeId(model.getQuickTestTypeId());
|
||||
old.setQuickTestTypeName(model.getQuickTestTypeName());
|
||||
old.setUnitType(model.getUnitType());
|
||||
old.setPointDesc(model.getPointDesc());
|
||||
try {
|
||||
mesXslRubberQuickTestDataPointService.updateById(old);
|
||||
} catch (JeecgBootException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点编辑校验-----------
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检数据点-删除")
|
||||
@Operation(summary = "MES胶料快检数据点-通过id删除")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestDataPointDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestDataPointService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检数据点-批量删除")
|
||||
@Operation(summary = "MES胶料快检数据点-批量删除")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestDataPointDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestDataPointService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES胶料快检数据点-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslRubberQuickTestDataPoint> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslRubberQuickTestDataPoint entity = mesXslRubberQuickTestDataPointService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@Operation(summary = "校验数据点名称是否重复")
|
||||
@GetMapping(value = "/checkPointName")
|
||||
public Result<String> checkPointName(
|
||||
@RequestParam(name = "pointName", required = true) String pointName,
|
||||
@RequestParam(name = "dataId", required = false) String dataId) {
|
||||
if (oConvertUtils.isEmpty(pointName) || pointName.trim().isEmpty()) {
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
MesXslRubberQuickTestDataPoint ctx = new MesXslRubberQuickTestDataPoint();
|
||||
if (mesXslRubberQuickTestDataPointService.isPointNameDuplicated(pointName.trim(), dataId, ctx)) {
|
||||
return Result.error("该数据点名称已存在");
|
||||
}
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslRubberQuickTestDataPoint model) {
|
||||
return super.exportXls(request, model, MesXslRubberQuickTestDataPoint.class, "MES胶料快检数据点");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
//update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点导入校验-----------
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<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<MesXslRubberQuickTestDataPoint> list =
|
||||
ExcelImportUtil.importExcel(file.getInputStream(), MesXslRubberQuickTestDataPoint.class, params);
|
||||
if (list == null) {
|
||||
list = List.of();
|
||||
}
|
||||
Set<String> namesInFile = new HashSet<>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
MesXslRubberQuickTestDataPoint row = list.get(i);
|
||||
int rowNo = i + 1;
|
||||
if (row == null) {
|
||||
return Result.error("文件导入失败:第 " + rowNo + " 条数据无效(空行)");
|
||||
}
|
||||
String err = validateImportRow(row, rowNo, namesInFile);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
}
|
||||
for (MesXslRubberQuickTestDataPoint row : list) {
|
||||
try {
|
||||
mesXslRubberQuickTestDataPointService.save(row);
|
||||
} catch (JeecgBootException e) {
|
||||
return Result.error("文件导入失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
log.info("胶料快检数据点Excel导入完成,行数={}", list.size());
|
||||
return Result.ok("文件导入成功!数据行数:" + list.size());
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
log.error(msg, e);
|
||||
return Result.error("文件导入失败:" + e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点导入校验-----------
|
||||
return Result.error("文件导入失败!");
|
||||
}
|
||||
|
||||
private String validateForSave(MesXslRubberQuickTestDataPoint model, String excludeId) {
|
||||
if (oConvertUtils.isEmpty(model.getPointName()) || model.getPointName().trim().isEmpty()) {
|
||||
return "数据点名称不能为空";
|
||||
}
|
||||
model.setPointName(model.getPointName().trim());
|
||||
if (mesXslRubberQuickTestDataPointService.isPointNameDuplicated(model.getPointName(), excludeId, model)) {
|
||||
return "数据点名称已存在";
|
||||
}
|
||||
if (oConvertUtils.isNotEmpty(model.getUnitType())) {
|
||||
model.setUnitType(model.getUnitType().trim());
|
||||
}
|
||||
if (oConvertUtils.isNotEmpty(model.getPointDesc())) {
|
||||
model.setPointDesc(model.getPointDesc().trim());
|
||||
}
|
||||
return resolveAndFillQuickTestType(model);
|
||||
}
|
||||
|
||||
private String validateImportRow(MesXslRubberQuickTestDataPoint row, int rowNo, Set<String> namesInFile) {
|
||||
if (oConvertUtils.isEmpty(row.getPointName()) || row.getPointName().trim().isEmpty()) {
|
||||
return "文件导入失败:第 " + rowNo + " 条数据点名称不能为空";
|
||||
}
|
||||
row.setPointName(row.getPointName().trim());
|
||||
if (!namesInFile.add(row.getPointName())) {
|
||||
return "文件导入失败:数据点名称【" + row.getPointName() + "】在导入文件中重复";
|
||||
}
|
||||
if (mesXslRubberQuickTestDataPointService.isPointNameDuplicated(row.getPointName(), null, row)) {
|
||||
return "文件导入失败:第 " + rowNo + " 条数据点名称【" + row.getPointName() + "】已存在";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(row.getQuickTestTypeId()) && oConvertUtils.isNotEmpty(row.getImportQuickTestTypeName())) {
|
||||
row.setQuickTestTypeName(row.getImportQuickTestTypeName().trim());
|
||||
}
|
||||
if (oConvertUtils.isEmpty(row.getQuickTestTypeId()) && oConvertUtils.isNotEmpty(row.getQuickTestTypeName())) {
|
||||
MesXslRubberQuickTestType type = findQuickTestTypeByName(row.getQuickTestTypeName(), row);
|
||||
if (type == null) {
|
||||
return "文件导入失败:第 " + rowNo + " 条实验类型【" + row.getQuickTestTypeName() + "】不存在";
|
||||
}
|
||||
row.setQuickTestTypeId(type.getId());
|
||||
}
|
||||
String typeErr = resolveAndFillQuickTestType(row);
|
||||
if (typeErr != null) {
|
||||
return "文件导入失败:第 " + rowNo + " 条" + typeErr;
|
||||
}
|
||||
if (oConvertUtils.isNotEmpty(row.getUnitType())) {
|
||||
row.setUnitType(row.getUnitType().trim());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String resolveAndFillQuickTestType(MesXslRubberQuickTestDataPoint model) {
|
||||
if (oConvertUtils.isEmpty(model.getQuickTestTypeId())) {
|
||||
return "请选择实验类型";
|
||||
}
|
||||
MesXslRubberQuickTestType type = mesXslRubberQuickTestTypeService.getById(model.getQuickTestTypeId());
|
||||
if (type == null) {
|
||||
return "实验类型不存在或已删除";
|
||||
}
|
||||
model.setQuickTestTypeName(type.getTypeName());
|
||||
return null;
|
||||
}
|
||||
|
||||
private MesXslRubberQuickTestType findQuickTestTypeByName(String typeName, MesXslRubberQuickTestDataPoint context) {
|
||||
LambdaQueryWrapper<MesXslRubberQuickTestType> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslRubberQuickTestType::getTypeName, typeName.trim());
|
||||
w.and(
|
||||
q ->
|
||||
q.eq(MesXslRubberQuickTestType::getDelFlag, CommonConstant.DEL_FLAG_0)
|
||||
.or()
|
||||
.isNull(MesXslRubberQuickTestType::getDelFlag));
|
||||
Integer tenantId = context != null ? context.getTenantId() : null;
|
||||
if (tenantId != null) {
|
||||
w.eq(MesXslRubberQuickTestType::getTenantId, tenantId);
|
||||
}
|
||||
w.last("LIMIT 1");
|
||||
return mesXslRubberQuickTestTypeService.getOne(w, false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,506 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestDataPoint;
|
||||
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethod;
|
||||
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethodLine;
|
||||
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType;
|
||||
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestDataPointService;
|
||||
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestMethodService;
|
||||
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService;
|
||||
|
||||
import org.jeecg.modules.xslmes.vo.MesXslRubberQuickTestMethodPage;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* MES 胶料快检实验方法(主子表)
|
||||
|
||||
*/
|
||||
|
||||
@Tag(name = "MES胶料快检实验方法")
|
||||
|
||||
@RestController
|
||||
|
||||
@RequestMapping("/xslmes/mesXslRubberQuickTestMethod")
|
||||
|
||||
@Slf4j
|
||||
|
||||
public class MesXslRubberQuickTestMethodController
|
||||
|
||||
extends JeecgController<MesXslRubberQuickTestMethod, IMesXslRubberQuickTestMethodService> {
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
|
||||
private IMesXslRubberQuickTestMethodService mesXslRubberQuickTestMethodService;
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
|
||||
private IMesXslRubberQuickTestTypeService mesXslRubberQuickTestTypeService;
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
|
||||
private IMesXslRubberQuickTestDataPointService mesXslRubberQuickTestDataPointService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料快检实验方法-分页列表查询")
|
||||
|
||||
@GetMapping(value = "/list")
|
||||
|
||||
public Result<IPage<MesXslRubberQuickTestMethod>> queryPageList(
|
||||
|
||||
MesXslRubberQuickTestMethod model,
|
||||
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
|
||||
HttpServletRequest req) {
|
||||
|
||||
QueryWrapper<MesXslRubberQuickTestMethod> queryWrapper =
|
||||
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
||||
Page<MesXslRubberQuickTestMethod> page = new Page<>(pageNo, pageSize);
|
||||
|
||||
IPage<MesXslRubberQuickTestMethod> pageList = mesXslRubberQuickTestMethodService.page(page, queryWrapper);
|
||||
|
||||
return Result.OK(pageList);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@AutoLog(value = "MES胶料快检实验方法-添加")
|
||||
|
||||
@Operation(summary = "MES胶料快检实验方法-添加")
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_method:add")
|
||||
|
||||
@PostMapping(value = "/add")
|
||||
|
||||
public Result<String> add(@RequestBody MesXslRubberQuickTestMethodPage page) {
|
||||
|
||||
MesXslRubberQuickTestMethod main = new MesXslRubberQuickTestMethod();
|
||||
|
||||
BeanUtils.copyProperties(page, main);
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法保存校验与明细从数据点带出-----------
|
||||
|
||||
String err = validateForSave(main, page.getLineList(), null);
|
||||
|
||||
if (err != null) {
|
||||
|
||||
return Result.error(err);
|
||||
|
||||
}
|
||||
|
||||
//update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法保存校验与明细从数据点带出-----------
|
||||
|
||||
try {
|
||||
|
||||
mesXslRubberQuickTestMethodService.saveMain(main, page.getLineList());
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
log.error(e.getMessage(), e);
|
||||
|
||||
return Result.error(e.getMessage());
|
||||
|
||||
}
|
||||
|
||||
return Result.OK("添加成功!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@AutoLog(value = "MES胶料快检实验方法-编辑")
|
||||
|
||||
@Operation(summary = "MES胶料快检实验方法-编辑")
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_method:edit")
|
||||
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
|
||||
public Result<String> edit(@RequestBody MesXslRubberQuickTestMethodPage page) {
|
||||
|
||||
MesXslRubberQuickTestMethod main = new MesXslRubberQuickTestMethod();
|
||||
|
||||
BeanUtils.copyProperties(page, main);
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法保存校验与明细从数据点带出-----------
|
||||
|
||||
String err = validateForSave(main, page.getLineList(), main.getId());
|
||||
|
||||
if (err != null) {
|
||||
|
||||
return Result.error(err);
|
||||
|
||||
}
|
||||
|
||||
//update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法保存校验与明细从数据点带出-----------
|
||||
|
||||
try {
|
||||
|
||||
mesXslRubberQuickTestMethodService.updateMain(main, page.getLineList());
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
log.error(e.getMessage(), e);
|
||||
|
||||
return Result.error(e.getMessage());
|
||||
|
||||
}
|
||||
|
||||
return Result.OK("编辑成功!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@AutoLog(value = "MES胶料快检实验方法-删除")
|
||||
|
||||
@Operation(summary = "MES胶料快检实验方法-通过id删除")
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_method:delete")
|
||||
|
||||
@DeleteMapping(value = "/delete")
|
||||
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestMethodDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestMethodService.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检实验方法-批量删除")
|
||||
@Operation(summary = "MES胶料快检实验方法-批量删除")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_method:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestMethodDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestMethodService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "MES胶料快检实验方法-通过id查询")
|
||||
|
||||
@GetMapping(value = "/queryById")
|
||||
|
||||
public Result<MesXslRubberQuickTestMethod> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
|
||||
MesXslRubberQuickTestMethod entity = mesXslRubberQuickTestMethodService.getById(id);
|
||||
|
||||
if (entity == null) {
|
||||
|
||||
return Result.error("未找到对应数据");
|
||||
|
||||
}
|
||||
|
||||
return Result.OK(entity);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "MES胶料快检实验方法-查询明细")
|
||||
|
||||
@GetMapping(value = "/queryLineListByMethodId")
|
||||
|
||||
public Result<List<MesXslRubberQuickTestMethodLine>> queryLineListByMethodId(
|
||||
|
||||
@RequestParam(name = "id", required = true) String id) {
|
||||
|
||||
return Result.OK(mesXslRubberQuickTestMethodService.selectLinesByMethodId(id));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "MES胶料快检实验方法-下一编号")
|
||||
|
||||
@GetMapping(value = "/nextMethodCode")
|
||||
|
||||
public Result<String> nextMethodCode() {
|
||||
|
||||
MesXslRubberQuickTestMethod ctx = new MesXslRubberQuickTestMethod();
|
||||
|
||||
return Result.OK(mesXslRubberQuickTestMethodService.generateNextMethodCode(ctx));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "MES胶料快检实验方法-校验名称唯一")
|
||||
|
||||
@GetMapping(value = "/checkMethodName")
|
||||
|
||||
public Result<?> checkMethodName(
|
||||
|
||||
@RequestParam(name = "methodName") String methodName,
|
||||
|
||||
@RequestParam(name = "dataId", required = false) String dataId) {
|
||||
|
||||
if (oConvertUtils.isEmpty(methodName) || methodName.trim().isEmpty()) {
|
||||
|
||||
return Result.OK();
|
||||
|
||||
}
|
||||
|
||||
MesXslRubberQuickTestMethod ctx = new MesXslRubberQuickTestMethod();
|
||||
|
||||
if (mesXslRubberQuickTestMethodService.isMethodNameDuplicated(methodName.trim(), dataId, ctx)) {
|
||||
|
||||
return Result.error("实验方法名称已存在");
|
||||
|
||||
}
|
||||
|
||||
return Result.OK();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_method:exportXls")
|
||||
|
||||
@RequestMapping(value = "/exportXls")
|
||||
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslRubberQuickTestMethod model) {
|
||||
|
||||
return super.exportXls(request, model, MesXslRubberQuickTestMethod.class, "MES胶料快检实验方法");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_method:importExcel")
|
||||
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
return super.importExcel(request, response, MesXslRubberQuickTestMethod.class);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法保存校验与明细从数据点带出-----------
|
||||
|
||||
private String validateForSave(
|
||||
|
||||
MesXslRubberQuickTestMethod main, List<MesXslRubberQuickTestMethodLine> lineList, String excludeId) {
|
||||
|
||||
if (main == null) {
|
||||
|
||||
return "参数不能为空";
|
||||
|
||||
}
|
||||
|
||||
if (oConvertUtils.isEmpty(main.getMethodName())) {
|
||||
|
||||
return "实验方法名称不能为空";
|
||||
|
||||
}
|
||||
|
||||
main.setMethodName(main.getMethodName().trim());
|
||||
|
||||
if (mesXslRubberQuickTestMethodService.isMethodNameDuplicated(main.getMethodName(), excludeId, main)) {
|
||||
|
||||
return "实验方法名称已存在";
|
||||
|
||||
}
|
||||
|
||||
if (oConvertUtils.isEmpty(main.getQuickTestTypeId())) {
|
||||
|
||||
return "请选择实验类型";
|
||||
|
||||
}
|
||||
|
||||
MesXslRubberQuickTestType type = mesXslRubberQuickTestTypeService.getById(main.getQuickTestTypeId());
|
||||
|
||||
if (type == null || isDeleted(type.getDelFlag())) {
|
||||
|
||||
return "实验类型不存在或已删除";
|
||||
|
||||
}
|
||||
|
||||
main.setQuickTestTypeName(type.getTypeName());
|
||||
|
||||
|
||||
|
||||
if (lineList == null || lineList.isEmpty()) {
|
||||
|
||||
return "请通过「选择数据点」至少添加一条明细";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Set<String> pointIds = new HashSet<>();
|
||||
|
||||
int sort = 0;
|
||||
|
||||
for (int i = 0; i < lineList.size(); i++) {
|
||||
|
||||
MesXslRubberQuickTestMethodLine line = lineList.get(i);
|
||||
|
||||
if (line == null) {
|
||||
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
int rowNo = i + 1;
|
||||
|
||||
if (oConvertUtils.isEmpty(line.getDataPointId())) {
|
||||
|
||||
return "第 " + rowNo + " 行未选择数据点";
|
||||
|
||||
}
|
||||
|
||||
String pointId = line.getDataPointId().trim();
|
||||
|
||||
if (!pointIds.add(pointId)) {
|
||||
|
||||
return "第 " + rowNo + " 行数据点与前面行重复,同一方法中数据点不能重复";
|
||||
|
||||
}
|
||||
|
||||
MesXslRubberQuickTestDataPoint point = mesXslRubberQuickTestDataPointService.getById(pointId);
|
||||
|
||||
if (point == null || isDeleted(point.getDelFlag())) {
|
||||
|
||||
return "第 " + rowNo + " 行数据点不存在或已删除";
|
||||
|
||||
}
|
||||
|
||||
if (!main.getQuickTestTypeId().equals(point.getQuickTestTypeId())) {
|
||||
|
||||
return "第 " + rowNo + " 行数据点的实验类型与主表实验类型不一致";
|
||||
|
||||
}
|
||||
|
||||
line.setDataPointId(pointId);
|
||||
|
||||
line.setPointName(point.getPointName());
|
||||
|
||||
line.setUnitType(point.getUnitType());
|
||||
|
||||
if (oConvertUtils.isEmpty(line.getTorqueUnitType())) {
|
||||
|
||||
return "第 " + rowNo + " 行请选择扭矩单位类型";
|
||||
|
||||
}
|
||||
|
||||
if (oConvertUtils.isEmpty(line.getTimeUnitType())) {
|
||||
|
||||
return "第 " + rowNo + " 行请选择时间单位类型";
|
||||
|
||||
}
|
||||
|
||||
if (oConvertUtils.isEmpty(line.getMooneyUnitType())) {
|
||||
|
||||
return "第 " + rowNo + " 行请选择门尼单位类型";
|
||||
|
||||
}
|
||||
|
||||
line.setSortNo(sort++);
|
||||
|
||||
}
|
||||
|
||||
if (pointIds.isEmpty()) {
|
||||
|
||||
return "请通过「选择数据点」至少添加一条明细";
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static boolean isDeleted(Integer delFlag) {
|
||||
|
||||
return delFlag != null && delFlag.equals(CommonConstant.DEL_FLAG_1);
|
||||
|
||||
}
|
||||
|
||||
//update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法保存校验与明细从数据点带出-----------
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
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.List;
|
||||
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.mes.material.entity.MesMaterial;
|
||||
import org.jeecg.modules.mes.material.service.IMesMaterialService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecord;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestRecordService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslRubberQuickTestRecordBatchFromMaterialVO;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslRubberQuickTestRecordPage;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 胶料快检记录(主子表)
|
||||
*/
|
||||
@Tag(name = "MES胶料快检记录")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslRubberQuickTestRecord")
|
||||
@Slf4j
|
||||
public class MesXslRubberQuickTestRecordController
|
||||
extends JeecgController<MesXslRubberQuickTestRecord, IMesXslRubberQuickTestRecordService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslRubberQuickTestRecordService mesXslRubberQuickTestRecordService;
|
||||
|
||||
@Autowired
|
||||
private IMesMaterialService mesMaterialService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslRubberQuickTestTypeService mesXslRubberQuickTestTypeService;
|
||||
|
||||
@Operation(summary = "MES胶料快检记录-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberQuickTestRecord>> queryPageList(
|
||||
MesXslRubberQuickTestRecord model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslRubberQuickTestRecord> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("inspect_time", "create_time");
|
||||
Page<MesXslRubberQuickTestRecord> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslRubberQuickTestRecord> pageList = mesXslRubberQuickTestRecordService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检记录-添加")
|
||||
@Operation(summary = "MES胶料快检记录-添加")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_record:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslRubberQuickTestRecordPage page) {
|
||||
MesXslRubberQuickTestRecord main = new MesXslRubberQuickTestRecord();
|
||||
BeanUtils.copyProperties(page, main);
|
||||
String err = validateForSave(main, page.getLineList());
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
try {
|
||||
mesXslRubberQuickTestRecordService.saveMain(main, page.getLineList());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检记录-编辑")
|
||||
@Operation(summary = "MES胶料快检记录-编辑")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_record:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslRubberQuickTestRecordPage page) {
|
||||
MesXslRubberQuickTestRecord main = new MesXslRubberQuickTestRecord();
|
||||
BeanUtils.copyProperties(page, main);
|
||||
String err = validateForSave(main, page.getLineList());
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
try {
|
||||
mesXslRubberQuickTestRecordService.updateMain(main, page.getLineList());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检记录-从胶料批量生成")
|
||||
@Operation(summary = "MES胶料快检记录-从胶料信息批量生成")
|
||||
@RequiresPermissions("mes:mes_material:rubberQuickTestInspect")
|
||||
@PostMapping(value = "/batchFromMaterial")
|
||||
public Result<List<String>> batchFromMaterial(@RequestBody MesXslRubberQuickTestRecordBatchFromMaterialVO vo) {
|
||||
try {
|
||||
List<String> ids = mesXslRubberQuickTestRecordService.batchFromMaterial(vo);
|
||||
return Result.OK("成功生成 " + ids.size() + " 条快检记录", ids);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检记录-删除")
|
||||
@Operation(summary = "MES胶料快检记录-通过id删除")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_record:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslRubberQuickTestRecordService.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检记录-批量删除")
|
||||
@Operation(summary = "MES胶料快检记录-批量删除")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_record:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslRubberQuickTestRecordService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES胶料快检记录-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslRubberQuickTestRecord> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslRubberQuickTestRecord entity = mesXslRubberQuickTestRecordService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@Operation(summary = "MES胶料快检记录-查询明细")
|
||||
@GetMapping(value = "/queryLineListByRecordId")
|
||||
public Result<List<MesXslRubberQuickTestRecordLine>> queryLineListByRecordId(
|
||||
@RequestParam(name = "id", required = true) String id) {
|
||||
return Result.OK(mesXslRubberQuickTestRecordService.selectLinesByRecordId(id));
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_record:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslRubberQuickTestRecord model) {
|
||||
return super.exportXls(request, model, MesXslRubberQuickTestRecord.class, "MES胶料快检记录");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_record:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslRubberQuickTestRecord.class);
|
||||
}
|
||||
|
||||
private String validateForSave(MesXslRubberQuickTestRecord main, List<MesXslRubberQuickTestRecordLine> lineList) {
|
||||
if (main == null) {
|
||||
return "参数不能为空";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(main.getRubberMaterialId())) {
|
||||
return "请选择胶料";
|
||||
}
|
||||
MesMaterial material = mesMaterialService.getById(main.getRubberMaterialId());
|
||||
if (material == null) {
|
||||
return "所选胶料不存在";
|
||||
}
|
||||
main.setRubberMaterialName(material.getMaterialName());
|
||||
|
||||
if (oConvertUtils.isNotEmpty(main.getQuickTestTypeId())) {
|
||||
MesXslRubberQuickTestType type = mesXslRubberQuickTestTypeService.getById(main.getQuickTestTypeId());
|
||||
if (type == null) {
|
||||
return "所选检验类型不存在";
|
||||
}
|
||||
main.setQuickTestTypeName(type.getTypeName());
|
||||
}
|
||||
|
||||
if (lineList == null || lineList.isEmpty()) {
|
||||
return "请维护检验明细";
|
||||
}
|
||||
for (int i = 0; i < lineList.size(); i++) {
|
||||
MesXslRubberQuickTestRecordLine line = lineList.get(i);
|
||||
if (line == null || oConvertUtils.isEmpty(line.getInspectItem())) {
|
||||
return "第 " + (i + 1) + " 行检验项目不能为空";
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
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.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.approval.action.ApprovalBizAction;
|
||||
import org.jeecg.modules.mes.material.entity.MesMaterial;
|
||||
import org.jeecg.modules.mes.material.service.IMesMaterialService;
|
||||
import org.jeecg.modules.system.entity.SysDepart;
|
||||
import org.jeecg.modules.system.service.ISysDepartService;
|
||||
import org.jeecg.modules.xslmes.common.XslMesBizConstants;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerPsCompile;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethod;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethodLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStd;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStdLine;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerPsCompileService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestMethodService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestStdService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslRubberQuickTestStdPage;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 胶料快检实验标准(主子表)
|
||||
*/
|
||||
@Tag(name = "MES胶料快检实验标准")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslRubberQuickTestStd")
|
||||
@Slf4j
|
||||
public class MesXslRubberQuickTestStdController
|
||||
extends JeecgController<MesXslRubberQuickTestStd, IMesXslRubberQuickTestStdService> {
|
||||
|
||||
private static final String ENABLE_IN_USE = "1";
|
||||
private static final String ENABLE_STOPPED = "0";
|
||||
|
||||
@Autowired
|
||||
private IMesXslRubberQuickTestStdService mesXslRubberQuickTestStdService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslRubberQuickTestMethodService mesXslRubberQuickTestMethodService;
|
||||
|
||||
@Autowired
|
||||
private IMesMaterialService mesMaterialService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslMixerPsCompileService mesXslMixerPsCompileService;
|
||||
|
||||
@Autowired
|
||||
private ISysDepartService sysDepartService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料快检实验标准-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberQuickTestStd>> queryPageList(
|
||||
MesXslRubberQuickTestStd model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslRubberQuickTestStd> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<MesXslRubberQuickTestStd> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslRubberQuickTestStd> pageList = mesXslRubberQuickTestStdService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检实验标准-添加")
|
||||
@Operation(summary = "MES胶料快检实验标准-添加")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_std:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslRubberQuickTestStdPage page) {
|
||||
MesXslRubberQuickTestStd main = new MesXslRubberQuickTestStd();
|
||||
BeanUtils.copyProperties(page, main);
|
||||
//update-begin---author:jiangxh ---date:20260525 for:【MES】胶料快检实验标准保存校验与明细从实验方法带出-----------
|
||||
String err = validateForSave(main, page.getLineList(), null);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260525 for:【MES】胶料快检实验标准保存校验与明细从实验方法带出-----------
|
||||
try {
|
||||
mesXslRubberQuickTestStdService.saveMain(main, page.getLineList());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检实验标准-编辑")
|
||||
@Operation(summary = "MES胶料快检实验标准-编辑")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_std:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslRubberQuickTestStdPage page) {
|
||||
MesXslRubberQuickTestStd main = new MesXslRubberQuickTestStd();
|
||||
BeanUtils.copyProperties(page, main);
|
||||
//update-begin---author:jiangxh ---date:20260525 for:【MES】胶料快检实验标准保存校验与明细从实验方法带出-----------
|
||||
String err = validateForSave(main, page.getLineList(), main.getId());
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260525 for:【MES】胶料快检实验标准保存校验与明细从实验方法带出-----------
|
||||
try {
|
||||
mesXslRubberQuickTestStdService.updateMain(main, page.getLineList());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检实验标准-删除")
|
||||
@Operation(summary = "MES胶料快检实验标准-通过id删除")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_std:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestStdDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestStdService.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检实验标准-批量删除")
|
||||
@Operation(summary = "MES胶料快检实验标准-批量删除")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_std:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestStdDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestStdService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES胶料快检实验标准-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslRubberQuickTestStd> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslRubberQuickTestStd entity = mesXslRubberQuickTestStdService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@Operation(summary = "MES胶料快检实验标准-查询明细")
|
||||
@GetMapping(value = "/queryLineListByStdId")
|
||||
public Result<List<MesXslRubberQuickTestStdLine>> queryLineListByStdId(
|
||||
@RequestParam(name = "id", required = true) String id) {
|
||||
return Result.OK(mesXslRubberQuickTestStdService.selectLinesByStdId(id));
|
||||
}
|
||||
|
||||
//update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】标注为审批可选回调动作-----
|
||||
@ApprovalBizAction(name = "启用/停用", table = "mes_xsl_rubber_quick_test_std", phase = {"onApprove", "onReject"})
|
||||
//update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】标注为审批可选回调动作-----
|
||||
@AutoLog(value = "MES胶料快检实验标准-启用/停用")
|
||||
@Operation(summary = "MES胶料快检实验标准-启用/停用(字典 xslmes_rubber_quick_test_std_enable_status:1使用中 0已停用)")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_std:updateStatus")
|
||||
@PostMapping(value = "/updateStatus")
|
||||
public Result<String> updateStatus(
|
||||
@RequestParam(name = "id", required = true) String id,
|
||||
@RequestParam(name = "enableStatus", required = true) String enableStatus) {
|
||||
if (enableStatus != null) {
|
||||
enableStatus = enableStatus.trim();
|
||||
}
|
||||
if (!ENABLE_IN_USE.equals(enableStatus) && !ENABLE_STOPPED.equals(enableStatus)) {
|
||||
return Result.error("启用状态参数非法");
|
||||
}
|
||||
boolean updated = mesXslRubberQuickTestStdService.lambdaUpdate()
|
||||
.eq(MesXslRubberQuickTestStd::getId, id)
|
||||
.set(MesXslRubberQuickTestStd::getEnableStatus, enableStatus)
|
||||
.update();
|
||||
if (updated) {
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
MesXslRubberQuickTestStd cur = mesXslRubberQuickTestStdService.getById(id);
|
||||
if (cur != null && java.util.Objects.equals(enableStatus, cur.getEnableStatus())) {
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
return Result.error("操作失败,请确认记录存在");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES胶料快检实验标准-校验名称唯一")
|
||||
@GetMapping(value = "/checkStdName")
|
||||
public Result<?> checkStdName(
|
||||
@RequestParam(name = "stdName") String stdName,
|
||||
@RequestParam(name = "dataId", required = false) String dataId) {
|
||||
if (oConvertUtils.isEmpty(stdName) || stdName.trim().isEmpty()) {
|
||||
return Result.OK();
|
||||
}
|
||||
MesXslRubberQuickTestStd ctx = new MesXslRubberQuickTestStd();
|
||||
if (mesXslRubberQuickTestStdService.isStdNameDuplicated(stdName.trim(), dataId, ctx)) {
|
||||
return Result.error("实验标准名称已存在");
|
||||
}
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_std:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslRubberQuickTestStd model) {
|
||||
return super.exportXls(request, model, MesXslRubberQuickTestStd.class, "MES胶料快检实验标准");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_std:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslRubberQuickTestStd.class);
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260525 for:【MES】胶料快检实验标准保存校验与明细从实验方法带出-----------
|
||||
private String validateForSave(
|
||||
MesXslRubberQuickTestStd main, List<MesXslRubberQuickTestStdLine> lineList, String excludeId) {
|
||||
if (main == null) {
|
||||
return "参数不能为空";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(main.getStdName())) {
|
||||
return "实验标准名称不能为空";
|
||||
}
|
||||
main.setStdName(main.getStdName().trim());
|
||||
if (mesXslRubberQuickTestStdService.isStdNameDuplicated(main.getStdName(), excludeId, main)) {
|
||||
return "实验标准名称已存在";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(main.getTestMethodId())) {
|
||||
return "请选择实验方法";
|
||||
}
|
||||
MesXslRubberQuickTestMethod method = mesXslRubberQuickTestMethodService.getById(main.getTestMethodId());
|
||||
if (method == null || isDeleted(method.getDelFlag())) {
|
||||
return "实验方法不存在或已删除";
|
||||
}
|
||||
main.setTestMethodName(method.getMethodName());
|
||||
|
||||
if (oConvertUtils.isNotEmpty(main.getRubberMaterialId())) {
|
||||
MesMaterial material = mesMaterialService.getById(main.getRubberMaterialId());
|
||||
if (material == null) {
|
||||
return "所选胶料不存在";
|
||||
}
|
||||
main.setRubberMaterialName(material.getMaterialName());
|
||||
}
|
||||
|
||||
if (oConvertUtils.isNotEmpty(main.getPsCompileId())) {
|
||||
MesXslMixerPsCompile ps = mesXslMixerPsCompileService.getById(main.getPsCompileId());
|
||||
if (ps == null) {
|
||||
return "所选密炼PS不存在";
|
||||
}
|
||||
if (!XslMesBizConstants.PS_TYPE_RAW_INSPECT_STD.equals(ps.getPsType())) {
|
||||
return "发行编号须选择类型为原材料检验标准的密炼PS";
|
||||
}
|
||||
main.setIssueNumber(ps.getPsCode());
|
||||
if (main.getIssueDate() == null && ps.getIssueDate() != null) {
|
||||
main.setIssueDate(ps.getIssueDate());
|
||||
}
|
||||
}
|
||||
|
||||
if (oConvertUtils.isNotEmpty(main.getIssueDeptId())) {
|
||||
SysDepart depart = sysDepartService.getById(main.getIssueDeptId());
|
||||
if (depart != null) {
|
||||
main.setIssueDeptName(depart.getDepartName());
|
||||
}
|
||||
}
|
||||
|
||||
List<MesXslRubberQuickTestMethodLine> methodLines =
|
||||
mesXslRubberQuickTestMethodService.selectLinesByMethodId(main.getTestMethodId());
|
||||
if (methodLines == null || methodLines.isEmpty()) {
|
||||
return "所选实验方法未维护数据点明细,请先在实验方法中配置数据点";
|
||||
}
|
||||
|
||||
if (lineList == null || lineList.isEmpty()) {
|
||||
return "请保存与实验方法一致的数据点明细";
|
||||
}
|
||||
|
||||
Map<String, MesXslRubberQuickTestMethodLine> methodLineByPointId = new HashMap<>();
|
||||
for (MesXslRubberQuickTestMethodLine ml : methodLines) {
|
||||
if (ml != null && oConvertUtils.isNotEmpty(ml.getDataPointId())) {
|
||||
methodLineByPointId.put(ml.getDataPointId().trim(), ml);
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> submittedPointIds = new HashSet<>();
|
||||
int sort = 0;
|
||||
for (int i = 0; i < lineList.size(); i++) {
|
||||
MesXslRubberQuickTestStdLine line = lineList.get(i);
|
||||
if (line == null) {
|
||||
continue;
|
||||
}
|
||||
int rowNo = i + 1;
|
||||
if (oConvertUtils.isEmpty(line.getDataPointId())) {
|
||||
return "第 " + rowNo + " 行未关联数据点";
|
||||
}
|
||||
String pointId = line.getDataPointId().trim();
|
||||
if (!submittedPointIds.add(pointId)) {
|
||||
return "第 " + rowNo + " 行数据点重复";
|
||||
}
|
||||
MesXslRubberQuickTestMethodLine methodLine = methodLineByPointId.get(pointId);
|
||||
if (methodLine == null) {
|
||||
return "第 " + rowNo + " 行数据点不属于所选实验方法,请重新选择实验方法后保存";
|
||||
}
|
||||
line.setDataPointId(pointId);
|
||||
line.setPointName(methodLine.getPointName());
|
||||
line.setSortNo(sort++);
|
||||
}
|
||||
|
||||
if (submittedPointIds.size() != methodLineByPointId.size()) {
|
||||
return "明细须包含实验方法中的全部数据点,且不可新增或删除数据点";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isDeleted(Integer delFlag) {
|
||||
return delFlag != null && delFlag.equals(CommonConstant.DEL_FLAG_1);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260525 for:【MES】胶料快检实验标准保存校验与明细从实验方法带出-----------
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 胶料快检实验类型
|
||||
*/
|
||||
@Tag(name = "MES胶料快检实验类型")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslRubberQuickTestType")
|
||||
@Slf4j
|
||||
public class MesXslRubberQuickTestTypeController
|
||||
extends JeecgController<MesXslRubberQuickTestType, IMesXslRubberQuickTestTypeService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslRubberQuickTestTypeService mesXslRubberQuickTestTypeService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料快检实验类型-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberQuickTestType>> queryPageList(
|
||||
MesXslRubberQuickTestType model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslRubberQuickTestType> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
Page<MesXslRubberQuickTestType> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslRubberQuickTestType> pageList = mesXslRubberQuickTestTypeService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检实验类型-添加")
|
||||
@Operation(summary = "MES胶料快检实验类型-添加")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslRubberQuickTestType model) {
|
||||
//update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型新增校验与自动编号-----------
|
||||
if (oConvertUtils.isEmpty(model.getTypeName()) || model.getTypeName().trim().isEmpty()) {
|
||||
return Result.error("实验类型名称不能为空");
|
||||
}
|
||||
model.setTypeName(model.getTypeName().trim());
|
||||
if (mesXslRubberQuickTestTypeService.isTypeNameDuplicated(model.getTypeName(), null, model)) {
|
||||
return Result.error("实验类型名称已存在");
|
||||
}
|
||||
model.setTypeCode(null);
|
||||
try {
|
||||
mesXslRubberQuickTestTypeService.save(model);
|
||||
} catch (JeecgBootException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型新增校验与自动编号-----------
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检实验类型-编辑")
|
||||
@Operation(summary = "MES胶料快检实验类型-编辑")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslRubberQuickTestType model) {
|
||||
//update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型编辑仅改名称、编号只读-----------
|
||||
if (oConvertUtils.isEmpty(model.getId())) {
|
||||
return Result.error("缺少主键");
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getTypeName()) || model.getTypeName().trim().isEmpty()) {
|
||||
return Result.error("实验类型名称不能为空");
|
||||
}
|
||||
model.setTypeName(model.getTypeName().trim());
|
||||
if (mesXslRubberQuickTestTypeService.isTypeNameDuplicated(model.getTypeName(), model.getId(), model)) {
|
||||
return Result.error("实验类型名称已存在");
|
||||
}
|
||||
MesXslRubberQuickTestType old = mesXslRubberQuickTestTypeService.getById(model.getId());
|
||||
if (old == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
old.setTypeName(model.getTypeName());
|
||||
try {
|
||||
mesXslRubberQuickTestTypeService.updateById(old);
|
||||
} catch (JeecgBootException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型编辑仅改名称、编号只读-----------
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检实验类型-删除")
|
||||
@Operation(summary = "MES胶料快检实验类型-通过id删除")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestTypeDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestTypeService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料快检实验类型-批量删除")
|
||||
@Operation(summary = "MES胶料快检实验类型-批量删除")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestTypeDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestTypeService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES胶料快检实验类型-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslRubberQuickTestType> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslRubberQuickTestType entity = mesXslRubberQuickTestTypeService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@Operation(summary = "预览下一实验类型编号(001起)")
|
||||
@GetMapping(value = "/nextTypeCode")
|
||||
public Result<String> nextTypeCode() {
|
||||
MesXslRubberQuickTestType ctx = new MesXslRubberQuickTestType();
|
||||
return Result.OK(mesXslRubberQuickTestTypeService.generateNextTypeCode(ctx));
|
||||
}
|
||||
|
||||
@Operation(summary = "校验实验类型名称是否重复")
|
||||
@GetMapping(value = "/checkTypeName")
|
||||
public Result<String> checkTypeName(
|
||||
@RequestParam(name = "typeName", required = true) String typeName,
|
||||
@RequestParam(name = "dataId", required = false) String dataId) {
|
||||
if (oConvertUtils.isEmpty(typeName) || typeName.trim().isEmpty()) {
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
MesXslRubberQuickTestType ctx = new MesXslRubberQuickTestType();
|
||||
if (mesXslRubberQuickTestTypeService.isTypeNameDuplicated(typeName.trim(), dataId, ctx)) {
|
||||
return Result.error("该实验类型名称已存在");
|
||||
}
|
||||
return Result.OK("该值可用!");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslRubberQuickTestType model) {
|
||||
return super.exportXls(request, model, MesXslRubberQuickTestType.class, "MES胶料快检实验类型");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
//update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型导入:名称必填且不重复,编号可空则自动生成-----------
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<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<MesXslRubberQuickTestType> list =
|
||||
ExcelImportUtil.importExcel(file.getInputStream(), MesXslRubberQuickTestType.class, params);
|
||||
if (list == null) {
|
||||
list = List.of();
|
||||
}
|
||||
Set<String> namesInFile = new HashSet<>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
MesXslRubberQuickTestType row = list.get(i);
|
||||
int rowNo = i + 1;
|
||||
if (row == null) {
|
||||
return Result.error("文件导入失败:第 " + rowNo + " 条数据无效(空行)");
|
||||
}
|
||||
if (oConvertUtils.isEmpty(row.getTypeName()) || row.getTypeName().trim().isEmpty()) {
|
||||
return Result.error("文件导入失败:第 " + rowNo + " 条实验类型名称不能为空");
|
||||
}
|
||||
row.setTypeName(row.getTypeName().trim());
|
||||
if (!namesInFile.add(row.getTypeName())) {
|
||||
return Result.error("文件导入失败:实验类型名称【" + row.getTypeName() + "】在导入文件中重复");
|
||||
}
|
||||
if (mesXslRubberQuickTestTypeService.isTypeNameDuplicated(row.getTypeName(), null, row)) {
|
||||
return Result.error("文件导入失败:第 " + rowNo + " 条实验类型名称【" + row.getTypeName() + "】已存在");
|
||||
}
|
||||
if (oConvertUtils.isNotEmpty(row.getTypeCode())) {
|
||||
row.setTypeCode(row.getTypeCode().trim());
|
||||
} else {
|
||||
row.setTypeCode(null);
|
||||
}
|
||||
}
|
||||
for (MesXslRubberQuickTestType row : list) {
|
||||
try {
|
||||
mesXslRubberQuickTestTypeService.save(row);
|
||||
} catch (JeecgBootException e) {
|
||||
return Result.error("文件导入失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
log.info("胶料快检实验类型Excel导入完成,行数={}", list.size());
|
||||
return Result.ok("文件导入成功!数据行数:" + list.size());
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
log.error(msg, e);
|
||||
return Result.error("文件导入失败:" + e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型导入:名称必填且不重复,编号可空则自动生成-----------
|
||||
return Result.error("文件导入失败!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
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 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.exception.JeecgBootException;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberSmallLockLog;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberSmallLockLogService;
|
||||
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/mesXslRubberSmallLockLog")
|
||||
@Slf4j
|
||||
public class MesXslRubberSmallLockLogController
|
||||
extends JeecgController<MesXslRubberSmallLockLog, IMesXslRubberSmallLockLogService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslRubberSmallLockLogService mesXslRubberSmallLockLogService;
|
||||
|
||||
@Operation(summary = "MES胶料小料锁定日志-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberSmallLockLog>> queryPageList(
|
||||
MesXslRubberSmallLockLog model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslRubberSmallLockLog> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
Page<MesXslRubberSmallLockLog> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslRubberSmallLockLog> pageList = mesXslRubberSmallLockLogService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料小料锁定日志-添加")
|
||||
@Operation(summary = "MES胶料小料锁定日志-添加")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_log:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslRubberSmallLockLog model) {
|
||||
try {
|
||||
mesXslRubberSmallLockLogService.save(model);
|
||||
} catch (JeecgBootException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料小料锁定日志-编辑")
|
||||
@Operation(summary = "MES胶料小料锁定日志-编辑")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_log:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslRubberSmallLockLog model) {
|
||||
try {
|
||||
mesXslRubberSmallLockLogService.updateById(model);
|
||||
} catch (JeecgBootException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料小料锁定日志-删除")
|
||||
@Operation(summary = "MES胶料小料锁定日志-通过id删除")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_log:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslRubberSmallLockLogService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料小料锁定日志-批量删除")
|
||||
@Operation(summary = "MES胶料小料锁定日志-批量删除")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_log:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslRubberSmallLockLogService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES胶料小料锁定日志-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslRubberSmallLockLog> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslRubberSmallLockLog entity = mesXslRubberSmallLockLogService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_log:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslRubberSmallLockLog model) {
|
||||
return super.exportXls(request, model, MesXslRubberSmallLockLog.class, "MES胶料小料锁定日志");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_log:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslRubberSmallLockLog.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
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.exception.JeecgBootException;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberSmallLockReason;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberSmallLockReasonService;
|
||||
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/mesXslRubberSmallLockReason")
|
||||
@Slf4j
|
||||
public class MesXslRubberSmallLockReasonController
|
||||
extends JeecgController<MesXslRubberSmallLockReason, IMesXslRubberSmallLockReasonService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslRubberSmallLockReasonService mesXslRubberSmallLockReasonService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料小料锁定原因-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberSmallLockReason>> queryPageList(
|
||||
MesXslRubberSmallLockReason model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslRubberSmallLockReason> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
Page<MesXslRubberSmallLockReason> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslRubberSmallLockReason> pageList = mesXslRubberSmallLockReasonService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料小料锁定原因-添加")
|
||||
@Operation(summary = "MES胶料小料锁定原因-添加")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_reason:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslRubberSmallLockReason model) {
|
||||
//update-begin---author:jiangxh ---date:20250602 for:【MES】胶料小料锁定原因新增校验与自动编号-----------
|
||||
if (oConvertUtils.isEmpty(model.getLockType())) {
|
||||
return Result.error("类型不能为空");
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getBarcodeType())) {
|
||||
return Result.error("条码类型不能为空");
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getReasonDesc()) || model.getReasonDesc().trim().isEmpty()) {
|
||||
return Result.error("原因不能为空");
|
||||
}
|
||||
model.setReasonCode(null);
|
||||
try {
|
||||
mesXslRubberSmallLockReasonService.save(model);
|
||||
} catch (JeecgBootException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20250602 for:【MES】胶料小料锁定原因新增校验与自动编号-----------
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料小料锁定原因-编辑")
|
||||
@Operation(summary = "MES胶料小料锁定原因-编辑")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_reason:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslRubberSmallLockReason model) {
|
||||
//update-begin---author:jiangxh ---date:20250602 for:【MES】胶料小料锁定原因编辑仅改类型与条码类型、编号只读-----------
|
||||
if (oConvertUtils.isEmpty(model.getId())) {
|
||||
return Result.error("缺少主键");
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getLockType())) {
|
||||
return Result.error("类型不能为空");
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getBarcodeType())) {
|
||||
return Result.error("条码类型不能为空");
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getReasonDesc()) || model.getReasonDesc().trim().isEmpty()) {
|
||||
return Result.error("原因不能为空");
|
||||
}
|
||||
MesXslRubberSmallLockReason old = mesXslRubberSmallLockReasonService.getById(model.getId());
|
||||
if (old == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
old.setLockType(model.getLockType());
|
||||
old.setBarcodeType(model.getBarcodeType());
|
||||
old.setReasonDesc(model.getReasonDesc().trim());
|
||||
try {
|
||||
mesXslRubberSmallLockReasonService.updateById(old);
|
||||
} catch (JeecgBootException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20250602 for:【MES】胶料小料锁定原因编辑仅改类型与条码类型、编号只读-----------
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料小料锁定原因-删除")
|
||||
@Operation(summary = "MES胶料小料锁定原因-通过id删除")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_reason:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberSmallLockReasonDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberSmallLockReasonService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES胶料小料锁定原因-批量删除")
|
||||
@Operation(summary = "MES胶料小料锁定原因-批量删除")
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_reason:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberSmallLockReasonDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberSmallLockReasonService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES胶料小料锁定原因-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslRubberSmallLockReason> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslRubberSmallLockReason entity = mesXslRubberSmallLockReasonService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@Operation(summary = "预览下一编号(001起)")
|
||||
@GetMapping(value = "/nextReasonCode")
|
||||
public Result<String> nextReasonCode() {
|
||||
MesXslRubberSmallLockReason ctx = new MesXslRubberSmallLockReason();
|
||||
return Result.OK(mesXslRubberSmallLockReasonService.generateNextReasonCode(ctx));
|
||||
}
|
||||
|
||||
@Operation(summary = "按条码类型查询锁定原因选项(日志表单联动)")
|
||||
@GetMapping(value = "/optionsByBarcodeType")
|
||||
public Result<List<MesXslRubberSmallLockReason>> optionsByBarcodeType(
|
||||
@RequestParam(name = "barcodeType", required = true) String barcodeType) {
|
||||
//update-begin---author:jiangxh ---date:20250602 for:【MES】锁定日志按条码类型加载原因选项-----------
|
||||
if (oConvertUtils.isEmpty(barcodeType)) {
|
||||
return Result.error("条码类型不能为空");
|
||||
}
|
||||
LambdaQueryWrapper<MesXslRubberSmallLockReason> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslRubberSmallLockReason::getBarcodeType, barcodeType.trim());
|
||||
w.and(
|
||||
q ->
|
||||
q.eq(MesXslRubberSmallLockReason::getDelFlag, CommonConstant.DEL_FLAG_0)
|
||||
.or()
|
||||
.isNull(MesXslRubberSmallLockReason::getDelFlag));
|
||||
w.orderByAsc(MesXslRubberSmallLockReason::getReasonCode);
|
||||
return Result.OK(mesXslRubberSmallLockReasonService.list(w));
|
||||
//update-end---author:jiangxh ---date:20250602 for:【MES】锁定日志按条码类型加载原因选项-----------
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_reason:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslRubberSmallLockReason model) {
|
||||
return super.exportXls(request, model, MesXslRubberSmallLockReason.class, "MES胶料小料锁定原因");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_reason:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
//update-begin---author:jiangxh ---date:20250602 for:【MES】胶料小料锁定原因导入:类型与条码类型必填,编号可空则自动生成-----------
|
||||
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<MesXslRubberSmallLockReason> list =
|
||||
ExcelImportUtil.importExcel(file.getInputStream(), MesXslRubberSmallLockReason.class, params);
|
||||
if (list == null) {
|
||||
list = List.of();
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
MesXslRubberSmallLockReason row = list.get(i);
|
||||
int rowNo = i + 1;
|
||||
if (row == null) {
|
||||
return Result.error("文件导入失败:第 " + rowNo + " 条数据无效(空行)");
|
||||
}
|
||||
if (oConvertUtils.isEmpty(row.getLockType())) {
|
||||
return Result.error("文件导入失败:第 " + rowNo + " 条类型不能为空");
|
||||
}
|
||||
if (oConvertUtils.isEmpty(row.getBarcodeType())) {
|
||||
return Result.error("文件导入失败:第 " + rowNo + " 条条码类型不能为空");
|
||||
}
|
||||
if (oConvertUtils.isEmpty(row.getReasonDesc()) || row.getReasonDesc().trim().isEmpty()) {
|
||||
return Result.error("文件导入失败:第 " + rowNo + " 条原因不能为空");
|
||||
}
|
||||
if (oConvertUtils.isNotEmpty(row.getReasonCode())) {
|
||||
row.setReasonCode(row.getReasonCode().trim());
|
||||
} else {
|
||||
row.setReasonCode(null);
|
||||
}
|
||||
}
|
||||
for (MesXslRubberSmallLockReason row : list) {
|
||||
try {
|
||||
mesXslRubberSmallLockReasonService.save(row);
|
||||
} catch (JeecgBootException e) {
|
||||
return Result.error("文件导入失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
log.info("胶料小料锁定原因Excel导入完成,行数={}", list.size());
|
||||
return Result.ok("文件导入成功!数据行数:" + list.size());
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
log.error(msg, e);
|
||||
return Result.error("文件导入失败:" + e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20250602 for:【MES】胶料小料锁定原因导入:类型与条码类型必填,编号可空则自动生成-----------
|
||||
return Result.error("文件导入失败!");
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ 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.MesXslSparePartsCategory;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslSparePartsCategoryService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
@@ -42,6 +43,9 @@ public class MesXslSparePartsCategoryController extends JeecgController<MesXslSp
|
||||
@Autowired
|
||||
private IMesXslSparePartsCategoryService mesXslSparePartsCategoryService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES备品件类别-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslSparePartsCategory>> queryPageList(
|
||||
@@ -90,6 +94,10 @@ public class MesXslSparePartsCategoryController extends JeecgController<MesXslSp
|
||||
@RequiresPermissions("mes:mes_xsl_spare_parts_category:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateSparePartsCategoryDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslSparePartsCategoryService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -99,6 +107,10 @@ public class MesXslSparePartsCategoryController extends JeecgController<MesXslSp
|
||||
@RequiresPermissions("mes:mes_xsl_spare_parts_category:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateSparePartsCategoryDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslSparePartsCategoryService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -27,9 +27,7 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 地磅数据记录
|
||||
@@ -57,7 +55,7 @@ public class MesXslWeightRecordController extends JeecgController<MesXslWeightRe
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<MesXslWeightRecord> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslWeightRecord> pageList = mesXslWeightRecordService.page(page, queryWrapper);
|
||||
fillEnteredWeight(pageList.getRecords());
|
||||
rawMaterialEntryService.fillWeightRecordDerivedFields(pageList.getRecords());
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@@ -120,7 +118,7 @@ public class MesXslWeightRecordController extends JeecgController<MesXslWeightRe
|
||||
if (record == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
fillEnteredWeight(Collections.singletonList(record));
|
||||
fillWeightRecordDerivedFields(Collections.singletonList(record));
|
||||
return Result.OK(record);
|
||||
}
|
||||
|
||||
@@ -187,27 +185,7 @@ public class MesXslWeightRecordController extends JeecgController<MesXslWeightRe
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 给一批磅单记录批量填充「已入场重量」(transient 字段,不入库)。
|
||||
* 数据来源:所有引用本榜单(bill_no 匹配)的原料入场记录的拆码明细的 (份数×每份重量) 累计。
|
||||
* 实现上为避免 N+1,先收集所有 billNo,再一次 IN 查询累计。
|
||||
*/
|
||||
private void fillEnteredWeight(List<MesXslWeightRecord> records) {
|
||||
if (records == null || records.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<String> billNos = records.stream()
|
||||
.map(MesXslWeightRecord::getBillNo)
|
||||
.filter(s -> s != null && !s.isBlank())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
if (billNos.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Map<String, BigDecimal> sumMap = rawMaterialEntryService.sumEnteredWeightByBillNos(billNos);
|
||||
for (MesXslWeightRecord r : records) {
|
||||
BigDecimal v = (r.getBillNo() == null) ? null : sumMap.get(r.getBillNo());
|
||||
r.setEnteredWeight(v != null ? v : BigDecimal.ZERO);
|
||||
}
|
||||
private void fillWeightRecordDerivedFields(List<MesXslWeightRecord> records) {
|
||||
rawMaterialEntryService.fillWeightRecordDerivedFields(records);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user