From 3824cbcaec6e6c67418d5280a53e9c2fedeef6f9 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 11 七月 2019 16:34:13 +0800 Subject: [PATCH] 订单bug,分享爆款自购修改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/goods/RecommendUserGoodsServiceImpl.java | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/RecommendUserGoodsServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/RecommendUserGoodsServiceImpl.java index e0a025d..55cd457 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/RecommendUserGoodsServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/RecommendUserGoodsServiceImpl.java @@ -18,6 +18,7 @@ import com.yeshi.fanli.exception.goods.RecommendUserGoodsException; import com.yeshi.fanli.service.inter.goods.CommonGoodsService; import com.yeshi.fanli.service.inter.goods.RecommendUserGoodsService; +import com.yeshi.fanli.util.StringUtil; @Service public class RecommendUserGoodsServiceImpl implements RecommendUserGoodsService { @@ -92,4 +93,19 @@ return recommendUserGoodsMapper.countRecommendGoodsByDevice(device); } + @Override + public void syncDeviceAndUid(Long uid, String targetDevice) { + + List<RecommendUserGoods> list = recommendUserGoodsMapper.listRecommendGoods(uid, 0, 20); + for (RecommendUserGoods ru : list) { + if (StringUtil.isNullOrEmpty(ru.getDevice())) { + RecommendUserGoods update = new RecommendUserGoods(); + update.setId(ru.getId()); + update.setDevice(targetDevice); + recommendUserGoodsMapper.updateByPrimaryKeySelective(update); + } + } + + } + } -- Gitblit v1.8.0