From 3727469752a977dde6327e2c48d761b20b565d3d Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 15 七月 2022 09:19:21 +0800 Subject: [PATCH] 商品ID字符串化 --- fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java index 5d34421..4699c81 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java @@ -25,7 +25,7 @@ import com.yeshi.fanli.entity.taobao.TaoBaoLink; import com.yeshi.fanli.exception.dynamic.ActivityUserException; import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException; -import com.yeshi.fanli.exception.goods.ConvertLinkExceptionException; +import com.yeshi.fanli.exception.goods.ConvertLinkException; import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException; import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; import com.yeshi.fanli.lijin.manager.GoodsLijinMnager; @@ -437,7 +437,7 @@ params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { try { - TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(Long.parseLong(goodsId)); + TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(goodsId); goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, params); } catch (TaobaoGoodsDownException e) { throw new GoodsEvaluateException(1, "鍟嗗搧宸蹭笅鏋�"); @@ -555,7 +555,7 @@ String commentText = ""; if (addComment) { if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { - TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(system, 1L, Long.parseLong(goodsId), "0", null); + TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(system, 1L, goodsId, "0", null); String template = configService.getValue(ConfigKeyEnum.quickShareTBCommentText.getKey(), system); commentText = template.replace("[娣樺彛浠", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); } else if (goodsType == Constant.SOURCE_TYPE_JD) { @@ -623,7 +623,7 @@ private String createTokenAndLink(GoodsDetailVO goodsDetailVO, SystemEnum system) throws Exception { String commentText = ""; if (goodsDetailVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { - TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(system, 1L, Long.parseLong(goodsDetailVO.getGoodsId()), "0", null); + TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(system, 1L, goodsDetailVO.getGoodsId(), "0", null); String template = configService.getValue(ConfigKeyEnum.quickShareTBCommentText.getKey(), system); commentText = template.replace("[娣樺彛浠", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); } else if (goodsDetailVO.getGoodsType() == Constant.SOURCE_TYPE_JD) { @@ -663,7 +663,7 @@ return commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); } - public GoodsDetailVO getGoodsDetailVO(Long goodsId, Integer goodsType, SystemEnum system) throws GoodsEvaluateException { + public GoodsDetailVO getGoodsDetailVO(String goodsId, Integer goodsType, SystemEnum system) throws GoodsEvaluateException { GoodsDetailVO goodsDetail = null; GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); @@ -679,10 +679,10 @@ throw new GoodsEvaluateException(1, "鍟嗗搧宸蹭笅鏋�"); } } else if (goodsType == Constant.SOURCE_TYPE_JD) { - JDGoods goodsInfo = jdGoodsCacheUtil.getGoodsInfo(goodsId); + JDGoods goodsInfo = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong(goodsId)); goodsDetail = GoodsDetailVOFactory.convertJDGoods(goodsInfo, params); } else if (goodsType == Constant.SOURCE_TYPE_PDD) { - PDDGoodsDetail goodsInfo = pinDuoDuoCacheUtil.getGoodsInfo(goodsId); + PDDGoodsDetail goodsInfo = pinDuoDuoCacheUtil.getGoodsInfo(Long.parseLong(goodsId)); goodsDetail = GoodsDetailVOFactory.convertPDDGoods(goodsInfo, params); } if (goodsDetail != null) @@ -776,7 +776,7 @@ for (int i = 0; i < goodsArray.length && i < 9; i++) { String goodsids = goodsArray[i]; String[] g = goodsids.split("-"); - GoodsDetailVO goodsDetailVO = getGoodsDetailVO(Long.parseLong(g[0]), Integer.parseInt(g[1]), resultObj.getSystem()); + GoodsDetailVO goodsDetailVO = getGoodsDetailVO(g[0], Integer.parseInt(g[1]), resultObj.getSystem()); if (goodsDetailVO == null) { continue; } @@ -997,8 +997,8 @@ if (!StringUtil.isNullOrEmpty(content) && commentInfo.getNeedSpin()) { try { convertLinkManager.convertLinkFromText(system, content, Constant.LINK_TOKEN_VERIFY_UID, true, false); - } catch (ConvertLinkExceptionException e) { - if (ConvertLinkExceptionException.CODE_NONE != e.getCode()) { + } catch (ConvertLinkException e) { + if (ConvertLinkException.CODE_NONE != e.getCode()) { throw new GoodsEvaluateException(1, "鍖呭惈涓嶅彲杞摼鐨勫彛浠や笌閾炬帴"); } } catch (Exception e) { @@ -1965,7 +1965,7 @@ if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { TaoBaoGoodsBrief goods; try { - goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(goodsId)); + goods = redisManager.getTaoBaoGoodsBrief(goodsId); if (goods != null) { vo = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); } @@ -2001,7 +2001,7 @@ TaoBaoGoodsBrief goodsBrief = null; try { - goodsBrief = redisManager.getTaoBaoGoodsBrief(Long.parseLong(goodsId)); + goodsBrief = redisManager.getTaoBaoGoodsBrief(goodsId); } catch (TaobaoGoodsDownException e) { throw new GoodsEvaluateException(1, "鍟嗗搧宸蹭笅鏋�"); } @@ -2133,7 +2133,7 @@ } Date limitDate = DateUtil.reduceDay(new Date(), 7); - Long goodsId = goodsBrief.getAuctionId(); + String goodsId = goodsBrief.getAuctionId(); List<GoodsEvaluate> evaluateList = goodsEvaluateDao.queryExistLimitTime(Constant.SOURCE_TYPE_TAOBAO, goodsId + "", limitDate); if (evaluateList != null && evaluateList.size() > 0) throw new GoodsEvaluateException(1, "璇ュ晢鍝佸凡瀛樺湪"); @@ -2152,7 +2152,7 @@ // 鍟嗗搧鍥剧墖淇℃伅 int i = 0; - List<ImgInfo> imgList = new ArrayList<ImgInfo>(); + List<ImgInfo> imgList = new ArrayList<>(); for (String img : imgs) { ImgInfo imgInfo = new ImgInfo(); @@ -2323,7 +2323,7 @@ switch (source) { case "tb": try { - TaoBaoGoodsBrief goodsBrief = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id)); + TaoBaoGoodsBrief goodsBrief = TaoKeApiUtil.searchGoodsDetail(id); if (goodsBrief != null && goodsBrief.getImgList() != null) { GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); goods = GoodsDetailVOFactory.convertTaoBao(goodsBrief, params); -- Gitblit v1.8.0