| | |
| | | import com.iailab.module.model.api.mcs.dto.*; |
| | | import com.iailab.module.model.mcs.pre.entity.DmModuleEntity; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; |
| | | import com.iailab.module.model.mcs.pre.enums.ItemStatus; |
| | | import com.iailab.module.model.mcs.pre.service.*; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO; |
| | | import com.iailab.module.model.mdk.vo.ItemVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | List<String> outIds = reqVO.getOutIds(); |
| | | List<String> legends = new ArrayList<>(); |
| | | List<PreDataViewRespDTO> dataViewList = new ArrayList<>(); |
| | | if (CollectionUtils.isEmpty(reqVO.getQueryIds())) { |
| | | if (CollectionUtils.isEmpty(outIds)) { |
| | | return result; |
| | | } |
| | | Date predictTime = reqVO.getPredictTime(); |
| | | if (predictTime == null) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | predictTime = calendar.getTime(); |
| | | MmItemOutputEntity output = mmItemOutputService.getOutPutById(reqVO.getOutIds().get(0)); |
| | | ItemVO predictItem = mmPredictItemService.getItemById(output.getItemid()); |
| | | if (predictItem.getLastTime() != null) { |
| | | predictTime = predictItem.getLastTime(); |
| | | } else { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | predictTime = calendar.getTime(); |
| | | } |
| | | } |
| | | Date startTime = reqVO.getStartTime(); |
| | | if (startTime == null) { |
| | |
| | | String outId = outIds.get(i); |
| | | MmItemOutputEntity output = mmItemOutputService.getOutPutById(outId); |
| | | if (output == null) { |
| | | continue; |
| | | continue; |
| | | } |
| | | legends.add(output.getResultstr()); |
| | | viewDto.setItemId(output.getItemid()); |
| | | viewDto.setOutId(outId); |
| | | viewDto.setResultstr(output.getResultstr()); |
| | | viewDto.setRealData(getHisData(output.getPointid(), startTime, endTime)); |
| | | viewDto.setPreDataN(mmItemResultService.getData(output.getId(), startTime, endTime)); |
| | | viewDto.setPreDataL(mmItemResultLastPointService.getData(output.getId(), startTime, endTime)); |