瑞利声电固定资产管理系统
ycq
2026-10-16 dbbadb021c2fc171466cc82bd9a7a82cc47165f5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
-- FAMS 第一阶段:资产卡片「流转记录」子页签 + Excel 导入(按钮、权限、导入模板、导入后事件)
-- 新视图/列从「资产变动记录」视图(1800000000000001407)复制,保证字段默认值与已验证的视图一致
 
-- 1. 子页签用视图:资产流转记录(按 ASSET_ID 关联卡片,平台自动追加关联条件)
create temporary table tmp_view as select * from cnf_view where view_id = 1800000000000001407;
update tmp_view set view_id = 1800000000000002002, view_identify = 'card_change_log', view_name = '资产流转记录', sort_num = 2,
  default_search_fields = 'CHANGE_TYPE,BILL_NO', default_search_prompt = '请输入变动类型、来源单号查询';
insert into cnf_view select * from tmp_view;
drop temporary table tmp_view;
 
create temporary table tmp_view_column as select * from cnf_view_column where view_id = 1800000000000001407 and field_name not in ('ASSET_NO', 'ASSET_NAME');
update tmp_view_column set view_id = 1800000000000002002, column_id = column_id - 1800000000000001000 + 1800000000000002000;
insert into cnf_view_column select * from tmp_view_column;
drop temporary table tmp_view_column;
 
-- 2. 子页签 + 挂到资产卡片表单
insert into cnf_subtab (subtab_id, subtab_identify, subtab_name, subtab_type, view_id, form_id, url, report_id, target_module_id, target_module_name,
  relation_type, relation_columns, target_columns, sql_expression, enable_expression, display_expression, enable_permission, permission_name,
  module_id, module_name, sort_num, create_user_id, create_user_name, create_time, modify_time, show_in_create)
values (1800000000000002001, 'CARD_CHANGE_LOG', '流转记录', '0', 1800000000000002002, null, '', null, 1800000000000001040, '资产变动记录',
  '0', 'ID', 'ASSET_ID', '', 0, '', 0, null,
  1800000000000001039, '资产卡片', 1, 1118460701772660737, '管理员', now(), now(), 0);
insert into cnf_form_subtab (id, form_id, subtab_id, subtab_name, sort_num, create_user_id, create_user_name, create_time, last_modify_user_id, last_modify_user_name, last_modify_time)
values (1800000000000002003, 1800000000000001206, 1800000000000002001, '流转记录', 1, 1118460701772660737, '管理员', now(), 1118460701772660737, '管理员', now());
 
-- 3. 导入按钮(复制资产卡片的新增按钮行再改),权限挂到卡片「操作」节点下,绑定到「资产卡片」视图
create temporary table tmp_op as select * from cnf_operation where module_id = 1800000000000001039 and operation_name = 'SysAdd';
update tmp_op set operation_id = 1800000000000002004, operation_name = 'SysImport', display_name = '导入', operation_icon = 'fa fa-upload',
  operation_css = 'pt-btn-info', permission_name = 'FAMS_ASSET.ASSET_CARD.Operation.SysImport', create_time = now(), modify_time = now();
insert into cnf_operation select * from tmp_op;
drop temporary table tmp_op;
 
create temporary table tmp_perm as select * from cnf_permission where permission_name = 'FAMS_ASSET.ASSET_CARD.Operation.SysAdd';
update tmp_perm set permission_id = 1800000000000002005, permission_name = 'FAMS_ASSET.ASSET_CARD.Operation.SysImport', display_name = '导入', sort_num = 4, create_time = now();
insert into cnf_permission select * from tmp_perm;
drop temporary table tmp_perm;
 
insert into cnf_view_operation (id, view_id, operation_id, sort_num, create_time, last_modify_user_id, last_modify_user_name, last_modify_time)
values (1800000000000002006, 1800000000000001282, 1800000000000002004, 3, now(), 1118460701772660737, '管理员', now());
 
-- 4. 导入模板:名称类字段按文字导入,导入后事件负责匹配ID、编号、写入库记录
insert into cnf_import_template (import_template_id, import_template_name, module_id, module_name, table_Id, table_name, import_type,
  create_user_id, create_user_name, create_time, modify_time, sort_num, enable_show_name, enable_add_mark, mark_content, mount_file, scene,
  rule_code, rename_file, rename_file_rule_code, rename_file_rule_name, after_event, rule_name)
select 1800000000000002010, '资产卡片导入', 1800000000000001039, '资产卡片', table_id, 'BUS_ASSET_CARD', '0',
  1118460701772660737, '管理员', now(), now(), 1, 0, 0, '', 0, '1',
  '', 0, '', '', 'zbooksoft.fams.delegate.FamsPublicOperations.afterImportCards', ''
from cnf_table where table_name = 'BUS_ASSET_CARD';
 
insert into cnf_import_column (import_column_id, import_template_id, column_name, display_name, excel_colunm, enable_not_null, enable_unique,
  enable_default_column, default_value, linked_data, linked_type, verification_expression, enable_formula, formula_expression, enable_coding,
  coding_id, sort_num, create_user_id, create_user_name, create_time, modify_time) values
