-- 1、市级和省级,权限全部开发。除批复、民警 -- 2、批复、民警,设置对应的权限 -- 3、区、派出所,打回、打印、批复审批 TRUNCATE permission; # 清空内置角色 update police_role set active =false where roletype ='001'; #管理员默认权限 INSERT INTO`permission` (`native_code`, `role_id`, `module_id`, `operation_id`, `roletype`) select '61',1,module_id,id,'2' from operation; -- 1、市级和省级,权限全部开发。除批复、民警 INSERT INTO`permission` (`native_code`, `role_id`, `module_id`, `operation_id`, `roletype`) select '61',pr.id,o.module_id,o.id,'2' from police_role pr,police p,operation o where pr.active=true and p.active=TRUE and o.active=TRUE and pr.orgid=p.id and p.orgtype in (1,2) and o.id not in (249,256) -- 批复意见 and o.id not in (250,257) -- 上传批复文件 and o.id not in (251,258,316) -- 制证 and o.id not in (254,259,317,318,248,252,293,294,296,297,298,272,320,321,322,295,298,321); -- 打印 -- 保安服务公司许可审批:批复意见 sponsorlicense:replyidea 249 -- 保安培训单位许可审批:批复意见 traincompanyapply:replyidea 256 -- 保安服务公司许可审批:上传批复文件 sponsorlicense:replyfile 250 -- 保安培训单位许可审批:上传批复文件 traincompanyapply:replyfile 257 -- 保安服务公司许可审批:制证 sponsorlicense:certificate 251 -- 保安培训单位许可审批:制证 traincompanyapply:certificate 258 -- 保安服务(培训)许可证项目变更:制证 legalchange:certificate 316 -- 2、省市级机构角色 批复、民警,设置对应的权限 #新增制证角色 INSERT INTO`police_role` (`active`, `create_time`, `update_time`, `update_by`, `creater`, `createrorg`, `rolename`, `roledesc`, `oprole`, `datarole`, `orgname`, `orgid`, `usernum`, `authtype`, `roletype`, `updateflag`) select DISTINCT true, now(), NOW(), 'system', '系统管理员', '系统管理员', '制证角色', '制证角色', '1', '1', p.orgname, p.id, '0', '3',null, '\0' from `user` u,police p where u.active=true and p.active=true and u.platform=1 and u.orgid=p.id and p.orgtype in (1,2) and u.policeman=TRUE; #插入制证权限 INSERT INTO`permission` (`native_code`, `role_id`, `module_id`, `operation_id`, `roletype`) select '61',pr.id,o.module_id,o.id,'2' from police_role pr,police p,operation o where pr.active=true and p.active=TRUE and o.active=TRUE and pr.orgid=p.id and pr.rolename = '制证角色' and p.orgtype in (1,2) and o.id in (251,258,316); -- 制证 #新增上传批复文件角色 INSERT INTO`police_role` (`active`, `create_time`, `update_time`, `update_by`, `creater`, `createrorg`, `rolename`, `roledesc`, `oprole`, `datarole`, `orgname`, `orgid`, `usernum`, `authtype`, `roletype`, `updateflag`) select DISTINCT true, now(), NOW(), 'system', '系统管理员', '系统管理员', '上传批复文件角色', '上传批复文件角色', '1', '1', p.orgname, p.id, '0', '3', null, '\0' from `user` u,police p where u.active=true and p.active=true and u.platform=1 and u.orgid=p.id and p.orgtype in (1,2) and u.policeman=TRUE; #插入上传批复文件权限 INSERT INTO`permission` (`native_code`, `role_id`, `module_id`, `operation_id`, `roletype`) select '61',pr.id,o.module_id,o.id,'2' from police_role pr,police p,operation o where pr.active=true and p.active=TRUE and o.active=TRUE and pr.orgid=p.id and pr.rolename = '上传批复文件角色' and p.orgtype in (1,2) and o.id in (250,257); -- 上传批复文件 #插入批复意见权限(根据config中配置的处长角色id) INSERT INTO`permission` (`native_code`, `role_id`, `module_id`, `operation_id`, `roletype`) select '61',c.`value`,o.module_id,o.id,'2' from config c,operation o where c.active=true and `key`='czjsid' and o.active=TRUE and o.id in (249,256); -- 批复意见 -- 3、区、派出所,除批复、民警 以及 除了 打回、打印、批量审批 INSERT INTO`permission` (`native_code`, `role_id`, `module_id`, `operation_id`, `roletype`) select '61',pr.id,o.module_id,o.id,'2' from police_role pr,police p,operation o where pr.active=true and p.active=TRUE and o.active=TRUE and pr.orgid=p.id and p.orgtype in (3,4) and o.id not in (249,256) -- 批复意见 and o.id not in (250,257) -- 上传批复文件 and o.id not in (251,258,316) -- 制证 and o.id not in (254,259,317,318,248,252,293,294,296,297,298,272,320,321,322,295,298,321) -- 打印 and o.id not in (242) -- 打回 and o.id not in (211); -- 批量审批 -- 67 保安培训单位许可审批:打印详情 traincompanyapply:printDetail 254 -- 67 保安培训单位许可审批:打印处理签 traincompanyapply:printDispose 259 -- 71 保安服务(培训)许可证项目变更:打印详细 legalchange:printDetail 317 -- 71 保安服务(培训)许可证项目变更:打印处理签 legalchange:printHandle 318 -- 114 保安服务公司许可审批:打印详细 sponsorlicense:printDetail 248 -- 114 保安服务公司许可审批:打印处理签 sponsorlicense:printDispose 252 -- 130 保安服务公司许可证打印:打印 sponsorlicensePrint:print 293 -- 130 保安服务公司许可证打印:下载PDF文件 sponsorlicensePrint:download 294 -- 131 保安培训单位许可证打印:打印 traincompanyapplyPrint:print 296 -- 131 保安培训单位许可证打印:下载PDF traincompanyapplyPrint:download 297 -- 131 保安培训单位许可证打印:修改 traincompanyapplyPrint:edit 298 -- 135 保安员资格证打印:打印 personcertificatePrint:print 272 -- 140 保安服务(培训许可变更打印):下载PDF legalchangePrint:download 320 -- 140 保安服务(培训许可变更打印):修改 legalchangePrint:edit 321 -- 140 保安服务(培训许可变更打印):打印 legalchangePrint:print 322 -- 134 保安员资格证考试报名:打回 personcertificate:repulse 242 -- 165 审批事项:批量审批通过 todoList:batchApproval 211 -- 打印权限 INSERT INTO`permission` (`native_code`, `role_id`, `module_id`, `operation_id`, `roletype`) select '61',pr.id,o.module_id,o.id,'2' from police_role pr,operation o where pr.active=true and o.active=TRUE and pr.id in(10530,10531,10532,10533,10534,605) -- 榆林打证\宝鸡打证角色\保安许可打印员\咸阳打证\省厅科长 and o.id in (254,259,317,318,248,252,293,294,296,297,298,272,320,321,322,295,298,321) -- 打印