From 11bc2a4737a526b803959dfdd7c522b056425fe2 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期一, 09 三月 2026 09:54:13 +0800
Subject: [PATCH] fix: 日期判空操作,默认赋值当天日期
---
src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
index 48d3c28..31d9632 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
@@ -342,7 +342,18 @@
}
@Override
- public IPage<HashMap<String, Object>> queryProductInputAndOutput(Page page, ProductionProductMainDto productionProductMainDto) {
- return productionProductMainMapper.queryProductInputAndOutput(page, productionProductMainDto);
+ public IPage<HashMap<String, Object>> queryProductInputAndOutput(Page page, ProductionProductMainDto dto) {
+ if (isEmptyDate(dto.getStartTime())) {
+ dto.setStartTime(LocalDate.now().toString());
+ }
+ if (isEmptyDate(dto.getEndTime())) {
+ dto.setEndTime(LocalDate.now().plusDays(1).toString());
+ }
+
+ return productionProductMainMapper.queryProductInputAndOutput(page, dto);
+ }
+
+ private boolean isEmptyDate(String date) {
+ return date == null || date.trim().isEmpty() || "Invalid Date".equals(date);
}
}
--
Gitblit v1.9.3