(1800000000000002011, 1800000000000002010, 'ASSET_NO', '资产编号', '资产编号(有旧编号才填)', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 1, 1118460701772660737, '管理员', now(), now()),
(1800000000000002012, 1800000000000002010, 'ASSET_NAME', '资产名称', '资产名称', '1', '0', '0', '', '0', '', '', '0', '', '0', null, 2, 1118460701772660737, '管理员', now(), now()),
(1800000000000002013, 1800000000000002010, 'SPEC_MODEL', '规格型号', '规格型号', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 3, 1118460701772660737, '管理员', now(), now()),
(1800000000000002014, 1800000000000002010, 'CATEGORY_NAME', '资产类别', '资产类别(末级类别名称)', '1', '0', '0', '', '0', '', '', '0', '', '0', null, 4, 1118460701772660737, '管理员', now(), now()),
(1800000000000002015, 1800000000000002010, 'DEVICE_TYPE', '设备类型', '设备类型(普通设备/特种设备/计量设备)', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 5, 1118460701772660737, '管理员', now(), now()),
(1800000000000002016, 1800000000000002010, 'BRAND', '品牌', '品牌', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 6, 1118460701772660737, '管理员', now(), now()),
(1800000000000002017, 1800000000000002010, 'FACTORY_NO', '出厂编号', '出厂编号', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 7, 1118460701772660737, '管理员', now(), now()),
(1800000000000002018, 1800000000000002010, 'UNIT', '计量单位', '计量单位', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 8, 1118460701772660737, '管理员', now(), now()),
(1800000000000002019, 1800000000000002010, 'ORIGINAL_VALUE', '原值', '原值(元)', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 9, 1118460701772660737, '管理员', now(), now()),
(1800000000000002020, 1800000000000002010, 'PURCHASE_DATE', '购置日期', '购置日期', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 10, 1118460701772660737, '管理员', now(), now()),
(1800000000000002021, 1800000000000002010, 'SUPPLIER', '供应商', '供应商', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 11, 1118460701772660737, '管理员', now(), now()),
(1800000000000002022, 1800000000000002010, 'CONTRACT_NO', '合同号', '合同号', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 12, 1118460701772660737, '管理员', now(), now()),
(1800000000000002023, 1800000000000002010, 'ASSET_STATE', '资产状态', '资产状态(在用/闲置/借用/封存/维修/报废)', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 13, 1118460701772660737, '管理员', now(), now()),
(1800000000000002024, 1800000000000002010, 'START_USE_DATE', '启用日期', '启用日期', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 14, 1118460701772660737, '管理员', now(), now()),
(1800000000000002025, 1800000000000002010, 'USE_DEPT_NAME', '使用部门', '使用部门', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 15, 1118460701772660737, '管理员', now(), now()),
(1800000000000002026, 1800000000000002010, 'USER_NAME', '使用人', '使用人(姓名)', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 16, 1118460701772660737, '管理员', now(), now()),
(1800000000000002027, 1800000000000002010, 'LOCATION_NAME', '存放位置', '存放位置(完整位置,如 1号楼/3层/301室)', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 17, 1118460701772660737, '管理员', now(), now()),
(1800000000000002028, 1800000000000002010, 'WARRANTY_EXPIRE_DATE', '质保到期日', '质保到期日', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 18, 1118460701772660737, '管理员', now(), now()),
(1800000000000002029, 1800000000000002010, 'NEXT_MAINTAIN_DATE', '下次维保日期', '下次维保日期', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 19, 1118460701772660737, '管理员', now(), now()),
(1800000000000002030, 1800000000000002010, 'VERIFY_EXPIRE_DATE', '检定/年检到期日', '检定/年检到期日', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 20, 1118460701772660737, '管理员', now(), now()),
(1800000000000002031, 1800000000000002010, 'INSPECT_ORG', '检测机构', '检测机构', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 21, 1118460701772660737, '管理员', now(), now()),
(1800000000000002032, 1800000000000002010, 'CERT_NO', '证书编号', '证书编号', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 22, 1118460701772660737, '管理员', now(), now()),
(1800000000000002033, 1800000000000002010, 'SAFETY_USER_NAME', '安全责任人', '安全责任人(姓名)', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 23, 1118460701772660737, '管理员', now(), now()),
(1800000000000002034, 1800000000000002010, 'RISK_LEVEL', '风险等级', '风险等级(低/中/高)', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 24, 1118460701772660737, '管理员', now(), now()),
(1800000000000002035, 1800000000000002010, 'REMARK', '备注', '备注', '0', '0', '0', '', '0', '', '', '0', '', '0', null, 25, 1118460701772660737, '管理员', now(), now()),
(1800000000000002036, 1800000000000002010, 'SOURCE_TYPE', '资产来源', '资产来源', '0', '0', '1', 'Excel导入', '0', '', '', '0', '', '0', null, 26, 1118460701772660737, '管理员', now(), now());
 
select subtab_id, subtab_name, view_id, relation_columns, target_columns from cnf_subtab where subtab_id = 1800000000000002001;
select view_id, view_name, sql_where, row_click_event_type from cnf_view where view_id = 1800000000000002002;
select count(*) as subtab_view_columns from cnf_view_column where view_id = 1800000000000002002;
select operation_id, operation_name, display_name, permission_name from cnf_operation where operation_id = 1800000000000002004;
select import_template_id, import_template_name, table_Id, after_event from cnf_import_template;
select count(*) as import_columns from cnf_import_column where import_template_id = 1800000000000002010;