| | |
| | | import com.iailab.module.data.api.point.DataPointApi; |
| | | import com.iailab.module.data.api.point.dto.ApiPointValueQueryDTO; |
| | | import com.iailab.module.model.api.mcs.McsApi; |
| | | import com.iailab.module.model.api.mcs.dto.ChartParamDTO; |
| | | import com.iailab.module.model.api.mcs.dto.MmItemOutputDTO; |
| | | import com.iailab.module.model.api.mcs.dto.PreDataSingleChartReqVO; |
| | | import com.iailab.module.model.api.mcs.dto.PredictItemVO; |
| | | import com.iailab.module.model.api.mcs.dto.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | Date endTime = timeArray[2]; |
| | | |
| | | PreDataChartRespVO result = ConvertUtils.sourceToTarget(mcsApi.getPreDataSingleChart(reqVO), PreDataChartRespVO.class); |
| | | PreDataViewDTO dataView = result.getDataView(); |
| | | PreDataViewRespDTO dataView = result.getDataView(); |
| | | PreDataViewDTO preDataView = ConvertUtils.sourceToTarget(dataView, PreDataViewDTO.class); |
| | | if(trendsDataH != null) { |
| | | ApiPointValueQueryDTO pointValueQueryDTO = new ApiPointValueQueryDTO(); |
| | | pointValueQueryDTO.setPointNo(trendsDataH); |
| | | List<ApiPointValueDTO> trendsDataHList = ConvertUtils.sourceToTarget(dataPointApi.queryPointHistoryValue(pointValueQueryDTO), ApiPointValueDTO.class); |
| | | dataView.setTrendsDataH(trendsDataHList); |
| | | preDataView.setTrendsDataH(trendsDataHList); |
| | | } |
| | | if(trendsDataL != null) { |
| | | ApiPointValueQueryDTO pointValueQueryDTO = new ApiPointValueQueryDTO(); |
| | | pointValueQueryDTO.setPointNo(trendsDataL); |
| | | List<ApiPointValueDTO> trendsDataLList = ConvertUtils.sourceToTarget(dataPointApi.queryPointHistoryValue(pointValueQueryDTO), ApiPointValueDTO.class); |
| | | dataView.setTrendsDataL(trendsDataLList); |
| | | preDataView.setTrendsDataL(trendsDataLList); |
| | | } |
| | | MmItemOutputDTO outputDTO = mcsApi.getItemOutputByItemid(predictItem.getId(), resultStr, resultIndex); |
| | | |
| | | PreItemResultReqVO preItemResultReqVO = new PreItemResultReqVO(); |
| | | preItemResultReqVO.setOutputid(outputDTO.getId()); |
| | | preItemResultReqVO.setStartTime(startTime); |
| | | preItemResultReqVO.setEndTime(endTime); |
| | | preItemResultReqVO.setTimeFormat(timeFormat); |
| | | switch (lineType) { |
| | | case TN: |
| | | if(reqVO.getChartCode().equals(CommonConstant.LDG_CHARRCODE)){ |
| | | dataView.setPreData(mcsApi.getItemResult(outputDTO.getId(), predictTime, endTime, timeFormat)); |
| | | preDataView.setPreData(mcsApi.getItemResult(preItemResultReqVO)); |
| | | }else{ |
| | | dataView.setPreData(mcsApi.getItemResult(outputDTO.getId(), startTime, endTime, timeFormat)); |
| | | preDataView.setPreData(mcsApi.getItemResult(preItemResultReqVO)); |
| | | } |
| | | |
| | | break; |
| | | case TL: |
| | | if(reqVO.getChartCode().equals(CommonConstant.LDG_CHARRCODE)){ |
| | | dataView.setPreData(mcsApi.getItemResultLastPoint(outputDTO.getId(), predictTime, endTime, timeFormat)); |
| | | preDataView.setPreData(mcsApi.getItemResultLastPoint(preItemResultReqVO)); |
| | | }else{ |
| | | dataView.setPreData(mcsApi.getItemResultLastPoint(outputDTO.getId(), startTime, endTime, timeFormat)); |
| | | preDataView.setPreData(mcsApi.getItemResultLastPoint(preItemResultReqVO)); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | result.setDataView(dataView); |
| | | result.setPreDataView(preDataView); |
| | | return result; |
| | | } |
| | | |