mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-08 02:16:49 +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.HttpServletResponse;
|
||||
|
||||
import it.sauronsoftware.jave.Encoder;
|
||||
import it.sauronsoftware.jave.MultimediaInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
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.enums.BoedxCourseFileType;
|
||||
|
||||
import it.sauronsoftware.jave.Encoder;
|
||||
import it.sauronsoftware.jave.MultimediaInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
@@ -256,7 +256,7 @@ public class CourseFileApi extends ApiBaseController {
|
||||
}
|
||||
String fileFullPath = SysConstant.getConfigValue(BaseConstant.CONFIG_UPLOAD_FILES_SAVEPATH) + file.getFilePath();
|
||||
if ("mp3,mp4".indexOf(file.getFileType()) > -1){
|
||||
log.info("上传 "+file.getFileType()+"文件:"+file.getFilePath());
|
||||
log.info("上传 "+file.getFileType()+"文件:"+file.getFilePath());
|
||||
Encoder encoder = new Encoder();
|
||||
try {
|
||||
//System.out.println(fileFullPath);
|
||||
@@ -279,7 +279,7 @@ public class CourseFileApi extends ApiBaseController {
|
||||
}
|
||||
} catch (Exception 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.CollectionUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.xboe.api.ThirdApi;
|
||||
import com.xboe.core.orm.*;
|
||||
import com.xboe.module.course.dao.*;
|
||||
@@ -116,6 +117,9 @@ public class CourseServiceImpl implements ICourseService {
|
||||
@Resource
|
||||
private CourseTeacherDeletedRecordDao courseTeacherDeletedRecordDao;
|
||||
|
||||
@Resource
|
||||
private ModifyLogDao modifyLogDao;
|
||||
|
||||
/**
|
||||
* 生成过滤条件
|
||||
*
|
||||
@@ -910,6 +914,7 @@ public class CourseServiceImpl implements ICourseService {
|
||||
for (CourseTeacher ct : full.getTeachers()) {
|
||||
ct.setCourseId(c.getId());
|
||||
courseTeacherDao.save(ct);
|
||||
addBoeCourseTeacherModifyLog(ct, "M1位置讲师名修改", JSONUtil.toJsonStr(ct), null);
|
||||
}
|
||||
}
|
||||
if (full.getCrowds() != null && !full.getCrowds().isEmpty()) {
|
||||
@@ -1000,6 +1005,7 @@ public class CourseServiceImpl implements ICourseService {
|
||||
for (CourseTeacher ct : full.getTeachers()) {
|
||||
ct.setCourseId(c.getId());
|
||||
courseTeacherDao.saveOrUpdate(ct);
|
||||
addBoeCourseTeacherModifyLog(ct, "M2位置讲师名修改", JSONUtil.toJsonStr(ct), null);
|
||||
}
|
||||
}
|
||||
//先清空受众信息,受众信息如果不一样了,也要加入到日志中
|
||||
@@ -1056,6 +1062,7 @@ public class CourseServiceImpl implements ICourseService {
|
||||
for (CourseTeacher ct : full.getTeachers()) {
|
||||
ct.setCourseId(c.getId());
|
||||
courseTeacherDao.saveOrUpdate(ct);
|
||||
addBoeCourseTeacherModifyLog(ct, "M3位置讲师名修改", JSONUtil.toJsonStr(ct), null);
|
||||
}
|
||||
}
|
||||
//先清空受众信息,受众信息如果不一样了,也要加入到日志中
|
||||
@@ -1093,6 +1100,7 @@ public class CourseServiceImpl implements ICourseService {
|
||||
for (CourseTeacher ct : full.getTeachers()) {
|
||||
ct.setCourseId(c.getId());
|
||||
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