xiangpei
2024-08-31 730ff79f5bd62ce7faa3624e338b22de0797bcaf
ycl-server/src/main/java/com/ycl/calculate/IndexCalculationServe.java
@@ -183,28 +183,31 @@
    //返回省厅国标码集合
    public List<String> getProvince() {
        List<YwPoint> province = pointMapper.selectByTag(null, Boolean.TRUE, null);
        List<YwPoint> province = pointMapper.selectByTag(null, Boolean.TRUE, null, 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, null);
        List<YwPoint> important = pointMapper.selectByTag(Boolean.TRUE, null, 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);
        List<YwPoint> commandImages = pointMapper.selectByTag(null, null, Boolean.TRUE, null);
        return CollectionUtils.isEmpty(commandImages) ? new ArrayList<>() : commandImages.stream().map(YwPoint::getSerialNumber).collect(Collectors.toList());
    }
    //返回重点指挥图像集合
    public List<String> getDeptTag() {
        List<YwPoint> commandImages = pointMapper.selectByTag(null, null, null, Boolean.TRUE);
        return CollectionUtils.isEmpty(commandImages) ? new ArrayList<>() : commandImages.stream().map(YwPoint::getSerialNumber).collect(Collectors.toList());
    }
    //返回monitor
    //TODO:时间写死了
    public List<String> getMonitorFromMongo() {
        Date date = DateUtils.getDay(2024, 7, 13);
        Query query = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(date)).lt(DateUtils.getDayEnd(date)));
//        Query query = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date())));
        Query query = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date())));
        List<MonitorQualifyResult> oneMachineFileResults = mongoTemplate.find(query, MonitorQualifyResult.class);
        return CollectionUtils.isEmpty(oneMachineFileResults) ? new ArrayList<>() : oneMachineFileResults.stream().map(result -> result.getSerialNumber().getValue()).collect(Collectors.toList());