17 Commits

Author SHA1 Message Date
fa1c5c9b42 Merge remote-tracking branch 'origin/生产及设备基础资料' 2026-05-22 09:58:43 +08:00
geht
442b31ad37 Merge branch '20260519-3.9.2版本-葛昊天分支' 2026-05-21 18:50:05 +08:00
geht
89407d1f1d 新增配合示方模块,包括主子表结构、控制器、服务及映射器的实现,支持增删改查功能,优化胶料代号生成逻辑及相关字段,增强数据验证和用户体验。 2026-05-21 18:49:20 +08:00
874e513c90 Merge branch 'main' of http://27.223.88.102:33000/chenx/qhmes 2026-05-21 10:04:24 +08:00
e678276aba 密炼机动作维护、日罐物料对应关系 2026-05-21 10:04:06 +08:00
geht
a10aae420a 更新胶料信息处理逻辑,优化字段描述及数据验证,增强系统稳定性和用户体验。 2026-05-20 19:06:58 +08:00
geht
9f37292eea 更新胶料编码为胶料别名,调整相关字段和描述,新增数据库字段以支持胶料信息补全 2026-05-20 16:12:38 +08:00
geht
1a4027086c Merge branch 'main' into 20260519-3.9.2版本-葛昊天分支 2026-05-20 15:59:44 +08:00
geht
031725de7e 新增MES密炼物料替代对应关系及开炼机参数维护模块,包括相关实体、控制器、服务和映射器的实现,支持增删改查及数据验证功能。 2026-05-20 15:56:27 +08:00
09c58f80eb 胶料信息更换分类字典 2026-05-20 15:55:54 +08:00
geht
cd3194d1a6 Merge remote-tracking branch 'origin/main' into 20260519-3.9.2版本-葛昊天分支 2026-05-20 15:49:36 +08:00
0e6eba8cf4 Merge branch 'main' of http://27.223.88.102:33000/chenx/qhmes 2026-05-20 15:30:46 +08:00
34b6ed4478 胶料信息 2026-05-20 15:30:42 +08:00
geht
27c2ed898c 添加兼容旧库的桌面端登录设置配置项,确保在缺失时自动补全相关 sys_config 项 2026-05-20 12:29:10 +08:00
geht
e5e8341b3e 修正日志输出中的访问URL提示信息,去掉多余的冒号以提高可读性。 2026-05-20 11:59:21 +08:00
geht
39c990b2ae 修正日志输出中的访问URL提示信息,调整标点符号以提高可读性。 2026-05-20 11:58:43 +08:00
geht
ddc10cf7ea 桌面端打包,降低版本。 2026-05-19 14:13:32 +08:00
111 changed files with 11173 additions and 61 deletions

View File

