| | |
| | | package com.iailab.module.model.mdk.sample; |
| | | |
| | | import com.iailab.module.data.api.plan.PlanItemApi; |
| | | import com.iailab.module.data.api.plan.dto.ApiPlanItemDTO; |
| | | import com.iailab.module.data.api.point.DataPointApi; |
| | | import com.iailab.module.data.api.point.dto.ApiPointDTO; |
| | | import com.iailab.module.data.api.point.dto.ApiPointValueDTO; |
| | |
| | | public List<SampleData> prepareSampleData(SampleInfo sampleInfo) throws Exception { |
| | | List<SampleData> sampleDataList = new ArrayList<>(); |
| | | Map<String, ApiPointDTO> pointMap = sampleInfo.getPointMap(); |
| | | Map<String, ApiPlanItemDTO> planMap = sampleInfo.getPlanMap(); |
| | | //对每个爪分别进行计算 |
| | | for (ColumnItemPort entry : sampleInfo.getColumnInfo()) { |
| | | //先依据爪内数据项的modelParamOrder进行排序——重写comparator匿名函数 |
| | |
| | | //对每一项依次进行数据查询,然后将查询出的值赋给matrix对应的位置 |
| | | for (int i = 0; i < entry.getColumnItemList().size(); i++) { |
| | | try { |
| | | List<DataValueVO> dataEntityList = getData(entry.getColumnItemList().get(i),pointMap); |
| | | List<DataValueVO> dataEntityList = getData(entry.getColumnItemList().get(i),pointMap,planMap); |
| | | //补全数据 |
| | | ColumnItem columnItem = entry.getColumnItemList().get(i); |
| | | dataEntityList = super.completionData(matrix.length, dataEntityList, columnItem.startTime, columnItem.endTime, |
| | | columnItem.paramId, columnItem.getParamType()); |
| | | columnItem.paramId, columnItem.getParamType(),pointMap,planMap); |
| | | |
| | | /** 如果数据取不满,把缺失的数据点放在后面 */ |
| | | if (dataEntityList != null && dataEntityList.size() != 0) { |
| | |
| | | * |
| | | * @param columnItem |
| | | * @param pointMap |
| | | * @param planMap |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | private List<DataValueVO> getData(ColumnItem columnItem, Map<String, ApiPointDTO> pointMap) throws Exception { |
| | | private List<DataValueVO> getData(ColumnItem columnItem, Map<String, ApiPointDTO> pointMap, Map<String, ApiPlanItemDTO> planMap) throws Exception { |
| | | List<DataValueVO> dataList = new ArrayList<>(); |
| | | String paramType = columnItem.getParamType(); |
| | | switch (ModelParamType.getEumByCode(paramType)) { |
| | |
| | | break; |
| | | case PLAN: |
| | | ApiDataQueryDTO queryPlanItemDto = new ApiDataQueryDTO(); |
| | | queryPlanItemDto.setItemNo(columnItem.getParamId()); |
| | | queryPlanItemDto.setItemNo(planMap.get(columnItem.getParamId()).getItemNo()); |
| | | queryPlanItemDto.setStart(columnItem.getStartTime()); |
| | | queryPlanItemDto.setEnd(columnItem.getEndTime()); |
| | | List<ApiDataValueDTO> planValueList = planItemApi.queryPlanItemHistoryValue(queryPlanItemDto); |