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