|
@@ -6,12 +6,17 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
-import com.zhongzheng.modules.course.bo.CourseHandoutsBusinessAddBo;
|
|
|
+import com.zhongzheng.modules.course.bo.*;
|
|
|
import com.zhongzheng.modules.course.domain.CourseEducationTier;
|
|
|
+import com.zhongzheng.modules.course.domain.CourseFile;
|
|
|
import com.zhongzheng.modules.course.domain.CourseHandoutsBusiness;
|
|
|
+import com.zhongzheng.modules.course.service.ICourseFileService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseHandoutsBusinessService;
|
|
|
import com.zhongzheng.modules.course.vo.CourseHandoutsBusinessVo;
|
|
|
+import com.zhongzheng.modules.goods.bo.GoodsCourseAddBo;
|
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
|
+import com.zhongzheng.modules.goods.domain.GoodsAttached;
|
|
|
+import com.zhongzheng.modules.goods.domain.GoodsCourse;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -19,9 +24,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.pagehelper.Page;
|
|
|
-import com.zhongzheng.modules.course.bo.CourseHandoutsAddBo;
|
|
|
-import com.zhongzheng.modules.course.bo.CourseHandoutsQueryBo;
|
|
|
-import com.zhongzheng.modules.course.bo.CourseHandoutsEditBo;
|
|
|
import com.zhongzheng.modules.course.domain.CourseHandouts;
|
|
|
import com.zhongzheng.modules.course.mapper.CourseHandoutsMapper;
|
|
|
import com.zhongzheng.modules.course.vo.CourseHandoutsVo;
|
|
@@ -44,6 +46,8 @@ public class CourseHandoutsServiceImpl extends ServiceImpl<CourseHandoutsMapper,
|
|
|
private ICourseHandoutsBusinessService courseHandoutsBusinessService;
|
|
|
@Autowired
|
|
|
private IGoodsService iGoodsService;
|
|
|
+ @Autowired
|
|
|
+ private ICourseFileService iCourseFileService;
|
|
|
|
|
|
@Override
|
|
|
public CourseHandoutsVo queryById(Long handoutsId){
|
|
@@ -113,6 +117,21 @@ public class CourseHandoutsServiceImpl extends ServiceImpl<CourseHandoutsMapper,
|
|
|
addBusiness.setUpdateTime(DateUtils.getNowTime());
|
|
|
courseHandoutsBusinessService.save(addBusiness);
|
|
|
}
|
|
|
+ //文件列表
|
|
|
+ if (bo.getFileList() != null && bo.getFileList().size() > 0) {
|
|
|
+ Collection<CourseFile> coll = new HashSet<>();
|
|
|
+ for (int i = 0; i < bo.getFileList().size(); i++) {
|
|
|
+ CourseFileAddBo item = bo.getFileList().get(i);
|
|
|
+ CourseFile addItem = new CourseFile();
|
|
|
+ addItem.setMajorId(add.getHandoutsId());
|
|
|
+ addItem.setType(1);
|
|
|
+ addItem.setUrl(item.getUrl());
|
|
|
+ addItem.setSort(item.getSort());
|
|
|
+ addItem.setUrlName(item.getUrlName());
|
|
|
+ coll.add(addItem);
|
|
|
+ }
|
|
|
+ iCourseFileService.saveBatch(coll);
|
|
|
+ }
|
|
|
return save;
|
|
|
}
|
|
|
|
|
@@ -134,6 +153,22 @@ public class CourseHandoutsServiceImpl extends ServiceImpl<CourseHandoutsMapper,
|
|
|
courseHandoutsBusinessService.save(addBusiness);
|
|
|
}
|
|
|
}
|
|
|
+ //文件列表
|
|
|
+ if (bo.getFileList() != null && bo.getFileList().size() > 0) {
|
|
|
+ iCourseFileService.remove(new LambdaQueryWrapper<CourseFile>().eq(CourseFile::getType, 1).eq(CourseFile::getMajorId, update.getHandoutsId()));
|
|
|
+ Collection<CourseFile> coll = new HashSet<>();
|
|
|
+ for (int i = 0; i < bo.getFileList().size(); i++) {
|
|
|
+ CourseFileAddBo item = bo.getFileList().get(i);
|
|
|
+ CourseFile addItem = new CourseFile();
|
|
|
+ addItem.setMajorId(update.getHandoutsId());
|
|
|
+ addItem.setType(1);
|
|
|
+ addItem.setUrl(item.getUrl());
|
|
|
+ addItem.setSort(item.getSort());
|
|
|
+ addItem.setUrlName(item.getUrlName());
|
|
|
+ coll.add(addItem);
|
|
|
+ }
|
|
|
+ iCourseFileService.saveBatch(coll);
|
|
|
+ }
|
|
|
return this.updateById(update);
|
|
|
}
|
|
|
|