Commit cdda9321 authored by muhong's avatar muhong

修改 浏览量

parent e82c7bd3
......@@ -572,31 +572,29 @@ public class ItemServiceImpl implements ItemService {
}
}
if (Objects.nonNull(userItemsRelation) && !userItemsRelation.getUserId().equals(dto.getUserId())) {
// 添加或更新用户足迹
Footprint footprint = footPrintDao.selectByUserIdItem(dto.getUserId(), item.getId());
Date now = new Date();
if (Objects.isNull(footprint)) {
Footprint newVo = new Footprint();
newVo.setUserId(dto.getUserId());
newVo.setItemId(item.getId());
newVo.setDeleted(false);
newVo.setAddTime(now);
newVo.setUpdateTime(now);
footPrintDao.insert(newVo);
// 更新藏品发布者的浏览量
if (Objects.nonNull(userItemsRelation)) {
UserCollectBrowseNum userCollectBrowseNum = userCollectBrowseNumDao.findByUserId(userItemsRelation.getUserId());
if (Objects.nonNull(userCollectBrowseNum)) {
userCollectBrowseNum.setBrowseNum(userCollectBrowseNum.getBrowseNum() + 1);
userCollectBrowseNumDao.update(userCollectBrowseNum);
}
// 添加或更新用户足迹
Footprint footprint = footPrintDao.selectByUserIdItem(dto.getUserId(), item.getId());
Date now = new Date();
if (Objects.isNull(footprint)) {
Footprint newVo = new Footprint();
newVo.setUserId(dto.getUserId());
newVo.setItemId(item.getId());
newVo.setDeleted(false);
newVo.setAddTime(now);
newVo.setUpdateTime(now);
footPrintDao.insert(newVo);
// 更新藏品发布者的浏览量
if (Objects.nonNull(userItemsRelation)) {
UserCollectBrowseNum userCollectBrowseNum = userCollectBrowseNumDao.findByUserId(userItemsRelation.getUserId());
if (Objects.nonNull(userCollectBrowseNum) && !userItemsRelation.getUserId().equals(dto.getUserId())) {
userCollectBrowseNum.setBrowseNum(userCollectBrowseNum.getBrowseNum() + 1);
userCollectBrowseNumDao.update(userCollectBrowseNum);
}
} else {
footprint.setUpdateTime(now);
footPrintDao.upateTime(footprint);
}
} else {
footprint.setUpdateTime(now);
footPrintDao.upateTime(footprint);
}
}
......
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