From d8359ddb48dab5cc797a9d552e11fde571f4920c Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期二, 27 八月 2019 12:32:46 +0800 Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div --- 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