火点重构-完善防火季订阅

This commit is contained in:
liuchengqian 2023-04-13 09:04:35 +08:00
parent 9ac1cd73c9
commit b58d06d680
3 changed files with 10 additions and 2 deletions

View File

@ -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<FirePointOrdinaryEntity> 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());
}

View File

@ -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<FirePointOrdinaryEntity> 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 {

View File

@ -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();