From b58d06d680cccf516aeb16e5080af8965e042353 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Thu, 13 Apr 2023 09:04:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=81=AB=E7=82=B9=E9=87=8D=E6=9E=84-=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E9=98=B2=E7=81=AB=E5=AD=A3=E8=AE=A2=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/xkrs/helper/FirePointQueryManager.java | 8 ++++++++ .../xkrs/service/impl/DispatchFirePointServiceImpl.java | 3 ++- src/main/java/com/xkrs/utilsnew/VipTimeRangeUtils.java | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/xkrs/helper/FirePointQueryManager.java b/src/main/java/com/xkrs/helper/FirePointQueryManager.java index 2840d0a..6d0efb5 100644 --- a/src/main/java/com/xkrs/helper/FirePointQueryManager.java +++ b/src/main/java/com/xkrs/helper/FirePointQueryManager.java @@ -6,6 +6,7 @@ import com.xkrs.model.entity.FirePointOrdinaryEntity; import com.xkrs.model.entity.SysUserEntity; import com.xkrs.utilsnew.DateTimeUtils; import com.xkrs.utilsnew.FirePointCodeUtils; +import com.xkrs.utilsnew.VipTimeRangeUtils; import org.apache.hc.core5.util.TextUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -89,6 +90,13 @@ public class FirePointQueryManager { }; //未审核的普通火点列表 List firePointList = firePointOrdinaryDao.findAll(specificationOrdinary, Sort.by(Sort.Direction.DESC, "satelliteTime")); + boolean inVipTimeRange = VipTimeRangeUtils.checkIfInVipTimeRange(sysUserEntity.getVipTimeRangeJson());//查询火点后的步骤 + if ((!"管理员".equals(sysUserEntity.getAccountType())) && (!inVipTimeRange)) { + //该账号不是管理员,并且不在VIP时间范围内。(过期的普通用户)那就清空火点的研判标志 + for (FirePointOrdinaryEntity firePoint : firePointList) { + firePoint.setFireStatus(null);//过期的普通用户看不到火点的研判标志 + } + } return new FirePointQueryResultBean(true, "", firePointList, firePointList.size()); } diff --git a/src/main/java/com/xkrs/service/impl/DispatchFirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/DispatchFirePointServiceImpl.java index 087d4e0..9876750 100644 --- a/src/main/java/com/xkrs/service/impl/DispatchFirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/DispatchFirePointServiceImpl.java @@ -90,6 +90,7 @@ public class DispatchFirePointServiceImpl implements DispatchFirePointService { //生成实体类 FirePointOrdinaryEntity firePointOrdinaryEntity = new FirePointOrdinaryEntity(); firePointOrdinaryEntity.setFireCode(fireCode); + firePointOrdinaryEntity.setFireStatus(null);//默认火点的研判标志是null:伪火点 firePointOrdinaryEntity.setSatelliteTime(satelliteTime); firePointOrdinaryEntity.setLongitude(longitude); firePointOrdinaryEntity.setLatitude(latitude); @@ -178,7 +179,7 @@ public class DispatchFirePointServiceImpl implements DispatchFirePointService { List firePointList = firePointOrdinaryDao.findAll(specification); if (firePointList.size() == 1) { FirePointOrdinaryEntity firePoint = firePointList.get(0); - firePoint.setFireStatus(status);//设置属性 + firePoint.setFireStatus(status);//设置火点的研判标志属性 firePointOrdinaryDao.save(firePoint);//数据库保存 firePointPushManager.pushNotification(firePoint);//将火点消息通知用户 } else { diff --git a/src/main/java/com/xkrs/utilsnew/VipTimeRangeUtils.java b/src/main/java/com/xkrs/utilsnew/VipTimeRangeUtils.java index 7831853..605f972 100644 --- a/src/main/java/com/xkrs/utilsnew/VipTimeRangeUtils.java +++ b/src/main/java/com/xkrs/utilsnew/VipTimeRangeUtils.java @@ -171,7 +171,6 @@ public class VipTimeRangeUtils { } return 0; }).collect(Collectors.toList()); -// log.info("原始集合size=" + list.size() + ",格式化后的集合size=" + vipLocalDateTimeRangePairList.size() + ",排序后的集合size=" + sortedVipLocalDateTimeRangePairList.size()); return sortedVipLocalDateTimeRangePairList; } catch (Exception e) { e.printStackTrace();