From e07ed9ecc14afd8b7eb15c2106b46dea6ffeb318 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Tue, 7 Mar 2023 09:57:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20queryFirePointBroadcast?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xkrs/straw/utils/FirePointQueryManager.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/xkrs/straw/utils/FirePointQueryManager.java b/src/main/java/com/xkrs/straw/utils/FirePointQueryManager.java index f146c7a..7cc2e5f 100644 --- a/src/main/java/com/xkrs/straw/utils/FirePointQueryManager.java +++ b/src/main/java/com/xkrs/straw/utils/FirePointQueryManager.java @@ -14,6 +14,7 @@ import com.xkrs.utils.FirePointCodeUtils; import org.apache.hc.core5.util.TextUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Component; @@ -37,6 +38,17 @@ public class FirePointQueryManager { @Resource private FirePointPreciseDao firePointPreciseDao; + public FirePointQueryResultBean queryFirePointBroadcast(Integer limit) { + int size = (limit != null && limit > 0) ? limit : 10; + PageRequest pageRequest = PageRequest.of(1, size, Sort.by(Sort.Direction.DESC, "satelliteTime")); + List firePointList = firePointPreciseDao.findAll(pageRequest).getContent(); + List resultList = new ArrayList<>(); + for (FirePointPreciseEntity firePoint : firePointList) { + resultList.add(FirePointConvertUtils.convert(firePoint)); + } + return new FirePointQueryResultBean(true, "", resultList, resultList.size()); + } + public FirePointQueryResultBean queryFirePointBelongToUser(SysUserEntity sysUserEntity, String userSubAreaCountyCode, String startTime, String endTime, String satelliteType, String landType) { String countyCode = sysUserEntity.getCountyCode(); String vipTimeRangeJson = sysUserEntity.getVipTimeRangeJson();