From cae71f98572da0f6809ce888ef9a2ecacead34b2 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期六, 10 八月 2024 11:11:17 +0800 Subject: [PATCH] 重点指挥图像在线率 --- ycl-server/src/main/java/com/ycl/calculate/IndexCalculationServe.java | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ycl-server/src/main/java/com/ycl/calculate/IndexCalculationServe.java b/ycl-server/src/main/java/com/ycl/calculate/IndexCalculationServe.java index 637ef58..6546b7b 100644 --- a/ycl-server/src/main/java/com/ycl/calculate/IndexCalculationServe.java +++ b/ycl-server/src/main/java/com/ycl/calculate/IndexCalculationServe.java @@ -9,13 +9,11 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.math.RoundingMode; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; import java.util.stream.Collectors; /** @@ -127,14 +125,20 @@ //杩斿洖鐪佸巺鍥芥爣鐮侀泦鍚� public List<String> getProvince() { - List<YwPoint> province = pointMapper.selectByTag(null, Boolean.TRUE); - return province.stream().map(YwPoint::getSerialNumber).collect(Collectors.toList()); + List<YwPoint> province = pointMapper.selectByTag(null, Boolean.TRUE, null); + return CollectionUtils.isEmpty(province) ? new ArrayList<>() : province.stream().map(YwPoint::getSerialNumber).collect(Collectors.toList()); } //杩斿洖閲嶇偣鐐逛綅闆嗗悎 public List<String> getImportant() { - List<YwPoint> important = pointMapper.selectByTag(Boolean.TRUE, null); - return important.stream().map(YwPoint::getSerialNumber).collect(Collectors.toList()); + List<YwPoint> important = pointMapper.selectByTag(Boolean.TRUE, null, null); + return CollectionUtils.isEmpty(important) ? new ArrayList<>() : important.stream().map(YwPoint::getSerialNumber).collect(Collectors.toList()); + } + + //杩斿洖閲嶇偣鎸囨尌鍥惧儚闆嗗悎 + public List<String> getCommandImage() { + List<YwPoint> commandImages = pointMapper.selectByTag(null, null, Boolean.TRUE); + return CollectionUtils.isEmpty(commandImages) ? new ArrayList<>() : commandImages.stream().map(YwPoint::getSerialNumber).collect(Collectors.toList()); } //妫�鏌ユ槸鍚﹀瓨鍦ㄥ綋鏃ユ暟鎹� @@ -153,8 +157,8 @@ } else { try { checkIndex = clazz.getDeclaredConstructor().newInstance(); - checkIndex.setDeptId(key.startsWith(ApiConstants.Province ) ? Long.parseLong(key.split("_")[1]) : Long.parseLong(key)); - checkIndex.setExamineTag(key.startsWith(ApiConstants.Province ) ? CheckConstants.Examine_Tag_Province : CheckConstants.Examine_Tag_County); + checkIndex.setDeptId(key.startsWith(ApiConstants.Province) ? Long.parseLong(key.split("_")[1]) : Long.parseLong(key)); + checkIndex.setExamineTag(key.startsWith(ApiConstants.Province) ? CheckConstants.Examine_Tag_Province : CheckConstants.Examine_Tag_County); checkIndex.setCreateTime(new Date()); } catch (Exception e) { checkIndex = null; -- Gitblit v1.8.0