yangys
2024-04-28 258a769f6790f832d1c67839d59be04a118767e5
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/RealTimeDataServiceImpl.java
@@ -16,12 +16,12 @@
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;
@@ -33,18 +33,16 @@
        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 -> {
@@ -57,15 +55,13 @@
        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());
    }
}