mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-10 03:16:48 +08:00
Compare commits
2 Commits
20251103-1
...
20251031-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ede914452 | ||
|
|
309599f43f |
@@ -15,8 +15,6 @@ import javax.annotation.Resource;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import it.sauronsoftware.jave.Encoder;
|
|
||||||
import it.sauronsoftware.jave.MultimediaInfo;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -48,6 +46,8 @@ import com.xboe.module.scorm.SCORMParser;
|
|||||||
import com.xboe.standard.BaseConstant;
|
import com.xboe.standard.BaseConstant;
|
||||||
import com.xboe.standard.enums.BoedxCourseFileType;
|
import com.xboe.standard.enums.BoedxCourseFileType;
|
||||||
|
|
||||||
|
import it.sauronsoftware.jave.Encoder;
|
||||||
|
import it.sauronsoftware.jave.MultimediaInfo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -279,7 +279,7 @@ public class CourseFileApi extends ApiBaseController {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("读取视频时长错误", e);
|
log.error("读取视频时长错误", e);
|
||||||
return error("视频解析失败,尝试重新上传或联系管理员", "视频解析失败,尝试重新上传或联系管理员");
|
// e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.xboe.module.course.dao;
|
||||||
|
|
||||||
|
import com.xboe.core.orm.BaseDao;
|
||||||
|
import com.xboe.module.course.entity.ModifyLog;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class ModifyLogDao extends BaseDao<ModifyLog> {
|
||||||
|
|
||||||
|
public void insert(String requestId, String location, String body, String remark) {
|
||||||
|
ModifyLog entity = new ModifyLog();
|
||||||
|
entity.setRequestId(requestId);
|
||||||
|
entity.setLocation(location);
|
||||||
|
entity.setBody(body);
|
||||||
|
entity.setRemark(remark);
|
||||||
|
|
||||||
|
save(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.xboe.module.course.entity;
|
||||||
|
|
||||||
|
import com.xboe.core.SysConstant;
|
||||||
|
import com.xboe.core.orm.IdBaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 讲师删除记录表
|
||||||
|
* 为了监控PngCode-SZX-1227问题临时创建的表
|
||||||
|
*
|
||||||
|
* @author guo jia
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Table(name = SysConstant.TABLE_PRE + "modify_log")
|
||||||
|
public class ModifyLog extends IdBaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求ID
|
||||||
|
*/
|
||||||
|
private String requestId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 位置
|
||||||
|
*/
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求body
|
||||||
|
*/
|
||||||
|
private String body;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注信息
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ import javax.management.Query;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.xboe.api.ThirdApi;
|
import com.xboe.api.ThirdApi;
|
||||||
import com.xboe.core.orm.*;
|
import com.xboe.core.orm.*;
|
||||||
import com.xboe.module.course.dao.*;
|
import com.xboe.module.course.dao.*;
|
||||||
@@ -116,6 +117,9 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
@Resource
|
@Resource
|
||||||
private CourseTeacherDeletedRecordDao courseTeacherDeletedRecordDao;
|
private CourseTeacherDeletedRecordDao courseTeacherDeletedRecordDao;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ModifyLogDao modifyLogDao;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成过滤条件
|
* 生成过滤条件
|
||||||
*
|
*
|
||||||
@@ -910,6 +914,7 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
for (CourseTeacher ct : full.getTeachers()) {
|
for (CourseTeacher ct : full.getTeachers()) {
|
||||||
ct.setCourseId(c.getId());
|
ct.setCourseId(c.getId());
|
||||||
courseTeacherDao.save(ct);
|
courseTeacherDao.save(ct);
|
||||||
|
addBoeCourseTeacherModifyLog(ct, "M1位置讲师名修改", JSONUtil.toJsonStr(ct), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (full.getCrowds() != null && !full.getCrowds().isEmpty()) {
|
if (full.getCrowds() != null && !full.getCrowds().isEmpty()) {
|
||||||
@@ -1000,6 +1005,7 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
for (CourseTeacher ct : full.getTeachers()) {
|
for (CourseTeacher ct : full.getTeachers()) {
|
||||||
ct.setCourseId(c.getId());
|
ct.setCourseId(c.getId());
|
||||||
courseTeacherDao.saveOrUpdate(ct);
|
courseTeacherDao.saveOrUpdate(ct);
|
||||||
|
addBoeCourseTeacherModifyLog(ct, "M2位置讲师名修改", JSONUtil.toJsonStr(ct), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//先清空受众信息,受众信息如果不一样了,也要加入到日志中
|
//先清空受众信息,受众信息如果不一样了,也要加入到日志中
|
||||||
@@ -1056,6 +1062,7 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
for (CourseTeacher ct : full.getTeachers()) {
|
for (CourseTeacher ct : full.getTeachers()) {
|
||||||
ct.setCourseId(c.getId());
|
ct.setCourseId(c.getId());
|
||||||
courseTeacherDao.saveOrUpdate(ct);
|
courseTeacherDao.saveOrUpdate(ct);
|
||||||
|
addBoeCourseTeacherModifyLog(ct, "M3位置讲师名修改", JSONUtil.toJsonStr(ct), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//先清空受众信息,受众信息如果不一样了,也要加入到日志中
|
//先清空受众信息,受众信息如果不一样了,也要加入到日志中
|
||||||
@@ -1093,6 +1100,7 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
for (CourseTeacher ct : full.getTeachers()) {
|
for (CourseTeacher ct : full.getTeachers()) {
|
||||||
ct.setCourseId(c.getId());
|
ct.setCourseId(c.getId());
|
||||||
courseTeacherDao.saveOrUpdate(ct);
|
courseTeacherDao.saveOrUpdate(ct);
|
||||||
|
addBoeCourseTeacherModifyLog(ct, "M4位置讲师名修改", JSONUtil.toJsonStr(ct), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//先清空受众信息,受众信息如果不一样了,也要加入到日志中
|
//先清空受众信息,受众信息如果不一样了,也要加入到日志中
|
||||||
@@ -2030,4 +2038,20 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增加boe_course_teacher的teacher_name字段被改为"BOE教师"的监控
|
||||||
|
*/
|
||||||
|
private void addBoeCourseTeacherModifyLog(CourseTeacher ct, String location, String body, String remark) {
|
||||||
|
try {
|
||||||
|
if (ct == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Objects.equals(ct.getTeacherName(), "BOE教师")) {
|
||||||
|
modifyLogDao.insert(null, location, body, remark);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("创建boe_course_teacher记录失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user