Browse Source

图表排序,各部门序列号依次递增

main
Julin 2 years ago
parent
commit
1129b5c398
  1. 1
      code/pep-stats-report/app/db_helper.py
  2. 8
      code/pep-stats-report/main.py

1
code/pep-stats-report/app/db_helper.py

@ -181,4 +181,5 @@ SELECT user_name,
ROUND(AVG(procinst_duration_in_minutes) /60, 2) as procinst_duration_in_hours_by_user ROUND(AVG(procinst_duration_in_minutes) /60, 2) as procinst_duration_in_hours_by_user
from ({}) as r2 from ({}) as r2
group by r2.user_name group by r2.user_name
order by procinst_duration_in_hours_by_user DESC
""".format(querystring_user_procinst_duration(start, end, True, department)) """.format(querystring_user_procinst_duration(start, end, True, department))

8
code/pep-stats-report/main.py

@ -165,9 +165,13 @@ def add_chapter_2(doc):
departments_excluded = ['汇派-质量部', '汇派-生产部', '汇派-计划部', '汇派-人事部', '汇派-采购部', '党建工会', '工程项目中心', '北京技术中心'] departments_excluded = ['汇派-质量部', '汇派-生产部', '汇派-计划部', '汇派-人事部', '汇派-采购部', '党建工会', '工程项目中心', '北京技术中心']
for index, (department, elapse) in enumerate(procinst_duration_by_department): d = []
for department, elapse in procinst_duration_by_department:
if department not in departments_excluded: if department not in departments_excluded:
add_section(doc, index + 1, department, elapse) d.append((department, elapse))
for index, (department, elapse) in enumerate(d):
add_section(doc, index + 1, department, elapse)
def add_chapter_1(doc): def add_chapter_1(doc):

Loading…
Cancel
Save