|
@@ -6,7 +6,6 @@ import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.exception.user.ProjectException;
|
|
|
-import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
|
|
import com.ruoyi.generator.domain.Community.CommunityReturnRecord;
|
|
@@ -217,21 +216,24 @@ public class CommunityChatMsgController extends BaseController {
|
|
|
long otherUserId = updateAnonName.getOtherUserId();
|
|
|
String newAnonName = updateAnonName.getNewAnonName();
|
|
|
String type = updateAnonName.getType();
|
|
|
+ String returnRecordId = updateAnonName.getReturnRecordId();
|
|
|
try {
|
|
|
if ("anonymous".equals(type)) {
|
|
|
- List<CommunityChatMsg> chatMsgList = communitychatMsgMapper.getChatMsgRecord(userId, otherUserId, type);
|
|
|
- for (CommunityChatMsg chatMsg : chatMsgList) {
|
|
|
- if (chatMsg.getSenderId().equals(otherUserId)) {
|
|
|
- chatMsg.setSenderAnonName(newAnonName);
|
|
|
- }
|
|
|
+ CommunityReturnRecord returnRecord = communityReturnRecordService.getOne(new UpdateWrapper<CommunityReturnRecord>()
|
|
|
+ .eq("id", returnRecordId));
|
|
|
+ if (returnRecord.getReturnCreateUserId().equals(otherUserId)) {
|
|
|
+ System.out.println("修改创建者者匿名名称:" + newAnonName);
|
|
|
+ communityReturnRecordService.update(new UpdateWrapper<CommunityReturnRecord>()
|
|
|
+ .eq("id", returnRecordId)
|
|
|
+ .set("return_create_anon_name", newAnonName));
|
|
|
+ }
|
|
|
|
|
|
- if (chatMsg.getReceiverId().equals(otherUserId)) {
|
|
|
- chatMsg.setReceiverAnonName(newAnonName);
|
|
|
- }
|
|
|
- chatMsg.setUpdateBy(SecurityUtils.getUserId());
|
|
|
- chatMsg.setUpdateTime(DateUtils.parseDate(DateUtils.getDate()));
|
|
|
+ if (returnRecord.getReturnReceiveUserId().equals(otherUserId)) {
|
|
|
+ System.out.println("修改接收者者匿名名称:" + newAnonName);
|
|
|
+ communityReturnRecordService.update(new UpdateWrapper<CommunityReturnRecord>()
|
|
|
+ .eq("id", returnRecordId)
|
|
|
+ .set("return_receive_anon_name", newAnonName));
|
|
|
}
|
|
|
- communityChatMsgService.updateBatchById(chatMsgList);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
System.out.println(e.getMessage());
|