@@ -11,9 +11,9 @@ menu_type=VALUES(menu_type), perms=VALUES(perms), perms_type=VALUES(perms_type),
is_route=VALUES(is_route), is_leaf=VALUES(is_leaf), hidden=VALUES(hidden), status=VALUES(status), del_flag=VALUES(del_flag),
always_show=VALUES(always_show), keep_alive=VALUES(keep_alive), internal_or_external=VALUES(internal_or_external);
-- 二级菜单料信息
-- 二级菜单料信息
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, menu_type, perms, perms_type, sort_no, is_route, is_leaf, hidden, status, del_flag, keep_alive, internal_or_external, create_by, create_time)
VALUES ('1860000000000000011', '1860000000000000001', '料信息', '/mes/materialinfo', 'mes/materialinfo/index', 'MesMaterialList', 1, NULL, '1', 1, 1, 1, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000011', '1860000000000000001', '料信息', '/mes/materialinfo', 'mes/materialinfo/index', 'MesMaterialList', 1, NULL, '1', 1, 1, 1, 0, '1', 0, 1, 0, 'admin', NOW())
ON DUPLICATE KEY UPDATE
parent_id=VALUES(parent_id), name=VALUES(name), url=VALUES(url), component=VALUES(component), component_name=VALUES(component_name),
menu_type=VALUES(menu_type), perms=VALUES(perms), perms_type=VALUES(perms_type), sort_no=VALUES(sort_no),

View File

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

View File

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

View File

@@ -0,0 +1,105 @@
-- author:jiangxh---date:20260521--for: 【配合示方】新增配合示方主子表模块 ---
jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_91__mes_xsl_formula_spec.sql
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslFormulaSpec.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslFormulaSpecLine.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslFormulaSpecPage.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslFormulaSpecMapper.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslFormulaSpecLineMapper.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslFormulaSpecService.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslFormulaSpecController.java
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpecList.vue
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.api.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
-- author:jiangxh---date:20260521--for: 【配合示方】主表新增混合段1-7合计字段 ---
jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_92__mes_xsl_formula_spec_stage_total.sql
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslFormulaSpec.java
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
-- author:cursor---date:20260521--for: 【配合示方】STEP全为A/Q时对应胶比重清零 ---
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
-- author:cursor---date:20260521--for: 【配合示方】含胶率按密炼物料小类汇总重量% ---
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
jeecgboot-vue3/src/views/mes/material/modules/MesMixerMaterialSelectModal.vue
-- author:cursor---date:20260521--for: 【配合示方】含胶率物料小类可配置设置弹窗 ---
jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_96__mes_xsl_formula_spec_rubber_content_setting.sql
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslFormulaSpecSetting.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslFormulaRubberContentSettingVO.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslFormulaSpecSettingMapper.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslFormulaSpecSettingService.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecSettingServiceImpl.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslFormulaSpecController.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.api.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaRubberContentSettingModal.vue
-- author:cursor---date:20260521--for: 【配合示方】含胶率设置改用系统MES物料分类字典 ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.api.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaRubberContentSettingModal.vue
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslFormulaSpecSettingService.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecSettingServiceImpl.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslFormulaSpecController.java
-- author:cursor---date:20260521--for: 【配合示方】含胶率设置小类下拉对齐密炼物料loadTreeData加载 ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaRubberContentSettingModal.vue
-- author:cursor---date:20260521--for: 【配合示方】含胶率设置改为loadAllData加载MES物料分类全部节点 ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaRubberContentSettingModal.vue
-- author:cursor---date:20260521--for: 【配合示方】含胶率设置弹窗openModal未传data导致不加载分类 ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaRubberContentSettingModal.vue
-- author:cursor---date:20260521--for: 【配合示方】明细新增物料大类/小类展示列(不落库) ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
jeecgboot-vue3/src/views/mes/material/modules/MesMixerMaterialSelectModal.vue
-- author:cursor---date:20260521--for: 【配合示方】明细备注列与1-7段列宽适当缩小 ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
-- author:cursor---date:20260521--for: 【配合示方】基本信息模块改为汇总格状布局 ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
-- author:cursor---date:20260521--for: 【配合示方】基本信息改为显式表格格状布局 ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
-- author:cursor---date:20260521--for: 【配合示方】汇总与基本信息标题格增加内阴影 ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
-- author:cursor---date:20260521--for: 【配合示方】明细列表新增列显示/隐藏设置 ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaLineColumnSetting.vue
-- author:cursor---date:20260521--for: 【配合示方】明细列表列设置改为保存后生效并修复勾选状态 ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaLineColumnSetting.vue
-- author:cursor---date:20260521--for: 【配合示方】审批进度编制人展示真实姓名 ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/MesXslFormulaSpec.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslFormulaSpec.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslFormulaSpecServiceImpl.java
-- author:cursor---date:20260521--for: 【配合示方】编辑页A胶TOTAL PHR缺失时按明细补算回显 ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue
-- author:cursor---date:20260521--for: 【配合示方】编辑打开时基本资料闪清修复 ---
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpec/components/MesXslFormulaSpecModal.vue

View File

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

View File

@@ -0,0 +1,208 @@
package org.jeecg.modules.xslmes.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpec;
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpecLine;
import org.jeecg.modules.xslmes.service.IMesXslFormulaSpecService;
import org.jeecg.modules.xslmes.service.IMesXslFormulaSpecSettingService;
import org.jeecg.modules.xslmes.vo.MesXslFormulaRubberContentSettingVO;
import org.jeecg.modules.xslmes.vo.MesXslFormulaSpecPage;
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/mesXslFormulaSpec")
@Slf4j
public class MesXslFormulaSpecController extends JeecgController<MesXslFormulaSpec, IMesXslFormulaSpecService> {
@Autowired
private IMesXslFormulaSpecService mesXslFormulaSpecService;
@Autowired
private IMesXslFormulaSpecSettingService mesXslFormulaSpecSettingService;
@Operation(summary = "MES配合示方-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<MesXslFormulaSpec>> queryPageList(
MesXslFormulaSpec model,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@RequestParam(name = "keyword", required = false) String keyword,
HttpServletRequest req) {
QueryWrapper<MesXslFormulaSpec> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
if (oConvertUtils.isNotEmpty(keyword)) {
queryWrapper.and(
w -> w.like("spec_code", keyword)
.or()
.like("rubber_code", keyword)
.or()
.like("issue_number", keyword)
.or()
.like("purpose", keyword));
}
queryWrapper.orderByDesc("update_time").orderByDesc("create_time");
Page<MesXslFormulaSpec> page = new Page<>(pageNo, pageSize);
IPage<MesXslFormulaSpec> pageList = mesXslFormulaSpecService.page(page, queryWrapper);
return Result.OK(pageList);
}
@AutoLog(value = "MES配合示方-添加")
@Operation(summary = "MES配合示方-添加")
@RequiresPermissions("xslmes:mes_xsl_formula_spec:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody MesXslFormulaSpecPage page) {
//update-begin---author:jiangxh ---date:20260521 for【配合示方】主子表保存校验-----------
String err = validateMain(page);
if (err != null) {
return Result.error(err);
}
//update-end---author:jiangxh ---date:20260521 for【配合示方】主子表保存校验-----------
MesXslFormulaSpec main = new MesXslFormulaSpec();
BeanUtils.copyProperties(page, main);
mesXslFormulaSpecService.saveMain(main, page.getLineList());
return Result.OK("添加成功!");
}
@AutoLog(value = "MES配合示方-编辑")
@Operation(summary = "MES配合示方-编辑")
@RequiresPermissions("xslmes:mes_xsl_formula_spec:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody MesXslFormulaSpecPage page) {
//update-begin---author:jiangxh ---date:20260521 for【配合示方】主子表保存校验-----------
String err = validateMain(page);
if (err != null) {
return Result.error(err);
}
//update-end---author:jiangxh ---date:20260521 for【配合示方】主子表保存校验-----------
MesXslFormulaSpec main = new MesXslFormulaSpec();
BeanUtils.copyProperties(page, main);
mesXslFormulaSpecService.updateMain(main, page.getLineList());
return Result.OK("编辑成功!");
}
@AutoLog(value = "MES配合示方-删除")
@Operation(summary = "MES配合示方-通过id删除")
@RequiresPermissions("xslmes:mes_xsl_formula_spec:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
mesXslFormulaSpecService.delMain(id);
return Result.OK("删除成功!");
}
@AutoLog(value = "MES配合示方-批量删除")
@Operation(summary = "MES配合示方-批量删除")
@RequiresPermissions("xslmes:mes_xsl_formula_spec:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
mesXslFormulaSpecService.delBatchMain(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@Operation(summary = "MES配合示方-通过id查询")
@GetMapping(value = "/queryById")
public Result<MesXslFormulaSpec> queryById(@RequestParam(name = "id", required = true) String id) {
MesXslFormulaSpec entity = mesXslFormulaSpecService.getByIdWithLines(id);
if (entity == null) {
return Result.error("未找到对应数据");
}
return Result.OK(entity);
}
@Operation(summary = "MES配合示方-查询明细")
@GetMapping(value = "/queryLineListByMainId")
public Result<List<MesXslFormulaSpecLine>> queryLineListByMainId(@RequestParam(name = "id", required = true) String id) {
return Result.OK(mesXslFormulaSpecService.selectLinesByMainId(id));
}
//update-begin---author:cursor ---date:20260521 for配合示方胶料代号自动生成-----------
@Operation(summary = "MES配合示方-生成胶料代号")
@GetMapping(value = "/generateRubberCode")
public Result<Map<String, String>> generateRubberCode(
@RequestParam(name = "rubberMaterialId") String rubberMaterialId,
@RequestParam(name = "category") String category,
@RequestParam(name = "excludeSpecId", required = false) String excludeSpecId) {
try {
String rubberCode = mesXslFormulaSpecService.generateRubberCode(rubberMaterialId, category, excludeSpecId);
return Result.OK(Map.of("rubberCode", rubberCode));
} catch (IllegalArgumentException ex) {
return Result.error(ex.getMessage());
}
}
//update-end---author:cursor ---date:20260521 for配合示方胶料代号自动生成-----------
//update-begin---author:cursor ---date:20260521 for【配合示方】含胶率物料小类可配置-----------
@Operation(summary = "MES配合示方-查询含胶率物料小类配置")
@GetMapping(value = "/getRubberContentSetting")
public Result<MesXslFormulaRubberContentSettingVO> getRubberContentSetting() {
return Result.OK(mesXslFormulaSpecSettingService.getRubberContentSetting());
}
@AutoLog(value = "MES配合示方-保存含胶率物料小类配置")
@Operation(summary = "MES配合示方-保存含胶率物料小类配置")
@RequiresPermissions("xslmes:mes_xsl_formula_spec:edit")
@PostMapping(value = "/saveRubberContentSetting")
public Result<String> saveRubberContentSetting(@RequestBody MesXslFormulaRubberContentSettingVO setting) {
mesXslFormulaSpecSettingService.saveRubberContentSetting(setting);
return Result.OK("保存成功");
}
//update-end---author:cursor ---date:20260521 for【配合示方】含胶率物料小类可配置-----------
@RequiresPermissions("xslmes:mes_xsl_formula_spec:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MesXslFormulaSpec model) {
return super.exportXls(request, model, MesXslFormulaSpec.class, "配合示方");
}
@RequiresPermissions("xslmes:mes_xsl_formula_spec:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, MesXslFormulaSpec.class);
}
//update-begin---author:jiangxh ---date:20260521 for【配合示方】主子表保存校验-----------
private String validateMain(MesXslFormulaSpecPage page) {
if (oConvertUtils.isEmpty(page.getSpecCode())) {
return "请输入示方编号";
}
if (oConvertUtils.isEmpty(page.getRubberCode())) {
return "请选择胶料并生成胶料代号";
}
if (oConvertUtils.isEmpty(page.getRubberMaterialId())) {
return "请选择胶料信息";
}
if (page.getMixingStages() != null && (page.getMixingStages() < 1 || page.getMixingStages() > 7)) {
return "混合段数必须在1-7之间";
}
if (page.getLineList() == null || page.getLineList().isEmpty()) {
return "请至少添加一行配合明细";
}
return null;
}
//update-end---author:jiangxh ---date:20260521 for【配合示方】主子表保存校验-----------
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,90 @@
package org.jeecg.modules.xslmes.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* MES 日罐物料对应信息
*/
@Data
@TableName("mes_xsl_day_tank_material_map")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES日罐物料对应信息")
public class MesXslDayTankMaterialMap implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Excel(name = "机台名称", width = 20, dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id")
@Dict(dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id")
@Schema(description = "设备台账ID")
private String equipmentId;
@Excel(name = "机台代码", width = 20)
@Schema(description = "机台代码(设备编号冗余)")
private String machineCode;
@Excel(name = "机台名称", width = 20)
@Schema(description = "机台名称冗余")
private String machineName;
@Excel(name = "料仓分类", width = 20, dictTable = "sys_category", dicText = "name", dicCode = "id")
@Dict(dictTable = "sys_category", dicText = "name", dicCode = "id")
@Schema(description = "料仓分类ID分类字典")
private String siloCategoryId;
@Excel(name = "工位", width = 20)
@Schema(description = "工位")
private String station;
@Excel(name = "料仓号", width = 20)
@Schema(description = "料仓号")
private String siloNo;
@Excel(name = "物料名称", width = 20, dictTable = "mes_material", dicText = "material_name", dicCode = "id")
@Dict(dictTable = "mes_material", dicText = "material_name", dicCode = "id")
@Schema(description = "胶料信息ID")
private String materialId;
@Excel(name = "物料名称", width = 20)
@Schema(description = "物料名称冗余")
private String materialName;
@Excel(name = "使用状态", width = 12, replace = {"使用中_1", "停用_0"})
@Schema(description = "使用状态1使用中 0停用")
private Integer useStatus;
@Excel(name = "是否允许同步", width = 12, replace = {"允许_1", "不允许_0"})
@Schema(description = "是否允许同步1允许 0不允许")
private Integer allowSync;
private Integer tenantId;
private String sysOrgCode;
private String createBy;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String updateBy;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
private Integer delFlag;
}

View File

@@ -0,0 +1,220 @@
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.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* MES 配合示方
*/
@Data
@TableName("mes_xsl_formula_spec")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES配合示方")
public class MesXslFormulaSpec implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Excel(name = "分类", width = 10, dicCode = "xslmes_formula_spec_category")
@Dict(dicCode = "xslmes_formula_spec_category")
@Schema(description = "分类")
private String category;
@Excel(name = "示方编号", width = 18)
@Schema(description = "示方编号")
private String specCode;
@Excel(name = "胶料代号", width = 18)
@Schema(description = "胶料代号")
private String rubberCode;
@Schema(description = "胶料ID关联mes_material.id")
private String rubberMaterialId;
@Excel(name = "基本配合", width = 15)
@Schema(description = "基本配合")
private String basicFormula;
@Excel(name = "发行日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(description = "发行日期")
private Date issueDate;
@Excel(name = "用途", width = 20)
@Schema(description = "用途")
private String purpose;
@Excel(name = "发行编号", width = 15)
@Schema(description = "发行编号")
private String issueNumber;
@Excel(name = "混合段数", width = 10)
@Schema(description = "混合段数")
private Integer mixingStages;
@Excel(name = "混合机器", width = 15)
@Schema(description = "混合机器")
private String mixingMachine;
@Schema(description = "发行部门ID")
private String issueDeptId;
@Excel(name = "发行部门", width = 15)
@Schema(description = "发行部门名称")
private String issueDeptName;
@Excel(name = "A胶TOTAL PHR", width = 14)
@Schema(description = "A胶TOTAL PHR")
private BigDecimal aRubberTotalPhr;
@Excel(name = "TOTAL PHR", width = 12)
@Schema(description = "TOTAL PHR")
private BigDecimal totalPhr;
//update-begin---author:jiangxh ---date:20260521 for【配合示方】主表新增混合段1-7合计字段-----------
@Excel(name = "混合段1合计", width = 12)
@Schema(description = "混合段1合计")
private BigDecimal stage1Total;
@Excel(name = "混合段2合计", width = 12)
@Schema(description = "混合段2合计")
private BigDecimal stage2Total;
@Excel(name = "混合段3合计", width = 12)
@Schema(description = "混合段3合计")
private BigDecimal stage3Total;
@Excel(name = "混合段4合计", width = 12)
@Schema(description = "混合段4合计")
private BigDecimal stage4Total;
@Excel(name = "混合段5合计", width = 12)
@Schema(description = "混合段5合计")
private BigDecimal stage5Total;
@Excel(name = "混合段6合计", width = 12)
@Schema(description = "混合段6合计")
private BigDecimal stage6Total;
@Excel(name = "混合段7合计", width = 12)
@Schema(description = "混合段7合计")
private BigDecimal stage7Total;
//update-end---author:jiangxh ---date:20260521 for【配合示方】主表新增混合段1-7合计字段-----------
@Excel(name = "发行理由", width = 30)
@Schema(description = "发行理由")
private String issueReason;
@Excel(name = "天然橡胶", width = 12)
@Schema(description = "天然橡胶")
private BigDecimal naturalRubber;
@Excel(name = "合成橡胶", width = 12)
@Schema(description = "合成橡胶")
private BigDecimal syntheticRubber;
@Excel(name = "合计", width = 12)
@Schema(description = "合计")
private BigDecimal totalAmount;
@Excel(name = "重量单价", width = 12)
@Schema(description = "重量单价")
private BigDecimal weightUnitPrice;
@Excel(name = "体积单价", width = 12)
@Schema(description = "体积单价")
private BigDecimal volumeUnitPrice;
@Excel(name = "Q胶比重", width = 12)
@Schema(description = "Q胶比重")
@TableField("q_rubber_sg")
private BigDecimal qRubberSg;
@Excel(name = "A胶比重", width = 12)
@Schema(description = "A胶比重")
@TableField("a_rubber_sg")
private BigDecimal aRubberSg;
@Excel(name = "人工配料", width = 10, replace = {"是_1", "否_0"})
@Schema(description = "是否有人工配料0否 1是")
private Integer hasManualBatch;
@Excel(name = "状态", width = 12, dicCode = "xslmes_formula_spec_status")
@Dict(dicCode = "xslmes_formula_spec_status")
@Schema(description = "状态")
private String status;
@Excel(name = "校对人", width = 12)
@Schema(description = "校对人")
private String proofreadBy;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "校对时间")
private Date proofreadTime;
@Excel(name = "审核人", width = 12)
@Schema(description = "审核人")
private String auditBy;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "审核时间")
private Date auditTime;
@Excel(name = "批准人", width = 12)
@Schema(description = "批准人")
private String approveBy;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "批准时间")
private Date approveTime;
@Excel(name = "创建人", width = 12, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
private String createBy;
/** queryById 等非分页接口补充创建人姓名DictAspect 仅翻译分页列表) */
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createBy_dictText;
@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;
@Schema(description = "租户ID")
private Integer tenantId;
private String sysOrgCode;
private Integer delFlag;
@TableField(exist = false)
@Schema(description = "配合明细")
private List<MesXslFormulaSpecLine> lineList;
}

View File

@@ -0,0 +1,105 @@
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.springframework.format.annotation.DateTimeFormat;
/**
* MES 配合示方明细
*/
@Data
@TableName("mes_xsl_formula_spec_line")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES配合示方明细")
public class MesXslFormulaSpecLine implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Schema(description = "配合示方主表ID")
private String formulaSpecId;
@Schema(description = "行序号")
private Integer sortNo;
@Schema(description = "PHR")
private BigDecimal phr;
@Schema(description = "密炼物料ID")
private String mixerMaterialId;
@Schema(description = "密炼物料编码")
private String mixerMaterialCode;
@Schema(description = "密炼物料名称")
private String mixerMaterialName;
@Schema(description = "物料描述")
private String materialDesc;
@Dict(dicCode = "xslmes_formula_spec_step")
@Schema(description = "STEP")
private String step;
@Dict(dicCode = "xslmes_formula_spec_weigh_mode")
@Schema(description = "称量方式")
private String weighMode;
@Schema(description = "重量%")
private BigDecimal weightPercent;
@Schema(description = "体积")
private BigDecimal volume;
@Schema(description = "备注")
private String remark;
@Schema(description = "混合段1")
private BigDecimal stage1;
@Schema(description = "混合段2")
private BigDecimal stage2;
@Schema(description = "混合段3")
private BigDecimal stage3;
@Schema(description = "混合段4")
private BigDecimal stage4;
@Schema(description = "混合段5")
private BigDecimal stage5;
@Schema(description = "混合段6")
private BigDecimal stage6;
@Schema(description = "混合段7")
private BigDecimal stage7;
@Schema(description = "租户ID")
private Integer tenantId;
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;
}

View File

@@ -0,0 +1,48 @@
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.springframework.format.annotation.DateTimeFormat;
/**
* 配合示方模块配置
*/
@Data
@TableName("mes_xsl_formula_spec_setting")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "配合示方模块配置")
public class MesXslFormulaSpecSetting implements Serializable {
private static final long serialVersionUID = 1L;
public static final String DEFAULT_ID = "1993000000000000991";
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Schema(description = "天然橡胶物料小类ID逗号分隔")
private String naturalMinorCategoryIds;
@Schema(description = "合成橡胶物料小类ID逗号分隔")
private String syntheticMinorCategoryIds;
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;
}

View File

@@ -0,0 +1,68 @@
package org.jeecg.modules.xslmes.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* MES 密炼机动作维护
*/
@Data
@TableName("mes_xsl_mixer_action")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES密炼机动作维护")
public class MesXslMixerAction implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Excel(name = "设备名称", width = 20, dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id")
@Dict(dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id")
@Schema(description = "设备台账ID")
private String equipmentId;
@Excel(name = "设备名称", width = 20)
@Schema(description = "设备名称冗余")
private String equipmentName;
@Excel(name = "动作名称", width = 20)
@Schema(description = "动作名称")
private String actionName;
@Excel(name = "动作代号", width = 20)
@Schema(description = "动作代号")
private String actionCode;
@Excel(name = "备注", width = 30)
@Schema(description = "备注")
private String remark;
private Integer tenantId;
private String sysOrgCode;
private String createBy;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String updateBy;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
private Integer delFlag;
}

View File

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

View File

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

View File

@@ -0,0 +1,98 @@
package org.jeecg.modules.xslmes.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* MES 开炼机参数维护
*/
@Data
@TableName("mes_xsl_open_mill_param")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES开炼机参数维护")
public class MesXslOpenMillParam implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Excel(name = "胶料ID", width = 15, dictTable = "mes_material", dicText = "material_name", dicCode = "id")
@Dict(dictTable = "mes_material", dicText = "material_name", dicCode = "id")
@Schema(description = "胶料ID关联 mes_material.id")
private String materialId;
@Excel(name = "胶料名称", width = 20)
@Schema(description = "胶料名称冗余")
private String materialName;
@Excel(name = "胶料别名", width = 15)
@Schema(description = "胶料别名冗余(取自 mes_material.alias_name")
private String materialCode;
@Excel(name = "R0进胶时间(秒)", width = 14)
@Schema(description = "R0进胶时间")
private BigDecimal r0FeedTime;
@Excel(name = "R0成环时间(秒)", width = 14)
@Schema(description = "R0成环时间")
private BigDecimal r0RingTime;
@Excel(name = "R0拉断时间(秒)", width = 14)
@Schema(description = "R0拉断时间")
private BigDecimal r0BreakTime;
@Excel(name = "R0排胶时间(秒)", width = 14)
@Schema(description = "R0排胶时间")
private BigDecimal r0DischargeTime;
@Excel(name = "R1进胶时间(秒)", width = 14)
@Schema(description = "R1进胶时间")
private BigDecimal r1FeedTime;
@Excel(name = "R1成环时间(秒)", width = 14)
@Schema(description = "R1成环时间")
private BigDecimal r1RingTime;
@Excel(name = "R1拉断时间(秒)", width = 14)
@Schema(description = "R1拉断时间")
private BigDecimal r1BreakTime;
@Excel(name = "R1排胶时间(秒)", width = 14)
@Schema(description = "R1排胶时间")
private BigDecimal r1DischargeTime;
@Excel(name = "创建人", width = 15)
private String createBy;
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@Excel(name = "修改人", width = 15)
private String updateBy;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
@Schema(description = "租户ID")
private Integer tenantId;
private String sysOrgCode;
private Integer delFlag;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,20 @@
package org.jeecg.modules.xslmes.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
/**
* MES 密炼物料替代对应关系 Mapper
*/
@Mapper
public interface MesXslMixerMaterialSubstituteMapper extends BaseMapper<MesXslMixerMaterialSubstitute> {
//update-begin---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】查询租户内最大编号-----------
@Select("SELECT IFNULL(MAX(serial_no), 0) FROM mes_xsl_mixer_material_substitute "
+ "WHERE del_flag = 0 AND (#{tenantId} IS NULL OR tenant_id = #{tenantId})")
Integer selectMaxSerialNo(@Param("tenantId") Integer tenantId);
//update-end---author:jiangxh ---date:20260520 for【密炼物料替代对应关系】查询租户内最大编号-----------
}

View File

@@ -0,0 +1,12 @@
package org.jeecg.modules.xslmes.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.jeecg.modules.xslmes.entity.MesXslMixerPsCompile;
/**
* MES 密炼PS编制 Mapper
*/
@Mapper
public interface MesXslMixerPsCompileMapper extends BaseMapper<MesXslMixerPsCompile> {
}

View File

@@ -0,0 +1,12 @@
package org.jeecg.modules.xslmes.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
/**
* MES 开炼机参数维护 Mapper
*/
@Mapper
public interface MesXslOpenMillParamMapper extends BaseMapper<MesXslOpenMillParam> {
}

View File

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

View File

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

View File

@@ -0,0 +1,28 @@
package org.jeecg.modules.xslmes.service;
import com.baomidou.mybatisplus.extension.service.IService;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpec;
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpecLine;
public interface IMesXslFormulaSpecService extends IService<MesXslFormulaSpec> {
void saveMain(MesXslFormulaSpec main, List<MesXslFormulaSpecLine> lineList);
void updateMain(MesXslFormulaSpec main, List<MesXslFormulaSpecLine> lineList);
void delMain(String id);
void delBatchMain(Collection<? extends Serializable> idList);
List<MesXslFormulaSpecLine> selectLinesByMainId(String mainId);
MesXslFormulaSpec getByIdWithLines(String id);
/**
* 生成胶料代号D + 胶料名称 + 分类键值(S/P/T/C) + 版本号(A01-Z01)
*/
String generateRubberCode(String rubberMaterialId, String category, String excludeSpecId);
}

View File

@@ -0,0 +1,17 @@
package org.jeecg.modules.xslmes.service;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.Set;
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpecSetting;
import org.jeecg.modules.xslmes.vo.MesXslFormulaRubberContentSettingVO;
public interface IMesXslFormulaSpecSettingService extends IService<MesXslFormulaSpecSetting> {
MesXslFormulaRubberContentSettingVO getRubberContentSetting();
void saveRubberContentSetting(MesXslFormulaRubberContentSettingVO setting);
Set<String> getNaturalMinorCategoryIds();
Set<String> getSyntheticMinorCategoryIds();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,403 @@
package org.jeecg.modules.xslmes.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.modules.mes.material.entity.MesMaterial;
import org.jeecg.modules.mes.material.entity.MesMixerMaterial;
import org.jeecg.modules.mes.material.service.IMesMaterialService;
import org.jeecg.modules.mes.material.service.IMesMixerMaterialService;
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpec;
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpecLine;
import org.jeecg.modules.xslmes.mapper.MesXslFormulaSpecLineMapper;
import org.jeecg.modules.xslmes.mapper.MesXslFormulaSpecMapper;
import org.jeecg.modules.xslmes.service.IMesXslFormulaSpecService;
import org.jeecg.modules.xslmes.service.IMesXslFormulaSpecSettingService;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@Service
public class MesXslFormulaSpecServiceImpl extends ServiceImpl<MesXslFormulaSpecMapper, MesXslFormulaSpec>
implements IMesXslFormulaSpecService {
private static final Set<String> RUBBER_CATEGORY_KEYS = Set.of("S", "P", "T", "C");
private static final Pattern RUBBER_CODE_VERSION_PATTERN = Pattern.compile("([A-Z])01$");
@Resource
private MesXslFormulaSpecLineMapper lineMapper;
@Resource
private IMesMixerMaterialService mesMixerMaterialService;
@Resource
private IMesMaterialService mesMaterialService;
@Resource
private IMesXslFormulaSpecSettingService mesXslFormulaSpecSettingService;
@Resource
private ISysUserService sysUserService;
@Override
@Transactional(rollbackFor = Exception.class)
public void saveMain(MesXslFormulaSpec main, List<MesXslFormulaSpecLine> lineList) {
fillMainDefaults(main);
//update-begin---author:cursor ---date:20260521 for配合示方新增时服务端生成胶料代号-----------
fillRubberCodeOnCreate(main);
//update-end---author:cursor ---date:20260521 for配合示方新增时服务端生成胶料代号-----------
this.save(main);
insertLines(main, lineList);
refreshMainSummary(main.getId());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateMain(MesXslFormulaSpec main, List<MesXslFormulaSpecLine> lineList) {
fillMainDefaults(main);
this.updateById(main);
lineMapper.delete(new LambdaQueryWrapper<MesXslFormulaSpecLine>().eq(MesXslFormulaSpecLine::getFormulaSpecId, main.getId()));
insertLines(main, lineList);
refreshMainSummary(main.getId());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delMain(String id) {
lineMapper.delete(new LambdaQueryWrapper<MesXslFormulaSpecLine>().eq(MesXslFormulaSpecLine::getFormulaSpecId, id));
this.removeById(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delBatchMain(Collection<? extends Serializable> idList) {
if (idList == null || idList.isEmpty()) {
return;
}
for (Serializable id : idList) {
if (id != null) {
delMain(id.toString());
}
}
}
@Override
public List<MesXslFormulaSpecLine> selectLinesByMainId(String mainId) {
return lineMapper.selectList(
new LambdaQueryWrapper<MesXslFormulaSpecLine>()
.eq(MesXslFormulaSpecLine::getFormulaSpecId, mainId)
.orderByAsc(MesXslFormulaSpecLine::getSortNo)
.orderByAsc(MesXslFormulaSpecLine::getId));
}
@Override
public MesXslFormulaSpec getByIdWithLines(String id) {
MesXslFormulaSpec main = this.getById(id);
if (main == null) {
return null;
}
main.setLineList(selectLinesByMainId(id));
//update-begin---author:cursor ---date:20260521 for【配合示方】queryById补充创建人姓名供审批进度展示-----------
fillCreateByDictText(main);
//update-end---author:cursor ---date:20260521 for【配合示方】queryById补充创建人姓名供审批进度展示-----------
return main;
}
private void fillCreateByDictText(MesXslFormulaSpec main) {
if (main == null || StringUtils.isBlank(main.getCreateBy())) {
return;
}
SysUser user = sysUserService.getUserByName(main.getCreateBy());
if (user != null && StringUtils.isNotBlank(user.getRealname())) {
main.setCreateBy_dictText(user.getRealname());
}
}
//update-begin---author:cursor ---date:20260521 for配合示方胶料代号自动生成 D+胶料名称+分类+版本号-----------
@Override
public String generateRubberCode(String rubberMaterialId, String category, String excludeSpecId) {
if (StringUtils.isBlank(rubberMaterialId)) {
throw new IllegalArgumentException("请选择胶料信息");
}
if (StringUtils.isBlank(category) || !RUBBER_CATEGORY_KEYS.contains(category)) {
throw new IllegalArgumentException("请选择有效的示方分类");
}
MesMaterial material = mesMaterialService.getById(rubberMaterialId);
if (material == null || StringUtils.isBlank(material.getMaterialName())) {
throw new IllegalArgumentException("所选胶料不存在或未维护胶料名称");
}
String basePrefix = buildRubberCodePrefix(material.getMaterialName(), category);
Set<Character> usedLetters = loadUsedRubberCodeLetters(rubberMaterialId, category, basePrefix, excludeSpecId);
for (char letter = 'A'; letter <= 'Z'; letter++) {
if (!usedLetters.contains(letter)) {
return basePrefix + letter + "01";
}
}
throw new IllegalArgumentException("该胶料在当前分类下的代号版本已用尽(A01-Z01)");
}
private void fillRubberCodeOnCreate(MesXslFormulaSpec main) {
if (StringUtils.isBlank(main.getRubberMaterialId()) || StringUtils.isBlank(main.getCategory())) {
return;
}
main.setRubberCode(generateRubberCode(main.getRubberMaterialId(), main.getCategory(), null));
main.setSpecCode(main.getRubberCode());
}
private String buildRubberCodePrefix(String materialName, String category) {
return "D" + materialName.trim() + category;
}
private Set<Character> loadUsedRubberCodeLetters(
String rubberMaterialId, String category, String basePrefix, String excludeSpecId) {
LambdaQueryWrapper<MesXslFormulaSpec> queryWrapper = new LambdaQueryWrapper<MesXslFormulaSpec>()
.eq(MesXslFormulaSpec::getRubberMaterialId, rubberMaterialId)
.eq(MesXslFormulaSpec::getCategory, category)
.likeRight(MesXslFormulaSpec::getRubberCode, basePrefix);
if (StringUtils.isNotBlank(excludeSpecId)) {
queryWrapper.ne(MesXslFormulaSpec::getId, excludeSpecId);
}
List<MesXslFormulaSpec> existingList = this.list(queryWrapper);
Set<Character> usedLetters = new HashSet<>();
for (MesXslFormulaSpec item : existingList) {
if (item == null || StringUtils.isBlank(item.getRubberCode())) {
continue;
}
if (!item.getRubberCode().startsWith(basePrefix) || item.getRubberCode().length() <= basePrefix.length()) {
continue;
}
String suffix = item.getRubberCode().substring(basePrefix.length());
Matcher matcher = RUBBER_CODE_VERSION_PATTERN.matcher(suffix);
if (matcher.matches()) {
usedLetters.add(matcher.group(1).charAt(0));
}
}
return usedLetters;
}
//update-end---author:cursor ---date:20260521 for配合示方胶料代号自动生成 D+胶料名称+分类+版本号-----------
private void fillMainDefaults(MesXslFormulaSpec main) {
if (StringUtils.isBlank(main.getCategory())) {
//update-begin---author:cursor ---date:20260521 for配合示方分类字典默认值改为 S-----------
main.setCategory("S");
//update-end---author:cursor ---date:20260521 for配合示方分类字典默认值改为 S-----------
}
if (StringUtils.isBlank(main.getStatus())) {
main.setStatus("compile");
}
if (main.getHasManualBatch() == null) {
main.setHasManualBatch(0);
}
}
private void insertLines(MesXslFormulaSpec main, List<MesXslFormulaSpecLine> lineList) {
if (CollectionUtils.isEmpty(lineList)) {
return;
}
Date now = new Date();
int sort = 0;
//update-begin---author:cursor ---date:20260521 for配合示方明细重量%按PHR/总PHR自动计算-----------
BigDecimal totalPhr = BigDecimal.ZERO;
for (MesXslFormulaSpecLine line : lineList) {
if (line == null || StringUtils.isBlank(line.getMixerMaterialId()) || line.getPhr() == null) {
continue;
}
totalPhr = totalPhr.add(line.getPhr());
}
if (main.getTotalPhr() == null) {
main.setTotalPhr(totalPhr);
}
BigDecimal weightBase = main.getTotalPhr() != null && main.getTotalPhr().compareTo(BigDecimal.ZERO) > 0
? main.getTotalPhr()
: totalPhr;
//update-end---author:cursor ---date:20260521 for配合示方明细重量%按PHR/总PHR自动计算-----------
boolean hasManual = false;
for (MesXslFormulaSpecLine line : lineList) {
if (line == null || StringUtils.isBlank(line.getMixerMaterialId())) {
continue;
}
line.setId(null);
line.setFormulaSpecId(main.getId());
line.setSortNo(sort++);
fillMaterialInfo(line);
fillVolumeIfBlank(line);
//update-begin---author:cursor ---date:20260521 for配合示方明细重量%按PHR/总PHR自动计算-----------
fillWeightPercent(line, weightBase);
//update-end---author:cursor ---date:20260521 for配合示方明细重量%按PHR/总PHR自动计算-----------
if (line.getCreateTime() == null) {
line.setCreateTime(now);
}
if (line.getUpdateTime() == null) {
line.setUpdateTime(now);
}
if ("manual".equals(line.getWeighMode())) {
hasManual = true;
}
lineMapper.insert(line);
}
if (main.getTotalPhr() == null) {
main.setTotalPhr(totalPhr);
}
if (main.getHasManualBatch() == null || main.getHasManualBatch() == 0) {
main.setHasManualBatch(hasManual ? 1 : 0);
}
}
private void fillMaterialInfo(MesXslFormulaSpecLine line) {
MesMixerMaterial material = mesMixerMaterialService.getById(line.getMixerMaterialId());
if (material == null) {
return;
}
line.setMixerMaterialCode(material.getMaterialCode());
line.setMixerMaterialName(material.getMaterialName());
if (StringUtils.isBlank(line.getMaterialDesc())) {
line.setMaterialDesc(StringUtils.defaultIfBlank(material.getMaterialDesc(), material.getMaterialName()));
}
}
private void fillVolumeIfBlank(MesXslFormulaSpecLine line) {
if (line.getVolume() != null || line.getPhr() == null || StringUtils.isBlank(line.getMixerMaterialId())) {
return;
}
MesMixerMaterial material = mesMixerMaterialService.getById(line.getMixerMaterialId());
if (material == null || material.getSpecificGravity() == null || material.getSpecificGravity().compareTo(BigDecimal.ZERO) <= 0) {
return;
}
line.setVolume(line.getPhr().divide(material.getSpecificGravity(), 6, RoundingMode.HALF_UP));
}
private void fillWeightPercent(MesXslFormulaSpecLine line, BigDecimal totalPhr) {
//update-begin---author:cursor ---date:20260521 for配合示方明细重量%按PHR/总PHR自动计算可手工覆盖-----------
if (line.getWeightPercent() != null || line.getPhr() == null || totalPhr == null || totalPhr.compareTo(BigDecimal.ZERO) <= 0) {
return;
}
line.setWeightPercent(line.getPhr().multiply(BigDecimal.valueOf(100)).divide(totalPhr, 4, RoundingMode.HALF_UP));
//update-end---author:cursor ---date:20260521 for配合示方明细重量%按PHR/总PHR自动计算可手工覆盖-----------
}
//update-begin---author:cursor ---date:20260521 for【配合示方】保存后汇总A/Q胶比重写入数据库-----------
/** 根据明细重新汇总主表 TOTAL PHR、A胶TOTAL PHR、比重与人工配料标记 */
private void refreshMainSummary(String mainId) {
List<MesXslFormulaSpecLine> lines = selectLinesByMainId(mainId);
if (CollectionUtils.isEmpty(lines)) {
return;
}
BigDecimal totalPhr = BigDecimal.ZERO;
BigDecimal aRubberPhr = BigDecimal.ZERO;
BigDecimal aRubberVolume = BigDecimal.ZERO;
BigDecimal qRubberPhr = BigDecimal.ZERO;
BigDecimal qRubberVolume = BigDecimal.ZERO;
BigDecimal naturalRubber = BigDecimal.ZERO;
BigDecimal syntheticRubber = BigDecimal.ZERO;
boolean hasManual = false;
Map<String, MesMixerMaterial> materialCache = new HashMap<>();
Set<String> naturalCategoryIds = mesXslFormulaSpecSettingService.getNaturalMinorCategoryIds();
Set<String> syntheticCategoryIds = mesXslFormulaSpecSettingService.getSyntheticMinorCategoryIds();
for (MesXslFormulaSpecLine line : lines) {
if (line == null) {
continue;
}
if (line.getPhr() != null) {
totalPhr = totalPhr.add(line.getPhr());
if ("A".equals(line.getStep())) {
aRubberPhr = aRubberPhr.add(line.getPhr());
} else if ("Q".equals(line.getStep())) {
qRubberPhr = qRubberPhr.add(line.getPhr());
}
}
if ("manual".equals(line.getWeighMode())) {
hasManual = true;
}
BigDecimal volume = resolveLineVolume(line);
if (volume == null) {
continue;
}
if ("A".equals(line.getStep())) {
aRubberVolume = aRubberVolume.add(volume);
} else if ("Q".equals(line.getStep())) {
qRubberVolume = qRubberVolume.add(volume);
}
//update-begin---author:cursor ---date:20260521 for【配合示方】含胶率按密炼物料小类汇总重量%-----------
if (line.getWeightPercent() != null && StringUtils.isNotBlank(line.getMixerMaterialId())) {
MesMixerMaterial mixerMaterial = materialCache.computeIfAbsent(
line.getMixerMaterialId(), mesMixerMaterialService::getById);
if (mixerMaterial != null && StringUtils.isNotBlank(mixerMaterial.getMinorCategoryId())) {
String minorCategoryId = mixerMaterial.getMinorCategoryId();
if (!naturalCategoryIds.isEmpty() && naturalCategoryIds.contains(minorCategoryId)) {
naturalRubber = naturalRubber.add(line.getWeightPercent());
} else if (!syntheticCategoryIds.isEmpty() && syntheticCategoryIds.contains(minorCategoryId)) {
syntheticRubber = syntheticRubber.add(line.getWeightPercent());
}
}
}
//update-end---author:cursor ---date:20260521 for【配合示方】含胶率按密炼物料小类汇总重量%-----------
}
//update-begin---author:cursor ---date:20260521 for【配合示方】STEP全为A/Q时对应胶比重清零并写库-----------
BigDecimal aRubberSg = aRubberVolume.compareTo(BigDecimal.ZERO) > 0
? aRubberPhr.divide(aRubberVolume, 6, RoundingMode.HALF_UP)
: null;
BigDecimal qRubberSg = qRubberVolume.compareTo(BigDecimal.ZERO) > 0
? qRubberPhr.divide(qRubberVolume, 6, RoundingMode.HALF_UP)
: null;
BigDecimal aRubberTotalPhr = aRubberPhr.compareTo(BigDecimal.ZERO) > 0 ? aRubberPhr : null;
BigDecimal naturalRubberValue = naturalRubber.compareTo(BigDecimal.ZERO) > 0
? naturalRubber.setScale(4, RoundingMode.HALF_UP)
: null;
BigDecimal syntheticRubberValue = syntheticRubber.compareTo(BigDecimal.ZERO) > 0
? syntheticRubber.setScale(4, RoundingMode.HALF_UP)
: null;
BigDecimal totalAmount = null;
if (naturalRubberValue != null || syntheticRubberValue != null) {
totalAmount = (naturalRubberValue != null ? naturalRubberValue : BigDecimal.ZERO)
.add(syntheticRubberValue != null ? syntheticRubberValue : BigDecimal.ZERO)
.setScale(4, RoundingMode.HALF_UP);
}
LambdaUpdateWrapper<MesXslFormulaSpec> updateWrapper = new LambdaUpdateWrapper<MesXslFormulaSpec>()
.eq(MesXslFormulaSpec::getId, mainId)
.set(MesXslFormulaSpec::getTotalPhr, totalPhr)
.set(MesXslFormulaSpec::getHasManualBatch, hasManual ? 1 : 0)
.set(MesXslFormulaSpec::getARubberTotalPhr, aRubberTotalPhr)
.set(MesXslFormulaSpec::getARubberSg, aRubberSg)
.set(MesXslFormulaSpec::getQRubberSg, qRubberSg)
.set(MesXslFormulaSpec::getNaturalRubber, naturalRubberValue)
.set(MesXslFormulaSpec::getSyntheticRubber, syntheticRubberValue)
.set(MesXslFormulaSpec::getTotalAmount, totalAmount);
this.update(updateWrapper);
//update-end---author:cursor ---date:20260521 for【配合示方】STEP全为A/Q时对应胶比重清零并写库-----------
}
/** 优先取明细已保存体积,缺失时按 PHR/物料比重补算 */
private BigDecimal resolveLineVolume(MesXslFormulaSpecLine line) {
if (line == null) {
return null;
}
if (line.getVolume() != null && line.getVolume().compareTo(BigDecimal.ZERO) > 0) {
return line.getVolume();
}
if (line.getPhr() == null || StringUtils.isBlank(line.getMixerMaterialId())) {
return null;
}
MesMixerMaterial material = mesMixerMaterialService.getById(line.getMixerMaterialId());
if (material == null || material.getSpecificGravity() == null || material.getSpecificGravity().compareTo(BigDecimal.ZERO) <= 0) {
return null;
}
return line.getPhr().divide(material.getSpecificGravity(), 6, RoundingMode.HALF_UP);
}
//update-end---author:cursor ---date:20260521 for【配合示方】保存后汇总A/Q胶比重写入数据库-----------
}

View File

@@ -0,0 +1,104 @@
package org.jeecg.modules.xslmes.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.modules.system.entity.SysCategory;
import org.jeecg.modules.system.service.ISysCategoryService;
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpecSetting;
import org.jeecg.modules.xslmes.mapper.MesXslFormulaSpecSettingMapper;
import org.jeecg.modules.xslmes.service.IMesXslFormulaSpecSettingService;
import org.jeecg.modules.xslmes.vo.MesXslFormulaRubberContentSettingVO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class MesXslFormulaSpecSettingServiceImpl extends ServiceImpl<MesXslFormulaSpecSettingMapper, MesXslFormulaSpecSetting>
implements IMesXslFormulaSpecSettingService {
private static final String DEFAULT_NATURAL_CATEGORY_CODE = "XSLMES_MATERIAL_RAW_AUX_TRJ";
private static final String DEFAULT_SYNTHETIC_CATEGORY_CODE = "XSLMES_MATERIAL_RAW_AUX_HCJ";
private final ISysCategoryService sysCategoryService;
public MesXslFormulaSpecSettingServiceImpl(ISysCategoryService sysCategoryService) {
this.sysCategoryService = sysCategoryService;
}
@Override
public MesXslFormulaRubberContentSettingVO getRubberContentSetting() {
MesXslFormulaSpecSetting setting = loadOrInitSetting();
MesXslFormulaRubberContentSettingVO vo = new MesXslFormulaRubberContentSettingVO();
vo.setNaturalMinorCategoryIds(parseIdList(setting.getNaturalMinorCategoryIds()));
vo.setSyntheticMinorCategoryIds(parseIdList(setting.getSyntheticMinorCategoryIds()));
return vo;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void saveRubberContentSetting(MesXslFormulaRubberContentSettingVO settingVo) {
MesXslFormulaSpecSetting setting = loadOrInitSetting();
setting.setNaturalMinorCategoryIds(joinIdList(settingVo != null ? settingVo.getNaturalMinorCategoryIds() : null));
setting.setSyntheticMinorCategoryIds(joinIdList(settingVo != null ? settingVo.getSyntheticMinorCategoryIds() : null));
setting.setUpdateTime(new Date());
this.updateById(setting);
}
@Override
public Set<String> getNaturalMinorCategoryIds() {
return new LinkedHashSet<>(parseIdList(loadOrInitSetting().getNaturalMinorCategoryIds()));
}
@Override
public Set<String> getSyntheticMinorCategoryIds() {
return new LinkedHashSet<>(parseIdList(loadOrInitSetting().getSyntheticMinorCategoryIds()));
}
private MesXslFormulaSpecSetting loadOrInitSetting() {
MesXslFormulaSpecSetting setting = this.getById(MesXslFormulaSpecSetting.DEFAULT_ID);
if (setting != null) {
return setting;
}
setting = new MesXslFormulaSpecSetting();
setting.setId(MesXslFormulaSpecSetting.DEFAULT_ID);
setting.setNaturalMinorCategoryIds(resolveCategoryIdByCode(DEFAULT_NATURAL_CATEGORY_CODE));
setting.setSyntheticMinorCategoryIds(resolveCategoryIdByCode(DEFAULT_SYNTHETIC_CATEGORY_CODE));
setting.setCreateTime(new Date());
this.save(setting);
return setting;
}
private String resolveCategoryIdByCode(String categoryCode) {
if (StringUtils.isBlank(categoryCode)) {
return null;
}
SysCategory category = sysCategoryService.getOne(
new LambdaQueryWrapper<SysCategory>().eq(SysCategory::getCode, categoryCode).last("LIMIT 1"));
return category != null ? category.getId() : null;
}
private List<String> parseIdList(String raw) {
if (StringUtils.isBlank(raw)) {
return Collections.emptyList();
}
return Arrays.stream(raw.split(","))
.map(String::trim)
.filter(StringUtils::isNotBlank)
.distinct()
.collect(Collectors.toList());
}
private String joinIdList(List<String> ids) {
if (ids == null || ids.isEmpty()) {
return null;
}
return ids.stream().filter(StringUtils::isNotBlank).map(String::trim).distinct().collect(Collectors.joining(","));
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,22 @@
package org.jeecg.modules.xslmes.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
/**
* 配合示方含胶率物料小类配置
*/
@Data
@Schema(description = "配合示方含胶率物料小类配置")
public class MesXslFormulaRubberContentSettingVO implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "天然橡胶物料小类ID列表")
private List<String> naturalMinorCategoryIds = new ArrayList<>();
@Schema(description = "合成橡胶物料小类ID列表")
private List<String> syntheticMinorCategoryIds = new ArrayList<>();
}

View File

@@ -0,0 +1,10 @@
package org.jeecg.modules.xslmes.vo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.modules.xslmes.entity.MesXslFormulaSpec;
/** 配合示方主子保存 VO */
@Data
@EqualsAndHashCode(callSuper = true)
public class MesXslFormulaSpecPage extends MesXslFormulaSpec {}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,186 @@
-- 配合示方分类/STEP/称量方式/状态字典 + /子表 + 菜单 MES技术管理+ admin 授权
SET NAMES utf8mb4;
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
VALUES ('1995000000000000010', '配合示方分类', 'xslmes_formula_spec_category', 'MES配合示方分类', 0, 'admin', NOW(), 0, 1002);
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001001', '1995000000000000010', '标准', 'standard', 1, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001002', '1995000000000000010', '临时', 'temporary', 2, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001003', '1995000000000000010', '实验', 'trial', 3, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001004', '1995000000000000010', '消费', 'consumption', 4, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
VALUES ('1995000000000000011', '配合示方STEP', 'xslmes_formula_spec_step', 'MES配合示方STEP', 0, 'admin', NOW(), 0, 1002);
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001011', '1995000000000000011', 'A', 'A', 1, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001012', '1995000000000000011', 'B', 'B', 2, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001013', '1995000000000000011', 'Q', 'Q', 3, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
VALUES ('1995000000000000012', '配合示方称量方式', 'xslmes_formula_spec_weigh_mode', 'MES配合示方自动/人工称量', 0, 'admin', NOW(), 0, 1002);
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001021', '1995000000000000012', '自动称量1', 'auto1', 1, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001022', '1995000000000000012', '人工称量', 'manual', 2, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
VALUES ('1995000000000000013', '配合示方状态', 'xslmes_formula_spec_status', 'MES配合示方状态', 0, 'admin', NOW(), 0, 1002);
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001031', '1995000000000000013', '编制', 'compile', 1, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001032', '1995000000000000013', '校对', 'proofread', 2, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001033', '1995000000000000013', '审核', 'audit', 3, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001034', '1995000000000000013', '批准', 'approve', 4, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001035', '1995000000000000013', '正式发布', 'released', 5, 1, 'admin', NOW());
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
VALUES ('1995000000000001036', '1995000000000000013', '作废', 'obsolete', 6, 1, 'admin', NOW());
CREATE TABLE IF NOT EXISTS `mes_xsl_formula_spec` (
`id` varchar(32) NOT NULL COMMENT '主键',
`category` varchar(32) DEFAULT 'standard' COMMENT '分类字典xslmes_formula_spec_categorystandard标准 temporary临时 trial实验 consumption消费',
`spec_code` varchar(100) DEFAULT NULL COMMENT '示方编号',
`rubber_code` varchar(100) DEFAULT NULL COMMENT '胶料代号',
`basic_formula` varchar(100) DEFAULT NULL COMMENT '基本配合',
`issue_date` date DEFAULT NULL COMMENT '发行日期',
`purpose` varchar(500) DEFAULT NULL COMMENT '用途',
`issue_number` varchar(100) DEFAULT NULL COMMENT '发行编号',
`mixing_stages` int DEFAULT NULL COMMENT '混合段数1-7',
`mixing_machine` varchar(200) DEFAULT NULL COMMENT '混合机器',
`issue_dept_id` varchar(32) DEFAULT NULL COMMENT '发行部门ID',
`issue_dept_name` varchar(200) DEFAULT NULL COMMENT '发行部门名称冗余',
`a_rubber_total_phr` decimal(18,4) DEFAULT NULL COMMENT 'A胶TOTAL PHR',
`total_phr` decimal(18,4) DEFAULT NULL COMMENT 'TOTAL PHR',
`issue_reason` text COMMENT '发行理由',
`natural_rubber` decimal(18,4) DEFAULT NULL COMMENT '天然橡胶',
`synthetic_rubber` decimal(18,4) DEFAULT NULL COMMENT '合成橡胶',
`total_amount` decimal(18,4) DEFAULT NULL COMMENT '合计',
`weight_unit_price` decimal(18,4) DEFAULT NULL COMMENT '重量单价',
`volume_unit_price` decimal(18,4) DEFAULT NULL COMMENT '体积单价',
`q_rubber_sg` decimal(18,6) DEFAULT NULL COMMENT 'Q胶比重',
`a_rubber_sg` decimal(18,6) DEFAULT NULL COMMENT 'A胶比重',
`has_manual_batch` int DEFAULT 0 COMMENT '是否有人工配料0否 1是',
`status` varchar(32) DEFAULT 'compile' COMMENT '状态字典xslmes_formula_spec_status',
`proofread_by` varchar(50) DEFAULT NULL COMMENT '校对人',
`proofread_time` datetime DEFAULT NULL COMMENT '校对时间',
`audit_by` varchar(50) DEFAULT NULL COMMENT '审核人',
`audit_time` datetime DEFAULT NULL COMMENT '审核时间',
`approve_by` varchar(50) DEFAULT NULL COMMENT '批准人',
`approve_time` datetime DEFAULT NULL COMMENT '批准时间',
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`del_flag` int NOT NULL DEFAULT 0 COMMENT '逻辑删除0正常 1已删除',
PRIMARY KEY (`id`),
KEY `idx_mxfs_spec_code` (`spec_code`),
KEY `idx_mxfs_rubber_code` (`rubber_code`),
KEY `idx_mxfs_issue_number` (`issue_number`),
KEY `idx_mxfs_category` (`category`),
KEY `idx_mxfs_status` (`status`),
KEY `idx_mxfs_issue_date` (`issue_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES配合示方';
CREATE TABLE IF NOT EXISTS `mes_xsl_formula_spec_line` (
`id` varchar(32) NOT NULL COMMENT '主键',
`formula_spec_id` varchar(32) NOT NULL COMMENT '配合示方主表ID',
`sort_no` int DEFAULT NULL COMMENT '行序号',
`phr` decimal(18,4) DEFAULT NULL COMMENT 'PHR',
`mixer_material_id` varchar(32) DEFAULT NULL COMMENT '密炼物料ID',
`mixer_material_code` varchar(100) DEFAULT NULL COMMENT '密炼物料编码冗余',
`mixer_material_name` varchar(200) DEFAULT NULL COMMENT '密炼物料名称冗余',
`material_desc` varchar(500) DEFAULT NULL COMMENT '物料描述',
`step` varchar(8) DEFAULT NULL COMMENT 'STEP字典xslmes_formula_spec_stepA/B/Q',
`weigh_mode` varchar(32) DEFAULT NULL COMMENT '称量方式字典xslmes_formula_spec_weigh_mode',
`weight_percent` decimal(18,4) DEFAULT NULL COMMENT '重量%',
`volume` decimal(18,6) DEFAULT NULL COMMENT '体积',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`stage1` decimal(18,4) DEFAULT NULL COMMENT '混合段1',
`stage2` decimal(18,4) DEFAULT NULL COMMENT '混合段2',
`stage3` decimal(18,4) DEFAULT NULL COMMENT '混合段3',
`stage4` decimal(18,4) DEFAULT NULL COMMENT '混合段4',
`stage5` decimal(18,4) DEFAULT NULL COMMENT '混合段5',
`stage6` decimal(18,4) DEFAULT NULL COMMENT '混合段6',
`stage7` decimal(18,4) DEFAULT NULL COMMENT '混合段7',
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`),
KEY `idx_mxfsl_formula_spec_id` (`formula_spec_id`),
KEY `idx_mxfsl_mixer_material_id` (`mixer_material_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES配合示方明细';
UPDATE `sys_permission`
SET `is_leaf` = 0, `update_time` = NOW()
WHERE `id` = '1900000000000000810' AND `is_leaf` = 1;
INSERT IGNORE INTO `sys_permission` (
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
`del_flag`, `rule_flag`, `status`, `internal_or_external`
) VALUES (
'177925970995530', '1900000000000000810', '配合示方', '/xslmes/mesXslFormulaSpec',
'xslmes/mesXslFormulaSpec/MesXslFormulaSpecList', 1, 'MesXslFormulaSpecList', NULL,
1, NULL, '0', 1.00, 0, 'ant-design:experiment-outlined', 0, 1,
0, 0, 'MES配合示方', 'admin', NOW(), 'admin', NOW(),
0, 0, '1', 0
);
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995531', '177925970995530', '新增', 2, 'xslmes:mes_xsl_formula_spec:add', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995532', '177925970995530', '编辑', 2, 'xslmes:mes_xsl_formula_spec:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995533', '177925970995530', '删除', 2, 'xslmes:mes_xsl_formula_spec:delete', '1', 3.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995534', '177925970995530', '批量删除', 2, 'xslmes:mes_xsl_formula_spec:deleteBatch', '1', 4.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995535', '177925970995530', '导出', 2, 'xslmes:mes_xsl_formula_spec:exportXls', '1', 5.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
VALUES ('177925970995536', '177925970995530', '导入', 2, 'xslmes:mes_xsl_formula_spec:importExcel', '1', 6.00, 0, 1, 0, '1', 0, 'admin', NOW());
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
FROM `sys_role` r
CROSS JOIN `sys_permission` p
WHERE r.`role_code` = 'admin'
AND p.`id` IN (
'177925970995530', '177925970995531', '177925970995532',
'177925970995533', '177925970995534', '177925970995535', '177925970995536'
)
AND NOT EXISTS (
SELECT 1 FROM `sys_role_permission` rp
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
);

View File

@@ -0,0 +1,9 @@
-- 配合示方主表新增混合段1-7合计字段
ALTER TABLE `mes_xsl_formula_spec`
ADD COLUMN `stage1_total` decimal(18,4) DEFAULT NULL COMMENT '混合段1合计' AFTER `total_phr`,
ADD COLUMN `stage2_total` decimal(18,4) DEFAULT NULL COMMENT '混合段2合计' AFTER `stage1_total`,
ADD COLUMN `stage3_total` decimal(18,4) DEFAULT NULL COMMENT '混合段3合计' AFTER `stage2_total`,
ADD COLUMN `stage4_total` decimal(18,4) DEFAULT NULL COMMENT '混合段4合计' AFTER `stage3_total`,
ADD COLUMN `stage5_total` decimal(18,4) DEFAULT NULL COMMENT '混合段5合计' AFTER `stage4_total`,
ADD COLUMN `stage6_total` decimal(18,4) DEFAULT NULL COMMENT '混合段6合计' AFTER `stage5_total`,
ADD COLUMN `stage7_total` decimal(18,4) DEFAULT NULL COMMENT '混合段7合计' AFTER `stage6_total`;

View File

@@ -0,0 +1,15 @@
-- 配合示方分类字典标准示方 S / 临时示方 P / 试验示方 T / 消费示方 C
SET NAMES utf8mb4;
UPDATE `sys_dict_item` SET `item_text` = '标准示方', `item_value` = 'S' WHERE `id` = '1995000000000001001';
UPDATE `sys_dict_item` SET `item_text` = '临时示方', `item_value` = 'P' WHERE `id` = '1995000000000001002';
UPDATE `sys_dict_item` SET `item_text` = '试验示方', `item_value` = 'T' WHERE `id` = '1995000000000001003';
UPDATE `sys_dict_item` SET `item_text` = '消费示方', `item_value` = 'C' WHERE `id` = '1995000000000001004';
UPDATE `mes_xsl_formula_spec` SET `category` = 'S' WHERE `category` = 'standard';
UPDATE `mes_xsl_formula_spec` SET `category` = 'P' WHERE `category` = 'temporary';
UPDATE `mes_xsl_formula_spec` SET `category` = 'T' WHERE `category` = 'trial';
UPDATE `mes_xsl_formula_spec` SET `category` = 'C' WHERE `category` = 'consumption';
ALTER TABLE `mes_xsl_formula_spec`
MODIFY COLUMN `category` varchar(32) DEFAULT 'S' COMMENT '分类字典xslmes_formula_spec_categoryS标准示方 P临时示方 T试验示方 C消费示方';

View File

@@ -0,0 +1,7 @@
-- 配合示方关联胶料主数据支持胶料代号自动生成
SET NAMES utf8mb4;
ALTER TABLE `mes_xsl_formula_spec`
ADD COLUMN `rubber_material_id` varchar(32) DEFAULT NULL COMMENT '胶料ID关联mes_material.id' AFTER `rubber_code`;
CREATE INDEX `idx_mxfs_rubber_material_id` ON `mes_xsl_formula_spec` (`rubber_material_id`);

View File

@@ -0,0 +1,10 @@
-- 配合示方 STEP 字典删除字典值 B
SET NAMES utf8mb4;
-- 已有业务数据若使用 B清空以便重新选择
UPDATE `mes_xsl_formula_spec_line` SET `step` = NULL WHERE `step` = 'B';
DELETE FROM `sys_dict_item` WHERE `id` = '1995000000000001012';
ALTER TABLE `mes_xsl_formula_spec_line`
MODIFY COLUMN `step` varchar(8) DEFAULT NULL COMMENT 'STEP字典xslmes_formula_spec_stepA/Q';

View File

@@ -0,0 +1,20 @@
-- 配合示方含胶率物料小类配置天然橡胶 / 合成橡胶
DROP TABLE IF EXISTS `mes_xsl_formula_spec_setting`;
CREATE TABLE `mes_xsl_formula_spec_setting` (
`id` varchar(32) NOT NULL COMMENT '主键',
`natural_minor_category_ids` varchar(2000) DEFAULT NULL COMMENT '天然橡胶物料小类ID逗号分隔',
`synthetic_minor_category_ids` varchar(2000) DEFAULT NULL COMMENT '合成橡胶物料小类ID逗号分隔',
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配合示方模块配置';
INSERT INTO `mes_xsl_formula_spec_setting` (`id`, `natural_minor_category_ids`, `synthetic_minor_category_ids`, `create_time`)
SELECT
'1993000000000000991',
(SELECT `id` FROM `sys_category` WHERE `code` = 'XSLMES_MATERIAL_RAW_AUX_TRJ' LIMIT 1),
(SELECT `id` FROM `sys_category` WHERE `code` = 'XSLMES_MATERIAL_RAW_AUX_HCJ' LIMIT 1),
NOW()
WHERE NOT EXISTS (SELECT 1 FROM `mes_xsl_formula_spec_setting` WHERE `id` = '1993000000000000991');

View File

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

View File

@@ -9,11 +9,13 @@ enum Api {
deleteBatch = '/mes/material/material/deleteBatch',
importExcel = '/mes/material/material/importExcel',
exportXls = '/mes/material/material/exportXls',
queryById = '/mes/material/material/queryById',
}
export const getExportUrl = Api.exportXls;
export const getImportUrl = Api.importExcel;
export const list = (params) => defHttp.get({ url: Api.list, params });
export const queryById = (params) => defHttp.get({ url: Api.queryById, params }, { successMessageMode: 'none' });
export const deleteOne = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,90 @@
<template>
<BasicModal v-bind="$attrs" title="选择胶料" :width="960" @register="registerModal" @ok="handleOk">
<BasicTable @register="registerTable" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicTable, useTable } from '/@/components/Table';
import { list as materialList, queryById as queryMaterialById } from '../MesMaterial.api';
import { columns as materialColumns, searchFormSchema as materialSearch } from '../MesMaterial.data';
import { useMessage } from '/@/hooks/web/useMessage';
const emit = defineEmits(['register', 'select']);
const { createMessage } = useMessage();
const selectedRow = ref<Recordable | null>(null);
const [registerTable, { reload, getSelectRowKeys, getSelectRows, setSelectedRowKeys, clearSelectedRowKeys }] = useTable({
api: materialList,
columns: materialColumns.slice(0, 6),
rowKey: 'id',
useSearchForm: true,
formConfig: {
labelWidth: 90,
schemas: materialSearch,
},
pagination: { pageSize: 10 },
canResize: false,
showIndexColumn: false,
immediate: true,
beforeFetch: (params) => ({
...params,
enableFlag: params.enableFlag ?? 1,
}),
rowSelection: {
type: 'radio',
columnWidth: 48,
onChange: (_keys, rows) => {
selectedRow.value = rows?.[0] ?? null;
},
},
clickToRowSelect: true,
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
selectedRow.value = null;
clearSelectedRowKeys?.();
setModalProps({ confirmLoading: false });
const materialId = data?.materialId as string | undefined;
if (materialId) {
setSelectedRowKeys?.([materialId]);
try {
const raw = await queryMaterialById({ id: materialId });
const row = (raw as Recordable)?.materialName != null ? raw : (raw as Recordable)?.result;
if (row) {
selectedRow.value = row;
}
} catch {
// ignore
}
}
reload();
});
async function handleOk() {
const keys = (getSelectRowKeys?.() || []) as string[];
let row = selectedRow.value || ((getSelectRows?.() || []) as Recordable[])[0];
if (!row && keys.length) {
try {
const raw = await queryMaterialById({ id: keys[0] });
row = (raw as Recordable)?.materialName != null ? raw : (raw as Recordable)?.result;
} catch {
// ignore
}
}
if (!row?.id) {
createMessage.warning('请选择一条胶料信息');
return;
}
emit('select', {
materialId: row.id,
materialName: row.materialName || '',
aliasName: row.aliasName || '',
materialCode: row.materialCode || '',
});
closeModal();
}
</script>

View File

@@ -85,8 +85,12 @@
emit('select', {
mixerMaterialId: row.id,
materialName: row.materialName || '',
materialCode: row.materialCode || '',
materialDesc: row.materialDesc || '',
materialKind: buildKind(row),
minorCategoryId: row.minorCategoryId || '',
majorCategoryText: row.majorCategoryId_dictText || '',
minorCategoryText: row.minorCategoryId_dictText || '',
});
closeModal();
}

View File

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

View File

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

View File

@@ -0,0 +1,154 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
import { loadTreeData } from '/@/api/common/api';
import { queryEquipmentById } from './MesXslDayTankMaterialMap.api';
function useStatusText(v: unknown) {
if (v === 1) return '使用中';
if (v === 0) return '停用';
return '-';
}
function allowSyncText(v: unknown) {
if (v === 1) return '允许';
if (v === 0) return '不允许';
return '-';
}
const useStatusOptions = [
{ label: '使用中', value: 1 },
{ label: '停用', value: 0 },
];
const allowSyncOptions = [
{ label: '允许', value: 1 },
{ label: '不允许', value: 0 },
];
export const columns: BasicColumn[] = [
{ title: '机台代码', align: 'center', dataIndex: 'machineCode', width: 140 },
{ title: '机台名称', align: 'center', dataIndex: 'equipmentId_dictText', width: 160 },
{ title: '料仓分类', align: 'center', dataIndex: 'siloCategoryId_dictText', width: 140 },
{ title: '工位', align: 'center', dataIndex: 'station', width: 120 },
{ title: '料仓号', align: 'center', dataIndex: 'siloNo', width: 120 },
{ title: '物料名称', align: 'center', dataIndex: 'materialId_dictText', width: 160 },
{
title: '使用状态',
align: 'center',
dataIndex: 'useStatus',
width: 120,
customRender: ({ text }) => useStatusText(text),
},
{
title: '是否允许同步',
align: 'center',
dataIndex: 'allowSync',
width: 120,
customRender: ({ text }) => allowSyncText(text),
},
];
export const searchFormSchema: FormSchema[] = [
{
label: '机台名称',
field: 'equipmentId',
component: 'JDictSelectTag',
componentProps: { dictCode: 'mes_xsl_equipment_ledger,equipment_name,id' },
colProps: { span: 6 },
},
{
label: '物料名称',
field: 'materialId',
component: 'JDictSelectTag',
componentProps: { dictCode: 'mes_material,material_name,id' },
colProps: { span: 6 },
},
{
label: '料仓分类',
field: 'siloCategoryId',
component: 'ApiSelect',
componentProps: {
api: loadTreeData,
params: { pcode: 'XSLMES_LCTYPE' },
resultField: '',
labelField: 'title',
valueField: 'key',
placeholder: '请选择料仓分类',
},
colProps: { span: 6 },
},
{
label: '使用状态',
field: 'useStatus',
component: 'Select',
componentProps: { options: useStatusOptions },
colProps: { span: 6 },
},
];
export const formSchema: FormSchema[] = [
{ label: '', field: 'id', component: 'Input', show: false },
{
label: '机台名称',
field: 'equipmentId',
component: 'JDictSelectTag',
required: true,
componentProps: ({ formModel }) => ({
dictCode: 'mes_xsl_equipment_ledger,equipment_name,id',
placeholder: '请选择设备台账中的机台名称',
onChange: async (value: string) => {
if (!value) {
formModel.machineCode = '';
return;
}
try {
const equipment = await queryEquipmentById({ id: value });
formModel.machineCode = equipment?.equipmentCode || '';
} catch {
formModel.machineCode = '';
}
},
}),
},
{
label: '机台代码',
field: 'machineCode',
component: 'Input',
componentProps: { disabled: true, placeholder: '选择机台名称后自动带出设备编号' },
},
{
label: '料仓分类',
field: 'siloCategoryId',
component: 'ApiSelect',
componentProps: {
api: loadTreeData,
params: { pcode: 'XSLMES_LCTYPE' },
resultField: '',
labelField: 'title',
valueField: 'key',
placeholder: '请选择料仓分类',
},
},
{ label: '工位', field: 'station', component: 'Input' },
{ label: '料仓号', field: 'siloNo', component: 'Input' },
{
label: '物料名称',
field: 'materialId',
component: 'JDictSelectTag',
required: true,
componentProps: { dictCode: 'mes_material,material_name,id', placeholder: '请选择胶料信息中的物料名称' },
},
{
label: '使用状态',
field: 'useStatus',
component: 'Select',
defaultValue: 1,
componentProps: { options: useStatusOptions },
},
{
label: '是否允许同步',
field: 'allowSync',
component: 'Select',
defaultValue: 1,
componentProps: { options: allowSyncOptions },
},
];

View File

@@ -0,0 +1,84 @@
<template>
<div>
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<template #tableTitle>
<a-button type="primary" v-auth="'xslmes:mes_xsl_day_tank_material_map:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">新增</a-button>
<a-button
type="primary"
v-auth="'xslmes:mes_xsl_day_tank_material_map:exportXls'"
preIcon="ant-design:export-outlined"
@click="onExportXls"
>
导出
</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete"><Icon icon="ant-design:delete-outlined" />删除</a-menu-item>
</a-menu>
</template>
<a-button>批量操作<Icon icon="mdi:chevron-down" /></a-button>
</a-dropdown>
</template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
</BasicTable>
<MesXslDayTankMaterialMapModal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup>
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import MesXslDayTankMaterialMapModal from './modules/MesXslDayTankMaterialMapModal.vue';
import { columns, searchFormSchema } from './MesXslDayTankMaterialMap.data';
import { batchDelete, deleteOne, getExportUrl, list } from './MesXslDayTankMaterialMap.api';
const [registerModal, { openModal }] = useModal();
const { tableContext, onExportXls } = useListPage({
tableProps: {
title: '日罐物料对应信息',
api: list,
columns,
canResize: true,
formConfig: { labelWidth: 100, schemas: searchFormSchema, autoSubmitOnEnter: true },
actionColumn: { width: 120, fixed: 'right' },
},
exportConfig: { name: '日罐物料对应信息', url: getExportUrl },
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
function handleAdd() {
openModal(true, { isUpdate: false, showFooter: true });
}
function handleEdit(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: true });
}
function handleDetail(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: false });
}
async function handleDelete(record) {
await deleteOne({ id: record.id }, reload);
}
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value.join(',') }, reload);
}
function handleSuccess() {
reload();
}
function getTableAction(record) {
return [{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'xslmes:mes_xsl_day_tank_material_map:edit' }];
}
function getDropDownAction(record) {
return [
{ label: '详情', onClick: handleDetail.bind(null, record) },
{
label: '删除',
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
auth: 'xslmes:mes_xsl_day_tank_material_map:delete',
},
];
}
</script>

View File

@@ -0,0 +1,67 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="760px" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { computed, ref, unref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from '../MesXslDayTankMaterialMap.data';
import { queryEquipmentById, saveOrUpdate } from '../MesXslDayTankMaterialMap.api';
const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true);
const isDetail = ref(false);
const [registerForm, { resetFields, setFieldsValue, validate, setProps, getFieldsValue }] = useForm({
labelWidth: 110,
schemas: formSchema,
showActionButtonGroup: false,
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await resetFields();
setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter });
isUpdate.value = !!data?.isUpdate;
isDetail.value = !data?.showFooter;
if (unref(isUpdate)) {
await setFieldsValue({ ...data.record });
} else {
await setFieldsValue({ useStatus: 1, allowSync: 1 });
}
setProps({ disabled: !data?.showFooter });
});
const title = computed(() =>
!unref(isUpdate) ? '新增日罐物料对应信息' : unref(isDetail) ? '日罐物料对应信息详情' : '编辑日罐物料对应信息',
);
async function fillMachineCodeByEquipment() {
const values = getFieldsValue();
if (!values?.equipmentId) {
await setFieldsValue({ machineCode: '' });
return;
}
try {
const equipment = await queryEquipmentById({ id: values.equipmentId });
await setFieldsValue({ machineCode: equipment?.equipmentCode || '' });
} catch {
await setFieldsValue({ machineCode: '' });
}
}
async function handleSubmit() {
try {
await fillMachineCodeByEquipment();
const values = await validate();
setModalProps({ confirmLoading: true });
await saveOrUpdate(values, isUpdate.value);
closeModal();
emit('success');
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>

View File

@@ -0,0 +1,43 @@
import { defHttp } from '/@/utils/http/axios';
import { Modal } from 'ant-design-vue';
enum Api {
list = '/xslmes/mesXslFormulaSpec/list',
save = '/xslmes/mesXslFormulaSpec/add',
edit = '/xslmes/mesXslFormulaSpec/edit',
deleteOne = '/xslmes/mesXslFormulaSpec/delete',
deleteBatch = '/xslmes/mesXslFormulaSpec/deleteBatch',
importExcel = '/xslmes/mesXslFormulaSpec/importExcel',
exportXls = '/xslmes/mesXslFormulaSpec/exportXls',
queryById = '/xslmes/mesXslFormulaSpec/queryById',
queryLineList = '/xslmes/mesXslFormulaSpec/queryLineListByMainId',
generateRubberCode = '/xslmes/mesXslFormulaSpec/generateRubberCode',
getRubberContentSetting = '/xslmes/mesXslFormulaSpec/getRubberContentSetting',
saveRubberContentSetting = '/xslmes/mesXslFormulaSpec/saveRubberContentSetting',
}
export const getExportUrl = Api.exportXls;
export const getImportUrl = Api.importExcel;
export const list = (params) => defHttp.get({ url: Api.list, params });
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
export const queryLineListByMainId = (params) => defHttp.get({ url: Api.queryLineList, params });
export const generateRubberCode = (params) =>
defHttp.get({ url: Api.generateRubberCode, params }, { successMessageMode: 'none' });
export const getRubberContentSetting = () => defHttp.get({ url: Api.getRubberContentSetting });
export const saveRubberContentSetting = (params) => defHttp.post({ url: Api.saveRubberContentSetting, params });
export const deleteOne = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const batchDelete = (params, handleSuccess) => {
Modal.confirm({
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () =>
defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => handleSuccess()),
});
};
export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ? Api.edit : Api.save, params });

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,168 @@
<template>
<div>
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<template #tableTitle>
<a-button type="primary" v-auth="'xslmes:mes_xsl_formula_spec:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">
新增
</a-button>
<a-button
type="primary"
v-auth="'xslmes:mes_xsl_formula_spec:exportXls'"
preIcon="ant-design:export-outlined"
@click="onExportXls"
>
导出
</a-button>
<j-upload-button
type="primary"
v-auth="'xslmes:mes_xsl_formula_spec:importExcel'"
preIcon="ant-design:import-outlined"
@click="onImportXls"
>
导入
</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined" />
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'xslmes:mes_xsl_formula_spec:deleteBatch'">
批量操作
<Icon icon="mdi:chevron-down" />
</a-button>
</a-dropdown>
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<template #action="{ record }">
<TableAction :actions="getTableActions(record)" :dropDownActions="getDropDownAction(record)" />
</template>
</BasicTable>
<MesXslFormulaSpecModal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="xslmes-mesXslFormulaSpec" setup>
import { reactive } from 'vue';
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import Icon from '/@/components/Icon';
import MesXslFormulaSpecModal from './components/MesXslFormulaSpecModal.vue';
import { columns, searchFormSchema, superQuerySchema } from './MesXslFormulaSpec.data';
import { list, deleteOne, batchDelete, getExportUrl, getImportUrl } from './MesXslFormulaSpec.api';
const queryParam = reactive<any>({});
const [registerModal, { openModal }] = useModal();
const { tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '配合示方',
api: list,
columns,
canResize: true,
formConfig: {
schemas: searchFormSchema,
labelWidth: 90,
autoSubmitOnEnter: true,
showAdvancedButton: true,
},
actionColumn: {
title: '操作',
dataIndex: 'action',
width: 160,
fixed: 'right',
slots: { customRender: 'action' },
},
beforeFetch: (params) => Object.assign(params, queryParam),
},
exportConfig: {
name: '配合示方',
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess,
},
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
const superQueryConfig = reactive(superQuerySchema);
function handleSuperQuery(params) {
Object.keys(params).forEach((k) => {
queryParam[k] = params[k];
});
reload();
}
function handleAdd() {
openModal(true, { isUpdate: false, showFooter: true });
}
function handleEdit(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: true });
}
function handleDetail(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: false });
}
function handleDelete(record: Recordable) {
deleteOne({ id: record.id }, handleSuccess);
}
function batchHandleDelete() {
batchDelete({ ids: selectedRowKeys.value.join(',') }, handleSuccess);
}
function handleSuccess() {
reload();
selectedRowKeys.value = [];
}
function canEdit(record: Recordable) {
return !record?.status || record.status === 'compile';
}
function getTableActions(record: Recordable) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'xslmes:mes_xsl_formula_spec:edit',
ifShow: canEdit(record),
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
ifShow: !canEdit(record),
},
];
}
function getDropDownAction(record: Recordable) {
return [
{ label: '详情', onClick: handleDetail.bind(null, record), ifShow: canEdit(record) },
{
label: '删除',
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
auth: 'xslmes:mes_xsl_formula_spec:delete',
ifShow: canEdit(record),
},
];
}
</script>
<style lang="less" scoped>
:deep(.ant-table) {
.ant-table-thead > tr > th {
background: #fafafa;
font-weight: 600;
}
}
</style>

View File

@@ -0,0 +1,168 @@
<template>
<Popover
v-model:open="popoverOpen"
trigger="click"
placement="bottomRight"
:overlayClassName="`${prefixCls}__popover`"
@open-change="handleOpenChange"
>
<template #title>
<div :class="`${prefixCls}__title`">
<Checkbox :indeterminate="indeterminate" :checked="checkAll" @change="onCheckAllChange">列展示</Checkbox>
</div>
</template>
<template #content>
<div :class="`${prefixCls}__list`">
<CheckboxGroup v-model:value="draftCheckedList" :options="columnOptions" />
</div>
<div :class="`${prefixCls}__footer`">
<a-button size="small" @click="handleReset">重置</a-button>
<a-button size="small" type="primary" @click="handleSave">保存</a-button>
</div>
</template>
<a-tooltip title="列设置">
<a-button size="small" class="formula-line-column-setting-btn" @click.stop>
<Icon icon="ant-design:setting-outlined" />
</a-button>
</a-tooltip>
</Popover>
</template>
<script lang="ts" setup>
import { computed, ref, type PropType } from 'vue';
import { Popover, Checkbox } from 'ant-design-vue';
import type { CheckboxChangeEvent } from 'ant-design-vue/lib/checkbox/interface';
import { Icon } from '/@/components/Icon';
import { useMessage } from '/@/hooks/web/useMessage';
import {
FORMULA_LINE_LOCKED_COLUMN_KEYS,
getFormulaLineColumnSettingItems,
saveFormulaLineHiddenColumnKeys,
type FormulaLineColumnSettingItem,
} from '../MesXslFormulaSpec.data';
const CheckboxGroup = Checkbox.Group;
const prefixCls = 'formula-line-column-setting';
const { createMessage } = useMessage();
const props = defineProps({
hiddenKeys: {
type: Array as PropType<string[]>,
default: () => [],
},
});
const emit = defineEmits<{
(e: 'update:hiddenKeys', value: string[]): void;
(e: 'change', value: string[]): void;
}>();
const popoverOpen = ref(false);
const columnItems = ref<FormulaLineColumnSettingItem[]>(getFormulaLineColumnSettingItems());
const allKeys = computed(() => columnItems.value.map((item) => item.key));
const lockableKeys = computed(() => columnItems.value.filter((item) => !item.locked).map((item) => item.key));
/** 弹窗内草稿勾选状态,保存后才应用到表格 */
const draftCheckedList = ref<string[]>([]);
const columnOptions = computed(() =>
columnItems.value.map((item) => ({
label: item.title,
value: item.key,
disabled: item.locked,
})),
);
const checkAll = computed(() => {
const keys = lockableKeys.value;
return keys.length > 0 && keys.every((key) => draftCheckedList.value.includes(key));
});
const indeterminate = computed(() => {
const keys = lockableKeys.value;
const checkedCount = keys.filter((key) => draftCheckedList.value.includes(key)).length;
return checkedCount > 0 && checkedCount < keys.length;
});
function ensureLockedChecked() {
const next = new Set(draftCheckedList.value);
FORMULA_LINE_LOCKED_COLUMN_KEYS.forEach((key) => next.add(key));
draftCheckedList.value = Array.from(next);
}
function syncDraftFromHidden(hiddenKeys: string[]) {
const hiddenSet = new Set(hiddenKeys || []);
draftCheckedList.value = allKeys.value.filter((key) => !hiddenSet.has(key));
ensureLockedChecked();
}
function buildHiddenKeysFromDraft() {
ensureLockedChecked();
return allKeys.value.filter((key) => !draftCheckedList.value.includes(key));
}
function handleOpenChange(open: boolean) {
if (open) {
syncDraftFromHidden(props.hiddenKeys);
}
}
function onCheckAllChange(e: CheckboxChangeEvent) {
draftCheckedList.value = e.target.checked ? [...allKeys.value] : [...FORMULA_LINE_LOCKED_COLUMN_KEYS];
}
function handleReset() {
draftCheckedList.value = [...allKeys.value];
}
function handleSave() {
const hiddenKeys = buildHiddenKeysFromDraft();
saveFormulaLineHiddenColumnKeys(hiddenKeys);
emit('update:hiddenKeys', hiddenKeys);
emit('change', hiddenKeys);
createMessage.success('保存成功');
popoverOpen.value = false;
}
</script>
<style lang="less" scoped>
.formula-line-column-setting-btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding-inline: 8px;
}
</style>
<style lang="less">
.formula-line-column-setting__popover {
.formula-line-column-setting__title {
min-width: 180px;
}
.formula-line-column-setting__list {
max-height: 320px;
overflow-y: auto;
margin-bottom: 8px;
.ant-checkbox-group {
display: flex;
flex-direction: column;
gap: 4px;
}
.ant-checkbox-group-item {
margin-inline-start: 0;
white-space: nowrap;
}
}
.formula-line-column-setting__footer {
display: flex;
justify-content: flex-end;
gap: 8px;
padding-top: 4px;
border-top: 1px solid #f0f0f0;
}
}
</style>

View File

@@ -0,0 +1,240 @@
<template>
<BasicModal
v-bind="$attrs"
title="含胶率物料小类设置"
:width="640"
@register="registerModal"
@ok="handleSubmit"
>
<a-form layout="vertical" class="rubber-content-setting-form">
<a-form-item label="天然橡胶">
<a-select
v-model:value="formState.naturalMinorCategoryIds"
mode="multiple"
allowClear
showSearch
optionFilterProp="label"
placeholder="请选择计入天然橡胶的物料分类"
:options="minorCategoryOptions"
:loading="optionsLoading"
/>
</a-form-item>
<a-form-item label="合成橡胶">
<a-select
v-model:value="formState.syntheticMinorCategoryIds"
mode="multiple"
allowClear
showSearch
optionFilterProp="label"
placeholder="请选择计入合成橡胶的物料分类"
:options="minorCategoryOptions"
:loading="optionsLoading"
/>
</a-form-item>
<div class="setting-tip">选项来自系统分类字典MES物料分类全部节点保存后含胶率将按所选分类汇总明细行重量%</div>
</a-form>
</BasicModal>
</template>
<script lang="ts" setup>
import { reactive, ref, watch } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { getRubberContentSetting, saveRubberContentSetting } from '../MesXslFormulaSpec.api';
import { fetchMaterialCategoryOptions } from '../MesXslFormulaSpec.data';
import { useMessage } from '/@/hooks/web/useMessage';
const emit = defineEmits(['register', 'success']);
const { createMessage } = useMessage();
const optionsLoading = ref(false);
const minorCategoryOptions = ref<Array<{ label: string; value: string }>>([]);
const formState = reactive({
naturalMinorCategoryIds: [] as string[],
syntheticMinorCategoryIds: [] as string[],
});
const [registerModal, { setModalProps, closeModal, getOpen }] = useModalInner();
watch(
() => getOpen.value,
async (open) => {
if (!open) {
return;
}
setModalProps({ confirmLoading: false });
await Promise.all([loadMinorCategoryOptions(), loadSetting()]);
},
);
async function loadMinorCategoryOptions() {
optionsLoading.value = true;
try {
minorCategoryOptions.value = await fetchMaterialCategoryOptions();
if (!minorCategoryOptions.value.length) {
createMessage.warning('未加载到 MES物料分类请先在分类字典中维护。');
}
} catch {
minorCategoryOptions.value = [];
createMessage.warning('加载 MES物料分类 失败,请检查分类字典是否已配置。');
} finally {
optionsLoading.value = false;
}
}
async function loadSetting() {
try {
const raw = await getRubberContentSetting();
const setting = (raw as Recordable)?.naturalMinorCategoryIds != null ? raw : (raw as Recordable)?.result ?? raw;
formState.naturalMinorCategoryIds = [...((setting as Recordable)?.naturalMinorCategoryIds || [])];
formState.syntheticMinorCategoryIds = [...((setting as Recordable)?.syntheticMinorCategoryIds || [])];
} catch {
formState.naturalMinorCategoryIds = [];
formState.syntheticMinorCategoryIds = [];
}
}
async function handleSubmit() {
try {
setModalProps({ confirmLoading: true });
await saveRubberContentSetting({
naturalMinorCategoryIds: formState.naturalMinorCategoryIds,
syntheticMinorCategoryIds: formState.syntheticMinorCategoryIds,
});
createMessage.success('保存成功');
closeModal();
emit('success', {
naturalMinorCategoryIds: [...formState.naturalMinorCategoryIds],
syntheticMinorCategoryIds: [...formState.syntheticMinorCategoryIds],
});
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>
<style scoped lang="less">
.rubber-content-setting-form {
padding-top: 8px;
}
.setting-tip {
color: rgba(0, 0, 0, 0.45);
font-size: 12px;
line-height: 1.6;
}
</style>

View File

@@ -0,0 +1,33 @@
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/xslmes/mesXslMixerAction/list',
checkActionName = '/xslmes/mesXslMixerAction/checkActionName',
checkActionCode = '/xslmes/mesXslMixerAction/checkActionCode',
save = '/xslmes/mesXslMixerAction/add',
edit = '/xslmes/mesXslMixerAction/edit',
deleteOne = '/xslmes/mesXslMixerAction/delete',
deleteBatch = '/xslmes/mesXslMixerAction/deleteBatch',
queryById = '/xslmes/mesXslMixerAction/queryById',
exportXls = '/xslmes/mesXslMixerAction/exportXls',
}
export const list = (params) => defHttp.get({ url: Api.list, params });
export const checkActionName = (params: { actionName: string; dataId?: string }) =>
defHttp.get({ url: Api.checkActionName, params }, { successMessageMode: 'none', errorMessageMode: 'none' });
export const checkActionCode = (params: { actionCode: string; dataId?: string }) =>
defHttp.get({ url: Api.checkActionCode, params }, { successMessageMode: 'none', errorMessageMode: 'none' });
export const deleteOne = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const batchDelete = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ? Api.edit : Api.save, params });
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
export const getExportUrl = Api.exportXls;

View File

@@ -0,0 +1,76 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
import { checkActionCode, checkActionName } from './MesXslMixerAction.api';
export const columns: BasicColumn[] = [
{ title: '设备名称', align: 'center', dataIndex: 'equipmentId_dictText', width: 180 },
{ title: '动作名称', align: 'center', dataIndex: 'actionName', width: 180 },
{ title: '动作代号', align: 'center', dataIndex: 'actionCode', width: 160 },
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 170 },
];
export const searchFormSchema: FormSchema[] = [
{
label: '设备名称',
field: 'equipmentId',
component: 'JDictSelectTag',
componentProps: { dictCode: 'mes_xsl_equipment_ledger,equipment_name,id' },
colProps: { span: 6 },
},
{ label: '动作名称', field: 'actionName', component: 'Input', colProps: { span: 6 } },
{ label: '动作代号', field: 'actionCode', component: 'Input', colProps: { span: 6 } },
];
export const formSchema: FormSchema[] = [
{ label: '', field: 'id', component: 'Input', show: false },
{
label: '设备名称',
field: 'equipmentId',
component: 'JDictSelectTag',
required: true,
componentProps: { dictCode: 'mes_xsl_equipment_ledger,equipment_name,id', placeholder: '请选择设备台账中的设备' },
},
{
label: '动作名称',
field: 'actionName',
component: 'Input',
required: true,
dynamicRules: ({ model }) => [
{ required: true, message: '请输入动作名称' },
{
validator: async (_rule, value) => {
const v = value == null ? '' : String(value).trim();
if (!v) return Promise.resolve();
try {
await checkActionName({ actionName: v, dataId: model?.id });
return Promise.resolve();
} catch (e: any) {
return Promise.reject(e?.response?.data?.message || e?.message || '动作名称不能重复');
}
},
trigger: 'blur',
},
],
},
{
label: '动作代号',
field: 'actionCode',
component: 'Input',
required: true,
dynamicRules: ({ model }) => [
{ required: true, message: '请输入动作代号' },
{
validator: async (_rule, value) => {
const v = value == null ? '' : String(value).trim();
if (!v) return Promise.resolve();
try {
await checkActionCode({ actionCode: v, dataId: model?.id });
return Promise.resolve();
} catch (e: any) {
return Promise.reject(e?.response?.data?.message || e?.message || '动作代号不能重复');
}
},
trigger: 'blur',
},
],
},
];

View File

@@ -0,0 +1,84 @@
<template>
<div>
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<template #tableTitle>
<a-button type="primary" v-auth="'xslmes:mes_xsl_mixer_action:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">新增</a-button>
<a-button
type="primary"
v-auth="'xslmes:mes_xsl_mixer_action:exportXls'"
preIcon="ant-design:export-outlined"
@click="onExportXls"
>
导出
</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete"><Icon icon="ant-design:delete-outlined" />删除</a-menu-item>
</a-menu>
</template>
<a-button>批量操作<Icon icon="mdi:chevron-down" /></a-button>
</a-dropdown>
</template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
</BasicTable>
<MesXslMixerActionModal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup>
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import MesXslMixerActionModal from './modules/MesXslMixerActionModal.vue';
import { columns, searchFormSchema } from './MesXslMixerAction.data';
import { batchDelete, deleteOne, getExportUrl, list } from './MesXslMixerAction.api';
const [registerModal, { openModal }] = useModal();
const { tableContext, onExportXls } = useListPage({
tableProps: {
title: '密炼机动作维护',
api: list,
columns,
canResize: true,
formConfig: { labelWidth: 100, schemas: searchFormSchema, autoSubmitOnEnter: true },
actionColumn: { width: 120, fixed: 'right' },
},
exportConfig: { name: '密炼机动作维护', url: getExportUrl },
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
function handleAdd() {
openModal(true, { isUpdate: false, showFooter: true });
}
function handleEdit(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: true });
}
function handleDetail(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: false });
}
async function handleDelete(record) {
await deleteOne({ id: record.id }, reload);
}
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value.join(',') }, reload);
}
function handleSuccess() {
reload();
}
function getTableAction(record) {
return [{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'xslmes:mes_xsl_mixer_action:edit' }];
}
function getDropDownAction(record) {
return [
{ label: '详情', onClick: handleDetail.bind(null, record) },
{
label: '删除',
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
auth: 'xslmes:mes_xsl_mixer_action:delete',
},
];
}
</script>

View File

@@ -0,0 +1,48 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="680px" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { computed, ref, unref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from '../MesXslMixerAction.data';
import { saveOrUpdate } from '../MesXslMixerAction.api';
const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true);
const isDetail = ref(false);
const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({
labelWidth: 110,
schemas: formSchema,
showActionButtonGroup: false,
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await resetFields();
setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter });
isUpdate.value = !!data?.isUpdate;
isDetail.value = !data?.showFooter;
if (unref(isUpdate)) {
await setFieldsValue({ ...data.record });
}
setProps({ disabled: !data?.showFooter });
});
const title = computed(() => (!unref(isUpdate) ? '新增密炼机动作' : unref(isDetail) ? '密炼机动作详情' : '编辑密炼机动作'));
async function handleSubmit() {
try {
const values = await validate();
setModalProps({ confirmLoading: true });
await saveOrUpdate(values, isUpdate.value);
closeModal();
emit('success');
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>

View File

@@ -0,0 +1,30 @@
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/xslmes/mesXslMixerMaterialSubstitute/list',
save = '/xslmes/mesXslMixerMaterialSubstitute/add',
edit = '/xslmes/mesXslMixerMaterialSubstitute/edit',
deleteOne = '/xslmes/mesXslMixerMaterialSubstitute/delete',
deleteBatch = '/xslmes/mesXslMixerMaterialSubstitute/deleteBatch',
importExcel = '/xslmes/mesXslMixerMaterialSubstitute/importExcel',
exportXls = '/xslmes/mesXslMixerMaterialSubstitute/exportXls',
queryById = '/xslmes/mesXslMixerMaterialSubstitute/queryById',
}
export const list = (params) => defHttp.get({ url: Api.list, params });
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
export const deleteOne = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const batchDelete = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const saveOrUpdate = (params, isUpdate) => {
const url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url, params }, { successMessageMode: 'none' });
};
export const getExportUrl = Api.exportXls;
export const getImportUrl = Api.importExcel;

View File

@@ -0,0 +1,102 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
export const columns: BasicColumn[] = [
{ title: '编号', align: 'center', dataIndex: 'serialNo', width: 80 },
{ title: '密炼物料编码', align: 'center', dataIndex: 'mixerMaterialCode', width: 130 },
{ title: '密炼物料名称', align: 'center', dataIndex: 'mixerMaterialName', width: 160 },
{ title: '替代密炼物料编码', align: 'center', dataIndex: 'substituteMaterialCode', width: 140 },
{ title: '替代密炼物料名称', align: 'center', dataIndex: 'substituteMaterialName', width: 160 },
{ title: '创建人', align: 'center', dataIndex: 'createBy', width: 100, defaultHidden: true },
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 165 },
{ title: '修改人', align: 'center', dataIndex: 'updateBy', width: 100, defaultHidden: true },
];
export const searchFormSchema: FormSchema[] = [
{
label: '密炼物料',
field: 'mixerMaterialId',
component: 'JDictSelectTag',
componentProps: {
dictCode: 'mes_mixer_material,material_name,id',
placeholder: '请选择密炼物料',
},
colProps: { span: 6 },
},
{ label: '密炼物料编码', field: 'mixerMaterialCode', component: 'JInput', colProps: { span: 6 } },
{ label: '密炼物料名称', field: 'mixerMaterialName', component: 'JInput', colProps: { span: 6 } },
{
label: '替代密炼物料',
field: 'substituteMaterialId',
component: 'JDictSelectTag',
componentProps: {
dictCode: 'mes_mixer_material,material_name,id',
placeholder: '请选择替代密炼物料',
},
colProps: { span: 6 },
},
{ label: '替代物料编码', field: 'substituteMaterialCode', component: 'JInput', colProps: { span: 6 } },
{ label: '替代物料名称', field: 'substituteMaterialName', component: 'JInput', colProps: { span: 6 } },
];
export const formSchema: FormSchema[] = [
{ label: '', field: 'id', component: 'Input', show: false },
{
label: '编号',
field: 'serialNo',
component: 'InputNumber',
componentProps: { disabled: true, placeholder: '保存后自动生成', style: { width: '100%' } },
ifShow: ({ values }) => !!values.serialNo,
},
{
label: '密炼物料',
field: 'mixerMaterialName',
component: 'Input',
slot: 'mixerMaterialPicker',
dynamicRules: () => [{ required: true, message: '请选择密炼物料' }],
},
{ label: '', field: 'mixerMaterialId', component: 'Input', show: false },
{
label: '密炼物料编码',
field: 'mixerMaterialCode',
component: 'Input',
componentProps: { disabled: true, placeholder: '选择密炼物料后自动带出' },
},
{
label: '替代密炼物料',
field: 'substituteMaterialName',
component: 'Input',
slot: 'substituteMaterialPicker',
dynamicRules: () => [{ required: true, message: '请选择替代密炼物料' }],
},
{ label: '', field: 'substituteMaterialId', component: 'Input', show: false },
{
label: '替代密炼物料编码',
field: 'substituteMaterialCode',
component: 'Input',
componentProps: { disabled: true, placeholder: '选择替代密炼物料后自动带出' },
},
];
export const superQuerySchema = {
serialNo: { title: '编号', order: 0, view: 'number' },
mixerMaterialId: {
title: '密炼物料',
order: 1,
view: 'sel_search',
dictTable: 'mes_mixer_material',
dictCode: 'id',
dictText: 'material_name',
},
mixerMaterialCode: { title: '密炼物料编码', order: 2, view: 'text' },
mixerMaterialName: { title: '密炼物料名称', order: 3, view: 'text' },
substituteMaterialId: {
title: '替代密炼物料',
order: 4,
view: 'sel_search',
dictTable: 'mes_mixer_material',
dictCode: 'id',
dictText: 'material_name',
},
substituteMaterialCode: { title: '替代密炼物料编码', order: 5, view: 'text' },
substituteMaterialName: { title: '替代密炼物料名称', order: 6, view: 'text' },
};

View File

@@ -0,0 +1,152 @@
<template>
<div>
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<template #tableTitle>
<a-button
type="primary"
v-auth="'xslmes:mes_xsl_mixer_material_substitute:add'"
@click="handleAdd"
preIcon="ant-design:plus-outlined"
>
新增
</a-button>
<a-button
type="primary"
v-auth="'xslmes:mes_xsl_mixer_material_substitute:exportXls'"
preIcon="ant-design:export-outlined"
@click="onExportXls"
>
导出
</a-button>
<j-upload-button
type="primary"
v-auth="'xslmes:mes_xsl_mixer_material_substitute:importExcel'"
preIcon="ant-design:import-outlined"
@click="onImportXls"
>
导入
</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined" />
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'xslmes:mes_xsl_mixer_material_substitute:deleteBatch'">
批量操作
<Icon icon="mdi:chevron-down" />
</a-button>
</a-dropdown>
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<template #action="{ record }">
<TableAction
:actions="[
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'xslmes:mes_xsl_mixer_material_substitute:edit',
},
]"
:dropDownActions="getDropDownAction(record)"
/>
</template>
</BasicTable>
<MesXslMixerMaterialSubstituteModal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="xslmes-mesXslMixerMaterialSubstitute" setup>
import { reactive } from 'vue';
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import Icon from '/@/components/Icon';
import MesXslMixerMaterialSubstituteModal from './components/MesXslMixerMaterialSubstituteModal.vue';
import { columns, searchFormSchema, superQuerySchema } from './MesXslMixerMaterialSubstitute.data';
import { list, deleteOne, batchDelete, getExportUrl, getImportUrl } from './MesXslMixerMaterialSubstitute.api';
const queryParam = reactive<any>({});
const [registerModal, { openModal }] = useModal();
const { tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '密炼物料替代对应关系',
api: list,
columns,
canResize: true,
formConfig: {
schemas: searchFormSchema,
labelWidth: 110,
autoSubmitOnEnter: true,
showAdvancedButton: true,
},
actionColumn: {
title: '操作',
dataIndex: 'action',
width: 160,
fixed: 'right',
slots: { customRender: 'action' },
},
beforeFetch: (params) => Object.assign(params, queryParam),
},
exportConfig: {
name: '密炼物料替代对应关系',
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess,
},
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
const superQueryConfig = reactive(superQuerySchema);
function handleSuperQuery(params) {
Object.keys(params).forEach((k) => {
queryParam[k] = params[k];
});
reload();
}
function handleAdd() {
openModal(true, { isUpdate: false, showFooter: true });
}
function handleEdit(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: true });
}
function handleDetail(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: false });
}
function handleDelete(record: Recordable) {
deleteOne({ id: record.id }, handleSuccess);
}
function batchHandleDelete() {
batchDelete({ ids: selectedRowKeys.value.join(',') }, handleSuccess);
}
function handleSuccess() {
reload();
selectedRowKeys.value = [];
}
function getDropDownAction(record: Recordable) {
return [
{ label: '详情', onClick: handleDetail.bind(null, record) },
{
label: '删除',
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
auth: 'xslmes:mes_xsl_mixer_material_substitute:delete',
},
];
}
</script>

View File

@@ -0,0 +1,170 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="860" @ok="handleSubmit">
<BasicForm @register="registerForm">
<template #mixerMaterialPicker="{ model }">
<a-input-group compact style="display: flex; width: 100%">
<a-input
v-model:value="model.mixerMaterialName"
read-only
placeholder="请点击选择密炼物料"
style="flex: 1"
:disabled="isDetail"
/>
<a-button type="primary" :disabled="isDetail" @click="openMixerSelect('mixer')">选择</a-button>
<a-button v-if="model.mixerMaterialId && !isDetail" @click="clearMixer('mixer', model)">清除</a-button>
</a-input-group>
</template>
<template #substituteMaterialPicker="{ model }">
<a-input-group compact style="display: flex; width: 100%">
<a-input
v-model:value="model.substituteMaterialName"
read-only
placeholder="请点击选择替代密炼物料"
style="flex: 1"
:disabled="isDetail"
/>
<a-button type="primary" :disabled="isDetail" @click="openMixerSelect('substitute')">选择</a-button>
<a-button v-if="model.substituteMaterialId && !isDetail" @click="clearMixer('substitute', model)">清除</a-button>
</a-input-group>
</template>
</BasicForm>
<MesMixerMaterialSelectModal @register="registerMixerModal" @select="onMixerSelect" />
</BasicModal>
</template>
<script lang="ts" setup>
import { computed, ref, unref } from 'vue';
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { useMessage } from '/@/hooks/web/useMessage';
import MesMixerMaterialSelectModal from '/@/views/mes/material/modules/MesMixerMaterialSelectModal.vue';
import { formSchema } from '../MesXslMixerMaterialSubstitute.data';
import { saveOrUpdate } from '../MesXslMixerMaterialSubstitute.api';
const { createMessage } = useMessage();
const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true);
const isDetail = ref(false);
const pickerTarget = ref<'mixer' | 'substitute'>('mixer');
const [registerForm, { setProps, resetFields, setFieldsValue, validate, getFieldsValue, scrollToField }] = useForm({
labelWidth: 140,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: { span: 24 },
});
const [registerMixerModal, { openModal: openMixerModal }] = useModal();
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await resetFields();
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
isUpdate.value = !!data?.isUpdate;
isDetail.value = !data?.showFooter;
if (unref(isUpdate)) {
await setFieldsValue({ ...data.record });
}
setProps({ disabled: !data?.showFooter });
});
const title = computed(() => (!unref(isUpdate) ? '新增' : unref(isDetail) ? '详情' : '编辑'));
function openMixerSelect(target: 'mixer' | 'substitute') {
pickerTarget.value = target;
const values = getFieldsValue();
const mid = target === 'mixer' ? values?.mixerMaterialId : values?.substituteMaterialId;
openMixerModal(true, { mixerMaterialId: mid });
}
function onMixerSelect(payload: Recordable | null) {
if (!payload) {
return;
}
if (pickerTarget.value === 'mixer') {
setFieldsValue({
mixerMaterialId: payload.mixerMaterialId,
mixerMaterialName: payload.materialName || '',
mixerMaterialCode: '',
});
fillMaterialCode(payload.mixerMaterialId, 'mixer');
} else {
setFieldsValue({
substituteMaterialId: payload.mixerMaterialId,
substituteMaterialName: payload.materialName || '',
substituteMaterialCode: '',
});
fillMaterialCode(payload.mixerMaterialId, 'substitute');
}
}
async function fillMaterialCode(id: string, target: 'mixer' | 'substitute') {
if (!id) {
return;
}
try {
const { queryById } = await import('/@/views/mes/material/MesMixerMaterial.api');
const raw = await queryById({ id });
const row = (raw as Recordable)?.materialCode != null ? raw : (raw as Recordable)?.result;
if (row?.materialCode) {
if (target === 'mixer') {
setFieldsValue({ mixerMaterialCode: row.materialCode, mixerMaterialName: row.materialName || '' });
} else {
setFieldsValue({ substituteMaterialCode: row.materialCode, substituteMaterialName: row.materialName || '' });
}
}
} catch {
// ignore
}
}
function clearMixer(target: 'mixer' | 'substitute', model: Recordable) {
if (target === 'mixer') {
model.mixerMaterialId = '';
model.mixerMaterialName = '';
model.mixerMaterialCode = '';
} else {
model.substituteMaterialId = '';
model.substituteMaterialName = '';
model.substituteMaterialCode = '';
}
}
async function handleSubmit() {
try {
const values = await validate();
if (!values.mixerMaterialId) {
createMessage.warning('请选择密炼物料');
return;
}
if (!values.substituteMaterialId) {
createMessage.warning('请选择替代密炼物料');
return;
}
if (values.mixerMaterialId === values.substituteMaterialId) {
createMessage.warning('密炼物料与替代密炼物料不能相同');
return;
}
setModalProps({ confirmLoading: true });
await saveOrUpdate(values, unref(isUpdate));
createMessage.success(unref(isUpdate) ? '编辑成功' : '新增成功');
closeModal();
emit('success');
} catch (e: any) {
if (e?.errorFields) {
const firstField = e.errorFields[0];
if (firstField) {
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(e);
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>
<style lang="less" scoped>
:deep(.ant-input-number) {
width: 100%;
}
</style>

View File

@@ -0,0 +1,39 @@
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/xslmes/mesXslMixerPsCompile/list',
save = '/xslmes/mesXslMixerPsCompile/add',
edit = '/xslmes/mesXslMixerPsCompile/edit',
deleteOne = '/xslmes/mesXslMixerPsCompile/delete',
deleteBatch = '/xslmes/mesXslMixerPsCompile/deleteBatch',
importExcel = '/xslmes/mesXslMixerPsCompile/importExcel',
exportXls = '/xslmes/mesXslMixerPsCompile/exportXls',
queryById = '/xslmes/mesXslMixerPsCompile/queryById',
proofread = '/xslmes/mesXslMixerPsCompile/proofread',
audit = '/xslmes/mesXslMixerPsCompile/audit',
approve = '/xslmes/mesXslMixerPsCompile/approve',
}
export const list = (params) => defHttp.get({ url: Api.list, params });
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
export const deleteOne = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const batchDelete = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const saveOrUpdate = (params, isUpdate) => {
const url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url, params }, { successMessageMode: 'none' });
};
export const getExportUrl = Api.exportXls;
export const getImportUrl = Api.importExcel;
export const proofread = (params: { ids: string }) => defHttp.post({ url: Api.proofread, params }, { joinParamsToUrl: true });
export const audit = (params: { ids: string }) => defHttp.post({ url: Api.audit, params }, { joinParamsToUrl: true });
export const approve = (params: { ids: string }) => defHttp.post({ url: Api.approve, params }, { joinParamsToUrl: true });

View File

@@ -0,0 +1,279 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
const colHalf = { span: 12 };
const deptSelectBase = {
sync: false,
checkStrictly: true,
defaultExpandLevel: 2,
};
const deptSelectSingleProps = {
...deptSelectBase,
multiple: false,
};
const deptSelectProps = {
...deptSelectBase,
multiple: true,
};
const hasWorkflowInfo = ({ values }) =>
!!(values.proofreadBy || values.proofreadTime || values.auditBy || values.auditTime || values.approveBy || values.approveTime);
function sectionDivider(label: string, field: string, ifShow?: FormSchema['ifShow']): FormSchema {
return {
field,
label,
component: 'Divider',
componentProps: { orientation: 'left', plain: false },
colProps: { span: 24 },
ifShow,
};
}
export const columns: BasicColumn[] = [
{ title: 'PS编码', align: 'center', dataIndex: 'psCode', width: 140 },
{ title: '类型', align: 'center', dataIndex: 'psType_dictText', width: 110 },
{ title: '发放日期', align: 'center', dataIndex: 'issueDate', width: 110 },
{ title: '发送部门', align: 'center', dataIndex: 'sendDeptId_dictText', width: 120 },
{ title: '收信部门', align: 'center', dataIndex: 'receiveDeptId_dictText', width: 160 },
{ title: '参照部门', align: 'center', dataIndex: 'referenceDeptId_dictText', width: 160 },
{ title: '标题', align: 'center', dataIndex: 'title', width: 180 },
{ title: '目的', align: 'center', dataIndex: 'purpose', width: 160, defaultHidden: true },
{ title: '依据', align: 'center', dataIndex: 'basis', width: 160, defaultHidden: true },
{ title: '担当', align: 'center', dataIndex: 'responsiblePerson', width: 90 },
{ title: '状态', align: 'center', dataIndex: 'status_dictText', width: 90 },
{
title: '编制人',
align: 'center',
dataIndex: 'compileBy',
width: 100,
customRender: ({ record }) => record?.createBy_dictText || record?.createBy || '',
},
{ title: '校对人', align: 'center', dataIndex: 'proofreadBy', width: 100, defaultHidden: true },
{ title: '校对时间', align: 'center', dataIndex: 'proofreadTime', width: 165, defaultHidden: true },
{ title: '审核人', align: 'center', dataIndex: 'auditBy', width: 100, defaultHidden: true },
{ title: '审核时间', align: 'center', dataIndex: 'auditTime', width: 165, defaultHidden: true },
{ title: '批准人', align: 'center', dataIndex: 'approveBy', width: 100, defaultHidden: true },
{ title: '批准时间', align: 'center', dataIndex: 'approveTime', width: 165, defaultHidden: true },
{ title: '所属工厂', align: 'center', dataIndex: 'factoryName', width: 120, defaultHidden: true },
{ title: '施工代号', align: 'center', dataIndex: 'constructionCode_dictText', width: 110, defaultHidden: true },
{ title: '创建人', align: 'center', dataIndex: 'createBy', width: 100, defaultHidden: true },
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 165 },
{ title: '修改人', align: 'center', dataIndex: 'updateBy', width: 100, defaultHidden: true },
{ title: '修改时间', align: 'center', dataIndex: 'updateTime', width: 165, defaultHidden: true },
];
export const searchFormSchema: FormSchema[] = [
{ label: 'PS编码', field: 'psCode', component: 'JInput', colProps: { span: 6 } },
{ label: '标题', field: 'title', component: 'JInput', colProps: { span: 6 } },
{
label: '状态',
field: 'status',
component: 'JDictSelectTag',
defaultValue: 'compile',
componentProps: { dictCode: 'xslmes_mixer_ps_status', placeholder: '请选择状态' },
colProps: { span: 6 },
},
{
label: '开始日期',
field: 'issueDate_begin',
component: 'DatePicker',
componentProps: { valueFormat: 'YYYY-MM-DD', placeholder: '发放日期起' },
colProps: { span: 6 },
},
{
label: '结束日期',
field: 'issueDate_end',
component: 'DatePicker',
componentProps: { valueFormat: 'YYYY-MM-DD', placeholder: '发放日期止' },
colProps: { span: 6 },
},
{
label: '类型',
field: 'psType',
component: 'JDictSelectTag',
componentProps: { dictCode: 'xslmes_ps_belong' },
colProps: { span: 6 },
},
];
export const formSchema: FormSchema[] = [
{ label: '', field: 'id', component: 'Input', show: false },
sectionDivider('基本信息', 'dividerBasic'),
{
label: 'PS编码',
field: 'psCode',
component: 'Input',
colProps: colHalf,
componentProps: { placeholder: '请输入PS编码', allowClear: true },
},
{
label: 'PS归属',
field: 'psType',
component: 'JDictSelectTag',
componentProps: { dictCode: 'xslmes_ps_belong', placeholder: '请选择PS归属' },
colProps: colHalf,
},
{
label: '施工代号',
field: 'constructionCode',
component: 'JDictSelectTag',
componentProps: { dictCode: 'xslmes_construction_code', placeholder: '请选择施工代号' },
colProps: colHalf,
},
{
label: '发放日期',
field: 'issueDate',
component: 'DatePicker',
componentProps: { valueFormat: 'YYYY-MM-DD', style: { width: '100%' }, placeholder: '请选择发放日期' },
colProps: colHalf,
},
{
label: '状态',
field: 'status',
component: 'JDictSelectTag',
defaultValue: 'compile',
componentProps: { dictCode: 'xslmes_mixer_ps_status', disabled: true },
colProps: colHalf,
},
{
label: '编制人',
field: 'compileBy',
component: 'Input',
componentProps: { disabled: true, bordered: false, placeholder: '保存后按创建人显示' },
colProps: colHalf,
},
{
label: '担当',
field: 'responsiblePerson',
component: 'Input',
colProps: colHalf,
componentProps: { placeholder: '请输入担当', allowClear: true },
},
{
label: '标题',
field: 'title',
component: 'Input',
colProps: { span: 24 },
componentProps: { placeholder: '请输入标题', allowClear: true },
dynamicRules: () => [{ required: true, message: '请输入标题' }],
},
sectionDivider('组织与部门', 'dividerDept'),
{
label: '所属工厂',
field: 'factoryId',
component: 'JSelectDept',
componentProps: deptSelectSingleProps,
colProps: colHalf,
},
{
label: '发送部门',
field: 'sendDeptId',
component: 'JSelectDept',
componentProps: deptSelectSingleProps,
colProps: colHalf,
},
{
label: '收信部门',
field: 'receiveDeptId',
component: 'JSelectDept',
componentProps: deptSelectProps,
colProps: colHalf,
dynamicRules: () => [{ required: true, message: '请选择收信部门' }],
},
{
label: '参照部门',
field: 'referenceDeptId',
component: 'JSelectDept',
componentProps: deptSelectProps,
colProps: colHalf,
dynamicRules: () => [{ required: true, message: '请选择参照部门' }],
},
sectionDivider('文档内容', 'dividerContent'),
{
label: '目的',
field: 'purpose',
component: 'InputTextArea',
componentProps: { rows: 3, placeholder: '请输入目的', maxlength: 500, showCount: true },
colProps: colHalf,
},
{
label: '依据',
field: 'basis',
component: 'InputTextArea',
componentProps: { rows: 3, placeholder: '请输入依据', maxlength: 500, showCount: true },
colProps: colHalf,
},
{
label: '内容',
field: 'content',
component: 'InputTextArea',
componentProps: { rows: 5, placeholder: '请输入内容', maxlength: 2000, showCount: true },
colProps: { span: 24 },
},
sectionDivider('审批记录', 'dividerWorkflow', hasWorkflowInfo),
{
label: '校对人',
field: 'proofreadBy',
component: 'Input',
componentProps: { disabled: true, bordered: false },
colProps: colHalf,
ifShow: ({ values }) => !!values.proofreadBy,
},
{
label: '校对时间',
field: 'proofreadTime',
component: 'Input',
componentProps: { disabled: true, bordered: false },
colProps: colHalf,
ifShow: ({ values }) => !!values.proofreadTime,
},
{
label: '审核人',
field: 'auditBy',
component: 'Input',
componentProps: { disabled: true, bordered: false },
colProps: colHalf,
ifShow: ({ values }) => !!values.auditBy,
},
{
label: '审核时间',
field: 'auditTime',
component: 'Input',
componentProps: { disabled: true, bordered: false },
colProps: colHalf,
ifShow: ({ values }) => !!values.auditTime,
},
{
label: '批准人',
field: 'approveBy',
component: 'Input',
componentProps: { disabled: true, bordered: false },
colProps: colHalf,
ifShow: ({ values }) => !!values.approveBy,
},
{
label: '批准时间',
field: 'approveTime',
component: 'Input',
componentProps: { disabled: true, bordered: false },
colProps: colHalf,
ifShow: ({ values }) => !!values.approveTime,
},
];
export const superQuerySchema = {
psCode: { title: 'PS编码', order: 0, view: 'text' },
psType: { title: '类型', order: 1, view: 'list', dictCode: 'xslmes_ps_belong' },
constructionCode: { title: '施工代号', order: 2, view: 'list', dictCode: 'xslmes_construction_code' },
issueDate: { title: '发放日期', order: 3, view: 'date' },
title: { title: '标题', order: 4, view: 'text' },
status: { title: '状态', order: 5, view: 'list', dictCode: 'xslmes_mixer_ps_status' },
responsiblePerson: { title: '担当', order: 6, view: 'text' },
};

View File

@@ -0,0 +1,242 @@
<template>
<div>
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<template #tableTitle>
<a-button
type="primary"
v-auth="'xslmes:mes_xsl_mixer_ps_compile:add'"
@click="handleAdd"
preIcon="ant-design:plus-outlined"
>
新增
</a-button>
<a-button
v-auth="'xslmes:mes_xsl_mixer_ps_compile:proofread'"
:disabled="selectedRowKeys.length === 0"
preIcon="ant-design:check-circle-outlined"
@click="handleProofread"
>
校对
</a-button>
<a-button
v-auth="'xslmes:mes_xsl_mixer_ps_compile:audit'"
:disabled="selectedRowKeys.length === 0"
preIcon="ant-design:audit-outlined"
@click="handleAudit"
>
审核
</a-button>
<a-button
v-auth="'xslmes:mes_xsl_mixer_ps_compile:approve'"
:disabled="selectedRowKeys.length === 0"
preIcon="ant-design:safety-certificate-outlined"
@click="handleApprove"
>
批准
</a-button>
<a-button
type="primary"
v-auth="'xslmes:mes_xsl_mixer_ps_compile:exportXls'"
preIcon="ant-design:export-outlined"
@click="onExportXls"
>
导出
</a-button>
<j-upload-button
type="primary"
v-auth="'xslmes:mes_xsl_mixer_ps_compile:importExcel'"
preIcon="ant-design:import-outlined"
@click="onImportXls"
>
导入
</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0 && hasCompileSelection">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined" />
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'xslmes:mes_xsl_mixer_ps_compile:deleteBatch'">
批量操作
<Icon icon="mdi:chevron-down" />
</a-button>
</a-dropdown>
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<template #action="{ record }">
<TableAction
:actions="[
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'xslmes:mes_xsl_mixer_ps_compile:edit',
ifShow: isCompileStatus(record),
},
]"
:dropDownActions="getDropDownAction(record)"
/>
</template>
</BasicTable>
<MesXslMixerPsCompileModal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="xslmes-mesXslMixerPsCompile" setup>
import { computed, reactive } from 'vue';
import { Modal } from 'ant-design-vue';
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import { useMessage } from '/@/hooks/web/useMessage';
import Icon from '/@/components/Icon';
import MesXslMixerPsCompileModal from './components/MesXslMixerPsCompileModal.vue';
import { columns, searchFormSchema, superQuerySchema } from './MesXslMixerPsCompile.data';
import {
list,
deleteOne,
batchDelete,
getExportUrl,
getImportUrl,
proofread,
audit,
approve,
} from './MesXslMixerPsCompile.api';
const { createMessage } = useMessage();
const queryParam = reactive<any>({});
const [registerModal, { openModal }] = useModal();
const { tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '密炼PS编制',
api: list,
columns,
canResize: true,
tableSetting: { cacheKey: 'mesXslMixerPsCompile_v20260520' },
formConfig: {
schemas: searchFormSchema,
labelWidth: 90,
autoSubmitOnEnter: true,
showAdvancedButton: true,
},
actionColumn: {
title: '操作',
dataIndex: 'action',
width: 160,
fixed: 'right',
slots: { customRender: 'action' },
},
beforeFetch: (params) => Object.assign(params, queryParam),
},
exportConfig: {
name: '密炼PS编制',
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess,
},
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys, selectedRows }] = tableContext;
const superQueryConfig = reactive(superQuerySchema);
const isCompileStatus = (record?: Recordable) => !record?.status || record.status === 'compile';
const hasCompileSelection = computed(
() => selectedRows.value.length > 0 && selectedRows.value.every((row) => isCompileStatus(row)),
);
function handleSuperQuery(params) {
Object.keys(params).forEach((k) => {
queryParam[k] = params[k];
});
reload();
}
function handleAdd() {
openModal(true, { isUpdate: false, showFooter: true });
}
function handleEdit(record: Recordable) {
if (record.status && record.status !== 'compile') {
createMessage.warning('仅编制状态的单据允许编辑');
return;
}
openModal(true, { record, isUpdate: true, showFooter: true });
}
function handleStatusAction(action: 'proofread' | 'audit' | 'approve', label: string) {
if (selectedRowKeys.value.length === 0) {
createMessage.warning('请先选择要' + label + '的记录');
return;
}
Modal.confirm({
title: '确认' + label,
content: `确定对选中的 ${selectedRowKeys.value.length} 条记录执行${label}吗?`,
okText: '确认',
cancelText: '取消',
onOk: async () => {
const ids = selectedRowKeys.value.join(',');
const fn = action === 'proofread' ? proofread : action === 'audit' ? audit : approve;
await fn({ ids });
createMessage.success(label + '成功');
handleSuccess();
},
});
}
function handleProofread() {
handleStatusAction('proofread', '校对');
}
function handleAudit() {
handleStatusAction('audit', '审核');
}
function handleApprove() {
handleStatusAction('approve', '批准');
}
function handleDetail(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: false });
}
function handleDelete(record: Recordable) {
if (!isCompileStatus(record)) {
createMessage.warning('仅编制状态的单据允许删除');
return;
}
deleteOne({ id: record.id }, handleSuccess);
}
function batchHandleDelete() {
if (!hasCompileSelection.value) {
createMessage.warning('仅编制状态的单据允许删除,请取消已流转记录的勾选');
return;
}
batchDelete({ ids: selectedRowKeys.value.join(',') }, handleSuccess);
}
function handleSuccess() {
reload();
selectedRowKeys.value = [];
}
function getDropDownAction(record: Recordable) {
return [
{ label: '详情', onClick: handleDetail.bind(null, record) },
{
label: '删除',
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
auth: 'xslmes:mes_xsl_mixer_ps_compile:delete',
ifShow: isCompileStatus(record),
},
];
}
</script>

View File

@@ -0,0 +1,201 @@
<template>
<BasicModal
v-bind="$attrs"
@register="registerModal"
destroyOnClose
:title="title"
:width="1000"
wrapClassName="ps-compile-modal-wrap"
@ok="handleSubmit"
>
<div class="ps-compile-modal-body">
<BasicForm @register="registerForm" name="MesXslMixerPsCompileForm" />
</div>
</BasicModal>
</template>
<script lang="ts" setup>
import { computed, ref, unref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { useMessage } from '/@/hooks/web/useMessage';
import { useUserStore } from '/@/store/modules/user';
import { formSchema } from '../MesXslMixerPsCompile.data';
import { saveOrUpdate } from '../MesXslMixerPsCompile.api';
const { createMessage } = useMessage();
const userStore = useUserStore();
const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true);
const isDetail = ref(false);
const modalTitleOverride = ref('');
const statusDictCode = ref('xslmes_mixer_ps_status');
const [registerForm, { setProps, resetFields, setFieldsValue, validate, scrollToField, updateSchema }] = useForm({
labelWidth: 96,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: { span: 24 },
rowProps: { gutter: 16 },
compact: true,
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await resetFields();
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
isUpdate.value = !!data?.isUpdate;
isDetail.value = !data?.showFooter;
modalTitleOverride.value = data?.modalTitle || '';
statusDictCode.value = data?.statusDictCode || 'xslmes_mixer_ps_status';
await updateSchema([
{
field: 'status',
componentProps: { dictCode: statusDictCode.value, disabled: true },
},
]);
if (unref(isUpdate)) {
await setFieldsValue(normalizeRecord(data.record));
} else {
await setFieldsValue({ compileBy: resolveCompileBy() });
}
setProps({ disabled: !data?.showFooter });
});
const title = computed(() => {
if (modalTitleOverride.value) {
return modalTitleOverride.value;
}
return !unref(isUpdate) ? '新增PS' : unref(isDetail) ? 'PS详情' : '编辑PS';
});
function parseDeptIds(value: unknown): string[] {
if (Array.isArray(value)) {
return value.filter((v) => v != null && String(v).trim() !== '').map(String);
}
if (value == null || value === '') {
return [];
}
return String(value)
.split(',')
.map((v) => v.trim())
.filter(Boolean);
}
function joinDeptIds(value: unknown): string {
const arr = parseDeptIds(value);
return arr.length ? arr.join(',') : '';
}
function resolveCompileBy(record?: Recordable) {
if (record?.createBy_dictText || record?.createBy) {
return record.createBy_dictText || record.createBy || '';
}
const user = userStore.getUserInfo;
return user?.realname || user?.username || '';
}
function normalizeRecord(record?: Recordable) {
if (!record) {
return record;
}
return {
...record,
compileBy: resolveCompileBy(record),
receiveDeptId: parseDeptIds(record.receiveDeptId),
referenceDeptId: parseDeptIds(record.referenceDeptId),
};
}
async function handleSubmit() {
try {
const values = await validate();
delete values.compileBy;
values.receiveDeptId = joinDeptIds(values.receiveDeptId);
values.referenceDeptId = joinDeptIds(values.referenceDeptId);
if (!values.receiveDeptId) {
createMessage.warning('请选择收信部门');
return;
}
if (!values.referenceDeptId) {
createMessage.warning('请选择参照部门');
return;
}
setModalProps({ confirmLoading: true });
await saveOrUpdate(values, unref(isUpdate));
createMessage.success(unref(isUpdate) ? '编辑成功' : '新增成功');
closeModal();
emit('success');
} catch (e: any) {
if (e?.errorFields) {
const firstField = e.errorFields[0];
if (firstField) {
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(e);
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>
<style lang="less" scoped>
.ps-compile-modal-body {
padding: 4px 8px 0;
max-height: calc(100vh - 220px);
overflow-y: auto;
}
:deep(.ant-picker) {
width: 100%;
}
:deep(.ant-divider-horizontal.ant-divider-with-text-left) {
margin: 8px 0 12px;
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
&::before,
&::after {
border-color: #e8e8e8;
}
}
:deep(.ant-form-item) {
margin-bottom: 14px;
}
:deep(#MesXslMixerPsCompileForm_compileBy),
:deep(#MesXslMixerPsCompileForm_proofreadBy),
:deep(#MesXslMixerPsCompileForm_proofreadTime),
:deep(#MesXslMixerPsCompileForm_auditBy),
:deep(#MesXslMixerPsCompileForm_auditTime),
:deep(#MesXslMixerPsCompileForm_approveBy),
:deep(#MesXslMixerPsCompileForm_approveTime) {
margin-bottom: 8px;
.ant-form-item-label > label {
color: rgba(0, 0, 0, 0.45);
}
.ant-input[disabled] {
color: rgba(0, 0, 0, 0.75);
cursor: default;
padding-left: 0;
}
}
:deep(.JSelectDept .j-select-row) {
width: 100%;
}
</style>
<style lang="less">
.ps-compile-modal-wrap {
.ant-modal-body {
padding-top: 12px;
padding-bottom: 8px;
}
}
</style>

View File

@@ -0,0 +1,101 @@
<template>
<BasicModal v-bind="$attrs" title="选择密炼PS" :width="960" @register="registerModal" @ok="handleOk">
<BasicTable @register="registerTable" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicTable, useTable } from '/@/components/Table';
import type { FormSchema } from '/@/components/Table';
import { list as mixerPsList, queryById as queryMixerPsById } from '../MesXslMixerPsCompile.api';
import { columns as mixerPsColumns } from '../MesXslMixerPsCompile.data';
import { useMessage } from '/@/hooks/web/useMessage';
const emit = defineEmits(['register', 'select']);
const { createMessage } = useMessage();
const COMPILE_STATUS = 'compile';
const selectSearchSchema: FormSchema[] = [
{ label: 'PS编码', field: 'psCode', component: 'JInput', colProps: { span: 8 } },
{ label: '标题', field: 'title', component: 'JInput', colProps: { span: 8 } },
];
const selectedRow = ref<Recordable | null>(null);
const [registerTable, { reload, getSelectRowKeys, getSelectRows, setSelectedRowKeys, clearSelectedRowKeys }] = useTable({
api: mixerPsList,
columns: mixerPsColumns.slice(0, 7),
rowKey: 'id',
useSearchForm: true,
formConfig: {
labelWidth: 90,
schemas: selectSearchSchema,
},
pagination: { pageSize: 10 },
canResize: false,
showIndexColumn: false,
immediate: true,
beforeFetch: (params) => ({
...params,
status: COMPILE_STATUS,
}),
rowSelection: {
type: 'radio',
columnWidth: 48,
onChange: (_keys, rows) => {
selectedRow.value = rows?.[0] ?? null;
},
},
clickToRowSelect: true,
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
selectedRow.value = null;
clearSelectedRowKeys?.();
setModalProps({ confirmLoading: false });
const psId = data?.psCompileId as string | undefined;
if (psId) {
setSelectedRowKeys?.([psId]);
try {
const raw = await queryMixerPsById({ id: psId });
const row = (raw as Recordable)?.psCode != null ? raw : (raw as Recordable)?.result;
if (row) {
selectedRow.value = row;
}
} catch {
// ignore
}
}
reload();
});
async function handleOk() {
const keys = (getSelectRowKeys?.() || []) as string[];
let row = selectedRow.value || ((getSelectRows?.() || []) as Recordable[])[0];
if (!row && keys.length) {
try {
const raw = await queryMixerPsById({ id: keys[0] });
row = (raw as Recordable)?.psCode != null ? raw : (raw as Recordable)?.result;
} catch {
// ignore
}
}
if (!row?.id) {
createMessage.warning('请选择一条编制状态的密炼PS');
return;
}
if (row.status && row.status !== COMPILE_STATUS) {
createMessage.warning('仅可选择编制状态的密炼PS');
return;
}
emit('select', {
psCompileId: row.id,
psCode: row.psCode || '',
title: row.title || '',
});
closeModal();
}
</script>

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