feat(project): show business fields in statistics details
Reuse assignment business columns and keyword searches in the four statistics drill-down lists. Add a statistics-permission read endpoint sharing tenant-scoped detail queries without granting assignment access. Related to issue #13. Independent static review completed. User self-test arrangement: regression cases authored, no tests or builds executed.
This commit is contained in:
1 parent
f04e24186f
commit
fa5efa9629
7 files changed
+106
-8
No files matched your search
@@ -1,4 +1,4 @@
|
||||
"""历史归属维护专用检索;统计明细不返回业务联系信息。"""
|
||||
"""项目业务明细检索;统计读取与归属维护分别校验菜单权限。"""
|
||||
from collections import defaultdict
|
||||
|
||||
from fastapi import HTTPException
|
||||
@@ -162,8 +162,17 @@ def business_details(db, tenant, kind, rows):
|
||||
|
||||
def records(db, tenant, user, biz_type, page=1, pageSize=20, **filters):
|
||||
projects.check_permission(db, tenant, user, 'project:assignment:edit')
|
||||
return _records(db, tenant, user, biz_type, page, pageSize, **filters)
|
||||
|
||||
|
||||
def statistics_records(db, tenant, user, biz_type, page=1, pageSize=20, **filters):
|
||||
projects.check_permission(db, tenant, user, 'project:statistics:list')
|
||||
return _records(db, tenant, user, biz_type, page, pageSize, **filters)
|
||||
|
||||
|
||||
def _records(db, tenant, user, biz_type, page, pageSize, **filters):
|
||||
if biz_type not in projects.COUNT_TYPES:
|
||||
raise HTTPException(400, '归属维护仅支持四类正式业务')
|
||||
raise HTTPException(400, '业务明细仅支持四类正式业务')
|
||||
model, number, status = projects.BUSINESS[biz_type]
|
||||
# 继续使用现有租户、主单数据范围、项目/项目组和日期条件。
|
||||
query = projects.filtered_query(db, tenant, user, biz_type, {**filters, 'keyword': None})
|
||||
|
||||
Reference in new issue
Block a user