| | |
| | | private final TProjectTeamService projectTeamService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | private final TExperimentDispatchParticipantsService experimentDispatchParticipantsService; |
| | | private final TNoticeService noticeService; |
| | | @Autowired |
| | | public TSamplingRecordController(TSamplingRecordService samplingRecordService, TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TSamplingRecordOperationService samplingRecordOperationService, TExperimentDispatchService experimentDispatchService, TProjectProposalService projectProposalService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService, TExperimentDispatchParticipantsService experimentDispatchParticipantsService) { |
| | | public TSamplingRecordController(TSamplingRecordService samplingRecordService, TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TSamplingRecordOperationService samplingRecordOperationService, TExperimentDispatchService experimentDispatchService, TProjectProposalService projectProposalService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService, TExperimentDispatchParticipantsService experimentDispatchParticipantsService, TNoticeService noticeService) { |
| | | this.samplingRecordService = samplingRecordService; |
| | | this.tokenService = tokenService; |
| | | this.sysUserService = sysUserService; |
| | |
| | | this.projectTeamService = projectTeamService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | this.experimentDispatchParticipantsService = experimentDispatchParticipantsService; |
| | | this.noticeService = noticeService; |
| | | } |
| | | |
| | | /** |
| | |
| | | // 获取当前用户 |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |
| | | query.setRoleType(roleType); |
| | | if (roleType != 1){ |
| | | query.setUserId(userId); |
| | | if(roleType ==2){ |
| | |
| | | samplingRecordOperation.setSendTime(LocalDateTime.now()); |
| | | } |
| | | samplingRecordOperationService.updateBatchById(samplingRecordOperations); |
| | | |
| | | // 查询取样记录信息 |
| | | TSamplingRecord samplingRecord = samplingRecordService.getById(samplingRecordOperations.get(0).getSamplingId()); |
| | | // 查询实验调度 |
| | | TExperimentDispatch experimentDispatch = experimentDispatchService.getById(samplingRecord.getDispatchId()); |
| | | // 查询实验调度参与人员 |
| | | List<TExperimentDispatchParticipants> teamStaffs = experimentDispatchParticipantsService.list(Wrappers.lambdaQuery(TExperimentDispatchParticipants.class) |
| | | .eq(TExperimentDispatchParticipants::getDispatchId, experimentDispatch.getId()) |
| | | .eq(TExperimentDispatchParticipants::getRoleType, 4)); |
| | | // MESSAGE 添加消息 |
| | | teamStaffs.forEach(teamStaff -> { |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【送样单】等待确认接收样品", tokenService.getLoginUser().getUser().getNickName(),13); |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | .in(TSamplingRecordOperation::getId, ids)); |
| | | for (TSamplingRecordOperation samplingRecordOperation : samplingRecordOperations) { |
| | | samplingRecordOperation.setStatus(3); |
| | | samplingRecordOperation.setSendPersonId(userId); |
| | | samplingRecordOperation.setSendSign(samplingRecordOperation.getReceiptsSign()); |
| | | samplingRecordOperation.setSendTime(LocalDateTime.now()); |
| | | samplingRecordOperation.setReceiptsPersonId(userId); |
| | | samplingRecordOperation.setReceiptsSign(samplingRecordOperation.getReceiptsSign()); |
| | | samplingRecordOperation.setReceiptsTime(LocalDateTime.now()); |
| | | } |
| | | samplingRecordOperationService.updateBatchById(samplingRecordOperations); |
| | | return R.ok(); |