Commit d01b1e29 authored by luzhuang's avatar luzhuang

feat: 新增lessonlog构造

parent 75b016ff
......@@ -3,6 +3,7 @@ package org.rcisoft.business.blessonlog.entity;
import lombok.*;
import org.rcisoft.core.entity.IdEntity;
import org.rcisoft.core.util.UserUtil;
import javax.persistence.*;
......@@ -33,5 +34,10 @@ public class BLessonLog extends IdEntity<BLessonLog> {
private String lessonId;
public static BLessonLog generate(String content,String lessonId){
BLessonLog bLessonLog = new BLessonLog(content,lessonId);
UserUtil.setCurrentPersistOperation(bLessonLog);
return bLessonLog;
}
}
......@@ -8,7 +8,6 @@ import org.rcisoft.business.bfile.dao.BPFileRepository;
import org.rcisoft.business.bfile.entity.BFile;
import org.rcisoft.business.blesson.dao.BLessonRepository;
import org.rcisoft.business.blesson.dao.BPLessonRepository;
import org.rcisoft.business.blesson.dto.LessonAllDTO;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.enums.ReleaseStateEnum;
import org.rcisoft.business.blessonlog.dao.BLessonLogRepository;
......@@ -148,10 +147,7 @@ public class BMessageServiceImpl implements BMessageService {
List<BLessonLog> list = new ArrayList<>();
//将操作日志添加到每一个课程
for(BLesson lesson : lessons){
BLessonLog log = new BLessonLog();
UserUtil.setCurrentPersistOperation(log);
log.setContent("1".equals(bMessage.getTimeValue())?"开启共享":"关闭共享");
log.setLessonId(lesson.getBusinessId());
BLessonLog log = BLessonLog.generate("1".equals(bMessage.getTimeValue())?"开启共享":"关闭共享",lesson.getBusinessId());
list.add(log);
}
bLessonLogRepository.insertList(list);
......
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