From 3728fa293e1faf4bf4f9bf41105b84ddb43dc82e Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期一, 02 十一月 2026 16:53:02 +0800
Subject: [PATCH] feat(order-rates): 新增筛选条件下全部订单费用汇总接口

---
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsProductServiceImpl.java |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsProductServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsProductServiceImpl.java
index ed0e8e7..b59afae 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsProductServiceImpl.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsProductServiceImpl.java
@@ -77,7 +77,24 @@
             if (snapshot == null) {
                 throw new ErrorException("鏈壘鍒板綋鍓嶆ā鏉跨殑鍘熷璁板綍蹇収");
             }
-            boolean hasSnapshotField = dto.isTemperaturePresent() || dto.isDetectionTimePresent()
+            boolean hasDetectionRange = dto.isDetectionTimePresent() || dto.isDetectionEndTimePresent();
+            if (hasDetectionRange) {
+                if (!dto.isDetectionTimePresent()) {
+                    throw new ErrorException("璇烽�夋嫨瀹屾暣鐨勬娴嬫椂闂磋寖鍥�");
+                }
+                // 鍏煎鏃у鎴风鍙彁浜ゅ崟涓棩鏈燂紱鏂板鎴风蹇呴』鍚屾椂鎻愪氦璧锋鏃ユ湡鎴栧悓鏃舵竻绌恒��
+                if (!dto.isDetectionEndTimePresent()) {
+                    dto.setDetectionEndTime(dto.getDetectionTime());
+                }
+                if ((dto.getDetectionTime() == null) != (dto.getDetectionEndTime() == null)) {
+                    throw new ErrorException("璇烽�夋嫨瀹屾暣鐨勬娴嬫椂闂磋寖鍥�");
+                }
+                if (dto.getDetectionTime() != null
+                        && dto.getDetectionEndTime().isBefore(dto.getDetectionTime())) {
+                    throw new ErrorException("妫�娴嬬粨鏉熸棩鏈熶笉鑳芥棭浜庡紑濮嬫棩鏈�");
+                }
+            }
+            boolean hasSnapshotField = dto.isTemperaturePresent() || hasDetectionRange
                     || dto.isDetectionPlacePresent()
                     || dto.isInsResultPresent();
             if (hasSnapshotField) {
@@ -88,6 +105,8 @@
                                         InsOrderStandardTemplate::getTemperature, dto.getTemperature())
                                 .set(dto.isDetectionTimePresent(),
                                         InsOrderStandardTemplate::getDetectionTime, dto.getDetectionTime())
+                                .set(hasDetectionRange,
+                                        InsOrderStandardTemplate::getDetectionEndTime, dto.getDetectionEndTime())
                                 .set(dto.isDetectionPlacePresent(),
                                         InsOrderStandardTemplate::getDetectionPlace, dto.getDetectionPlace())
                                 .set(dto.isInsResultPresent(),

--
Gitblit v1.9.3