| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.ExperimentDispatchSignDTO; |
| | | import com.ruoyi.system.dto.TExperimentDispatchDTO; |
| | |
| | | // 查询项目组 |
| | | 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()) |
| | |
| | | @PostMapping(value = "/api/t-experiment-dispatch/update") |
| | | public R<Boolean> update(@RequestBody String param) { |
| | | TExperimentDispatchDTO dto = JSON.parseObject(param,TExperimentDispatchDTO.class); |
| | | |
| | | if (SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | dto.setStatus(null); |
| | | experimentDispatchService.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | experimentDispatchService.updateById(dto); |
| | | |
| | | // 添加实验分组 |
| | | experimentDispatchGroupService.remove(Wrappers.lambdaQuery(TExperimentDispatchGroup.class).eq(TExperimentDispatchGroup::getDispatchId, dto.getId())); |
| | | List<TExperimentDispatchGroup> experimentDispatchGroups = dto.getExperimentDispatchGroups(); |
| | |
| | | experimentDispatchTask.setDispatchId(dto.getId()); |
| | | }); |
| | | experimentDispatchTaskService.saveBatch(experimentDispatchTasks); |
| | | // MESSAGE 添加消息 |
| | | if(!dto.getStatus().equals(-1)){ |
| | | experimentDispatchParticipants.stream().filter(e->e.getRoleType().equals(4)).forEach(teamStaff -> { |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【实验调度】等待确认", tokenService.getLoginUser().getUser().getNickName(),11); |
| | | }); |
| | | experimentDispatchParticipants.stream().filter(e->e.getRoleType().equals(5)).forEach(teamStaff -> { |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【实验调度】等待确认", tokenService.getLoginUser().getUser().getNickName(),14); |
| | | }); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |