| | |
| | | import com.qianwen.smartman.modules.cps.service.IWorkstationOfMachineService; |
| | | import com.qianwen.smartman.modules.cps.vo.DmpStatusVariableVO; |
| | | import com.qianwen.smartman.modules.cps.vo.DmpVariablesVO; |
| | | import com.qianwen.smartman.modules.cps.vo.WorkstationRealTimeStatusVO; |
| | | import com.qianwen.smartman.modules.mdc.service.IRealTimeDataService; |
| | | import com.qianwen.smartman.modules.mdc.vo.WorkstationVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/mdc/service/impl/RealTimeDataServiceImpl.class */ |
| | | public class RealTimeDataServiceImpl implements IRealTimeDataService { |
| | | private final WorkstationMapper workstationMapper; |
| | | private final IWorkstationOfMachineService workstationOfMachineService; |
| | |
| | | this.dmpVariablesService = dmpVariablesService; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.mdc.service.IRealTimeDataService |
| | | @Override |
| | | public List<DmpStatusVariableVO> getWorkstationRealTimeStatus(WorkstationVO workstationVO) { |
| | | List<Long> workstationIdList = workstationVO.getWorkstationIdList(); |
| | | if (Func.isEmpty(workstationIdList)) { |
| | | List<String> workstationGroupIdList = (List) workstationVO.getWorkstationGroupIdList().stream().map(x -> { |
| | | List<String> workstationGroupIdList = workstationVO.getWorkstationGroupIdList().stream().map(x -> { |
| | | return String.valueOf(x); |
| | | }).collect(Collectors.toList()); |
| | | WorkstationRealTimeStatusDTO workstationRealTimeStatusDTO = new WorkstationRealTimeStatusDTO(); |
| | | workstationRealTimeStatusDTO.setWorkStationGroupIdList(workstationGroupIdList); |
| | | workstationIdList = (List) this.workstationMapper.getWorkstationListByWorkStationGroupIdList(null, workstationRealTimeStatusDTO).stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList()); |
| | | workstationIdList = this.workstationMapper.getWorkstationListByWorkStationGroupIdList(null, workstationRealTimeStatusDTO).stream().map(WorkstationRealTimeStatusVO::getId).collect(Collectors.toList()); |
| | | } |
| | | List<DmpStatusVariableVO> dmpStatusVariableList = this.dmpVariablesService.getDmpVariablesByWorkstationIdList(workstationIdList); |
| | | dmpStatusVariableList.forEach(x2 -> { |
| | |
| | | return dmpStatusVariableList; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.mdc.service.IRealTimeDataService |
| | | @Override |
| | | public List<DmpVariablesVO> getWorkstationDmpVariables(Long workstationId) { |
| | | WorkstationOfMachine workstationOfMachine = this.workstationOfMachineService.getWorkstationOfMachineByWorkstationId(workstationId); |
| | | if (Func.isEmpty(workstationOfMachine)) { |
| | | throw new ServiceException(MessageUtils.message("workstation.not.turn.on.acquisition.function", new Object[0])); |
| | | } |
| | | List<DmpVariablesVO> dmpVariables = this.dmpVariablesService.getDmpVariablesByWorkstationId(Long.valueOf(workstationId.longValue())); |
| | | return (List) dmpVariables.stream().filter((v0) -> { |
| | | return v0.getRealTimeData(); |
| | | }).collect(Collectors.toList()); |
| | | return dmpVariables.stream().filter(DmpVariablesVO::getRealTimeData).collect(Collectors.toList()); |
| | | } |
| | | } |