...
|
...
|
@@ -67,18 +67,18 @@ public class MessageNoteServiceImpl implements MessageNoteService { |
|
|
if (id.contains(splitItem)) {
|
|
|
String[] split = id.split(splitItem);
|
|
|
for (int i = 0; i < split.length; i++) {
|
|
|
MessageNote messageNote = messageNoteMapper.selectByPrimaryKey(split[i]);
|
|
|
if (messageNote != null) {
|
|
|
messageNoteMapper.deleteByPrimaryKey(split[i]);
|
|
|
}
|
|
|
// MessageNote messageNote = messageNoteMapper.selectByPrimaryKey(split[i]);
|
|
|
// if (messageNote != null) {
|
|
|
// messageNoteMapper.deleteByPrimaryKey(split[i]);
|
|
|
// }
|
|
|
elasticsearchService.deleteMessageNoteById(split[i]);
|
|
|
}
|
|
|
return 2;
|
|
|
} else {
|
|
|
MessageNote messageNote = messageNoteMapper.selectByPrimaryKey(id);
|
|
|
if (messageNote != null) {
|
|
|
messageNoteMapper.deleteByPrimaryKey(id);
|
|
|
}
|
|
|
// MessageNote messageNote = messageNoteMapper.selectByPrimaryKey(id);
|
|
|
// if (messageNote != null) {
|
|
|
// messageNoteMapper.deleteByPrimaryKey(id);
|
|
|
// }
|
|
|
elasticsearchService.deleteMessageNoteById(id);
|
|
|
return 2;
|
|
|
}
|
...
|
...
|
@@ -163,10 +163,9 @@ public class MessageNoteServiceImpl implements MessageNoteService { |
|
|
.description(description)
|
|
|
.build();
|
|
|
MessageNote note = note_fillId(messageNote);
|
|
|
int num = messageNoteMapper.insertSelective(note);
|
|
|
// int num = messageNoteMapper.insertSelective(note);
|
|
|
// ES没有事务,故先执行SQL
|
|
|
insertMessageToES(note);
|
|
|
return num;
|
|
|
return insertMessageToES(note) ? 1 : 0;
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -262,10 +261,9 @@ public class MessageNoteServiceImpl implements MessageNoteService { |
|
|
.superPassword(busServer.getSuperPassword())
|
|
|
.build();
|
|
|
directUtils.sendMessage(xmlData);
|
|
|
int num = messageNoteMapper.insertSelective(note);
|
|
|
// int num = messageNoteMapper.insertSelective(note);
|
|
|
// ES没有事务,故先执行SQL
|
|
|
insertMessageToES(note);
|
|
|
return num;
|
|
|
return insertMessageToES(note) ? 1 : 0;
|
|
|
} else {
|
|
|
return 0;
|
|
|
}
|
...
|
...
|
@@ -277,9 +275,9 @@ public class MessageNoteServiceImpl implements MessageNoteService { |
|
|
*
|
|
|
* @param note 消息
|
|
|
*/
|
|
|
public void insertMessageToES(MessageNote note)
|
|
|
public Boolean insertMessageToES(MessageNote note)
|
|
|
{
|
|
|
elasticsearchService.saveOrUpdateMessageNote(note);
|
|
|
return elasticsearchService.saveOrUpdateMessageNote(note);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|