优化 queryFirePointBroadcast
This commit is contained in:
parent
722300950d
commit
e07ed9ecc1
@ -14,6 +14,7 @@ import com.xkrs.utils.FirePointCodeUtils;
|
|||||||
import org.apache.hc.core5.util.TextUtils;
|
import org.apache.hc.core5.util.TextUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
import org.springframework.data.jpa.domain.Specification;
|
import org.springframework.data.jpa.domain.Specification;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -37,6 +38,17 @@ public class FirePointQueryManager {
|
|||||||
@Resource
|
@Resource
|
||||||
private FirePointPreciseDao firePointPreciseDao;
|
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<FirePointPreciseEntity> firePointList = firePointPreciseDao.findAll(pageRequest).getContent();
|
||||||
|
List<AllFirePointVo> 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) {
|
public FirePointQueryResultBean queryFirePointBelongToUser(SysUserEntity sysUserEntity, String userSubAreaCountyCode, String startTime, String endTime, String satelliteType, String landType) {
|
||||||
String countyCode = sysUserEntity.getCountyCode();
|
String countyCode = sysUserEntity.getCountyCode();
|
||||||
String vipTimeRangeJson = sysUserEntity.getVipTimeRangeJson();
|
String vipTimeRangeJson = sysUserEntity.getVipTimeRangeJson();
|
||||||
|
Loading…
Reference in New Issue
Block a user