| | |
| | | // 查询项目组 |
| | | TProjectTeamStaff projectTeamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getUserId, userId)); |
| | | if(Objects.isNull(projectTeamStaff)){ |
| | | return R.fail("当前用户未加入项目组,无法进行操作"); |
| | | } |
| | | // 查询项目的工艺工程师id |
| | | TProjectTeamStaff teamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getTeamId, projectTeamStaff.getTeamId()) |
| | |
| | | samplingRecordOperation.setReceiptsTime(LocalDateTime.now()); |
| | | } |
| | | samplingRecordOperationService.updateBatchById(samplingRecordOperations); |
| | | |
| | | // 判断是否所有取样记录都收样了 |
| | | List<TSamplingRecordOperation> allRecordOperations = samplingRecordOperationService.list(Wrappers.lambdaQuery(TSamplingRecordOperation.class) |
| | | .eq(TSamplingRecordOperation::getSamplingId, samplingRecordOperations.get(0).getSamplingId())); |
| | | if(allRecordOperations.stream().allMatch(e -> e.getStatus() == 3)){ |
| | | samplingRecordService.update(Wrappers.lambdaUpdate(TSamplingRecord.class) |
| | | .set(TSamplingRecord::getStatus, 4) |
| | | .eq(TSamplingRecord::getId, samplingRecordOperations.get(0).getSamplingId())); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |