|
@@ -173,7 +173,7 @@ public class GoodsLogic {
|
|
|
|
|
|
|
|
|
|
|
|
|
//记录用户浏览记录
|
|
//记录用户浏览记录
|
|
|
- if (user != null) {
|
|
|
|
|
|
|
+ if (Objects.nonNull(user)) {
|
|
|
GoodsVisit goodsVisit = new GoodsVisit();
|
|
GoodsVisit goodsVisit = new GoodsVisit();
|
|
|
goodsVisit.setGoodsId(goodsId);
|
|
goodsVisit.setGoodsId(goodsId);
|
|
|
goodsVisit.setGoodsName(goodsBean.getGoodsName());
|
|
goodsVisit.setGoodsName(goodsBean.getGoodsName());
|
|
@@ -225,10 +225,13 @@ public class GoodsLogic {
|
|
|
.collect(Collectors.toMap(GoodsMaterialStorage::getGoodsMaterialId, GoodsMaterialStorage::getStockQty));
|
|
.collect(Collectors.toMap(GoodsMaterialStorage::getGoodsMaterialId, GoodsMaterialStorage::getStockQty));
|
|
|
|
|
|
|
|
//是否有收藏
|
|
//是否有收藏
|
|
|
- Integer goodsFavoritesCount = goodsFavoriteService.lambdaQuery()
|
|
|
|
|
- .eq(GoodsFavorite::getGoodsId, goodsId)
|
|
|
|
|
- .eq(GoodsFavorite::getUserId, user.getUserId())
|
|
|
|
|
- .count();
|
|
|
|
|
|
|
+ Integer goodsFavoritesCount = 0;
|
|
|
|
|
+ if (Objects.nonNull(user)) {
|
|
|
|
|
+ goodsFavoritesCount = goodsFavoriteService.lambdaQuery()
|
|
|
|
|
+ .eq(GoodsFavorite::getGoodsId, goodsId)
|
|
|
|
|
+ .eq(GoodsFavorite::getUserId, user.getUserId())
|
|
|
|
|
+ .count();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 获取会员等级商品规格
|
|
// 获取会员等级商品规格
|
|
|
Map<String, UserLevelGoods> userLevelGoodsMap = this.queryUserLevelGoodsMap(currentCompanyWechat);
|
|
Map<String, UserLevelGoods> userLevelGoodsMap = this.queryUserLevelGoodsMap(currentCompanyWechat);
|
|
@@ -251,7 +254,7 @@ public class GoodsLogic {
|
|
|
.one();
|
|
.one();
|
|
|
|
|
|
|
|
// 如果有到货通知未执行的
|
|
// 如果有到货通知未执行的
|
|
|
- if (Objects.nonNull(notice)) {
|
|
|
|
|
|
|
+ if (Objects.nonNull(notice) && Objects.nonNull(user)) {
|
|
|
final Integer count = goodsAdviceNoticeItemService.lambdaQuery()
|
|
final Integer count = goodsAdviceNoticeItemService.lambdaQuery()
|
|
|
.eq(GoodsAdviceNoticeItem::getGoodsAdviceNoticeId, notice.getId())
|
|
.eq(GoodsAdviceNoticeItem::getGoodsAdviceNoticeId, notice.getId())
|
|
|
.eq(GoodsAdviceNoticeItem::getUserId, user.getUserId())
|
|
.eq(GoodsAdviceNoticeItem::getUserId, user.getUserId())
|