Compare commits
4 Commits
cbed4dc2a3
...
9a393fe7dc
| Author | SHA1 | Date | |
|---|---|---|---|
| 9a393fe7dc | |||
| a2468099c2 | |||
| 1a0dc9c982 | |||
| 173e22a58e |
@@ -283,7 +283,7 @@ public class ArBillController extends BaseController {
|
||||
/**
|
||||
* 下载已成功生成的导出文件;文件内容由服务层从临时文件或配置存储读取。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ar:bill:export')")
|
||||
@PreAuthorize("@ss.hasPermi('ar:bill:download')")
|
||||
@GetMapping("/export/{exportId}/download")
|
||||
public void download(@PathVariable Long exportId, HttpServletResponse response) throws Exception {
|
||||
billService.downloadExport(exportId, response);
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ public class ProductController extends BaseController
|
||||
return success(task);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:product:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('price:product:query')")
|
||||
@GetMapping("/{productCode}/countries")
|
||||
public AjaxResult countries(@PathVariable String productCode,
|
||||
@RequestParam(required = false) Date effectiveDate,
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
-- 应收账单导出与下载权限拆分
|
||||
-- ar:bill:export 继续用于账单列表导出和发起账单明细导出。
|
||||
-- 新增 ar:bill:download 用于下载已生成的账单明细文件。
|
||||
-- 新权限仅在首次创建时继承原 ar:bill:export 角色授权,后续可由管理员独立调整。
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
UPDATE sys_menu
|
||||
SET menu_name = '账单导出',
|
||||
remark = '应收账单列表导出及账单明细导出任务'
|
||||
WHERE perms = 'ar:bill:export';
|
||||
|
||||
SET @ar_bill_download_perm_created = 0;
|
||||
|
||||
INSERT INTO sys_menu (
|
||||
menu_name, parent_id, order_num, path, component, query, route_name,
|
||||
is_frame, is_cache, menu_type, visible, status, perms, icon,
|
||||
create_by, create_time, remark
|
||||
)
|
||||
SELECT '账单下载', export_menu.parent_id,
|
||||
(SELECT COALESCE(MAX(order_num), 0) + 1
|
||||
FROM sys_menu child_menu
|
||||
WHERE child_menu.parent_id = export_menu.parent_id),
|
||||
'', '', '', '', 1, 0, 'F', '0', '0', 'ar:bill:download', '#',
|
||||
'admin', NOW(), '应收账单明细文件下载'
|
||||
FROM sys_menu export_menu
|
||||
WHERE export_menu.perms = 'ar:bill:export'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM sys_menu WHERE perms = 'ar:bill:download'
|
||||
)
|
||||
ORDER BY export_menu.menu_id
|
||||
LIMIT 1;
|
||||
|
||||
SET @ar_bill_download_perm_created = ROW_COUNT();
|
||||
|
||||
-- 初次拆分时保持现有导出角色原有下载能力;后续角色可独立增删此权限。
|
||||
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||
SELECT DISTINCT export_grant.role_id, download_menu.menu_id
|
||||
FROM sys_role_menu export_grant
|
||||
JOIN sys_menu export_menu ON export_menu.menu_id = export_grant.menu_id
|
||||
JOIN sys_menu download_menu ON download_menu.perms = 'ar:bill:download'
|
||||
WHERE export_menu.perms = 'ar:bill:export'
|
||||
AND @ar_bill_download_perm_created > 0
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM sys_role_menu existing_grant
|
||||
WHERE existing_grant.role_id = export_grant.role_id
|
||||
AND existing_grant.menu_id = download_menu.menu_id
|
||||
);
|
||||
|
||||
COMMIT;
|
||||
|
||||
-- 核对权限菜单及角色授权结果。
|
||||
SELECT menu_id, menu_name, parent_id, order_num, menu_type, perms, remark
|
||||
FROM sys_menu
|
||||
WHERE perms IN ('ar:bill:export', 'ar:bill:download')
|
||||
ORDER BY parent_id, order_num, menu_id;
|
||||
|
||||
SELECT r.role_id, r.role_name, m.menu_name, m.perms
|
||||
FROM sys_role_menu rm
|
||||
JOIN sys_role r ON r.role_id = rm.role_id
|
||||
JOIN sys_menu m ON m.menu_id = rm.menu_id
|
||||
WHERE m.perms IN ('ar:bill:export', 'ar:bill:download')
|
||||
ORDER BY r.role_id, m.perms;
|
||||
@@ -67,7 +67,7 @@
|
||||
<el-table-column prop="remark" label="失败原因" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="exportBy" label="导出人" width="100" />
|
||||
<el-table-column prop="exportTime" label="导出时间" width="170" />
|
||||
<el-table-column label="操作" width="90"><template #default="{ row }"><el-button v-if="row.exportStatus === AR_EXPORT_STATUS.SUCCESS" link type="primary" @click="$emit('download', row)">下载</el-button></template></el-table-column>
|
||||
<el-table-column label="操作" width="90"><template #default="{ row }"><el-button v-if="row.exportStatus === AR_EXPORT_STATUS.SUCCESS" link type="primary" v-hasPermi="['ar:bill:download']" @click="$emit('download', row)">下载</el-button></template></el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user