|
|
@@ -196,21 +196,22 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
|
|
|
String importNo = ServletUtils.getEncoded("IMPORT");
|
|
|
int i=10;
|
|
|
int Index = 0;
|
|
|
+ int size = sectionList.size();
|
|
|
for (CourseSectionImport sectionImport : sectionList) {
|
|
|
|
|
|
Index++;
|
|
|
CourseSectionAddBo bo = new CourseSectionAddBo();
|
|
|
if(!Validator.isNotEmpty(sectionImport.getName())){
|
|
|
- errorLog+="第"+Index+"条:"+"节标题空白。\r\n";
|
|
|
+ errorLog+="第"+ (size - Index)+"条:"+"节标题空白。\r\n";
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
if(!Validator.isNotEmpty(sectionImport.getPublishStatus())){
|
|
|
- errorLog+="第"+Index+"条:"+"发布状态空白。\r\n";
|
|
|
+ errorLog+="第"+(size - Index)+"条:"+"发布状态空白。\r\n";
|
|
|
continue;
|
|
|
}
|
|
|
if(!sectionImport.getPublishStatus().equals("发布")&&!sectionImport.getPublishStatus().equals("未发布")){
|
|
|
- errorLog+="第"+Index+"条:"+"发布状态错误。\r\n";
|
|
|
+ errorLog+="第"+(size - Index)+"条:"+"发布状态错误。\r\n";
|
|
|
continue;
|
|
|
}
|
|
|
//业务层次,导入每条只有一条业务层次
|
|
|
@@ -218,27 +219,27 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
|
|
|
CourseSectionBusinessAddBo addBo = new CourseSectionBusinessAddBo();
|
|
|
Long eduId = findEduId(sectionImport.getEducationType());
|
|
|
if(!Validator.isNotEmpty(eduId)){
|
|
|
- errorLog+="第"+Index+"条:"+sectionImport.getEducationType()+"-该教育类型不存在。\r\n";
|
|
|
+ errorLog+="第"+(size - Index)+"条:"+sectionImport.getEducationType()+"-该教育类型不存在。\r\n";
|
|
|
continue;
|
|
|
}
|
|
|
Long projectId = findProjectId(sectionImport.getProject(),eduId);
|
|
|
if(!Validator.isNotEmpty(projectId)){
|
|
|
- errorLog+="第"+Index+"条:"+sectionImport.getProject()+"-该项目类型不存在或者和教育类型不匹配。\r\n";
|
|
|
+ errorLog+="第"+(size - Index)+"条:"+sectionImport.getProject()+"-该项目类型不存在或者和教育类型不匹配。\r\n";
|
|
|
continue;
|
|
|
}
|
|
|
Long businessId = findBusinessId(sectionImport.getBusiness(),projectId);
|
|
|
if(!Validator.isNotEmpty(businessId)){
|
|
|
- errorLog+="第"+Index+"条:"+sectionImport.getBusiness()+"-该业务层次不存在或者和项目类型不匹配。\r\n";
|
|
|
+ errorLog+="第"+(size - Index)+"条:"+sectionImport.getBusiness()+"-该业务层次不存在或者和项目类型不匹配。\r\n";
|
|
|
continue;
|
|
|
}
|
|
|
Long subjectId = findSubjectId(sectionImport.getSubject());
|
|
|
if(!Validator.isNotEmpty(subjectId)){
|
|
|
- errorLog+="第"+Index+"条:"+sectionImport.getSubject()+"-该科目不存在。\r\n";
|
|
|
+ errorLog+="第"+(size - Index)+"条:"+sectionImport.getSubject()+"-该科目不存在。\r\n";
|
|
|
continue;
|
|
|
}
|
|
|
Integer sectionType = findType(sectionImport.getSectionType());
|
|
|
if(!Validator.isNotEmpty(sectionType)){
|
|
|
- errorLog+="第"+Index+"条:"+sectionImport.getSectionType()+"-该节类型不存在。\r\n";
|
|
|
+ errorLog+="第"+(size - Index)+"条:"+sectionImport.getSectionType()+"-该节类型不存在。\r\n";
|
|
|
continue;
|
|
|
}
|
|
|
addBo.setEducationTypeId(eduId);
|
|
|
@@ -262,29 +263,29 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
|
|
|
bo.setCoverUrl("oss/images/avatar/20211013/1634097664410_1397766697");
|
|
|
if(Validator.isNotEmpty(sectionImport.getLiveStartTime())){
|
|
|
if(sectionImport.getLiveStartTime().length()!=19){
|
|
|
- errorLog+="第"+Index+"条:直播开始时间不对。\r\n";
|
|
|
+ errorLog+="第"+(size - Index)+"条:直播开始时间不对。\r\n";
|
|
|
continue;
|
|
|
}
|
|
|
try{
|
|
|
bo.setLiveStartTime(Convert.toLong(DateUtils.dateTimeThrow("yyyy-MM-dd HH:mm:ss",sectionImport.getLiveStartTime()).getTime())/1000);
|
|
|
}catch (ParseException e){
|
|
|
- errorLog+="第"+Index+"条:直播开始时间不对。\r\n";
|
|
|
+ errorLog+="第"+(size - Index)+"条:直播开始时间不对。\r\n";
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
if(Validator.isNotEmpty(sectionImport.getLiveEndTime())){
|
|
|
if(sectionImport.getLiveStartTime().length()!=19){
|
|
|
- errorLog+="第"+Index+"条:直播结束时间不对。\r\n";
|
|
|
+ errorLog+="第"+(size - Index)+"条:直播结束时间不对。\r\n";
|
|
|
continue;
|
|
|
}
|
|
|
try{
|
|
|
bo.setLiveEndTime(Convert.toLong(DateUtils.dateTimeThrow("yyyy-MM-dd HH:mm:ss",sectionImport.getLiveEndTime()).getTime())/1000);
|
|
|
}catch (ParseException e){
|
|
|
- errorLog+="第"+Index+"条:直播结束时间不对。\r\n";
|
|
|
+ errorLog+="第"+(size - Index)+"条:直播结束时间不对。\r\n";
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
- errorLog = insertByAddBoImport(bo,errorLog,Index);
|
|
|
+ errorLog = insertByAddBoImport(bo,errorLog,(size - Index));
|
|
|
i++;
|
|
|
}
|
|
|
return errorLog;
|