| | |
| | | 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; |
| | |
| | | moduleOpt.setId(item.getId()); |
| | | moduleOpt.setLabel(item.getModulename()); |
| | | List<PredictItemTreeDTO> children = new ArrayList<>(); |
| | | Map<String, Object> params = new HashMap<>(2); |
| | | params.put("status", 1); |
| | | params.put("moduleid", item.getId()); |
| | | List<MmPredictItemRespVO> itemList = mmPredictItemService.list(params); |
| | | List<ItemVO> itemList = mmPredictItemService.getByModuleId(item.getId()); |
| | | itemList.forEach(item1 -> { |
| | | PredictItemTreeDTO chd = new PredictItemTreeDTO(); |
| | | chd.setLabel(item1.getItemname()); |
| | | chd.setLabel(item1.getItemName()); |
| | | chd.setId(item1.getId()); |
| | | List<PredictItemTreeDTO> chd1 = new ArrayList<>(); |
| | | List<MmItemOutputEntity> outList = mmItemOutputService.getByItemid(item1.getId()); |
| | | if (!CollectionUtils.isEmpty(outList)) { |
| | | outList.forEach(out -> { |
| | | PredictItemTreeDTO chd2 = new PredictItemTreeDTO(); |
| | | chd2.setId(out.getId()); |
| | | chd2.setLabel(out.getResultstr()); |
| | | chd1.add(chd2); |
| | | }); |
| | | } |
| | | chd.setChildren(chd1); |
| | | children.add(chd); |
| | | }); |
| | | moduleOpt.setChildren(children); |
| | |
| | | @Override |
| | | public PreDataBarLineRespVO getPreDataCharts(PreDataBarLineReqVO reqVO) { |
| | | PreDataBarLineRespVO result = new PreDataBarLineRespVO(); |
| | | List<String[]> queryIds = reqVO.getQueryIds(); |
| | | List<String> outIds = reqVO.getOutIds(); |
| | | List<String> legends = new ArrayList<>(); |
| | | List<PreDataViewRespDTO> dataViewList = new ArrayList<>(); |
| | | if (CollectionUtils.isEmpty(reqVO.getQueryIds())) { |
| | |
| | | } |
| | | Date predictTime = reqVO.getPredictTime(); |
| | | if (predictTime == null) { |
| | | DmModuleEntity dmModule = dmModuleService.getModuleByItemId(queryIds.get(0)[0]); |
| | | if (dmModule != null) { |
| | | predictTime = dmModule.getPredicttime(); |
| | | } 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) { |
| | |
| | | endTime = calendar.getTime(); |
| | | } |
| | | |
| | | for (int i = 0; i < queryIds.size(); i++) { |
| | | for (int i = 0; i < outIds.size(); i++) { |
| | | PreDataViewRespDTO viewDto = new PreDataViewRespDTO(); |
| | | String itemId = queryIds.get(i)[0]; |
| | | String outKey = queryIds.get(i)[1]; |
| | | MmItemOutputEntity output = mmItemOutputService.getByItemid(itemId, outKey); |
| | | String outId = outIds.get(i); |
| | | MmItemOutputEntity output = mmItemOutputService.getOutPutById(outId); |
| | | if (output == null) { |
| | | continue; |
| | | } |