mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-10 19:36:50 +08:00
szx-1194 删除日志
This commit is contained in:
@@ -1,18 +1,12 @@
|
||||
package com.xboe.module.course.api;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xboe.module.course.dao.ThreadLogDao;
|
||||
|
||||
import com.boe.feign.api.infrastructure.entity.CommonSearchVo;
|
||||
import com.boe.feign.api.infrastructure.entity.Dict;
|
||||
import com.xboe.api.ThirdApi;
|
||||
@@ -99,10 +93,7 @@ public class CourseManageApi extends ApiBaseController{
|
||||
IDataUserSyncService userSyncService;
|
||||
@Resource
|
||||
private ThirdApi thirdApi;
|
||||
|
||||
@Autowired
|
||||
private ThreadLogDao threadLogDao;
|
||||
|
||||
|
||||
// @PostMapping("/test")
|
||||
// public JsonResponse<PageList<Course>> findTest(Pagination pager,CourseQueryDto dto){
|
||||
// //dto.setOrgAid("7003708665807110150");
|
||||
@@ -640,11 +631,7 @@ public class CourseManageApi extends ApiBaseController{
|
||||
}
|
||||
String email = userBasicInfoVoList.get(0).getEmail();
|
||||
log.info("审批获取邮箱 userBasicInfoVoList.get(0).getEmail():{}", email);
|
||||
|
||||
// 记录日志到boe_thread_log表(只有当email不为空时才记录)
|
||||
if (StringUtils.isNotBlank(email)) {
|
||||
saveEmailLog(email);
|
||||
}
|
||||
|
||||
|
||||
return email;
|
||||
} catch (Exception e) {
|
||||
@@ -1279,47 +1266,4 @@ public class CourseManageApi extends ApiBaseController{
|
||||
courseService.saveTip(aid);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存邮箱日志到boe_thread_log表
|
||||
* @param email 获取到的邮箱地址
|
||||
*/
|
||||
@Transactional
|
||||
public void saveEmailLog(String email) {
|
||||
// 如果email为null或空,写入占位并记录日志
|
||||
if (StringUtils.isBlank(email)) {
|
||||
log.warn("邮箱地址为空,使用占位值记录日志");
|
||||
email = "null";
|
||||
}
|
||||
|
||||
try {
|
||||
JSONObject extraData = new JSONObject();
|
||||
extraData.put("email", email);
|
||||
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
String threadName = "email";
|
||||
|
||||
String sql = "INSERT INTO boe_thread_log (system_name,module_name,action_name,level,content,thread_name,extra_data,remark,create_time,create_id,create_name,update_time,update_id,update_name) "
|
||||
+ "VALUES (?1,?2,?3,?4,?5,?6,?7,?8,?9,?10,?11,?12,?13,?14)";
|
||||
|
||||
threadLogDao.sqlUpdate(sql,
|
||||
"课程审批",
|
||||
"课程审批邮箱",
|
||||
"记录获取的邮箱",
|
||||
"info",
|
||||
null,
|
||||
threadName,
|
||||
extraData.toJSONString(),
|
||||
null,
|
||||
now,
|
||||
null,
|
||||
null,
|
||||
now,
|
||||
null,
|
||||
null);
|
||||
log.info("课程审批邮箱日志插入成功, email={}", email);
|
||||
} catch (Exception ex) {
|
||||
log.error("保存课程审批邮箱日志失败 email={}", email, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user