| | |
| | | |
| | | // 异常数据处理 |
| | | String content = null; |
| | | if (value != null) { |
| | | if (value != null && !value.equals(-2.0)) { |
| | | if (value.equals(0.0)) { |
| | | content = clock + " " + conf.getIndName() + "数据异常(数据为0)"; |
| | | }else if (value.compareTo(Double.valueOf(conf.getExt3())) > 0) { |
| | |
| | | entity.setIndCode(conf.getIndCode()); |
| | | entity.setIndName(conf.getIndName()); |
| | | entity.setIndUnit(conf.getIndUnit()); |
| | | if (value != null) { |
| | | entity.setIndValue(BigDecimal.valueOf(value)); |
| | | } |
| | | entity.setIndValue(BigDecimal.valueOf(value)); |
| | | entity.setCreateDate(new Date()); |
| | | overviewIndEntities.add(entity); |
| | | } |
| | |
| | | Double value = null; |
| | | switch (ProcessConfDataTypeEnum.getEumByCode(conf.getDataType())) { |
| | | case DATAPOINT: |
| | | List<String> points = new ArrayList<>(); |
| | | points.add(conf.getPointNo()); |
| | | Map<String, Object> pointsRealValue = dataPointApi.queryPointsRealValue(points); |
| | | if (pointsRealValue.containsKey(conf.getPointNo())) { |
| | | value = Double.valueOf(pointsRealValue.get(conf.getPointNo()).toString()); |
| | | ApiPointValueQueryDTO queryDTO = new ApiPointValueQueryDTO(); |
| | | queryDTO.setPointNo(conf.getPointNo()); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | queryDTO.setEnd(calendar.getTime()); |
| | | calendar.add(Calendar.DAY_OF_YEAR,-1); |
| | | queryDTO.setStart(calendar.getTime()); |
| | | List<ApiPointValueDTO> values = dataPointApi.queryPointHistoryValue(queryDTO); |
| | | if (!CollectionUtils.isEmpty(values)) { |
| | | value = values.get(values.size() - 1).getV(); |
| | | } |
| | | break; |
| | | case IND: |
| | |
| | | if (value != null && StringUtils.isNotBlank(conf.getExt5())) { |
| | | value = value * Double.valueOf(conf.getExt5()); |
| | | } |
| | | return value; |
| | | return value == null ? -2.0 : value; |
| | | } |
| | | } |