Hand-Aurora-新功能注册脚本

新功能上线

清除默认赋值权限, 仅有管理员可见

-- 功能定义
declare
  o_function_id   number;
begin                                     
  sys_function_pkg.sys_function_load(p_function_code      => 'XX001',
                                     p_function_name      => '功能名称',
                                     p_parent_code        => null,
                                     p_type               => 'F', -- 功能
                                     p_service_name       => 'modules/xxx/XX001/xxx.lview',
                                     p_squence            => null,
                                     p_icon_path          => null,
                                     p_language_code      => userenv('lang'));
  select s.function_id into o_function_id from sys_function s where s.function_code = 'XX001';                                                                    
  dbms_output.put_line('新功能ID >> ' || o_function_id);
  -- 页面分配
  delete from sys_function_service s where s.function_id = o_function_id;
  insert into sys_function_service(function_id, service_id, creation_date, created_by, last_update_date, last_updated_by)
  select o_function_id, s.service_id, sysdate, 1368, sysdate, 1368
    from sys_service s
   where s.service_name in
   ('modules/xxx/XX001/xxx.lview',
    );
  -- 分配BM
  delete from sys_function_bm_access s where s.function_id = o_function_id;
  insert into sys_function_bm_access(access_id, function_id, bm_name, insert_option, update_option, query_option, delete_option, execute_option, created_by, creation_date, last_updated_by, last_update_date)
  values (sys_function_bm_access_s.nextval, o_function_id, 'xxx.XX001.xxx', 'Y','Y','Y','Y','Y',1368,sysdate,1368,sysdate);
end;   

功能注册脚本

页面注册

-- 路径, URL, 是否需要权限控制, 是否需要登录, 系统级
sys_service_pkg.sys_service_load('modules/rating/RATING001/cs_rating_data_handle.lsc', '商业伙伴评级', 0, 0, 0);

系统Code导出

将当前系统代码导出, 并输出到控制台, 方便迁移.

declare
  v_code                  varchar2(200);
begin
  dbms_output.put_line('begin');
  for c_sys_code in(select * from sys_code_values_v s where s.code in('FFM110_APPROVAL_STATUS')) loop
    if v_code is null or v_code <> c_sys_code.code then
      dbms_output.put_line('sys_code_pkg.insert_sys_code(p_code =>'|| hls_util_pkg.format_varchar2(c_sys_code.code)||',
                                   p_code_name =>'||hls_util_pkg.format_varchar2(c_sys_code.code_name)||',
                                   p_sys_flag =>'||hls_util_pkg.format_varchar2('N')||',
                                   p_code_prompt =>' ||''''',
                                   p_code_name_prompt =>'||''''',
                                   p_language_code =>'|| hls_util_pkg.format_varchar2('ZHS')||');');


   end if;
    dbms_output.put_line('sys_code_pkg.insert_sys_code_value(p_code =>'||hls_util_pkg.format_varchar2(c_sys_code.code)||',
                                       p_code_value =>'|| hls_util_pkg.format_varchar2(c_sys_code.code_value)||',
                                       p_code_value_name => '||hls_util_pkg.format_varchar2(c_sys_code.code_value_name)||',
                                       p_order_seq       => '||hls_util_pkg.format_number(c_sys_code.order_seq)||',
                                       p_language_code =>'|| hls_util_pkg.format_varchar2('ZHS')||');');
     v_code := c_sys_code.code;                 
  end loop;
  dbms_output.put_line('end ;');
end;

功能定义

将已经注册的页面进行功能定义, 并定义分配页面和BM

-- 功能定义
declare
  o_function_id   number;
begin                                     
  sys_function_pkg.sys_function_load(p_function_code      => 'XX001',
                                     p_function_name      => '功能名称',
                                     p_parent_code        => null,
                                     p_type               => 'F', -- 功能
                                     p_service_name       => 'modules/xxx/XX001/xxx.lview',
                                     p_squence            => null,
                                     p_icon_path          => null,
                                     p_language_code      => userenv('lang'));
  select s.function_id into o_function_id from sys_function s where s.function_code = 'XX001';                                                                    
  dbms_output.put_line('新功能ID >> ' || o_function_id);
  -- 页面分配
  delete from sys_function_service s where s.function_id = o_function_id;
  insert into sys_function_service(function_id, service_id, creation_date, created_by, last_update_date, last_updated_by)
  select o_function_id, s.service_id, sysdate, 1368, sysdate, 1368
    from sys_service s
   where s.service_name in
   ('modules/xxx/XX001/xxx.lview',
    );
  -- 分配BM
  delete from sys_function_bm_access s where s.function_id = o_function_id;
  insert into sys_function_bm_access(access_id, function_id, bm_name, insert_option, update_option, query_option, delete_option, execute_option, created_by, creation_date, last_updated_by, last_update_date)
  values (sys_function_bm_access_s.nextval, o_function_id, 'xxx.XX001.xxx', 'Y','Y','Y','Y','Y',1368,sysdate,1368,sysdate);
end;   
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值