From 24587fd1b4af52469d1e122d2a495eea79d6865e Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 24 七月 2023 14:39:30 +0800 Subject: [PATCH] 淘客返利场景修复 --- fanli/src/main/java/com/yeshi/fanli/controller/client/lijin/GoodsControllerLijin.java | 34 ++++++++++++++++++++++++---------- 1 files changed, 24 insertions(+), 10 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/lijin/GoodsControllerLijin.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/lijin/GoodsControllerLijin.java index 5b7a39d..82f7944 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/lijin/GoodsControllerLijin.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/lijin/GoodsControllerLijin.java @@ -74,6 +74,9 @@ public class GoodsControllerLijin { Logger userGoodsScanLogger = LoggerFactory.getLogger("userGoodsScanLog"); + + + @Resource private TaoBaoGoodsCacheUtil taoBaoGoodsCacheUtil; @@ -150,7 +153,7 @@ } - TaoBaoGoodsBrief goods = getTaoBaoGoods(Long.parseLong(goodsId)); + TaoBaoGoodsBrief goods = getTaoBaoGoods(goodsId); //鍔犺浇璧勯噾淇℃伅 com.yeshi.fanli.vo.goods.GoodsDetailVO goodsDetailVO1 = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); @@ -164,7 +167,7 @@ GoodsDetailVOLijinFactory.fillRights(goodsDetailVO.getGoods()); // 搴楅摵淇℃伅 - TaoBaoShop shop = taoBaoShopService.getTaoBaoShop(goods.getId(), goods.getSellerId()); + TaoBaoShop shop = taoBaoShopService.getTaoBaoShop(goods.getAuctionId(), goods.getSellerId()); if (shop != null) { String shopLink = shop.getShopLink(); if (StringUtil.isNullOrEmpty(shopLink)) { @@ -271,13 +274,24 @@ break; } - userGoodsScanLogger.info("{}", new Gson().toJson(UserGoodsScanLog.UserGoodsScanLogFactory.create(goodsDetailVO.getGoods(), uid, acceptData.getUtdid(), acceptData.getDevice()))); + ThreadUtil.run(new Runnable() { + + + @Override + public void run() { + try { + userGoodsScanLogger.info("{}", new Gson().toJson(UserGoodsScanLog.UserGoodsScanLogFactory.create(goodsDetailVO.getGoods(), uid, acceptData.getUtdid(), acceptData.getDevice()))); + }catch(Exception e){ + + } + } + }); //鏄惁鏀惰棌 extraVO.setCollected(false); if (uid != null) { - CollectionGoodsV2 collectionGoodsV2 = collectionGoodsV2Service.findByUidAndAuctionId(uid, goodsType == Constant.SOURCE_TYPE_SUNING ? goodsIdSuning : Long.parseLong(goodsDetailVO.getGoods().getGoodsId()), goodsType); + CollectionGoodsV2 collectionGoodsV2 = collectionGoodsV2Service.findByUidAndAuctionId(uid, goodsType == Constant.SOURCE_TYPE_SUNING ? goodsIdSuning+"" : goodsDetailVO.getGoods().getGoodsId(), goodsType); if (collectionGoodsV2 != null) { extraVO.setCollected(true); } @@ -291,7 +305,7 @@ extraVO.setBuyValid(true); extraVO.setListCouponUser(listCouponUser); goodsDetailVO.setExtra(extraVO); - loadLijinInfo(uid, goodsDetailVO); + loadLijinInfo(uid, acceptData.getSystem(), goodsDetailVO); //娓呴櫎涓存椂淇℃伅 goodsDetailVO.getGoods().setTempCoupon(null); if (goodsDetailVO.getGoods().getLabels() == null) @@ -321,7 +335,7 @@ try { - LiJinExpendRecord record = goodsLijinMnager.createTBLijin(Long.parseLong(goodsId), uid, new Date(user.getCreatetime())); + LiJinExpendRecord record = goodsLijinMnager.createTBLijin(goodsId, uid, new Date(user.getCreatetime())); String sendUrl = record.getSendUrl(); if (StringUtil.isNullOrEmpty(sendUrl)) { out.print(JsonUtil.loadFalseResult("绀奸噾鍒涘缓澶辫触")); @@ -366,19 +380,19 @@ * * @param goodsDetailVO */ - private void loadLijinInfo(Long uid, GoodsDetailVO goodsDetailVO) { + private void loadLijinInfo(Long uid, SystemEnum system, GoodsDetailVO goodsDetailVO) { VIPEnum vipRank = userLijinMnager.getVIPRank(uid); - GoodsDetailVO.GoodsHongBaoListVO.UserLevelVO userLevelVO = goodsLijinMnager.getUserLevel(vipRank, true); + GoodsDetailVO.GoodsHongBaoListVO.UserLevelVO userLevelVO = goodsLijinMnager.getUserLevel(system, vipRank, true); //杩斿埄UserLevel if (goodsDetailVO.getGoods().getPriceList() != null && goodsDetailVO.getGoods().getPriceList().size() > 0) goodsDetailVO.getGoods().getPriceList().get(0).setUserLevel(userLevelVO); //绀奸噾UserLevel - userLevelVO = goodsLijinMnager.getUserLevel(vipRank, false); + userLevelVO = goodsLijinMnager.getUserLevel(system, vipRank, false); goodsLijinMnager.loadLijinInfo(vipRank, goodsDetailVO, userLevelVO); } - private TaoBaoGoodsBrief getTaoBaoGoods(Long id) { + private TaoBaoGoodsBrief getTaoBaoGoods(String id) { try { TaoBaoGoodsBrief goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(id); if (goods != null) { -- Gitblit v1.8.0