磅房数据校验不能超过32天

This commit is contained in:
2024-09-24 17:35:38 +08:00
parent 4c4b07d004
commit 93a8cdc875

View File

@@ -90,6 +90,15 @@ public class WeightDeviceDataService
@SneakyThrows
public List<Map> checkLocalData(CheckLocalDataRequest requst) {
if (requst.getStart()!=null && requst.getEnd()!=null){
// 不能超过32天
if (requst.getStart().plusDays(32).isBefore(requst.getEnd())){
throw new BizException("时间范围不能超过32天");
}
}
List<WeightDeviceEntity> devices =
em.createQuery(
" from WeightDeviceEntity d where d.organizationId = :organizationId",