fix(操作日志):优化消息对比内容问题 #1005218
--bug=1005218 --user=赵勇 【系统设置-操作日志】... https://www.tapd.cn/55049933/s/1025939
This commit is contained in:
parent
6a7055e9cd
commit
b815b251f1
|
@ -16,7 +16,7 @@ public class NoticeController {
|
||||||
private NoticeService noticeService;
|
private NoticeService noticeService;
|
||||||
|
|
||||||
@PostMapping("save/message/task")
|
@PostMapping("save/message/task")
|
||||||
@MsAuditLog(module = "organization_message_settings", type = OperLogConstants.UPDATE, content = "#msClass.getLogDetails(#messageDetail.id)", msClass = NoticeService.class)
|
@MsAuditLog(module = "organization_message_settings", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#messageDetail.id)", content = "#msClass.getLogDetails(#messageDetail.id)", msClass = NoticeService.class)
|
||||||
public void saveMessage(@RequestBody MessageDetail messageDetail) {
|
public void saveMessage(@RequestBody MessageDetail messageDetail) {
|
||||||
noticeService.saveMessageTask(messageDetail);
|
noticeService.saveMessageTask(messageDetail);
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,12 +216,21 @@ public class NoticeService {
|
||||||
public String getLogDetails(String id) {
|
public String getLogDetails(String id) {
|
||||||
MessageTask task = messageTaskMapper.selectByPrimaryKey(id);
|
MessageTask task = messageTaskMapper.selectByPrimaryKey(id);
|
||||||
if (task == null) {
|
if (task == null) {
|
||||||
MessageTaskExample example = new MessageTaskExample();
|
try {
|
||||||
example.createCriteria().andIdentificationEqualTo(id);
|
MessageTaskExample example = new MessageTaskExample();
|
||||||
List<MessageTask> tasks = messageTaskMapper.selectByExample(example);
|
example.createCriteria().andIdentificationEqualTo(id);
|
||||||
List<String> names = tasks.stream().map(MessageTask::getType).collect(Collectors.toList());
|
List<MessageTask> tasks = messageTaskMapper.selectByExample(example);
|
||||||
OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(id), null, String.join(",", names), null, new LinkedList<>());
|
List<String> names = tasks.stream().map(MessageTask::getType).collect(Collectors.toList());
|
||||||
return JSON.toJSONString(details);
|
OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(id), null, String.join(",", names), null, new LinkedList<>());
|
||||||
|
return JSON.toJSONString(details);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
task = new MessageTask();
|
||||||
|
List<DetailColumn> columns = ReflexObjectUtil.getColumns(task, SystemReference.messageColumns);
|
||||||
|
OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(task.getId()), null,
|
||||||
|
StatusReference.statusMap.containsKey(task.getTaskType()) ? StatusReference.statusMap.get(task.getTaskType()) : task.getTaskType(), task.getUserId(), columns);
|
||||||
|
return JSON.toJSONString(details);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (task != null) {
|
if (task != null) {
|
||||||
List<DetailColumn> columns = ReflexObjectUtil.getColumns(task, SystemReference.messageColumns);
|
List<DetailColumn> columns = ReflexObjectUtil.getColumns(task, SystemReference.messageColumns);
|
||||||
|
|
Loading…
Reference in New Issue