Compare commits
35 Commits
7786369a63
...
生产及设备基础资料
| 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 |
18
.vscode/launch.json
vendored
18
.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 (单体)",
|
||||
|
||||
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -14,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
.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)
|
||||
}
|
||||
|
||||
4
jeecg-boot/.vscode/settings.json
vendored
4
jeecg-boot/.vscode/settings.json
vendored
@@ -14,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/**",
|
||||
|
||||
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;
|
||||
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,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母胶计划';
|
||||
@@ -51,7 +51,8 @@ INSERT INTO sys_permission(id, parent_id, name, menu_type, perms, perms_type, st
|
||||
('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())
|
||||
('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),
|
||||
@@ -67,7 +68,7 @@ SELECT REPLACE(UUID(), '-', ''), 'f6817f48af4fb3af11b9e8bf182f618b', p.id, NOW()
|
||||
FROM sys_permission p
|
||||
WHERE p.id IN (
|
||||
'1860000000000099511',
|
||||
'1860000000000099512', '1860000000000099513', '1860000000000099514', '1860000000000099515', '1860000000000099516'
|
||||
'1860000000000099512', '1860000000000099513', '1860000000000099514', '1860000000000099515', '1860000000000099516', '1860000000000099517'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
|
||||
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,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
|
||||
);
|
||||
@@ -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");
|
||||
// 打印模板免密接口(供桌面端调用)
|
||||
|
||||
@@ -407,3 +407,359 @@ jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTes
|
||||
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
|
||||
|
||||
@@ -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,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审批流完善】启用定时任务支持-----
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ 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;
|
||||
@@ -53,6 +54,9 @@ public class MesXslEquipInspectConfigController
|
||||
@Autowired
|
||||
private IMesXslInspectMaintainItemService mesXslInspectMaintainItemService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES设备点检配置-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipInspectConfig>> queryPageList(
|
||||
@@ -106,6 +110,10 @@ public class MesXslEquipInspectConfigController
|
||||
@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("删除成功!");
|
||||
}
|
||||
@@ -115,6 +123,10 @@ public class MesXslEquipInspectConfigController
|
||||
@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("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -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,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 {
|
||||
|
||||
@@ -24,6 +24,7 @@ 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
|
||||
@@ -92,6 +93,15 @@ public class MesXslProductionOrderController
|
||||
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) {
|
||||
|
||||
@@ -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】架子车数设定保存-----------
|
||||
}
|
||||
@@ -25,6 +25,7 @@ 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;
|
||||
@@ -51,6 +52,9 @@ public class MesXslRubberQuickTestDataPointController
|
||||
@Autowired
|
||||
private IMesXslRubberQuickTestTypeService mesXslRubberQuickTestTypeService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料快检数据点-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberQuickTestDataPoint>> queryPageList(
|
||||
@@ -120,6 +124,10 @@ public class MesXslRubberQuickTestDataPointController
|
||||
@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("删除成功!");
|
||||
}
|
||||
@@ -129,6 +137,10 @@ public class MesXslRubberQuickTestDataPointController
|
||||
@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("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ 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;
|
||||
@@ -102,7 +103,8 @@ public class MesXslRubberQuickTestMethodController
|
||||
|
||||
private IMesXslRubberQuickTestDataPointService mesXslRubberQuickTestDataPointService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料快检实验方法-分页列表查询")
|
||||
|
||||
@@ -231,29 +233,25 @@ public class MesXslRubberQuickTestMethodController
|
||||
@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("批量删除成功!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ 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;
|
||||
@@ -33,6 +34,7 @@ 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;
|
||||
@@ -68,6 +70,9 @@ public class MesXslRubberQuickTestStdController
|
||||
@Autowired
|
||||
private ISysDepartService sysDepartService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料快检实验标准-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberQuickTestStd>> queryPageList(
|
||||
@@ -132,6 +137,10 @@ public class MesXslRubberQuickTestStdController
|
||||
@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("删除成功!");
|
||||
}
|
||||
@@ -141,6 +150,10 @@ public class MesXslRubberQuickTestStdController
|
||||
@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("批量删除成功!");
|
||||
}
|
||||
@@ -162,6 +175,9 @@ public class MesXslRubberQuickTestStdController
|
||||
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")
|
||||
|
||||
@@ -22,6 +22,7 @@ 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;
|
||||
@@ -44,6 +45,9 @@ public class MesXslRubberQuickTestTypeController
|
||||
@Autowired
|
||||
private IMesXslRubberQuickTestTypeService mesXslRubberQuickTestTypeService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料快检实验类型-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberQuickTestType>> queryPageList(
|
||||
@@ -116,6 +120,10 @@ public class MesXslRubberQuickTestTypeController
|
||||
@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("删除成功!");
|
||||
}
|
||||
@@ -125,6 +133,10 @@ public class MesXslRubberQuickTestTypeController
|
||||
@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("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 停机记录(表 mes_xsl_downtime_record)
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_downtime_record")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES停机记录")
|
||||
public class MesXslDowntimeRecord implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Schema(description = "设备台账主键 mes_xsl_equipment_ledger.id")
|
||||
private String equipmentLedgerId;
|
||||
|
||||
@Excel(name = "设备编号", width = 18)
|
||||
@Schema(description = "设备编号冗余")
|
||||
private String equipmentCode;
|
||||
|
||||
@Excel(name = "机台", width = 22)
|
||||
@Schema(description = "设备名称冗余")
|
||||
private String equipmentName;
|
||||
|
||||
@Schema(description = "停机类型主键 mes_xsl_downtime_type.id")
|
||||
private String downtimeTypeId;
|
||||
|
||||
@Excel(name = "停机原因", width = 24)
|
||||
@Schema(description = "停机类型名称冗余")
|
||||
private String downtimeTypeName;
|
||||
|
||||
@Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
@Excel(name = "结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
@Schema(description = "设备部位主键 mes_xsl_equipment_part.id")
|
||||
private String equipmentPartId;
|
||||
|
||||
@Excel(name = "设备部位", width = 18)
|
||||
@Schema(description = "设备部位名称冗余")
|
||||
private String equipmentPartName;
|
||||
|
||||
@Schema(description = "点检及保养项目主键 mes_xsl_inspect_maintain_item.id")
|
||||
private String inspectMaintainItemId;
|
||||
|
||||
@Excel(name = "维修项目", width = 22)
|
||||
@Schema(description = "点检项目名称冗余")
|
||||
private String inspectMaintainItemName;
|
||||
|
||||
@Excel(name = "维修结果", width = 28)
|
||||
@Schema(description = "维修结果")
|
||||
private String maintenanceResult;
|
||||
|
||||
@Schema(description = "维修人用户ID")
|
||||
private String maintainerUserId;
|
||||
|
||||
@Schema(description = "维修人账号")
|
||||
private String maintainerUsername;
|
||||
|
||||
@Excel(name = "维修人", width = 12)
|
||||
@Schema(description = "维修人姓名")
|
||||
private String maintainerRealname;
|
||||
|
||||
@Excel(name = "是否已录入维修", width = 14, dicCode = "yn")
|
||||
@Dict(dicCode = "yn")
|
||||
@Schema(description = "是否已录入维修结果(字典yn:1是0否)")
|
||||
private String maintenanceFilledFlag;
|
||||
|
||||
private Integer tenantId;
|
||||
private String sysOrgCode;
|
||||
private String createBy;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
private String updateBy;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 设备对应部位(表 mes_xsl_equip_part_mapping,由设备点检配置保存后自动生成)
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_equip_part_mapping")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES设备对应部位")
|
||||
public class MesXslEquipPartMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Schema(description = "设备台账主键 mes_xsl_equipment_ledger.id")
|
||||
private String equipmentLedgerId;
|
||||
|
||||
@Excel(name = "设备名称", width = 22)
|
||||
@Schema(description = "设备名称")
|
||||
private String equipmentName;
|
||||
|
||||
@Excel(name = "机台代号", width = 18)
|
||||
@Schema(description = "机台代号(设备编号冗余)")
|
||||
private String machineCode;
|
||||
|
||||
@Schema(description = "设备大部位主键 mes_xsl_equipment_part.id")
|
||||
private String equipmentPartId;
|
||||
|
||||
@Excel(name = "设备大部位", width = 20)
|
||||
@Schema(description = "设备大部位名称")
|
||||
private String equipmentPartName;
|
||||
|
||||
@Excel(name = "大部位代码", width = 16)
|
||||
@Schema(description = "大部位代码")
|
||||
private String partCode;
|
||||
|
||||
@Schema(description = "设备小部位主键 mes_xsl_equipment_sub_part.id")
|
||||
private String equipmentSubPartId;
|
||||
|
||||
@Excel(name = "设备小部位", width = 20)
|
||||
@Schema(description = "设备小部位名称")
|
||||
private String equipmentSubPartName;
|
||||
|
||||
@Excel(name = "小部位代码", width = 16)
|
||||
@Schema(description = "小部位代码")
|
||||
private String subPartCode;
|
||||
|
||||
private Integer tenantId;
|
||||
private String sysOrgCode;
|
||||
private String createBy;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
private String updateBy;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -40,6 +40,10 @@ public class MesXslEquipmentLedger implements Serializable {
|
||||
@Schema(description = "设备名称(同租户未删除数据中唯一)")
|
||||
private String equipmentName;
|
||||
|
||||
@Excel(name = "系统编号", width = 12)
|
||||
@Schema(description = "系统编号(租户内从001递增自动生成,只读)")
|
||||
private String ledgerNo;
|
||||
|
||||
@Excel(name = "设备编号", width = 18)
|
||||
@Schema(description = "设备编号(同租户未删除数据中唯一)")
|
||||
private String equipmentCode;
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 终胶计划
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_final_batch_plan")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES终胶计划")
|
||||
public class MesXslFinalBatchPlan implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Schema(description = "来源生产订单ID")
|
||||
private String sourceOrderId;
|
||||
|
||||
@Excel(name = "订单流水号", width = 20)
|
||||
private String orderSerialNo;
|
||||
|
||||
@Excel(name = "订单编号", width = 20)
|
||||
private String orderNo;
|
||||
|
||||
@Excel(name = "生产段数", width = 12)
|
||||
private Integer productionSegmentCount;
|
||||
|
||||
@Excel(name = "订单日期", width = 20, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date orderDate;
|
||||
|
||||
@Excel(name = "物料编码", width = 20)
|
||||
private String materialCode;
|
||||
|
||||
@Excel(name = "MES胶料信息", width = 20)
|
||||
private String mesMaterialName;
|
||||
|
||||
@Excel(name = "计划重量", width = 15)
|
||||
private BigDecimal planWeight;
|
||||
|
||||
@Excel(name = "每车重量", width = 15)
|
||||
private BigDecimal perCarWeight;
|
||||
|
||||
@Excel(name = "计划车数", width = 12)
|
||||
private Integer plannedCarCount;
|
||||
|
||||
@Excel(name = "已排产车数", width = 12)
|
||||
private Integer scheduledCarCount;
|
||||
|
||||
@Excel(name = "完成车数", width = 12)
|
||||
private Integer finishedCarCount;
|
||||
|
||||
@Excel(name = "状态", width = 12, replace = {"未开始_0", "进行中_1", "已完成_2"})
|
||||
private Integer status;
|
||||
|
||||
private Integer tenantId;
|
||||
private String sysOrgCode;
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 配方示方修改日志(配合示方/混炼示方)
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_formula_spec_edit_log")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "配方示方修改日志")
|
||||
public class MesXslFormulaSpecEditLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private String id;
|
||||
|
||||
@Excel(name = "示方分类", width = 12, dicCode = "xslmes_formula_spec_edit_log_type")
|
||||
@Dict(dicCode = "xslmes_formula_spec_edit_log_type")
|
||||
@Schema(description = "示方分类 formula=配合示方 mixing=混炼示方")
|
||||
private String specType;
|
||||
|
||||
@Schema(description = "示方主表ID")
|
||||
private String specId;
|
||||
|
||||
@Excel(name = "示方标识", width = 22)
|
||||
@Schema(description = "示方标识(胶料代号/规格名)")
|
||||
private String specTitle;
|
||||
|
||||
@Excel(name = "发行编号", width = 16)
|
||||
@Schema(description = "发行编号")
|
||||
private String issueNumber;
|
||||
|
||||
@Excel(name = "操作类型", width = 10, dicCode = "xslmes_formula_spec_edit_log_action")
|
||||
@Dict(dicCode = "xslmes_formula_spec_edit_log_action")
|
||||
@Schema(description = "操作类型 create=新增 update=修改 delete=删除")
|
||||
private String actionType;
|
||||
|
||||
@Excel(name = "修改内容", width = 50)
|
||||
@Schema(description = "修改内容摘要")
|
||||
private String changeSummary;
|
||||
|
||||
@Schema(description = "变更前快照JSON")
|
||||
private String beforeSnapshot;
|
||||
|
||||
@Schema(description = "变更后快照JSON")
|
||||
private String afterSnapshot;
|
||||
|
||||
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "修改时间")
|
||||
private Date modifyTime;
|
||||
|
||||
@Schema(description = "修改人账号")
|
||||
private String modifyBy;
|
||||
|
||||
@Excel(name = "修改人", width = 14)
|
||||
@Schema(description = "修改人姓名")
|
||||
private String modifyByName;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 母胶计划
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_master_batch_plan")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES母胶计划")
|
||||
public class MesXslMasterBatchPlan implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Schema(description = "来源生产订单ID")
|
||||
private String sourceOrderId;
|
||||
|
||||
@Excel(name = "订单流水号", width = 20)
|
||||
private String orderSerialNo;
|
||||
|
||||
@Excel(name = "订单编号", width = 20)
|
||||
private String orderNo;
|
||||
|
||||
@Excel(name = "生产段数", width = 12)
|
||||
private Integer productionSegmentCount;
|
||||
|
||||
@Excel(name = "订单日期", width = 20, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date orderDate;
|
||||
|
||||
@Excel(name = "物料编号", width = 20)
|
||||
private String materialCode;
|
||||
|
||||
@Excel(name = "MES胶料名称", width = 20)
|
||||
private String mesMaterialName;
|
||||
|
||||
@Excel(name = "计划重量", width = 15)
|
||||
private BigDecimal planWeight;
|
||||
|
||||
@Excel(name = "每车重量", width = 15)
|
||||
private BigDecimal perCarWeight;
|
||||
|
||||
@Excel(name = "计划车数", width = 12)
|
||||
private Integer plannedCarCount;
|
||||
|
||||
@Excel(name = "已排产车数", width = 12)
|
||||
private Integer scheduledCarCount;
|
||||
|
||||
@Excel(name = "完成车数", width = 12)
|
||||
private Integer finishedCarCount;
|
||||
|
||||
@Excel(name = "状态", width = 12, replace = {"未开始_0", "进行中_1", "已完成_2"})
|
||||
private Integer status;
|
||||
|
||||
private Integer tenantId;
|
||||
private String sysOrgCode;
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 密炼物料皮重策略
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_mixer_material_tare_strategy")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES密炼物料皮重策略")
|
||||
public class MesXslMixerMaterialTareStrategy implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@Excel(name = "密炼物料", width = 18, dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Schema(description = "密炼物料ID(关联 mes_mixer_material.id)")
|
||||
private String mixerMaterialId;
|
||||
|
||||
@Excel(name = "密炼物料名称", width = 20)
|
||||
@Schema(description = "密炼物料名称冗余")
|
||||
private String mixerMaterialName;
|
||||
|
||||
@Excel(name = "供应商", width = 18, dictTable = "mes_xsl_supplier", dicText = "supplier_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_xsl_supplier", dicText = "supplier_name", dicCode = "id")
|
||||
@Schema(description = "供应商ID(关联 mes_xsl_supplier.id)")
|
||||
private String supplierId;
|
||||
|
||||
@Excel(name = "供应商名称", width = 20)
|
||||
@Schema(description = "供应商名称冗余")
|
||||
private String supplierName;
|
||||
|
||||
@Excel(name = "物料规格", width = 16)
|
||||
@Schema(description = "物料规格(与密炼物料、供应商、生效日期共同参与唯一性校验,不同规格可分别维护)")
|
||||
private String materialSpec;
|
||||
|
||||
@Excel(name = "包装物重量", width = 12)
|
||||
@Schema(description = "包装物重量")
|
||||
private BigDecimal tareWeight;
|
||||
|
||||
@Excel(name = "托盘重量", width = 12)
|
||||
@Schema(description = "托盘重量")
|
||||
private BigDecimal palletWeight;
|
||||
|
||||
@Schema(description = "单位ID(关联 mes_xsl_unit.id)")
|
||||
private String unitId;
|
||||
|
||||
@Excel(name = "单位", width = 10)
|
||||
@Schema(description = "单位名称冗余")
|
||||
private String unitName;
|
||||
|
||||
@Excel(name = "生效开始日期", width = 14, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "生效开始日期")
|
||||
private Date effectiveStartDate;
|
||||
|
||||
@Excel(name = "生效截止日期", width = 14, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "生效截止日期")
|
||||
private Date effectiveEndDate;
|
||||
|
||||
@Excel(name = "维护人", width = 12, dictTable = "sys_user", dicText = "realname", dicCode = "username")
|
||||
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
|
||||
@Schema(description = "维护人(登录账号)")
|
||||
private String maintainBy;
|
||||
|
||||
@Excel(name = "创建人", width = 12)
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "修改人", width = 12)
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
private String sysOrgCode;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -86,6 +86,14 @@ public class MesXslRawMaterialCard implements Serializable {
|
||||
@Schema(description = "总重")
|
||||
private BigDecimal totalWeight;
|
||||
|
||||
@Excel(name = "包装物皮重", width = 12)
|
||||
@Schema(description = "包装物皮重(KG)")
|
||||
private BigDecimal packagingTare;
|
||||
|
||||
@Excel(name = "托盘重量", width = 12)
|
||||
@Schema(description = "托盘重量(KG)")
|
||||
private BigDecimal palletWeight;
|
||||
|
||||
@Excel(name = "剩余重量", width = 12)
|
||||
@Schema(description = "剩余重量")
|
||||
private BigDecimal remainingWeight;
|
||||
|
||||
@@ -89,6 +89,10 @@ public class MesXslRawMaterialEntry implements Serializable {
|
||||
@Schema(description = "总重(KG)")
|
||||
private BigDecimal totalWeight;
|
||||
|
||||
@Excel(name = "托盘及皮重合计", width = 14)
|
||||
@Schema(description = "托盘及皮重(合计)")
|
||||
private BigDecimal palletTareTotal;
|
||||
|
||||
// 总份数 / 每份总重 / 每份包数:从 数值类型 升级为 字符串类型,
|
||||
// 支持桌面端「拆码明细」多行拼接保存(如 20/1/ 与 100/200/)。
|
||||
@Excel(name = "总份数", width = 12)
|
||||
@@ -99,6 +103,17 @@ public class MesXslRawMaterialEntry implements Serializable {
|
||||
@Schema(description = "每份总重(KG)(支持多行拆码明细拼接,如 100/200/)")
|
||||
private String portionWeight;
|
||||
|
||||
@Excel(name = "包装物皮重", width = 14)
|
||||
@Schema(description = "拆码明细包装物皮重拼接(以 / 分隔,末尾带 /)")
|
||||
private String portionPackagingTare;
|
||||
|
||||
@Excel(name = "托盘重量", width = 14)
|
||||
@Schema(description = "拆码明细托盘重量拼接(以 / 分隔,末尾带 /)")
|
||||
private String portionPalletWeight;
|
||||
|
||||
@Schema(description = "拆码明细皮重策略ID拼接(以 / 分隔,末尾带 /)")
|
||||
private String portionTareStrategyIds;
|
||||
|
||||
@Excel(name = "每份包数", width = 12)
|
||||
@Schema(description = "每份包数(支持多行拆码明细拼接)")
|
||||
private String portionPackages;
|
||||
|
||||
@@ -56,6 +56,14 @@ public class MesXslRawMaterialWorkshopRemain extends JeecgEntity {
|
||||
@Schema(description = "总重")
|
||||
private BigDecimal totalWeight;
|
||||
|
||||
@Excel(name = "包装物皮重", width = 12)
|
||||
@Schema(description = "包装物皮重(KG)")
|
||||
private BigDecimal packagingTare;
|
||||
|
||||
@Excel(name = "托盘重量", width = 12)
|
||||
@Schema(description = "托盘重量(KG)")
|
||||
private BigDecimal palletWeight;
|
||||
|
||||
@Excel(name = "剩余重量", width = 12)
|
||||
@Schema(description = "剩余重量")
|
||||
private BigDecimal remainingWeight;
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 胶料快检记录主表
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_rubber_quick_test_record")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES胶料快检记录")
|
||||
public class MesXslRubberQuickTestRecord implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "单号", width = 16)
|
||||
@Schema(description = "单号(JL+yyyyMMdd+4位流水)")
|
||||
private String recordNo;
|
||||
|
||||
@Schema(description = "胶料ID mes_material.id")
|
||||
private String rubberMaterialId;
|
||||
|
||||
@Excel(name = "胶料名称", width = 20)
|
||||
@Schema(description = "胶料名称冗余")
|
||||
private String rubberMaterialName;
|
||||
|
||||
@Schema(description = "引用的实验标准ID")
|
||||
private String stdId;
|
||||
|
||||
@Schema(description = "生产机台ID")
|
||||
private String prodEquipmentLedgerId;
|
||||
|
||||
@Excel(name = "生产机台", width = 16)
|
||||
@Schema(description = "生产机台名称冗余")
|
||||
private String prodEquipmentName;
|
||||
|
||||
@Excel(name = "生产日期", width = 12, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date productionDate;
|
||||
|
||||
@Excel(name = "车次编号", width = 14)
|
||||
private String trainNo;
|
||||
|
||||
@Excel(name = "班次", width = 10, dicCode = "xslmes_rubber_quick_test_work_shift")
|
||||
@Dict(dicCode = "xslmes_rubber_quick_test_work_shift")
|
||||
private String workShift;
|
||||
|
||||
@Excel(name = "班组", width = 10, dicCode = "xslmes_rubber_quick_test_work_team")
|
||||
@Dict(dicCode = "xslmes_rubber_quick_test_work_team")
|
||||
private String workTeam;
|
||||
|
||||
@Excel(name = "检验次数", width = 10)
|
||||
private Integer inspectTimes;
|
||||
|
||||
@Excel(name = "检验时间", width = 18, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date inspectTime;
|
||||
|
||||
@Schema(description = "检验人用户ID")
|
||||
private String inspectorUserId;
|
||||
|
||||
private String inspectorUsername;
|
||||
|
||||
@Excel(name = "检验人", width = 12)
|
||||
private String inspectorRealname;
|
||||
|
||||
@Schema(description = "检验类型ID")
|
||||
private String quickTestTypeId;
|
||||
|
||||
@Excel(name = "检验类型", width = 16)
|
||||
private String quickTestTypeName;
|
||||
|
||||
@Excel(name = "检验结果", width = 10, dicCode = "xslmes_rubber_quick_test_record_result")
|
||||
@Dict(dicCode = "xslmes_rubber_quick_test_record_result")
|
||||
private String inspectResult;
|
||||
|
||||
@Excel(name = "生产计划号", width = 16)
|
||||
private String productionPlanNo;
|
||||
|
||||
@Schema(description = "检验机台ID")
|
||||
private String inspectEquipmentLedgerId;
|
||||
|
||||
@Excel(name = "检验机台", width = 16)
|
||||
private String inspectEquipmentName;
|
||||
|
||||
@Excel(name = "胶料卡片号", width = 16)
|
||||
private String rubberCardNo;
|
||||
|
||||
@Excel(name = "胶料批次", width = 16)
|
||||
private String rubberBatchNo;
|
||||
|
||||
private Integer tenantId;
|
||||
private String sysOrgCode;
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<MesXslRubberQuickTestRecordLine> lineList;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 胶料快检记录明细
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_rubber_quick_test_record_line")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES胶料快检记录明细")
|
||||
public class MesXslRubberQuickTestRecordLine implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
private String recordId;
|
||||
|
||||
private String dataPointId;
|
||||
|
||||
@Excel(name = "检验项目", width = 18)
|
||||
private String inspectItem;
|
||||
|
||||
@Excel(name = "检验下限", width = 12, type = 10)
|
||||
private BigDecimal lowerLimit;
|
||||
|
||||
@Excel(name = "检验值", width = 12, type = 10)
|
||||
private BigDecimal inspectValue;
|
||||
|
||||
@Excel(name = "检验上限", width = 12, type = 10)
|
||||
private BigDecimal upperLimit;
|
||||
|
||||
private Integer sortNo;
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 胶料小料锁定日志
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_rubber_small_lock_log")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES胶料小料锁定日志")
|
||||
public class MesXslRubberSmallLockLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Schema(description = "锁定原因ID")
|
||||
private String lockReasonId;
|
||||
|
||||
@Excel(name = "类型", width = 12, dicCode = "xslmes_rubber_small_lock_barcode_type")
|
||||
@Dict(dicCode = "xslmes_rubber_small_lock_barcode_type")
|
||||
@Schema(description = "条码类型")
|
||||
private String barcodeType;
|
||||
|
||||
@Excel(name = "条码", width = 20)
|
||||
@Schema(description = "条码")
|
||||
private String barcode;
|
||||
|
||||
@Excel(name = "状态", width = 12, dicCode = "xslmes_rubber_small_lock_type")
|
||||
@Dict(dicCode = "xslmes_rubber_small_lock_type")
|
||||
@Schema(description = "状态(来自锁定原因类型)")
|
||||
private String lockType;
|
||||
|
||||
@Excel(name = "原因", width = 40)
|
||||
@Schema(description = "原因(来自锁定原因)")
|
||||
private String reasonDesc;
|
||||
|
||||
@Excel(name = "日期", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "日期")
|
||||
private Date logDate;
|
||||
|
||||
private Integer tenantId;
|
||||
private String sysOrgCode;
|
||||
|
||||
@Excel(name = "创建人", width = 12)
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "修改人", width = 12)
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 胶料小料锁定原因
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_rubber_small_lock_reason")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES胶料小料锁定原因")
|
||||
public class MesXslRubberSmallLockReason implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "编号", width = 12)
|
||||
@Schema(description = "编号(租户内从001递增自动生成,只读)")
|
||||
private String reasonCode;
|
||||
|
||||
@Excel(name = "类型", width = 12, dicCode = "xslmes_rubber_small_lock_type")
|
||||
@Dict(dicCode = "xslmes_rubber_small_lock_type")
|
||||
@Schema(description = "类型(字典:lock锁定 unlock解锁)")
|
||||
private String lockType;
|
||||
|
||||
@Excel(name = "条码类型", width = 12, dicCode = "xslmes_rubber_small_lock_barcode_type")
|
||||
@Dict(dicCode = "xslmes_rubber_small_lock_barcode_type")
|
||||
@Schema(description = "条码类型(字典:small小料 rubber胶料)")
|
||||
private String barcodeType;
|
||||
|
||||
@Excel(name = "原因", width = 40)
|
||||
@Schema(description = "原因(手动输入,必填)")
|
||||
private String reasonDesc;
|
||||
|
||||
private Integer tenantId;
|
||||
private String sysOrgCode;
|
||||
|
||||
@Excel(name = "创建人", width = 12)
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "创建日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@TableLogic
|
||||
@Schema(description = "删除状态(0正常 1已删除)")
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -43,7 +43,10 @@ import java.util.Date;
|
||||
"driverName",
|
||||
"driverPhone",
|
||||
"billType",
|
||||
"tenantId"
|
||||
"tenantId",
|
||||
"enteredWeight",
|
||||
"cargoTareWeight",
|
||||
"rawMaterialWeight"
|
||||
})
|
||||
public class MesXslWeightRecord extends JeecgEntity implements Serializable {
|
||||
|
||||
@@ -129,4 +132,20 @@ public class MesXslWeightRecord extends JeecgEntity implements Serializable {
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "已入场重量(KG),由原料入场记录的拆码明细实时累计")
|
||||
private BigDecimal enteredWeight;
|
||||
|
||||
/**
|
||||
* 货物皮重(KG)—— 实时计算,不落库。
|
||||
* 数据来源:所有引用本榜单(bill_no 匹配)的原料入场记录的 pallet_tare_total(托盘及皮重合计)累加。
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "货物皮重(KG),关联原料入场记录的托盘及皮重合计累计")
|
||||
private BigDecimal cargoTareWeight;
|
||||
|
||||
/**
|
||||
* 原料重量(KG)—— 实时计算,不落库。
|
||||
* 公式:净重(KG) - 货物皮重(KG)。
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "原料重量(KG)=净重-货物皮重")
|
||||
private BigDecimal rawMaterialWeight;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslDowntimeRecord;
|
||||
|
||||
/**
|
||||
* MES 停机记录
|
||||
*/
|
||||
public interface MesXslDowntimeRecordMapper extends BaseMapper<MesXslDowntimeRecord> {}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipPartMapping;
|
||||
|
||||
public interface MesXslEquipPartMappingMapper extends BaseMapper<MesXslEquipPartMapping> {}
|
||||
@@ -1,6 +1,17 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
|
||||
|
||||
public interface MesXslEquipmentLedgerMapper extends BaseMapper<MesXslEquipmentLedger> {}
|
||||
public interface MesXslEquipmentLedgerMapper extends BaseMapper<MesXslEquipmentLedger> {
|
||||
|
||||
//update-begin---author:jiangxh ---date:20250602 for:【MES】设备台账租户内最大三位系统编号-----------
|
||||
@Select(
|
||||
"SELECT IFNULL(MAX(CAST(ledger_no AS UNSIGNED)), 0) FROM mes_xsl_equipment_ledger "
|
||||
+ "WHERE del_flag = 0 AND ledger_no REGEXP '^[0-9]+$' "
|
||||
+ "AND (#{tenantId} IS NULL OR tenant_id = #{tenantId})")
|
||||
Integer selectMaxNumericLedgerNo(@Param("tenantId") Integer tenantId);
|
||||
//update-end---author:jiangxh ---date:20250602 for:【MES】设备台账租户内最大三位系统编号-----------
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslFinalBatchPlan;
|
||||
|
||||
public interface MesXslFinalBatchPlanMapper extends BaseMapper<MesXslFinalBatchPlan> {}
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpecEditLog;
|
||||
|
||||
/**
|
||||
* 配方示方修改日志
|
||||
*/
|
||||
public interface MesXslFormulaSpecEditLogMapper extends BaseMapper<MesXslFormulaSpecEditLog> {}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user