he2802 před 3 roky
rodič
revize
7824910ff3

+ 2 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseSectionController.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.controller.course;
 
+import java.util.Collections;
 import java.util.List;
 import java.util.Arrays;
 
@@ -122,6 +123,7 @@ public class CourseSectionController extends BaseController {
     {
         ExcelUtil<CourseSectionImport> util = new ExcelUtil<CourseSectionImport>(CourseSectionImport.class);
         List<CourseSectionImport> sectionList = util.importExcel(file.getInputStream());
+        Collections.reverse(sectionList);
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         String operName = loginUser.getUsername();
         String message = iCourseSectionService.importSection(sectionList, updateSupport, operName);

+ 14 - 13
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java

@@ -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;

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamSiteQueryBo.java

@@ -49,4 +49,6 @@ public class ExamSiteQueryBo extends BaseEntity {
 	/** 1启用 0关闭 -1删除 */
 	@ApiModelProperty("1启用 0关闭 -1删除")
 	private List<Integer> status;
+
+
 }