[java]代码库
for(int i=0;i<selectFlags.length; i++){
isRepeatList=courseChapterBean.CheckIsCheck(selectFlags[i], courseId);
if(isRepeatList == null || isRepeatList.size() ==0){
List<CourseChapter> courseChapterList = new ArrayList<CourseChapter>();
courseChapter = new CourseChapter();
courseChapter.setCourseId(courseId);// 设置课程Id
courseChapter.setOperator(userId);// 设置操作人(此处应该为登录的用户名)
courseChapter.setChapterId(selectFlags[i]);
courseChapterList.add(courseChapter);
courseChapterBean.Mysave(courseChapterList);
result="添加成功";
}
else{
result= selectFlags[i]+"已经存在,请勿重复添加";
}
}
JsonUtils.outJson(response, result);