| | |
| | | import com.iailab.module.data.api.ind.IndItemApi; |
| | | import com.iailab.module.data.api.ind.dto.ApiIndItemValueDTO; |
| | | import com.iailab.module.data.api.point.DataPointApi; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | * @Description |
| | | * @createTime 2025年04月17日 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class CokingTraceIndServiceImpl implements CokingTraceIndService { |
| | | |
| | |
| | | String value = "-2"; |
| | | switch (ProcessConfDataTypeEnum.getEumByCode(conf.getDataType())) { |
| | | case DATAPOINT: |
| | | log.info("CokingTraceInd:DATAPOINT:" + conf.getPointNo()); |
| | | List<String> points = new ArrayList<>(); |
| | | points.add(conf.getPointNo()); |
| | | Map<String, Object> pointsRealValue = dataPointApi.queryPointsRealValue(points); |
| | | log.info("CokingTraceInd:pointsRealValue:{}", pointsRealValue); |
| | | value = new BigDecimal(pointsRealValue.get(conf.getPointNo()).toString()).setScale(2,BigDecimal.ROUND_HALF_UP) .toString(); |
| | | break; |
| | | case IND: |
| | | log.info("CokingTraceInd:IND:" + conf.getPointNo()); |
| | | List<ApiIndItemValueDTO> indValues = indItemApi.queryIndItemDefaultValue(conf.getPointNo()); |
| | | log.info("CokingTraceInd:indValues:{}", indValues); |
| | | if (!CollectionUtils.isEmpty(indValues)) { |
| | | value = new BigDecimal(indValues.get(indValues.size() - 1).getDataValue().toString()).setScale(2,BigDecimal.ROUND_HALF_UP) .toString(); |
| | | } |