| | |
| | | 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.ApplicationTerminationAuditDTO; |
| | | import com.ruoyi.system.dto.ApplicationTerminationDTO; |
| | |
| | | @PostMapping(value = "/api/t-experiment-scheme/update") |
| | | public R<Boolean> update(@RequestBody String param) { |
| | | TExperimentSchemeDTO dto = JSON.parseObject(param,TExperimentSchemeDTO.class); |
| | | |
| | | if (SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | dto.setStatus(null); |
| | | } |
| | | |
| | | experimentSchemeService.updateById(dto); |
| | | experimentSchemePersonService.remove(Wrappers.lambdaQuery(TExperimentSchemePerson.class).eq(TExperimentSchemePerson::getSchemeId,dto.getId())); |
| | | List<TExperimentSchemePerson> experimentSchemePersons = dto.getExperimentSchemePersons(); |
| | | if (experimentSchemePersons != null) { |
| | | experimentSchemePersons.forEach(experimentSchemePerson -> { |
| | | experimentSchemePerson.setSchemeId(dto.getId()); |
| | | experimentSchemePerson.setCommitTime(LocalDateTime.now()); |
| | | }); |
| | | experimentSchemePersonService.saveBatch(experimentSchemePersons); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | List<TExperimentSchemePerson> experimentSchemePersons = experimentSchemePersonService.list(Wrappers.lambdaQuery(TExperimentSchemePerson.class) |
| | | .eq(TExperimentSchemePerson::getSchemeId, id)); |
| | | List<Long> userIds = experimentSchemePersons.stream().map(TExperimentSchemePerson::getUserId).collect(Collectors.toList()); |
| | | |
| | | if (!userIds.isEmpty()) { |
| | | List<SysUser> sysUsers = sysUserMapper.selectUserByIds(userIds); |
| | | sysUsers.forEach(sysUser -> { |
| | | experimentSchemePersons.stream().filter(experimentSchemePerson -> experimentSchemePerson.getUserId().equals(sysUser.getUserId())).forEach(experimentSchemePerson -> { |
| | |
| | | experimentSchemePerson.setAvatar(sysUser.getAvatar()); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | experimentSchemeVO.setExperimentSchemePersons(experimentSchemePersons); |
| | | // 查询实验调度信息 |
| | | TExperimentDispatch experimentDispatch = experimentDispatchService.getById(experimentSchemeVO.getDispatchId()); |