|
|
@ -1,5 +1,7 @@
|
|
|
|
package com.ibeetl.jlw.web;
|
|
|
|
package com.ibeetl.jlw.web;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
import cn.jlw.Interceptor.SCoreUser;
|
|
|
|
import cn.jlw.Interceptor.SCoreUser;
|
|
|
|
import cn.jlw.validate.ValidateConfig;
|
|
|
|
import cn.jlw.validate.ValidateConfig;
|
|
|
@ -310,6 +312,18 @@ public class HandsOnController{
|
|
|
|
if(result.hasErrors()){
|
|
|
|
if(result.hasErrors()){
|
|
|
|
return JsonResult.failMessage(result);
|
|
|
|
return JsonResult.failMessage(result);
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
|
|
|
|
// 判断按理名称重复,同小节和同章节下
|
|
|
|
|
|
|
|
String handsOnName = handsOn.getHandsOnName();
|
|
|
|
|
|
|
|
if (handsOnName != null && !handsOnName.isEmpty()) {
|
|
|
|
|
|
|
|
HandsOnQuery query = new HandsOnQuery();
|
|
|
|
|
|
|
|
query.setCourseInfoId(handsOn.getCourseInfoId());
|
|
|
|
|
|
|
|
query.setCourseChildNode(handsOn.getCourseChildNode());
|
|
|
|
|
|
|
|
query.setHandsOnName(handsOnName);
|
|
|
|
|
|
|
|
List<HandsOn> valuesByQuery = handsOnService.getValuesByQuery(query);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.isTrue(CollectionUtil.isEmpty(valuesByQuery), "同一小节或者章节下,不允许重复的案例名称,请修改后再次提交!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
handsOn.setAddTime(new Date());
|
|
|
|
handsOn.setAddTime(new Date());
|
|
|
|
handsOn.setOrgId(coreUser.getOrgId());
|
|
|
|
handsOn.setOrgId(coreUser.getOrgId());
|
|
|
|
handsOn.setUserId(coreUser.getId());
|
|
|
|
handsOn.setUserId(coreUser.getId());
|
|
|
|