From 49120f2b9db33455756a911e56cfefd7c3120a14 Mon Sep 17 00:00:00 2001
From: sinake <sinake1@qq.com>
Date: 星期三, 28 十月 2026 17:05:36 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/SpStatCaseController.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/SpStatCaseController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/SpStatCaseController.java
index 713cfb3..f6877a3 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/SpStatCaseController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/SpStatCaseController.java
@@ -72,5 +72,58 @@
return getDataTable(spstatCaseService.getListBypower(spStatCaseReq));
}
+ /**
+ * 瀵煎嚭妗堜緥缁熻
+ */
+ @ApiOperation("瀵煎嚭妗堜緥缁熻")
+ @Log(title = "妗堜緥缁熻", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(SpStatCaseReq spStatCaseReq) {
+ List<SpStatCase> list = spstatCaseService.getListBypower(spStatCaseReq);
+ ExcelUtil<SpStatCase> util = new ExcelUtil<SpStatCase>(SpStatCase.class);
+ return util.exportExcel(list, "妗堜緥缁熻鏁版嵁");
+ }
+
+ /**
+ * 瀵煎嚭妗堜緥缁熻锛堟寜涓氬姟缁勶級
+ */
+ @ApiOperation("瀵煎嚭妗堜緥缁熻锛堟寜涓氬姟缁勶級")
+ @Log(title = "妗堜緥缁熻", businessType = BusinessType.EXPORT)
+ @GetMapping("/exportDept")
+ public AjaxResult exportDept(SpStatCaseReq spStatCaseReq) {
+ List<SpStatCase> list = spstatCaseService.getListBypower(spStatCaseReq);
+ Map<String, SpStatCaseDept> grouped = new LinkedHashMap<String, SpStatCaseDept>();
+ for (SpStatCase row : list) {
+ String key = StringUtils.isNotEmpty(row.getDeptid()) ? row.getDeptid() : row.getDeptname();
+ if (key == null) {
+ key = "";
+ }
+ SpStatCaseDept dept = grouped.get(key);
+ if (dept == null) {
+ dept = new SpStatCaseDept();
+ dept.setDeptname(row.getDeptname() == null ? "鏈垎缁�" : row.getDeptname());
+ dept.setCaseTotal(0);
+ dept.setTerminationTotal(0);
+ grouped.put(key, dept);
+ }
+ dept.setCaseTotal(dept.getCaseTotal() + toInt(row.getWorkflowsum()));
+ dept.setTerminationTotal(dept.getTerminationTotal() + toInt(row.getTerminationcase()));
+ }
+ List<SpStatCaseDept> result = new ArrayList<SpStatCaseDept>(grouped.values());
+ ExcelUtil<SpStatCaseDept> util = new ExcelUtil<SpStatCaseDept>(SpStatCaseDept.class);
+ return util.exportExcel(result, "妗堜緥缁熻锛堟寜涓氬姟缁勶級");
+ }
+
+ private int toInt(String value) {
+ if (StringUtils.isEmpty(value)) {
+ return 0;
+ }
+ try {
+ return Integer.parseInt(value.trim());
+ } catch (NumberFormatException e) {
+ return 0;
+ }
+ }
+
}
--
Gitblit v1.9.3