| | |
| | | import com.iailab.module.ansteel.coking.service.*; |
| | | import com.iailab.module.ansteel.common.enums.ProcessConfDataTypeEnum; |
| | | import com.iailab.module.ansteel.common.enums.ProcessTypeEnum; |
| | | import com.iailab.module.data.api.arc.ArcDataApi; |
| | | import com.iailab.module.data.api.arc.dto.ApiArcDataDTO; |
| | | import com.iailab.module.data.api.ind.IndItemApi; |
| | | import com.iailab.module.data.api.ind.dto.ApiIndItemQueryDTO; |
| | | import com.iailab.module.data.api.ind.dto.ApiIndItemValueDTO; |
| | |
| | | private DataPointApi dataPointApi; |
| | | @Resource |
| | | private IndItemApi indItemApi; |
| | | @Resource |
| | | private ArcDataApi arcDataApi; |
| | | @Resource |
| | | private CokingTraceReportService cokingTraceReportService; |
| | | @Resource |
| | |
| | | |
| | | // 异常数据处理 |
| | | 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: |
| | |
| | | value = Double.valueOf(indValues.get(0).getDataValue().toString()); |
| | | } |
| | | break; |
| | | case MODEL: |
| | | case ARC: |
| | | ApiArcDataDTO apiArcDataDTO = arcDataApi.queryArcLastValue(conf.getPointNo()); |
| | | if (apiArcDataDTO != null) { |
| | | value = apiArcDataDTO.getArcValue().doubleValue(); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | |
| | | } |
| | | return value; |
| | | if (value != null && StringUtils.isNotBlank(conf.getExt5())) { |
| | | value = value * Double.valueOf(conf.getExt5()); |
| | | } |
| | | return value == null ? -2.0 : value; |
| | | } |
| | | } |