From 0406c675e143bbb08284fd55381261afcc587afc Mon Sep 17 00:00:00 2001
From: chen.llin <1442464845@qq.comm>
Date: 星期日, 18 一月 2026 15:51:36 +0800
Subject: [PATCH] 月结增加明细
---
src/main/java/com/zy/asrs/service/impl/MonthlySettleServiceImpl.java | 49 +++++++++++++++++++++++++++----------------------
1 files changed, 27 insertions(+), 22 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/MonthlySettleServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MonthlySettleServiceImpl.java
index fcd629b..7e14911 100644
--- a/src/main/java/com/zy/asrs/service/impl/MonthlySettleServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MonthlySettleServiceImpl.java
@@ -395,12 +395,35 @@
throw new CoolException("鏈堢粨璁板綍涓嶅瓨鍦�");
}
- // 鍏宠仈鐗╂枡琛ㄦ煡璇㈡槑缁�
+ // 鍏宠仈鐗╂枡琛ㄦ煡璇㈡槑缁嗭紙姹囨�伙級
List<MonthlySettleDetail> details = monthlySettleDetailMapper.selectDetailWithMat(settleId);
+
+ // 鏌ヨ鏄庣粏娴佹按锛堣鍗曟槑缁嗭級
+ List<com.zy.asrs.entity.result.MonthlySettleDetailFlowVO> pakinFlows = this.baseMapper.selectDetailFlowFromPakin(settleId);
+ List<com.zy.asrs.entity.result.MonthlySettleDetailFlowVO> pakoutFlows = this.baseMapper.selectDetailFlowFromPakout(settleId);
+
+ // 鍚堝苟鍏ュ簱鍜屽嚭搴撶殑鏄庣粏娴佹按
+ List<com.zy.asrs.entity.result.MonthlySettleDetailFlowVO> detailFlows = new java.util.ArrayList<>();
+ if (pakinFlows != null && !pakinFlows.isEmpty()) {
+ detailFlows.addAll(pakinFlows);
+ }
+ if (pakoutFlows != null && !pakoutFlows.isEmpty()) {
+ detailFlows.addAll(pakoutFlows);
+ }
+
+ // 鎸変笟鍔℃椂闂村拰璁㈠崟缂栧彿鎺掑簭
+ detailFlows.sort((a, b) -> {
+ int timeCompare = (a.getOrderTime() != null ? a.getOrderTime() : "").compareTo(b.getOrderTime() != null ? b.getOrderTime() : "");
+ if (timeCompare != 0) {
+ return timeCompare;
+ }
+ return (a.getOrderNo() != null ? a.getOrderNo() : "").compareTo(b.getOrderNo() != null ? b.getOrderNo() : "");
+ });
MonthlySettleStatisticsVO result = new MonthlySettleStatisticsVO();
result.setSettle(settle);
result.setDetails(details);
+ result.setDetailFlows(detailFlows);
return result;
}
@@ -424,25 +447,9 @@
}
wrapper.orderBy("create_time", false);
- List<MonthlySettle> list = this.selectList(wrapper);
-
- EntityWrapper<MonthlySettle> countWrapper = new EntityWrapper<>();
- countWrapper.eq("is_deleted", 0);
- if (condition != null) {
- if (condition.get("settleNo") != null) {
- countWrapper.like("settle_no", condition.get("settleNo").toString());
- }
- if (condition.get("status") != null) {
- countWrapper.eq("status", condition.get("status"));
- }
- if (condition.get("startDate") != null && condition.get("endDate") != null) {
- countWrapper.ge("start_date", condition.get("startDate"));
- countWrapper.le("end_date", condition.get("endDate"));
- }
- }
- page.setRecords(list);
- page.setTotal(this.selectCount(countWrapper));
- return page;
+ // 浣跨敤鍒嗛〉鏌ヨ锛屽湪鏁版嵁搴撳眰闈㈣繘琛屽垎椤碉紝鑰屼笉鏄煡璇㈡墍鏈夎褰�
+ Page<MonthlySettle> resultPage = this.selectPage(page, wrapper);
+ return resultPage;
}
/**
@@ -498,8 +505,6 @@
detail.setInQty(inQty);
detail.setOutQty(outQty);
detail.setEndingQty(endingQty);
- // stock_qty 瀛楁宸插簾寮冿紝瀹為檯搴撳瓨绛変簬鏈熸湯搴撳瓨锛屼笉鍐嶅崟鐙瓨鍌�
- // detail.setStockQty(endingQty);
detail.setDiffQty(diffQty);
// 鏃堕棿淇℃伅
detail.setCreateTime(new Date());
--
Gitblit v1.9.1