解决删除掉的考核依旧提示名称已存在

hehai
rong.liu 4 years ago
parent 63c5aac00b
commit fd9a20a400
  1. 7
      src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java

@ -34,6 +34,7 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
ExperimentalTeachingEntity et = experimentalTeachingService.getById(id); ExperimentalTeachingEntity et = experimentalTeachingService.getById(id);
return R.ok().put("ExperimentalTeaching", et); return R.ok().put("ExperimentalTeaching", et);
} }
/** /**
* 根据邀请码查询 * 根据邀请码查询
*/ */
@ -44,6 +45,7 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
.eq("is_del", Constant.IsDel.NOT_DEL)); .eq("is_del", Constant.IsDel.NOT_DEL));
return R.ok().put("InvitationCode", one); return R.ok().put("InvitationCode", one);
} }
/** /**
* 查询 * 查询
*/ */
@ -135,7 +137,10 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
public R checkExperimentalName(@RequestParam String experimentalName) { public R checkExperimentalName(@RequestParam String experimentalName) {
QueryWrapper<ExperimentalTeachingEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<ExperimentalTeachingEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("experimental_name", experimentalName); queryWrapper.eq("experimental_name", experimentalName);
if (experimentalTeachingService.count(queryWrapper)>0){return R.error(200,"实验名称不能重复");} queryWrapper.eq("is_del", 0);
if (experimentalTeachingService.count(queryWrapper) > 0) {
return R.error(200, "实验名称不能重复");
}
return R.ok(); return R.ok();
} }
// /** // /**

Loading…
Cancel
Save