| | |
| | | import com.qianwen.smartman.modules.smis.service.ICalendarService; |
| | | import com.qianwen.smartman.modules.smis.service.ICommonGroupOfItemService; |
| | | import com.qianwen.smartman.modules.smis.service.ICommonGroupService; |
| | | import com.qianwen.smartman.modules.smis.service.IDmpVariablesService; |
| | | import com.qianwen.smartman.modules.smis.service.IMachineService; |
| | | import com.qianwen.smartman.modules.smis.service.IWorkstationOfMachineService; |
| | | import com.qianwen.smartman.modules.smis.service.IWorkstationService; |
| | |
| | | private WorkstationMapper workstationMapper; |
| | | @Autowired |
| | | private OssBuilder ossBuilder; |
| | | @Autowired |
| | | private IDmpVariablesService dmpVariablesService; |
| | | |
| | | |
| | | @Autowired |
| | | private IWorkstationWorkbenchService workbenchService; |
| | |
| | | return manualBuildIPage(query, buildProperties(result, dto.getDeviceStatus())); |
| | | } |
| | | |
| | | @Override |
| | | public List<RealTimeStatusVO> getRealTimeProperties(Long workstationId, Long machineId) { |
| | | List<RealTimeStatusVO> properties = new ArrayList<>(); |
| | | Map<String, Object> map = WorkstationCache.getWorkstationRealTime(String.valueOf(workstationId)); |
| | | List<DmpVariablesVO> list = this.dmpVariablesService.getDmpVariablesByWorkstationId(workstationId); |
| | | if (CollectionUtil.isNotEmpty(list)) { |
| | | list.forEach(dmpVariablesVO -> { |
| | | RealTimeStatusVO vo = new RealTimeStatusVO(); |
| | | vo.setKey(dmpVariablesVO.getName()); |
| | | vo.setName(dmpVariablesVO.getDescription()); |
| | | vo.setUnit(dmpVariablesVO.getDmpType()); |
| | | vo.setSort(dmpVariablesVO.getIdx()); |
| | | vo.setWcsDataType(dmpVariablesVO.getWcsDataType()); |
| | | vo.setBigScreen(dmpVariablesVO.getBigScreen()); |
| | | vo.setRealTimeData(dmpVariablesVO.getRealTimeData()); |
| | | if (map.containsKey(dmpVariablesVO.getName())) { |
| | | TelemetryDataResponseDTO t = (TelemetryDataResponseDTO) MapUtils.getObject(map, dmpVariablesVO.getName()); |
| | | vo.setValue(t.getV()); |
| | | } |
| | | properties.add(vo); |
| | | }); |
| | | } |
| | | return properties; |
| | | } |
| | | |
| | | |
| | | public Map<Long, List<RealTimeStatusVO>> getRealTimeProperties(List<Long> workstationIdList) { |
| | | Map<Long, List<RealTimeStatusVO>> properties = new HashMap<>(); |
| | | //在这里!!!! |
| | | //顶顶顶顶 |
| | | //List<DmpVariablesVO> list = this.dmpVariablesService.getDmpVariablesByWorkstationIds(workstationIdList); |
| | | //this.wsDpService.getDatapointsByWorkstationIds(); |
| | | //if (Func.isNotEmpty(list)) { |
| | | /* |
| | | Map<Long, List<DmpVariablesVO>> dmpVariablesMap =list.stream().collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getWorkstationId(); |
| | | })); |
| | | dmpVariablesMap.forEach((workstationId, dmpVariablesVOList) -> { |
| | | ArrayList<RealTimeStatusVO> arrayList = new ArrayList<>(); |
| | | Map<String, Object> map = WorkstationCache.getWorkstationRealTime(String.valueOf(workstationId));//应该有数据,因为缓存没有,直接查的queryLastParameter |
| | | dmpVariablesVOList.forEach(dmpVariablesVO -> { |
| | | RealTimeStatusVO vo = new RealTimeStatusVO(); |
| | | vo.setKey(dmpVariablesVO.getName()); |
| | | vo.setName(dmpVariablesVO.getDescription()); |
| | | vo.setUnit(dmpVariablesVO.getDmpType()); |
| | | vo.setSort(dmpVariablesVO.getIdx()); |
| | | vo.setWcsDataType(dmpVariablesVO.getWcsDataType()); |
| | | vo.setBigScreen(dmpVariablesVO.getBigScreen()); |
| | | vo.setRealTimeData(dmpVariablesVO.getRealTimeData()); |
| | | if (map.containsKey(dmpVariablesVO.getName())) { |
| | | TelemetryDataResponseDTO t = (TelemetryDataResponseDTO) MapUtils.getObject(map, dmpVariablesVO.getName()); |
| | | vo.setValue(t.getV()); |
| | | } |
| | | arrayList.add(vo); |
| | | }); |
| | | properties.put(workstationId, arrayList); |
| | | }); |
| | | */ |
| | | |
| | | //} |
| | | |
| | | //yangys修改,改为数据点位的方式 |
| | | for(Long workstationId: workstationIdList) { |
| | | |
| | |
| | | RealTimeStatusVO vo = new RealTimeStatusVO(); |
| | | prop = cfgRow.getString("dpName"); |
| | | vo.setKey(prop); |
| | | |
| | | /* |
| | | label = prop; |
| | | if(StringUtils.equals("DeviceStatus", prop)) { |
| | | label = "状态"; |
| | |
| | | label = "产量"; |
| | | }else if(StringUtils.equals("AlarmNo", prop)) { |
| | | label = "告警号"; |
| | | } |
| | | vo.setName(label); |
| | | //vo.setUnit(headRow.getString("dpUnit")); |
| | | }*/ |
| | | vo.setName(cfgRow.getString("dpLabel")); |
| | | vo.setSort(i); |
| | | //vo.setWcsDataType(dmpVariablesVO.getWcsDataType()); |
| | | vo.setBigScreen(false); |
| | | vo.setRealTimeData(true); |
| | | |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /* |
| | | @Override |
| | | public List<DmpVariablesVO> getDmpVariables(String workstationId, String machineId) { |
| | | if (Func.isBlank(machineId)) { |
| | |
| | | return v0.getRealTimeData(); |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | */ |
| | | |
| | | private void checkWorkstation(WorkstationSubmitVO workstationSubmitVO) { |
| | | if (Func.isNotEmpty(workstationSubmitVO.getCode()) && workstationSubmitVO.getCode().length() > 24) { |