diff --git a/ym-admin/db/ChangePackagingBoxHistorymysql.sql b/ym-admin/db/ChangePackagingBoxHistorymysql.sql
new file mode 100644
index 0000000..97b067d
--- /dev/null
+++ b/ym-admin/db/ChangePackagingBoxHistorymysql.sql
@@ -0,0 +1,7 @@
+-- 菜单初始SQL
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date)VALUES (1626059890161434625, 1067246875800000035, '包装箱拆合箱历史表', 'packing/changePackagingBoxHistory', NULL, 0, 'icon-desktop', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1626059890161434626, 1626059890161434625, '查看', NULL, 'packing:changePackagingBoxHistory:page,packing:changePackagingBoxHistory:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1626059890161434627, 1626059890161434625, '新增', NULL, 'packing:changePackagingBoxHistory:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1626059890161434628, 1626059890161434625, '修改', NULL, 'packing:changePackagingBoxHistory:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1626059890161434629, 1626059890161434625, '删除', NULL, 'packing:changePackagingBoxHistory:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1626059890161434630, 1626059890161434625, '导出', NULL, 'packing:changePackagingBoxHistory:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
diff --git a/ym-admin/db/PrintModelmysql.sql b/ym-admin/db/PrintModelmysql.sql
new file mode 100644
index 0000000..ca99f9c
--- /dev/null
+++ b/ym-admin/db/PrintModelmysql.sql
@@ -0,0 +1,7 @@
+-- 菜单初始SQL
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date)VALUES (1627506543435272194, 1067246875800000035, '打印标签模板表', 'packing/printModel', NULL, 0, 'icon-desktop', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627506543435272195, 1627506543435272194, '查看', NULL, 'packing:printModel:page,packing:printModel:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627506543435272196, 1627506543435272194, '新增', NULL, 'packing:printModel:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627506543435272197, 1627506543435272194, '修改', NULL, 'packing:printModel:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627506543435272198, 1627506543435272194, '删除', NULL, 'packing:printModel:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627506543435272199, 1627506543435272194, '导出', NULL, 'packing:printModel:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
diff --git a/ym-admin/db/WoCompensationPowermysql.sql b/ym-admin/db/WoCompensationPowermysql.sql
new file mode 100644
index 0000000..1fbf67a
--- /dev/null
+++ b/ym-admin/db/WoCompensationPowermysql.sql
@@ -0,0 +1,7 @@
+-- 菜单初始SQL
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date)VALUES (1627488175458189314, 1067246875800000035, '基板补偿功率 表', 'packing/woCompensationPower', NULL, 0, 'icon-desktop', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627488175458189315, 1627488175458189314, '查看', NULL, 'packing:woCompensationPower:page,packing:woCompensationPower:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627488175458189316, 1627488175458189314, '新增', NULL, 'packing:woCompensationPower:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627488175458189317, 1627488175458189314, '修改', NULL, 'packing:woCompensationPower:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627488175458189318, 1627488175458189314, '删除', NULL, 'packing:woCompensationPower:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627488175458189319, 1627488175458189314, '导出', NULL, 'packing:woCompensationPower:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
diff --git a/ym-admin/db/WoPackagingBoxSubstratemysql.sql b/ym-admin/db/WoPackagingBoxSubstratemysql.sql
new file mode 100644
index 0000000..f3b3d2f
--- /dev/null
+++ b/ym-admin/db/WoPackagingBoxSubstratemysql.sql
@@ -0,0 +1,7 @@
+-- 菜单初始SQL
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date)VALUES (1627855073022648322, 1067246875800000035, '包装箱基板关联表 ( 基板表 )', 'packing/woPackagingBoxSubstrate', NULL, 0, 'icon-desktop', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627855073022648323, 1627855073022648322, '查看', NULL, 'packing:woPackagingBoxSubstrate:page,packing:woPackagingBoxSubstrate:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627855073022648324, 1627855073022648322, '新增', NULL, 'packing:woPackagingBoxSubstrate:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627855073022648325, 1627855073022648322, '修改', NULL, 'packing:woPackagingBoxSubstrate:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627855073022648326, 1627855073022648322, '删除', NULL, 'packing:woPackagingBoxSubstrate:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627855073022648327, 1627855073022648322, '导出', NULL, 'packing:woPackagingBoxSubstrate:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
diff --git a/ym-admin/db/WoPackagingBoxmysql.sql b/ym-admin/db/WoPackagingBoxmysql.sql
new file mode 100644
index 0000000..fbc5955
--- /dev/null
+++ b/ym-admin/db/WoPackagingBoxmysql.sql
@@ -0,0 +1,7 @@
+-- 菜单初始SQL
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date)VALUES (1628230581925277697, 1067246875800000035, '包装箱表', 'code/woPackagingBox', NULL, 0, 'icon-desktop', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1628230581925277698, 1628230581925277697, '查看', NULL, 'code:woPackagingBox:page,code:woPackagingBox:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1628230581925277699, 1628230581925277697, '新增', NULL, 'code:woPackagingBox:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1628230581925277700, 1628230581925277697, '修改', NULL, 'code:woPackagingBox:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1628230581925277701, 1628230581925277697, '删除', NULL, 'code:woPackagingBox:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1628230581925277702, 1628230581925277697, '导出', NULL, 'code:woPackagingBox:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
diff --git a/ym-admin/db/WoPackagingPrintHistorymysql.sql b/ym-admin/db/WoPackagingPrintHistorymysql.sql
new file mode 100644
index 0000000..6eecc68
--- /dev/null
+++ b/ym-admin/db/WoPackagingPrintHistorymysql.sql
@@ -0,0 +1,7 @@
+-- 菜单初始SQL
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date)VALUES (1627603723110080513, 1067246875800000035, '包装箱打印历史表', 'packing/woPackagingPrintHistory', NULL, 0, 'icon-desktop', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627603723110080514, 1627603723110080513, '查看', NULL, 'packing:woPackagingPrintHistory:page,packing:woPackagingPrintHistory:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627603723110080515, 1627603723110080513, '新增', NULL, 'packing:woPackagingPrintHistory:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627603723110080516, 1627603723110080513, '修改', NULL, 'packing:woPackagingPrintHistory:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627603723110080517, 1627603723110080513, '删除', NULL, 'packing:woPackagingPrintHistory:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627603723110080518, 1627603723110080513, '导出', NULL, 'packing:woPackagingPrintHistory:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
diff --git a/ym-admin/db/WoPowerLevelmysql.sql b/ym-admin/db/WoPowerLevelmysql.sql
new file mode 100644
index 0000000..e499d43
--- /dev/null
+++ b/ym-admin/db/WoPowerLevelmysql.sql
@@ -0,0 +1,7 @@
+-- 菜单初始SQL
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date)VALUES (1627486255993688065, 1067246875800000035, '功率等级 表', 'packing/woPowerLevel', NULL, 0, 'icon-desktop', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627486255993688066, 1627486255993688065, '查看', NULL, 'packing:woPowerLevel:page,packing:woPowerLevel:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627486255993688067, 1627486255993688065, '新增', NULL, 'packing:woPowerLevel:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627486255993688068, 1627486255993688065, '修改', NULL, 'packing:woPowerLevel:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627486255993688069, 1627486255993688065, '删除', NULL, 'packing:woPowerLevel:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1627486255993688070, 1627486255993688065, '导出', NULL, 'packing:woPowerLevel:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
diff --git a/ym-admin/src/main/java/com/cnbm/admin/utils/CodeGeneratorHelper.java b/ym-admin/src/main/java/com/cnbm/admin/utils/CodeGeneratorHelper.java
new file mode 100644
index 0000000..16e4a4a
--- /dev/null
+++ b/ym-admin/src/main/java/com/cnbm/admin/utils/CodeGeneratorHelper.java
@@ -0,0 +1,683 @@
+/*
+ * Copyright (c) 2019.
+ * http://www.ulabcare.com
+ */
+
+package com.cnbm.admin.utils;
+
+/**
+ *
+ * 编号生成帮助类
+ * 以2+8+6形式生成(2位编号类型前缀+8位年月日+6位自增序列号 )
+ * 2位编号类型前缀定义如下⤵
+ * 1x:患者相关编号以 '1' 开头,(病例号:10 )
+ * 2x:订单相关编号以 '2' 开头,如订单编号=20
+ * 3x: 支付相关编号以 '3' 开头,如系统内部支付订单号=30
+ * (未完待续...)
+ *
+ *
+ * @author FanYi
+ * @date 2019-01-03
+ * @since 1.0
+ */
+public class CodeGeneratorHelper {
+
+ /**
+ * 订单编号
+ */
+ public static final String ORDER_CODE = "ORDER_CODE";
+ /**
+ * 工艺编号
+ */
+ public static final String PROCESS_FLOW_CODE = "PROCESS_FLOW_CODE";
+
+ /**
+ * 工艺设备点编号
+ */
+ public static final String PROCESS_FLOW_EQUIPMENT_CODE = "PROCESS_FLOW_EQUIPMENT_CODE";
+ /**
+ * BOM编号
+ */
+ public static final String BOM_CODE = "BOM_CODE";
+ /**
+ * 基板编号
+ */
+ public static final String SUBSTRATESU_CODE = "SUBSTRATESU_CODE";
+
+ /**
+ * 报警等级编号
+ */
+ public static final String ALARM_GRADE_CODE = "ALARM_GRADE_CODE";
+
+ /**
+ * 物料信息编号
+ */
+ public static final String MATERIAL_CODE = "MATERIAL_CODE";
+
+ /**
+ * 物料信息编号
+ */
+ public static final String EQUIPMENT_MATERIAL_BOM_CODE = "EQUIPMENT_MATERIAL_BOM_CODE";
+
+ /**
+ * 区域编号
+ */
+ public static final String AREA_CODE = "AREA_CODE";
+
+ /**
+ * 缓存区编号
+ */
+ public static final String CACHE_CODE = "CACHE_CODE";
+
+ /**
+ * 设备报警编号
+ */
+ public static final String EQUIPMENT_ALARM_CODE = "EQUIPMENT_ALARM_CODE";
+
+ /**
+ * 设备保养计划单号
+ */
+ public static final String EQUIPMENT_MAINTENANCE_PLAN_CODE = "EQUIPMENT_MAINTENANCE_PLAN_CODE";
+
+ /**
+ * 设备保养记录单号
+ */
+ public static final String EQUIPMENT_MAINTENANCE_LOG_CODE = "EQUIPMENT_MAINTENANCE_LOG_CODE";
+
+
+ /**
+ * 设备类型编号
+ */
+ public static final String EQUIPMENT_TYPE_CODE = "EQUIPMENT_TYPE_CODE";
+
+ /**
+ * 保养周期编号
+ */
+ public static final String MAINTENANCE_PERIOD_CODE = "MAINTENANCE_PERIOD_CODE";
+
+ /**
+ * 维修类型编号
+ */
+ public static final String MAINTENANCE_TYPE_CODE = "MAINTENANCE_TYPE_CODE";
+
+ /**
+ * 物料类型编号
+ */
+ public static final String MATERIAL_TYPE_CODE = "MATERIAL_TYPE_CODE";
+
+ /**
+ * 设备参数编号 编号
+ */
+ public static final String EQUIPMENT_PARAMETER_CODE = "EQUIPMENT_PARAMETER_CODE";
+
+ /**
+ * 设备编号
+ */
+ public static final String EQUIPMENT_CODE = "EQUIPMENT_CODE";
+
+ /**
+ * 库位编号
+ */
+ public static final String STOCK_CODE = "STOCK_CODE";
+
+ /**
+ * 库位位置编号
+ */
+ public static final String STOCK_POSITION_CODE = "STOCK_POSITION_CODE";
+
+ /**
+ * 货架编号
+ */
+ public static final String SHELF_CODE = "SHELF_CODE";
+
+ /**
+ * 废品报废编号
+ */
+ public static final String SCRAP_CODE = "SCRAP_CODE";
+
+ /**
+ * 连线设备编号
+ */
+ public static final String CONNECTING_DEVICE_CODE = "CONNECTING_DEVICE_CODE";
+
+ /**
+ * 报警类型编号
+ */
+ public static final String ALARM_TYPE_CODE = "ALARM_TYPE_CODE";
+
+ /**
+ * 报警信息编号
+ */
+ public static final String ALARM_CODE = "ALARM_CODE";
+
+ /**
+ * 物料批次编号
+ */
+ public static final String MATERIAL_DATE_CODE = "MATERIAL_DATE_CODE";
+
+ /**
+ * 储存箱编号
+ */
+ public static final String STORAGE_BOX_CODE = "STORAGE_BOX_CODE";
+ /**
+ * 工序编号
+ */
+ public static final String SEQUENCE_CODE = "SEQUENCE_CODE";
+
+ private static final String DETECT_EQUIPMENT_SYSTEM_CODE = "DETECT_EQUIPMENT_SYSTEM_CODE";
+
+ /**
+ * 标签编码
+ */
+ public static final String PRINT_MODEL_CODE = "PRINT_MODEL";
+
+ /**
+ * 生成物料批次编号
+ *
+ * @return 物料批次编号
+ */
+ public static String getMaterialDateCode() {
+ return IDGenerator.gen("PC", "yyyyMMdd", 6, MATERIAL_DATE_CODE);
+ }
+ /**
+ * 连线设备属性编号
+ */
+ public static final String CONNECTING_DEVICE_ATTR_CODE = "CONNECTING_DEVICE_ATTR_CODE";
+
+
+ /**
+ * 工厂编号
+ */
+ public static final String FACTORY_CODE = "FACTORY_CODE";
+
+ /**
+ * 产线编号
+ */
+ public static final String PRODUCTION_LINE_CODE = "PRODUCTION_LINE_CODE";
+
+ /**
+ * 设备类型报警明细编号
+ */
+ public static final String EQUIPMENT_TYPE_ALARM_CODE = "EQUIPMENT_TYPE_ALARM_CODE";
+
+
+ /**
+ * 工单编号
+ */
+ public static final String WORK_ORDER_CODE = "WORK_ORDER_CODE";
+
+ /**
+ * 报废类型编号
+ */
+ public static final String SCRAP_TYPE_INFORMATION_CODE = "SCRAP_TYPE_INFORMATION_CODE";
+
+ /**
+ * 报废原因编号
+ */
+ public static final String SCRAP_INFORMATION_CODE = "SCRAP_INFORMATION_CODE";
+
+ /**
+ * 报废原因编号
+ */
+ public static final String SUBSTRATE_BATCH_INFO_CODE = "SUBSTRATE_BATCH_INFO_CODE";
+
+ /**
+ * 检测下发区域编号
+ */
+ public static final String DETECT_DISTRIBUTION_AREA_CODE = "DETECT_DISTRIBUTION_AREA_CODE";
+
+ /**
+ * 离线检测参数编码
+ */
+ public static final String OFFLINE_DETECT_PARAM_CODE = "OFFLINE_DETECT_PARAM_CODE";
+
+ /**
+ * 设备配方CODE
+ */
+ public static final String EQUIPMENT_RECIPE_CODE = "EQUIPMENT_RECIPE_CODE";
+
+ /**
+ * 设备事件CODE
+ */
+ public static final String EQUIPMENT_EVENT_CODE = "EQUIPMENT_EVENT_CODE";
+
+ /**
+ * 设备分组CODE
+ */
+ public static final String EQUIPMENT_GROUP_CODE = "EQUIPMENT_GROUP_CODE";
+
+ /**
+ * power class CODE
+ */
+ public static final String POWER_CLASSIFICATION_CODE = "POWER_CLASSIFICATION_CODE";
+
+ /**
+ * power class CODE
+ */
+ public static final String EQUIPMENT_REPAIR_CODE = "EQUIPMENT_REPAIR_CODE";
+
+ /**
+ * 存储箱 CODE
+ */
+ public static final String STORAGE_TANK_CODE = "STORAGE_TANK_CODE";
+
+ /**
+ * 权限 CODE
+ */
+ public static final String ROLE_CODE = "STORAGE_TANK_CODE";
+ /**
+ * 权限CODE
+ *
+ * @return 权限CODE
+ */
+ public static String getRoleCode() {
+ return IDGenerator.gen("ROLE", "yyyyMMdd", 6, ROLE_CODE);
+ }
+
+ /**
+ * 存储箱CODE
+ *
+ * @return 存储箱CODE
+ */
+ public static String getStorageTankCode() {
+ return IDGenerator.gen("CCX", "yyyyMMdd", 6, STORAGE_TANK_CODE);
+ }
+
+ /**
+ * 生成工艺设备点CODE
+ *
+ * @return 工艺设备点CODE
+ */
+ public static String getEquipmentRepairCode() {
+ return IDGenerator.gen("SBWX", "yyyyMMdd", 6, EQUIPMENT_REPAIR_CODE);
+ }
+
+ /**
+ * 生成工艺设备点CODE
+ *
+ * @return 工艺设备点CODE
+ */
+ public static String getProcessFlowEquipmentGroupCode() {
+ return IDGenerator.gen("GYSBD", "yyyyMMdd", 6, PROCESS_FLOW_EQUIPMENT_CODE);
+ }
+
+ /**
+ * 生成设备分组CODE
+ *
+ * @return 设备分组CODE
+ */
+ public static String getEquipmentGroupCode() {
+ return IDGenerator.gen("SBFZ", "yyyyMMdd", 6, EQUIPMENT_GROUP_CODE);
+ }
+
+ /**
+ * 生成设备事件CODE
+ *
+ * @return 生成设备事件CODE
+ */
+ public static String getEquipmentEventCode() {
+ return IDGenerator.gen("SBSJ", "yyyyMMdd", 6, EQUIPMENT_EVENT_CODE);
+ }
+
+ /**
+ * 生成设备配方编码
+ *
+ * @return 生成设备配方编码
+ */
+ public static String getEquipmentRecipeCode() {
+ return IDGenerator.gen("SBPF", "yyyyMMdd", 6, EQUIPMENT_RECIPE_CODE);
+ }
+
+ /**
+ * 生成离线检测参数编码
+ *
+ * @return 生成离线检测参数编码
+ */
+ public static String getOfflineDetectParamCode() {
+ return IDGenerator.gen("LXCS", "yyyyMMdd", 6, OFFLINE_DETECT_PARAM_CODE);
+ }
+
+ /**
+ * 生成设备类型报警明细编号
+ *
+ * @return 设备类型报警明细编号
+ */
+ public static String getEquipmentTypeAlarmCode() {
+ return IDGenerator.gen("20", "yyyyMMdd", 6, EQUIPMENT_TYPE_ALARM_CODE);
+ }
+
+ /**
+ * 生成设备类型报警明细编号
+ *
+ * @return 设备类型报警明细编号
+ */
+ public static String getStorageBoxCode() {
+ return IDGenerator.gen("CCX", "yyyyMMdd", 6, STORAGE_BOX_CODE);
+ }
+
+
+
+ /**
+ * 生成订单编号
+ *
+ * @return 订单编号
+ */
+ public static String getOrderCode() {
+ return IDGenerator.gen("20", "yyyyMMdd", 6, ORDER_CODE);
+ }
+ /**
+ * 生成工艺编号
+ *
+ * @return 工艺编号
+ */
+ public static String getProcessFlowCode() {
+ return IDGenerator.gen("GY", "yyyyMMdd", 6, PROCESS_FLOW_CODE);
+ }
+ /**
+ * 生成基板编号
+ *
+ * @return 基板编号
+ */
+ public static String getSubstrateCode() {
+ return IDGenerator.gen("JB", "yyyyMMdd", 6, SUBSTRATESU_CODE);
+ }
+ /**
+ * 生成BOM编号
+ *
+ * @return BOM编号
+ */
+ public static String getBomCode() {
+ return IDGenerator.gen("BOM", "yyyyMMdd", 6, BOM_CODE);
+ }
+
+ /**
+ * 生成编号
+ *
+ * @return 编号
+ */
+ public static String getCode(String code) {
+ return IDGenerator.gen("20", "yyyyMMdd", 6, code);
+ }
+
+ /**
+ * 生成报警等级编号
+ *
+ * @return 编号
+ */
+ public static String getAlarmGradeCode() {
+ return IDGenerator.gen("BJDJ", "yyyyMMdd", 6, ALARM_GRADE_CODE);
+ }
+
+ /**
+ * 生成物料信息编号
+ *
+ * @return 编号
+ */
+ public static String getMaterialCode() {
+ return IDGenerator.gen("WLXX", "yyyyMMdd", 6, MATERIAL_CODE);
+ }
+
+ /**
+ * 生成设备物料Bom 编号
+ *
+ * @return 编号
+ */
+ public static String getEquipmentMaterialBomCode() {
+ return IDGenerator.gen("SBWLBOM", "yyyyMMdd", 6, EQUIPMENT_MATERIAL_BOM_CODE);
+ }
+
+ /**
+ * 生成设备参数 编号
+ *
+ * @return 编号
+ */
+ public static String getEquipmentParameterCode() {
+ return IDGenerator.gen("SBCS", "yyyyMMdd", 6, EQUIPMENT_PARAMETER_CODE);
+ }
+
+ /**
+ * 生成区域编号
+ *
+ * @return 编号
+ */
+ public static String getAreaCode() {
+ return IDGenerator.gen("QY", "yyyyMMdd", 6, AREA_CODE);
+ }
+
+ /**
+ * 生成缓存区编号
+ *
+ * @return 编号
+ */
+ public static String getCacheCode() {
+ return IDGenerator.gen("HCQ", "yyyyMMdd", 6, CACHE_CODE);
+ }
+
+ /**
+ * 生成设备报警编号
+ *
+ * @return 编号
+ */
+ public static String getEquipmentAlarmCode() {
+ return IDGenerator.gen("SBBJ", "yyyyMMdd", 6, EQUIPMENT_ALARM_CODE);
+ }
+
+ /**
+ * 生成设备保养计划编号
+ *
+ * @return 编号
+ */
+ public static String getEquipmentMaintenancePlanCode() {
+ return IDGenerator.gen("SBBYJH", "yyyyMMdd", 6, EQUIPMENT_MAINTENANCE_PLAN_CODE);
+ }
+
+ /**
+ * 生成设备保养记录编号
+ *
+ * @return 编号
+ */
+ public static String getEquipmentMaintenanceLogCode() {
+ return IDGenerator.gen("SBBYJL", "yyyyMMdd", 6, EQUIPMENT_MAINTENANCE_LOG_CODE);
+ }
+
+ /**
+ * 生成设备类型编号
+ *
+ * @return 编号
+ */
+ public static String getEquipmentTypeCode() {
+ return IDGenerator.gen("SBLX", "yyyyMMdd", 6, EQUIPMENT_TYPE_CODE);
+ }
+
+ /**
+ * 生成保养周期编号
+ *
+ * @return 编号
+ */
+ public static String getMaintenancePeriodCode() {
+ return IDGenerator.gen("BYZQ", "yyyyMMdd", 6, MAINTENANCE_PERIOD_CODE);
+ }
+
+ /**
+ * 生成维修类型编号
+ *
+ * @return 编号
+ */
+ public static String getMaintenanceTypeCode() {
+ return IDGenerator.gen("WXLX", "yyyyMMdd", 6, MAINTENANCE_TYPE_CODE);
+ }
+
+ /**
+ * 生成物料类型编号
+ *
+ * @return 编号
+ */
+ public static String getMaterialTypeCode() {
+ return IDGenerator.gen("WLLX", "yyyyMMdd", 6, MATERIAL_TYPE_CODE);
+ }
+
+ /**
+ * 生成设备编号
+ *
+ * @return 编号
+ */
+ public static String getEquipmentCode() {
+ return IDGenerator.gen("SB", "yyyyMMdd", 6, EQUIPMENT_CODE);
+ }
+
+ /**
+ * 生成库位位置编号
+ *
+ * @return 编号
+ */
+ public static String getStockPositionCode() {
+ return IDGenerator.gen("KWWZ", "yyyyMMdd", 6, STOCK_POSITION_CODE);
+ }
+
+ /**
+ * 生成库位编号
+ *
+ * @return 编号
+ */
+ public static String getStockCode() {
+ return IDGenerator.gen("KW", "yyyyMMdd", 6, STOCK_CODE);
+ }
+
+ /**
+ * 生成货架编号
+ *
+ * @return 编号
+ */
+ public static String getShelfCode() {
+ return IDGenerator.gen("HJ", "yyyyMMdd", 6, SHELF_CODE);
+ }
+
+ /**
+ * 生成废品报废编号
+ *
+ * @return 编号
+ */
+ public static String getScrapCode() {
+ return IDGenerator.gen("FPBF", "yyyyMMdd", 6, SCRAP_CODE);
+ }
+
+
+ /**
+ * 生成连线设备编号
+ *
+ * @return 编号
+ */
+ public static String getConnectingDeviceCode() {
+ return IDGenerator.gen("LXSB", "yyyyMMdd", 6, CONNECTING_DEVICE_CODE);
+ }
+
+ /**
+ * 生成报警类型编号
+ *
+ * @return 编号
+ */
+ public static String getAlarmTypeCode() {
+ return IDGenerator.gen("BJLX", "yyyyMMdd", 6, ALARM_TYPE_CODE);
+ }
+
+
+ /**
+ * 生成报警信息编号
+ *
+ * @return 编号
+ */
+ public static String getAlarmCode() {
+ return IDGenerator.gen("BJXX", "yyyyMMdd", 6, ALARM_CODE);
+ }
+
+ /**
+ * 生成连线设备属性编号
+ *
+ * @return 编号
+ */
+ public static String getConnectingDeviceAttrCode() {
+ return IDGenerator.gen("LXSBSX", "yyyyMMdd", 6, CONNECTING_DEVICE_ATTR_CODE);
+ }
+
+ /**
+ * 生成工厂编号
+ *
+ * @return 编号
+ */
+ public static String getFactoryCode() {
+ return IDGenerator.gen("GC", "yyyyMMdd", 6, FACTORY_CODE);
+ }
+
+
+ /**
+ * 生成产线编号
+ *
+ * @return 编号
+ */
+ public static String getProductionLineCode() {
+ return IDGenerator.gen("CX", "yyyyMMdd", 6, PRODUCTION_LINE_CODE);
+ }
+
+ /**
+ * 生成工单编号
+ *
+ * @return 编号
+ */
+ public static String getWorkOrderCode() {
+ return IDGenerator.gen("ZGD", "yyyyMMdd", 6, WORK_ORDER_CODE);
+ }
+
+ /**
+ * 生成报废类型编号
+ *
+ * @return 编号
+ */
+ public static String getScrapTypeInformationCode() {
+ return IDGenerator.gen("BFLX", "yyyyMMdd", 6, SCRAP_TYPE_INFORMATION_CODE);
+ }
+
+ /**
+ * 生成报废原因编号
+ *
+ * @return 编号
+ */
+ public static String getScrapInformationCode() {
+ return IDGenerator.gen("BFYY", "yyyyMMdd", 6, SCRAP_INFORMATION_CODE);
+ }
+
+
+ public static String getSubstrateBatchInfoCode() {
+ return IDGenerator.gen("PC", "yyyyMMdd", 6, SUBSTRATE_BATCH_INFO_CODE);
+ }
+ /**
+ * 生成工序编号
+ *
+ * @return
+ */
+ public static String getSequenceCode() {
+ return IDGenerator.gen("20", "yyyyMMdd", 6, SEQUENCE_CODE);
+ }
+
+
+ /**
+ * 生成检测下发区域编号
+ *
+ * @return
+ */
+ public static String getDetectDistributionAreaCode() {
+ return IDGenerator.gen("JCQY", "yyyyMMdd", 6, DETECT_DISTRIBUTION_AREA_CODE);
+ }
+
+
+ public static String getDetectEquipmentSystemCode() {
+ return IDGenerator.gen("LX", "yyyyMMdd", 6, DETECT_EQUIPMENT_SYSTEM_CODE);
+ }
+
+ public static String getPowerClassificationCode() {
+ return IDGenerator.gen("PC", "yyyyMMdd", 6, POWER_CLASSIFICATION_CODE);
+ }
+
+ public static String getPrintModelCode() {
+ return IDGenerator.gen("PM", "yyyyMMdd", 6, PRINT_MODEL_CODE);
+ }
+}
diff --git a/ym-admin/src/main/java/com/cnbm/admin/utils/IDGenerator.java b/ym-admin/src/main/java/com/cnbm/admin/utils/IDGenerator.java
new file mode 100644
index 0000000..3a8aede
--- /dev/null
+++ b/ym-admin/src/main/java/com/cnbm/admin/utils/IDGenerator.java
@@ -0,0 +1,213 @@
+package com.cnbm.admin.utils;
+
+import org.apache.commons.lang3.RandomStringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * id生成器,使用redis自增接口实现
+ * TODO 待完善
+ *
+ * @author jiff
+ * @date 2018-12-1
+ * @since 1.0
+ */
+@Component
+public class IDGenerator {
+ private RedisTemplate redisTemplate;
+ private static IDGenerator idGenerator;
+
+ /**
+ * 4位年格式
+ */
+ public static final String PATTERN_YYYY = "yyyy";
+ /**
+ * 6位年月格式
+ */
+ public static final String PATTERN_YYYYMM = "yyyyMM";
+ /**
+ * 8位年月日格式
+ */
+ public static final String PATTERN_YYYYMMDD = "yyyyMMdd";
+ /**
+ * 10位年月日时格式
+ */
+ public static final String PATTERN_YYYYMMDDHH = "yyyyMMddHH";
+ /**
+ * 12位年月日时分格式
+ */
+ public static final String PATTERN_YYYYMMDDHHMM = "yyyyMMddHHmm";
+
+
+ /**
+ * 最大序列号长度
+ */
+ private static final int MAX_SEQUENCE_LENGTH = 20;
+ /**
+ * 最大随机数长度
+ */
+ private static final int MAX_RANDOM_LENGTH = 10;
+ /**
+ * 序列命名空间
+ */
+ private static final String KEY_PREFIX_SEQUENCE = "SEQUENCE_";
+ private static final Map commonDateFormats = new HashMap<>();
+ private static final List sequenceFormats = new ArrayList<>();
+
+ static {
+ commonDateFormats.put(PATTERN_YYYY, new SimpleDateFormat(PATTERN_YYYY));
+ commonDateFormats.put(PATTERN_YYYYMM, new SimpleDateFormat(
+ PATTERN_YYYYMM));
+ commonDateFormats.put(PATTERN_YYYYMMDD, new SimpleDateFormat(
+ PATTERN_YYYYMMDD));
+ commonDateFormats.put(PATTERN_YYYYMMDDHH, new SimpleDateFormat(
+ PATTERN_YYYYMMDDHH));
+ commonDateFormats.put(PATTERN_YYYYMMDDHHMM, new SimpleDateFormat(
+ PATTERN_YYYYMMDDHHMM));
+ StringBuilder sequencePattern = new StringBuilder(MAX_SEQUENCE_LENGTH);
+ for (int i = 0; i < MAX_SEQUENCE_LENGTH; i++) {
+ sequencePattern.append("0");
+ sequenceFormats.add(new DecimalFormat(sequencePattern.toString()));
+ }
+ }
+
+ @Autowired(required = false)
+ public void setRedisTemplate(RedisTemplate redisTemplate) {
+ RedisSerializer stringSerializer = new StringRedisSerializer();
+ //设置序列化Key的实例化对象
+ redisTemplate.setKeySerializer(stringSerializer);
+ //设置序列化Value的实例化对象
+ redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
+ redisTemplate.setHashKeySerializer(stringSerializer);
+ redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
+ redisTemplate.setStringSerializer(stringSerializer);
+ redisTemplate.afterPropertiesSet();
+ this.redisTemplate = redisTemplate;
+ }
+
+ @PostConstruct
+ private void init() {
+ idGenerator = this;
+ idGenerator.redisTemplate = this.redisTemplate;
+ }
+
+ /**
+ * 生成主键
+ *
+ * @param sequenceName 序列名
+ * @return 主键
+ */
+ public static long gen(String sequenceName) {
+ return idGenerator.redisTemplate.opsForValue().increment(
+ KEY_PREFIX_SEQUENCE + sequenceName, 1);
+ }
+
+ /**
+ * 生成主键
+ *
+ * @param prefix 前缀,为空或null时则不使用前缀
+ * @param pattern 时间戳格式,为空或null时不使用时间戳,已定义5种格式:{@link #PATTERN_YYYY}、{@link #PATTERN_YYYYMM}、{@link #PATTERN_YYYYMMDD}、{@link #PATTERN_YYYYMMDDHH}、{@link #PATTERN_YYYYMMDDHHMM}、
+ * @param sequenceLength 序列长度,大于0时有效,否则使用序列原始值,最多{@value #MAX_SEQUENCE_LENGTH}位,超过{@value #MAX_SEQUENCE_LENGTH}默认为{@value #MAX_SEQUENCE_LENGTH}位
+ * @param sequenceName 序列名,为空或null时则不生成序列值
+ * @return prefix+timestamp+sequence
+ */
+ public static String gen(String prefix, String pattern, int sequenceLength,
+ String sequenceName) {
+ return gen(prefix, pattern, sequenceLength, sequenceName, 0);
+ }
+
+ /**
+ * 生成主键
+ *
+ * @param prefix 前缀,为空或null时则不使用前缀
+ * @param pattern 时间戳格式,为空或null时不使用时间戳,已定义5种格式:{@link #PATTERN_YYYY}、{@link #PATTERN_YYYYMM}、{@link #PATTERN_YYYYMMDD}、{@link #PATTERN_YYYYMMDDHH}、{@link #PATTERN_YYYYMMDDHHMM}、
+ * @param sequenceLength 序列长度,大于0时有效,否则使用序列原始值,最多{@value #MAX_SEQUENCE_LENGTH}位,超过{@value #MAX_SEQUENCE_LENGTH}默认为{@value #MAX_SEQUENCE_LENGTH}位
+ * @param sequenceName 序列名,为空或null时则不生成序列值
+ * @param randomLength 随机数长度,大于0时有效,最多{@value #MAX_RANDOM_LENGTH}位,超过{@value #MAX_RANDOM_LENGTH}默认为{@value #MAX_RANDOM_LENGTH}位
+ * @return prefix+timestamp+sequence+random
+ */
+ public static String gen(String prefix, String pattern, int sequenceLength,
+ String sequenceName, int randomLength) {
+ StringBuilder ids = new StringBuilder();
+ if (!isEmpty(prefix)) {
+ ids.append(prefix);
+ }
+ String timestamp = null;
+ if (!isEmpty(pattern)) {
+ timestamp = getFormattedDate(pattern);
+ }
+ if (timestamp != null) {
+ ids.append(timestamp);
+ }
+ if (!isEmpty(sequenceName)) {
+ long sequence = gen(sequenceName);
+ if (sequenceLength > 0) {
+ if (sequenceLength > MAX_SEQUENCE_LENGTH) {
+ sequenceLength = MAX_SEQUENCE_LENGTH;
+ }
+ String formatSequence = sequenceFormats.get(sequenceLength - 1)
+ .format(sequence);
+ if (formatSequence.length() > sequenceLength) {
+ formatSequence = formatSequence.substring(formatSequence
+ .length() - sequenceLength);
+ }
+ ids.append(formatSequence);
+ } else {
+ ids.append(sequence);
+ }
+ }
+ //随机数长度大于0时添加随机数
+ if (randomLength > 0) {
+ String random = RandomStringUtils.randomNumeric(randomLength);
+ ids.append(random);
+ }
+ return ids.toString();
+ }
+
+ private static String getFormattedDate(String pattern) {
+ SimpleDateFormat sdf = commonDateFormats.get(pattern);
+ if (sdf == null) {
+ try {
+ sdf = new SimpleDateFormat(pattern);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ if (sdf == null) {
+ return null;
+ }
+ java.util.Date now = new java.util.Date();
+ return sdf.format(now);
+ }
+
+ private static boolean isEmpty(String str) {
+ if (str == null || str.trim().isEmpty()) {
+ return true;
+ }
+ return false;
+ }
+
+ public static void main(String[] args) {
+ for (int i = 0; i < 100; i++) {
+ System.out.println(RandomStringUtils.randomNumeric(1));
+ System.out.println(RandomStringUtils.randomNumeric(2));
+ System.out.println(RandomStringUtils.randomNumeric(4));
+ }
+ System.out.println(new DecimalFormat("00").format(103));
+ System.out.println(new DecimalFormat("000").format(13));
+
+ }
+
+}
diff --git a/ym-admin/src/main/resources/mapper/SysDeptDao.xml b/ym-admin/src/main/resources/mapper/SysDeptDao.xml
index a558f10..5101128 100644
--- a/ym-admin/src/main/resources/mapper/SysDeptDao.xml
+++ b/ym-admin/src/main/resources/mapper/SysDeptDao.xml
@@ -6,8 +6,9 @@