|
@@ -122,18 +122,39 @@ public class CourseStreamingServiceImpl extends ServiceImpl<CourseStreamingMappe
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean updateByEditBo(CourseStreamingEditBo bo) {
|
|
|
- CourseStreaming update = BeanUtil.toBean(bo, CourseStreaming.class);
|
|
|
- validEntityBeforeSave(update);
|
|
|
- update.setUpdateTime(DateUtils.getNowTime());
|
|
|
- if(bo.getBusinessList()!= null){
|
|
|
- iCourseStreamingBusinessService.remove(new LambdaQueryWrapper<CourseStreamingBusiness>().eq(CourseStreamingBusiness::getStreamingId, bo.getId()));
|
|
|
- for(int i=0;i<bo.getBusinessList().size();i++){
|
|
|
- CourseStreamingBusinessAddBo item = bo.getBusinessList().get(i);
|
|
|
- item.setStreamingId(bo.getId());
|
|
|
- iCourseStreamingBusinessService.insertByAddBo(item);
|
|
|
+ if(Validator.isNotEmpty(bo.getIds())&&bo.getIds().size()>0){
|
|
|
+ Boolean result = false;
|
|
|
+ for(Long id : bo.getIds()){
|
|
|
+ CourseStreaming update = BeanUtil.toBean(bo, CourseStreaming.class);
|
|
|
+ update.setId(id);
|
|
|
+ validEntityBeforeSave(update);
|
|
|
+ update.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ if(bo.getBusinessList()!= null){
|
|
|
+ iCourseStreamingBusinessService.remove(new LambdaQueryWrapper<CourseStreamingBusiness>().eq(CourseStreamingBusiness::getStreamingId, bo.getId()));
|
|
|
+ for(int i=0;i<bo.getBusinessList().size();i++){
|
|
|
+ CourseStreamingBusinessAddBo item = bo.getBusinessList().get(i);
|
|
|
+ item.setStreamingId(bo.getId());
|
|
|
+ iCourseStreamingBusinessService.insertByAddBo(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ result = this.updateById(update);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }else{
|
|
|
+ CourseStreaming update = BeanUtil.toBean(bo, CourseStreaming.class);
|
|
|
+ validEntityBeforeSave(update);
|
|
|
+ update.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ if(bo.getBusinessList()!= null){
|
|
|
+ iCourseStreamingBusinessService.remove(new LambdaQueryWrapper<CourseStreamingBusiness>().eq(CourseStreamingBusiness::getStreamingId, bo.getId()));
|
|
|
+ for(int i=0;i<bo.getBusinessList().size();i++){
|
|
|
+ CourseStreamingBusinessAddBo item = bo.getBusinessList().get(i);
|
|
|
+ item.setStreamingId(bo.getId());
|
|
|
+ iCourseStreamingBusinessService.insertByAddBo(item);
|
|
|
+ }
|
|
|
}
|
|
|
+ return this.updateById(update);
|
|
|
}
|
|
|
- return this.updateById(update);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|