From 93a8cdc875385db1a525b03427d2339caeb914a7 Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Tue, 24 Sep 2024 17:35:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A3=85=E6=88=BF=E6=95=B0=E6=8D=AE=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E4=B8=8D=E8=83=BD=E8=B6=85=E8=BF=8732=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/WeightDeviceDataService.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/cn/lihongjie/coal/weightDeviceData/service/WeightDeviceDataService.java b/src/main/java/cn/lihongjie/coal/weightDeviceData/service/WeightDeviceDataService.java index ee456377..931e1730 100644 --- a/src/main/java/cn/lihongjie/coal/weightDeviceData/service/WeightDeviceDataService.java +++ b/src/main/java/cn/lihongjie/coal/weightDeviceData/service/WeightDeviceDataService.java @@ -90,6 +90,15 @@ public class WeightDeviceDataService @SneakyThrows public List checkLocalData(CheckLocalDataRequest requst) { + if (requst.getStart()!=null && requst.getEnd()!=null){ + + // 不能超过32天 + if (requst.getStart().plusDays(32).isBefore(requst.getEnd())){ + + throw new BizException("时间范围不能超过32天"); + } + } + List devices = em.createQuery( " from WeightDeviceEntity d where d.organizationId = :organizationId",