Commit 7ce6b368 authored by luzhuang's avatar luzhuang

更新代码

parent 2cbf362f
...@@ -203,6 +203,7 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -203,6 +203,7 @@ public class BChapterServiceImpl implements BChapterService {
if (model.getIsTest() == null || model.getIsTest().equals("")) { if (model.getIsTest() == null || model.getIsTest().equals("")) {
model.setIsTest(""); model.setIsTest("");
} }
model.setIsTest(dto.getType());
int sort = bChapterRepository.selectMaxSort(model.getPid(), model.getLessonId()); int sort = bChapterRepository.selectMaxSort(model.getPid(), model.getLessonId());
model.setSort(sort); model.setSort(sort);
...@@ -214,7 +215,7 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -214,7 +215,7 @@ public class BChapterServiceImpl implements BChapterService {
line = bChapterRepository.insertSelective(model); line = bChapterRepository.insertSelective(model);
} else { } else {
model.setClassHour("1"); model.setClassHour("1");
model.setCourseTime(dto.getFileTime()); model.setCourseTime(dto.getFileTime().substring(0,dto.getFileTime().lastIndexOf(".")));
// model.setCorpId(corpId); // model.setCorpId(corpId);
bFile.setChapterId(model.getBusinessId()); bFile.setChapterId(model.getBusinessId());
bFile.setLessonId(model.getLessonId()); bFile.setLessonId(model.getLessonId());
...@@ -234,10 +235,11 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -234,10 +235,11 @@ public class BChapterServiceImpl implements BChapterService {
} }
} else { } else {
UserUtil.setCurrentMergeOperation(model); UserUtil.setCurrentMergeOperation(model);
bFile.setChapterId(model.getBusinessId()); bFile.setChapterId(model.getBusinessId());
UserUtil.setCurrentMergeOperation(bFile); UserUtil.setCurrentMergeOperation(bFile);
model.setCourseTime(dto.getFileTime()); model.setCourseTime(dto.getFileTime());
model.setIsTest(dto.getType());
model.setCourseTime(dto.getFileTime().substring(0,dto.getFileTime().lastIndexOf(".")));
//先判断该课程的第一章的第一节是否是本节 更新blesson表中course_time字段 //先判断该课程的第一章的第一节是否是本节 更新blesson表中course_time字段
String cid = bChapterRepository.getFirstChapter(model.getLessonId()); String cid = bChapterRepository.getFirstChapter(model.getLessonId());
if (cid.equals(model.getBusinessId())) { if (cid.equals(model.getBusinessId())) {
......
...@@ -51,7 +51,7 @@ public interface BFileRepository extends BaseMapper<BFile> { ...@@ -51,7 +51,7 @@ public interface BFileRepository extends BaseMapper<BFile> {
"VALUES (#{businessId}, #{lessonId}, #{chapterId}, #{fileName}, #{videoUrl}, #{fileUrl}, #{type}, #{flag}, #{delFlag}, #{remarks}, #{createBy}, #{updateBy}, #{updateDate}, #{createDate},#{fileSize})") "VALUES (#{businessId}, #{lessonId}, #{chapterId}, #{fileName}, #{videoUrl}, #{fileUrl}, #{type}, #{flag}, #{delFlag}, #{remarks}, #{createBy}, #{updateBy}, #{updateDate}, #{createDate},#{fileSize})")
int insertUploadFile(BFile bFile); int insertUploadFile(BFile bFile);
@Update("update b_file set file_name = #{fileName} , video_url = #{videoUrl} , type = #{type} " + @Update("update b_file set file_name = #{fileName} , video_url = #{videoUrl} , type = #{type} ,file_size = #{fileSize}" +
"where chapter_id =#{chapterId}") "where chapter_id =#{chapterId}")
int updateUploadFile(BFile bFile); int updateUploadFile(BFile bFile);
......
...@@ -61,7 +61,7 @@ public class BLabelController extends PaginationController<BLabel> { ...@@ -61,7 +61,7 @@ public class BLabelController extends PaginationController<BLabel> {
return Result.builder(data, return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
bLabel.getBusinessId()); bLabel);
} }
@ApiOperation(value="504 添加新标签", notes="根据businessId插入新标签") @ApiOperation(value="504 添加新标签", notes="根据businessId插入新标签")
...@@ -73,7 +73,7 @@ public class BLabelController extends PaginationController<BLabel> { ...@@ -73,7 +73,7 @@ public class BLabelController extends PaginationController<BLabel> {
return Result.builder(data, return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
null); bLabel);
} }
@ApiOperation(value="505 根据条件查询", notes="根据条件查询标签") @ApiOperation(value="505 根据条件查询", notes="根据条件查询标签")
......
...@@ -20,7 +20,7 @@ import javax.validation.constraints.NotNull; ...@@ -20,7 +20,7 @@ import javax.validation.constraints.NotNull;
public class BLabel extends IdEntity<BLabel> { public class BLabel extends IdEntity<BLabel> {
/*标签名称*/ /*标签名称*/
@Length(min = 1,max = 64,message = "标签名称过长") @Length(min = 0,max = 64,message = "标签名称过长")
private String lName; private String lName;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment