From 9ccc8bd3a53160a40cf60f14e5867f6ce9f6c58f Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期五, 26 十二月 2025 16:49:15 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
---
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 112 insertions(+), 6 deletions(-)
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
index a20f900..ad0c82b 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
@@ -1124,30 +1124,44 @@
// }
public Map<String, Object> teamOutputSv(Integer pageNum, Integer pageSize,
- String selectTime1, String selectTime2,
+ List<String> selectDate,
+ String reportTime,
String selectProcesses, TeamOutputDTO teamOutputDTO) {
if ("all".equals(selectProcesses)) {
selectProcesses = "";
}
+// 榛樿鏃堕棿鑼冨洿锛氳繃鍘� 15 澶╋紙鏃ユ湡 + reportTime锛�
+ String startDate = toReportTime(LocalDate.now().minusDays(15).toString(), reportTime);
+ String endDate = toReportTime(LocalDate.now().toString(), reportTime);
+ // 濡傛灉鍓嶇浼犱簡鏃堕棿锛屽氨鐢ㄥ墠绔棩鏈� + reportTime
+ if (selectDate != null && selectDate.size() == 2) {
+ if (selectDate.get(0) != null && !selectDate.get(0).isEmpty()) {
+ startDate = toReportTime(selectDate.get(0), reportTime);
+ }
+ if (selectDate.get(1) != null && !selectDate.get(1).isEmpty()) {
+ endDate = toReportTime(selectDate.get(1), reportTime);
+ }
+ }
Integer offset = (pageNum - 1) * pageSize;
Map<String, Object> result = new HashMap<>();
String laminating = reportMapper.getLaminating(selectProcesses);
-
+ String finalStartDate = startDate;
+ String finalEndDate = endDate;
String finalSelectProcesses = selectProcesses;
CompletableFuture<List<TeamOutputDTO>> dataFuture = asyncExecutor.runAsync(() ->
- reportMapper.teamOutputMp(offset, pageSize, selectTime1, selectTime2, finalSelectProcesses, laminating, teamOutputDTO));
+ reportMapper.teamOutputMp(offset, pageSize, finalStartDate, finalEndDate, finalSelectProcesses, laminating, teamOutputDTO));
CompletableFuture<List<Map<String, String>>> processFuture = asyncExecutor.runAsync(() ->
productionSchedulingMapper.selectProcess());
CompletableFuture<Map<String, Integer>> totalFuture = asyncExecutor.runAsync(() ->
- reportMapper.teamOutputPageTotal(offset, pageSize, selectTime1, selectTime2, finalSelectProcesses, laminating, teamOutputDTO));
+ reportMapper.teamOutputPageTotal(offset, pageSize, finalStartDate, finalEndDate, finalSelectProcesses, laminating, teamOutputDTO));
CompletableFuture<Map<String, Float>> footSumFuture = asyncExecutor.runAsync(() ->
- reportMapper.teamOutputFootSum(selectTime1, selectTime2, finalSelectProcesses, laminating, teamOutputDTO));
+ reportMapper.teamOutputFootSum(finalStartDate, finalEndDate, finalSelectProcesses, laminating, teamOutputDTO));
// 绛夊緟鎵�鏈変换鍔″畬鎴�
CompletableFuture.allOf(dataFuture, processFuture, totalFuture, footSumFuture).join();
@@ -1161,7 +1175,10 @@
e.printStackTrace();
throw new RuntimeException("骞惰鏌ヨ寮傚父锛�" + e.getMessage(), e);
}
-
+ List<String> list = new ArrayList<>();
+ list.add(startDate);
+ list.add(endDate);
+ result.put("selectDate", list);
return result;
}
@@ -1188,6 +1205,34 @@
}
String laminating = reportMapper.getLaminating(process);
List<TeamOutputDTO> list = reportMapper.exportTeamOutputMp(date, process, laminating);
+
+ // 娓呮礂姣忎釜 TeamOutputDTO 瀹炰緥鐨� String 瀛楁锛堝幓闄ゅ墠鍚庣┖鏍硷級
+ for (TeamOutputDTO dto : list) {
+ for (Field field : dto.getClass().getDeclaredFields()) {
+ field.setAccessible(true);
+ try {
+ Object value = field.get(dto);
+ if (value instanceof String) {
+ String trimmed = ((String) value).trim();
+ field.set(dto, trimmed);
+ }
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ return list;
+ }
+
+ public List exportTeamOutputSummarySv(Map<String, Object> dates) {
+ List<LocalDate> date= (List<LocalDate>) dates.get("date");
+ String process= (String) dates.get("processes");
+ if (process.equals("all")){
+ process="";
+ }
+ String laminating = reportMapper.getLaminating(process);
+ List<TeamOutputDTO> list = reportMapper.exportTeamOutputSummaryMp(date, process, laminating);
// 娓呮礂姣忎釜 TeamOutputDTO 瀹炰緥鐨� String 瀛楁锛堝幓闄ゅ墠鍚庣┖鏍硷級
for (TeamOutputDTO dto : list) {
@@ -1752,4 +1797,65 @@
return map;
}
+
+ public Map<String, Object> TeamOutputSummarySv(Integer pageNum, Integer pageSize, List<String> selectDate,
+ String reportTime, String selectProcesses, TeamOutputDTO teamOutputDTO) {
+ if ("all".equals(selectProcesses)) {
+ selectProcesses = "";
+ }
+
+ Integer offset = (pageNum - 1) * pageSize;
+
+ // 榛樿鏃堕棿鑼冨洿锛氳繃鍘� 15 澶╋紙鏃ユ湡 + reportTime锛�
+ String startDate = toReportTime(LocalDate.now().minusDays(15).toString(), reportTime);
+ String endDate = toReportTime(LocalDate.now().toString(), reportTime);
+
+ // 濡傛灉鍓嶇浼犱簡鏃堕棿锛屽氨鐢ㄥ墠绔棩鏈� + reportTime
+ if (selectDate != null && selectDate.size() == 2) {
+ if (selectDate.get(0) != null && !selectDate.get(0).isEmpty()) {
+ startDate = toReportTime(selectDate.get(0), reportTime);
+ }
+ if (selectDate.get(1) != null && !selectDate.get(1).isEmpty()) {
+ endDate = toReportTime(selectDate.get(1), reportTime);
+ }
+ }
+ Map<String, Object> result = new HashMap<>();
+
+ String laminating = reportMapper.getLaminating(selectProcesses);
+
+ String finalSelectProcesses = selectProcesses;
+ String finalStartDate = startDate;
+ String finalEndDate = endDate;
+ CompletableFuture<List<TeamOutputDTO>> dataFuture = asyncExecutor.runAsync(() ->
+ reportMapper.TeamOutputSummaryMp(offset, pageSize, finalStartDate, finalEndDate, finalSelectProcesses, laminating, teamOutputDTO));
+
+ CompletableFuture<List<Map<String, String>>> processFuture = asyncExecutor.runAsync(() ->
+ productionSchedulingMapper.selectProcess());
+
+ CompletableFuture<Map<String, Integer>> totalFuture = asyncExecutor.runAsync(() ->
+ reportMapper.teamOutputSummaryPageTotal(offset, pageSize, finalStartDate, finalEndDate, finalSelectProcesses, laminating, teamOutputDTO));
+
+
+
+ CompletableFuture<Map<String, Float>> footSumFuture = asyncExecutor.runAsync(() ->
+ reportMapper.teamOutputFootSum(finalStartDate, finalEndDate, finalSelectProcesses, laminating, teamOutputDTO));
+
+ // 绛夊緟鎵�鏈変换鍔″畬鎴�
+ CompletableFuture.allOf(dataFuture, processFuture, totalFuture, footSumFuture).join();
+
+ try {
+ result.put("data", dataFuture.get());
+ result.put("process", processFuture.get());
+ result.put("total", totalFuture.get());
+ result.put("footSum", footSumFuture.get());
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RuntimeException("骞惰鏌ヨ寮傚父锛�" + e.getMessage(), e);
+ }
+ List<String> list = new ArrayList<>();
+ list.add(startDate);
+ list.add(endDate);
+ result.put("selectDate", list);
+ return result;
+ }
}
--
Gitblit v1.8.0