xiangpei
2024-08-13 e32fc76d4159be3e9a6fc37f64d84c5942abe136
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, "province");
        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("important", 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;