| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取实时数据展示的数据点列表 |
| | | * @param workstationIdList 工位id集合 |
| | | * @return map(工位id -> 数据点集合) |
| | | */ |
| | | public Map<Long, List<RealTimeStatusVO>> getRealTimeProperties(List<Long> workstationIdList) { |
| | | Map<Long, List<RealTimeStatusVO>> properties = new HashMap<>(); |
| | | |
| | |
| | | WorkstationDatapointsVO dpVO = wsDpService.getDatapoints(workstationId); |
| | | if(dpVO!=null && ObjectUtil.isNotEmpty(dpVO.getDpHead())) { |
| | | |
| | | String prop,label; |
| | | String prop; |
| | | JSONArray dpCfgJson = JSONArray.parseArray(dpVO.getDpConfig()); |
| | | for(int i=0;i<dpCfgJson.size();i++) { |
| | | cfgRow = dpCfgJson.getJSONObject(i); |
| | |
| | | } |
| | | |
| | | private IPage<WorkstationRealTimeStatusVO> manualBuildIPage(Query query, List<WorkstationRealTimeStatusVO> result) { |
| | | Page<WorkstationRealTimeStatusVO> page = new Page<>(query.getCurrent().intValue(), query.getSize().intValue(), result.size()); |
| | | Page<WorkstationRealTimeStatusVO> page = new Page<>(query.getCurrent(), query.getSize(), result.size()); |
| | | if (result.size() == 0) { |
| | | return page; |
| | | } |
| | | if (query.getSize().intValue() == -1) { |
| | | if (query.getSize() == -1) { |
| | | page.setRecords(result); |
| | | } else if (result.size() < ((query.getCurrent().intValue() - 1) * query.getSize().intValue()) + query.getSize().intValue()) { |
| | | page.setRecords(result.subList((query.getCurrent().intValue() - 1) * query.getSize().intValue(), result.size())); |
| | | } else if (result.size() < ((query.getCurrent() - 1) * query.getSize()) + query.getSize()) { |
| | | page.setRecords(result.subList((query.getCurrent() - 1) * query.getSize(), result.size())); |
| | | } else { |
| | | page.setRecords(result.subList((query.getCurrent().intValue() - 1) * query.getSize().intValue(), ((query.getCurrent().intValue() - 1) * query.getSize().intValue()) + query.getSize().intValue())); |
| | | page.setRecords(result.subList((query.getCurrent() - 1) * query.getSize(), ((query.getCurrent() - 1) * query.getSize()) + query.getSize())); |
| | | } |
| | | return page; |
| | | } |
| | |
| | | return dataList; |
| | | } |
| | | //TODO,格式太差 |
| | | Map<Long, List<RealTimeStatusVO>> realTimePropertiesMap = getRealTimeProperties( list.stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList())); |
| | | Map<Long, List<RealTimeStatusVO>> realTimePropertiesMap = getRealTimeProperties( list.stream().map(WorkstationRealTimeStatusVO::getId).collect(Collectors.toList())); |
| | | |
| | | return list.stream().filter(i -> { |
| | | boolean filter = Boolean.TRUE.booleanValue(); |
| | | boolean filter = true; |
| | | if (Func.isEmpty(i.getMachineId())) { |
| | | filter = false; |
| | | } |