Commit cdda9321 authored by muhong's avatar muhong

修改 浏览量

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