提交 f64b3b80 authored 作者: zhouzhigang's avatar zhouzhigang

--no commit message

上级 ba430d73
......@@ -60,7 +60,7 @@ public interface FgPublicBasicRelationService extends BaseService<PublicBasicRel
* @author zzg
* @date: 2019年7月30日 下午3:57:01
*/
boolean exportSave(List<ImportLessonExcelVo> list,Integer id,String type);
Integer exportSave(ImportLessonExcelVo vo,Integer id,String type);
}
......@@ -137,35 +137,36 @@ public class FgPublicBasicRelationServiceImpl extends BaseServiceImpl<PublicBasi
}
@Override
public boolean exportSave(List<ImportLessonExcelVo> list, Integer id,String type) {
list.forEach(vo ->{
PublicBasicRelation entity = new PublicBasicRelation();
if(PublicLessonTypeEnum.SYSTEM.getCode().equals(vo.getType())){
CallBack<ResourceSearchVo> data = fgResouceClient.get(vo.getISBN());
if(data != null && data.getData() != null){
ResourceSearchVo resource = data.getData();
entity.setExerciseBookId(resource.getExerciseBookId());
entity.setExerciseBookType("1-4");
entity.setGuidebooksId(resource.getGuideBooksId());
entity.setGuidebooksType("1-3");
entity.setResourceId(resource.getId());
entity.setResourceType(resource.getType());
}
public Integer exportSave(ImportLessonExcelVo vo, Integer id,String type) {
PublicBasicRelation entity = new PublicBasicRelation();
//系统教材
if(PublicLessonTypeEnum.SYSTEM.getCode().equals(vo.getType())){
CallBack<ResourceSearchVo> data = fgResouceClient.get(vo.getISBN());
if(data != null && data.getData() != null){
ResourceSearchVo resource = data.getData();
entity.setExerciseBookId(resource.getExerciseBookId());
entity.setExerciseBookType("1-4");
entity.setGuidebooksId(resource.getGuideBooksId());
entity.setGuidebooksType("1-3");
entity.setResourceId(resource.getId());
entity.setResourceType(resource.getType());
}
if(PublicLessonTypeEnum.SCHOOL_BASED_LIBRARY.getCode().equals(vo.getType())){
SchoolAsedLibrary form = new SchoolAsedLibrary();
form.setRelationId(redis.getMember().getRelationId());
form.setType(redis.getMember().getType());
form.setResourceName(vo.getResourceName());
SchoolAsedLibrary library = fgSchoolAsedLibraryService.selectOne(form);
if(library != null){
entity.setResourceId(library.getId());
}
}
//校本库
if(PublicLessonTypeEnum.SCHOOL_BASED_LIBRARY.getCode().equals(vo.getType())){
SchoolAsedLibrary form = new SchoolAsedLibrary();
form.setRelationId(redis.getMember().getRelationId());
form.setType(redis.getMember().getType());
form.setResourceName(vo.getResourceName());
SchoolAsedLibrary library = fgSchoolAsedLibraryService.selectOne(form);
if(library != null){
entity.setResourceId(library.getId());
}
entity.setLessonId(id);
entity.setType(type);
});
return true;
}
entity.setLessonId(id);
entity.setType(type);
super.insert(entity);
return entity.getId();
}
......
......@@ -505,8 +505,12 @@ public class FgPublicLessonServiceImpl extends BaseModelServiceImpl<PublicLesson
pl.setTrainingHours(trainingHours);
super.insert(pl);
//绑定课程跟教材的关系
fgPublicBasicRelationService.exportSave(voList, pl.getId(), type);
//绑定教材和课时的关系
voList.forEach(vo ->{
Integer id = fgPublicBasicRelationService.exportSave(vo, pl.getId(), type);
//绑定教材和课时的关系
});
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论