|
@@ -3,6 +3,8 @@ package com.zhongzheng.modules.course.service.impl;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.lang.Validator;
|
|
import cn.hutool.core.lang.Validator;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
@@ -14,6 +16,7 @@ import com.zhongzheng.modules.course.mapper.CourseChapterMapper;
|
|
import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
|
|
import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
|
|
import com.zhongzheng.modules.course.service.*;
|
|
import com.zhongzheng.modules.course.service.*;
|
|
import com.zhongzheng.modules.course.vo.CourseChapterVo;
|
|
import com.zhongzheng.modules.course.vo.CourseChapterVo;
|
|
|
|
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
|
|
import com.zhongzheng.modules.goods.domain.GoodsAttached;
|
|
import com.zhongzheng.modules.goods.domain.GoodsAttached;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -196,6 +199,16 @@ public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, C
|
|
return this.removeByIds(ids);
|
|
return this.removeByIds(ids);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public boolean batchDelChapter(GoodsBatchDelBo bo) {
|
|
|
|
+ if (CollectionUtils.isEmpty(bo.getIds())){
|
|
|
|
+ throw new CustomException("模块ID不能为空");
|
|
|
|
+ }
|
|
|
|
+ return update(new LambdaUpdateWrapper<CourseChapter>()
|
|
|
|
+ .set(CourseChapter::getStatus,bo.getStatus())
|
|
|
|
+ .in(CourseChapter::getChapterId,bo.getIds()));
|
|
|
|
+ }
|
|
|
|
+
|
|
private boolean checkNameUnique(CourseChapter entity) {
|
|
private boolean checkNameUnique(CourseChapter entity) {
|
|
CourseChapter info = getOne(new LambdaQueryWrapper<CourseChapter>()
|
|
CourseChapter info = getOne(new LambdaQueryWrapper<CourseChapter>()
|
|
.eq(CourseChapter::getPrefixName,entity.getPrefixName()).eq(CourseChapter::getName,entity.getName()).last("limit 1"));
|
|
.eq(CourseChapter::getPrefixName,entity.getPrefixName()).eq(CourseChapter::getName,entity.getName()).last("limit 1"));
|