Browse Source

优化更新实验校验实验名称长度

pull/225/head
chenzhihang 9 months ago
parent
commit
5287dc374f
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DevEnvironmentServiceImpl.java

+ 4
- 0
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DevEnvironmentServiceImpl.java View File

@@ -128,6 +128,10 @@ public class DevEnvironmentServiceImpl implements DevEnvironmentService {
*/
@Override
public DevEnvironment update(DevEnvironment devEnvironment) throws Exception {
DevEnvironment devByName = devEnvironmentDao.getByName(devEnvironment.getName());
if (devByName != null && !devByName.getId().equals(devEnvironment.getId())) {
throw new RuntimeException("开发环境名称已存在");
}
devEnvironment.setUpdateBy(devEnvironment.getCreateBy());
devEnvironment.setUpdateTime(new Date());
this.devEnvironmentDao.update(devEnvironment);


Loading…
Cancel
Save