| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | if (StringUtils.isBlank(conf.getPointNo())) { |
| | | continue; |
| | | } |
| | | String value = ""; |
| | | String value = "0"; |
| | | switch (ProcessConfDataTypeEnum.getEumByCode(conf.getDataType())) { |
| | | case DATAPOINT: |
| | | List<String> points = new ArrayList<>(); |
| | | points.add(conf.getPointNo()); |
| | | Map<String, Object> pointsRealValue = dataPointApi.queryPointsRealValue(points); |
| | | value = pointsRealValue.get(conf.getPointNo()).toString(); |
| | | value = new BigDecimal(pointsRealValue.get(conf.getPointNo()).toString()).setScale(2,BigDecimal.ROUND_HALF_UP) .toString(); |
| | | break; |
| | | case IND: |
| | | List<ApiIndItemValueDTO> indValues = indItemApi.queryIndItemDefaultValue(conf.getPointNo()); |
| | | if (!CollectionUtils.isEmpty(indValues)) { |
| | | value = indValues.get(indValues.size() - 1).getDataValue().toString(); |
| | | value = new BigDecimal(indValues.get(indValues.size() - 1).getDataValue().toString()).setScale(2,BigDecimal.ROUND_HALF_UP) .toString(); |
| | | } |
| | | break; |
| | | default: |