소스 검색

fix 导入

he2802 3 년 전
부모
커밋
3b7471c9d9

+ 1 - 5
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseSectionController.java

@@ -125,11 +125,7 @@ public class CourseSectionController extends BaseController {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         String operName = loginUser.getUsername();
         String message = iCourseSectionService.importSection(sectionList, updateSupport, operName);
-        if(Validator.isNotEmpty(message)){
-            return AjaxResult.error(message);
-        }else{
-            return AjaxResult.success(message);
-        }
+        return AjaxResult.success(message);
     }
 
     /**

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

@@ -199,20 +199,20 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
             Index++;
             CourseSectionAddBo bo = new CourseSectionAddBo();
             if(!Validator.isNotEmpty(sectionImport.getName())){
-               errorLog+="第"+Index+"条:"+"节标题空白\n";
+               errorLog+="第"+Index+"条:"+"节标题空白。\r\n";
                 continue;
             }
             if(!Validator.isNotEmpty(sectionImport.getPrefixName())){
-                errorLog+="第"+Index+"条:"+"标题前缀空白\n";
+                errorLog+="第"+Index+"条:"+"标题前缀空白。\r\n";
                 continue;
             }
             if(!Validator.isNotEmpty(sectionImport.getPrefixName())){
-                errorLog+="第"+Index+"条:"+"标题前缀空白\n";
+                errorLog+="第"+Index+"条:"+"标题前缀空白。\r\n";
                 continue;
             }
             System.out.println(sectionImport);
             if(!Validator.isNotEmpty(sectionImport.getPublishStatus())){
-                errorLog+="第"+Index+"条:"+"发布状态空白\n";
+                errorLog+="第"+Index+"条:"+"发布状态空白。\r\n";
                 continue;
             }
             //业务层次,导入每条只有一条业务层次
@@ -220,27 +220,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()+"-该教育类型不存在\n";
+                errorLog+="第"+Index+"条:"+sectionImport.getEducationType()+"-该教育类型不存在。\r\n";
                 continue;
             }
             Long projectId = findProjectId(sectionImport.getProject());
             if(!Validator.isNotEmpty(projectId)){
-                errorLog+="第"+Index+"条:"+sectionImport.getProject()+"-该项目类型不存在\n";
+                errorLog+="第"+Index+"条:"+sectionImport.getProject()+"-该项目类型不存在。\r\n";
                 continue;
             }
             Long businessId = findBusinessId(sectionImport.getBusiness());
             if(!Validator.isNotEmpty(businessId)){
-                errorLog+="第"+Index+"条:"+sectionImport.getBusiness()+"-该业务层次不存在\n";
+                errorLog+="第"+Index+"条:"+sectionImport.getBusiness()+"-该业务层次不存在。\r\n";
                 continue;
             }
             Long subjectId = findSubjectId(sectionImport.getSubject());
             if(!Validator.isNotEmpty(subjectId)){
-                errorLog+="第"+Index+"条:"+sectionImport.getSubject()+"-该科目不存在\n";
+                errorLog+="第"+Index+"条:"+sectionImport.getSubject()+"-该科目不存在。\r\n";
                 continue;
             }
             Integer sectionType = findType(sectionImport.getSectionType());
             if(!Validator.isNotEmpty(sectionType)){
-                errorLog+="第"+Index+"条:"+sectionImport.getSectionType()+"-该节类型不存在\n";
+                errorLog+="第"+Index+"条:"+sectionImport.getSectionType()+"-该节类型不存在。\r\n";
                 continue;
             }
             addBo.setEducationTypeId(eduId);

+ 14 - 13
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseSectionImport.java

@@ -32,9 +32,21 @@ public class CourseSectionImport {
     @ApiModelProperty("名称")
     private String name;
     /** 前缀名称 */
-    @Excel(name = "*标题前缀")
+    @Excel(name = "标题前缀")
     @ApiModelProperty("前缀名称")
     private String prefixName;
+    /** 教育类型ID */
+    @Excel(name = "教育类型")
+    private String educationType;
+    /** 项目ID */
+    @Excel(name = "项目类型")
+    private String project;
+    /** 业务层次id */
+    @Excel(name = "业务层次")
+    private String business;
+    /** 科目id */
+    @Excel(name = "科目")
+    private String subject;
     /** 节类型 1录播 2直播 3回放 */
     @Excel(name = "节类型")
     @ApiModelProperty("节类型 1录播 2直播 3回放")
@@ -63,16 +75,5 @@ public class CourseSectionImport {
     @ApiModelProperty("节时长(分钟)")
     private Long durationTime;
 
-    /** 教育类型ID */
-    @Excel(name = "教育类型")
-    private String educationType;
-    /** 业务层次id */
-    @Excel(name = "业务层次")
-    private String business;
-    /** 科目id */
-    @Excel(name = "科目")
-    private String subject;
-    /** 项目ID */
-    @Excel(name = "项目类型")
-    private String project;
+
 }