| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | Map<String, ApiPointDTO> pointMap = sampleInfo.getPointMap(); |
| | | Map<String, ApiPlanItemDTO> planMap = sampleInfo.getPlanMap(); |
| | | Map<String, ApiIndItemDTO> indMap = sampleInfo.getIndMap(); |
| | | int deviationIndex = 0; |
| | | |
| | | //对每个爪分别进行计算 |
| | | for (ColumnItemPort entry : sampleInfo.getColumnInfo()) { |
| | | //先依据爪内数据项的modelParamOrder进行排序——重写comparator匿名函数 |
| | |
| | | } |
| | | } |
| | | |
| | | //找出对应的调整值 |
| | | double[] deviationItem = null; |
| | | if (sampleInfo.getDeviation() != null && sampleInfo.getDeviation().length > 0) { |
| | | deviationItem = sampleInfo.getDeviation()[deviationIndex]; |
| | | } |
| | | deviationIndex ++; |
| | | |
| | | //对每一项依次进行数据查询,然后将查询出的值赋给matrix对应的位置 |
| | | for (int i = 0; i < entry.getColumnItemList().size(); i++) { |
| | | try { |
| | | List<DataValueVO> dataEntityList = getData(entry.getColumnItemList().get(i), pointMap, planMap,indMap); |
| | | //补全数据 |
| | | |
| | | //设置调整值 |
| | | if (deviationItem != null && deviationItem.length > 0) { |
| | | logger.info("设置调整值, i = " + i); |
| | | if (deviationItem[i] <= 0) { |
| | | continue; |
| | | } |
| | | for(int dataKey = 1; dataKey < dataEntityList.size(); dataKey ++) { |
| | | DataValueVO item = dataEntityList.get(dataKey); |
| | | item.setDataValue(item.getDataValue() + deviationItem[i]); |
| | | } |
| | | } |
| | | |
| | | // 补全数据 |
| | | ColumnItem columnItem = entry.getColumnItemList().get(i); |
| | | dataEntityList = super.completionData(matrix.length, dataEntityList, columnItem.startTime, columnItem.endTime, columnItem.getParamType(),columnItem.getGranularity()); |
| | | |
| | |
| | | vo.setDataValue(t.getDataValue()); |
| | | return vo; |
| | | }).collect(Collectors.toList()); |
| | | break; |
| | | case IND: |
| | | ApiIndItemQueryDTO queryIndItemDTO = new ApiIndItemQueryDTO(); |
| | | ApiIndItemDTO intItem = indMap.get(columnItem.getParamId()); |