| | |
| | | } |
| | | sgProgressReportDO.setStatus(0); |
| | | sgProgressReportMapper.insert(sgProgressReportDO); |
| | | SgDeviceDO sgDeviceDO = sgDeviceMapper.selectById(gxDeviceId); |
| | | String deviceType = sgDeviceDO.getDeviceType(); |
| | | String deviceType =""; |
| | | SgDeviceDO sgDeviceDO = new SgDeviceDO(); |
| | | if (gxDeviceId.equals("999")){ |
| | | deviceType = "sgzb"; |
| | | }else if(gxDeviceId.equals("998")){ |
| | | deviceType = "sgys"; |
| | | }else { |
| | | sgDeviceDO = sgDeviceMapper.selectById(gxDeviceId); |
| | | deviceType = sgDeviceDO.getDeviceType(); |
| | | } |
| | | List<SgGxConfigDO> sgGxConfigDOS = new LambdaQueryChainWrapper<>(sgGxConfigMapper) |
| | | .eq(SgGxConfigDO::getGxDeviceType, deviceType).eq(SgGxConfigDO::getGxStepId, gxStepId).orderByAsc(SgGxConfigDO::getSgOrder).list(); |
| | | List<String> roIds = sgGxConfigDOS.stream().map(SgGxConfigDO::getRoleId).collect(Collectors.toList()); |
| | |
| | | if (CollectionUtils.isNotEmpty(sgProgressReportDOS)) { |
| | | sgProgressReportDOS.sort((u1, u2) -> u2.getCreateTime().compareTo(u1.getCreateTime())); |
| | | SgProgressReportDO firstReport = sgProgressReportDOS.get(0); |
| | | if (firstReport.getStatus().equals(2)) { |
| | | sgReportVO.setGxDeviceId(deviceId); |
| | | sgReportVO.setGxStepId(sgGxStepMapper.selectOne(wrapperss.eq("id", stepId)).getId()); |
| | | sgReportVO.setProframId(firstReport.getProframId()); |
| | | SgGxStepDO sgGxStepDO = sgGxStepMapper.selectOne(wrapperss.eq("id", stepId)); |
| | | List<SgGxStepDO> sgGxStepDOS = sgGxStepMapper.selectList( |
| | | new QueryWrapper<SgGxStepDO>() |
| | | .lt("id", stepId) |
| | | .eq("gx_info_id", sgGxStepDO.getGxInfoId()) |
| | | .orderByDesc("gx_step_num")); |
| | | if (!sgGxStepDOS.isEmpty()) { |
| | | if (sgGxStepDOS.get(0).getGxStepName().equals(firstReport.getGxStepName())&&firstReport.getStatus().equals(2)) { |
| | | sgReportVO.setGxDeviceId(deviceId); |
| | | sgReportVO.setGxStepId(sgGxStepDO.getId()); |
| | | sgReportVO.setProframId(firstReport.getProframId()); |
| | | }else { |
| | | throw new ServiceException("请完成上一步工序!"); |
| | | } |
| | | } |
| | | else { |
| | | throw new ServiceException("请完成上一步工序!"); |
| | | } |
| | | |
| | | }else { |
| | | if (stepId!=null) { |
| | | SgGxStepDO sg = sgGxStepMapper.selectOne(wrapperss.eq("id", stepId)); |