Commit e82c7bd3 authored by muhong's avatar muhong

修改 浏览量

parent ff26d761
...@@ -572,6 +572,7 @@ public class ItemServiceImpl implements ItemService { ...@@ -572,6 +572,7 @@ public class ItemServiceImpl implements ItemService {
} }
} }
if (Objects.nonNull(userItemsRelation) && !userItemsRelation.getUserId().equals(dto.getUserId())) {
// 添加或更新用户足迹 // 添加或更新用户足迹
Footprint footprint = footPrintDao.selectByUserIdItem(dto.getUserId(), item.getId()); Footprint footprint = footPrintDao.selectByUserIdItem(dto.getUserId(), item.getId());
Date now = new Date(); Date now = new Date();
...@@ -597,6 +598,7 @@ public class ItemServiceImpl implements ItemService { ...@@ -597,6 +598,7 @@ public class ItemServiceImpl implements ItemService {
footPrintDao.upateTime(footprint); footPrintDao.upateTime(footprint);
} }
} }
}
// 设置藏品的发布用户昵称和头像 // 设置藏品的发布用户昵称和头像
itemCommonService.getNicknameAvatar(item.getId(), itemResponseVo); itemCommonService.getNicknameAvatar(item.getId(), itemResponseVo);
...@@ -714,6 +716,16 @@ public class ItemServiceImpl implements ItemService { ...@@ -714,6 +716,16 @@ public class ItemServiceImpl implements ItemService {
long count = favoritesItemsRelationDao.countByItemId(item.getId()); long count = favoritesItemsRelationDao.countByItemId(item.getId());
String collectCount = StringUtil.formatCount(count); String collectCount = StringUtil.formatCount(count);
// 更新藏品发布者的收藏数
UserItemsRelation userItemsRelation = userItemsRelationDao.find(item.getId());
if (Objects.nonNull(userItemsRelation)) {
UserCollectBrowseNum userCollectBrowseNum = userCollectBrowseNumDao.findByUserId(userItemsRelation.getUserId());
if (Objects.nonNull(userCollectBrowseNum)) {
userCollectBrowseNum.setCollectNum(userCollectBrowseNum.getCollectNum() - 1);
userCollectBrowseNumDao.update(userCollectBrowseNum);
}
}
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("collectCount", collectCount); map.put("collectCount", collectCount);
return Result.success(map); return Result.success(map);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment