admin
2021-05-31 1f2740829d4e7e1198a2070f66849873b18b4c22
fanli/src/main/java/com/yeshi/fanli/controller/client/lijin/GoodsControllerLijin.java
@@ -23,6 +23,7 @@
import com.yeshi.fanli.exception.pdd.PDDApiException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.lijin.manager.GoodsLijinMnager;
import com.yeshi.fanli.lijin.manager.UserLijinMnager;
import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
import com.yeshi.fanli.service.inter.pdd.PDDAuthService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
@@ -80,8 +81,13 @@
    @Resource
    private GoodsLijinMnager goodsLijinMnager;
    @Resource
    private UserLijinMnager userLijinMnager;
    @Resource
    private PIDManager pidManager;
    /**
     * 获取商品详情
@@ -97,9 +103,10 @@
        GoodsDetailVO goodsDetailVO = new GoodsDetailVO();
        GoodsDetailVO.GoodsExtraVO extraVO = new GoodsDetailVO.GoodsExtraVO();
        GoodsMoneyConfigParamsDTO paramsDTO = new GoodsMoneyConfigParamsDTO();
        paramsDTO.setFanLiRate(new BigDecimal("60"));
        paramsDTO.setFanLiRate(goodsLijinMnager.getFanLiRate(uid));
        // 领券人列表
        List<ShamUser> listCouponUser = new ArrayList<>();
        Long goodsIdSuning = null;
        switch (goodsType) {
            case Constant
                    .SOURCE_TYPE_TAOBAO:
@@ -146,6 +153,8 @@
                    .SOURCE_TYPE_SUNING:
                String[] ids = SuningUtil.getGoodsIdDetail(goodsId);
                SuningGoodsInfo suningGoodsInfo = SuningApiUtil.getGoodsDetail(ids[1], ids[0]);
                goodsIdSuning = Long.parseLong(suningGoodsInfo.getCommodityInfo().getCommodityCode());
                goodsDetailVO.setGoods(GoodsDetailVOLijinFactory.convertSuningGoods(suningGoodsInfo, paramsDTO));
                extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img_suning.html?id="
                        + suningGoodsInfo.getCommodityInfo().getCommodityCode() + "&supplierCode="
@@ -157,7 +166,7 @@
        //是否收藏
        extraVO.setCollected(false);
        if (uid != null) {
            CollectionGoodsV2 collectionGoodsV2 = collectionGoodsV2Service.findByUidAndAuctionId(uid, Long.parseLong(goodsDetailVO.getGoods().getGoodsId()), goodsType);
            CollectionGoodsV2 collectionGoodsV2 = collectionGoodsV2Service.findByUidAndAuctionId(uid, goodsType == Constant.SOURCE_TYPE_SUNING ? goodsIdSuning : Long.parseLong(goodsDetailVO.getGoods().getGoodsId()), goodsType);
            if (collectionGoodsV2 != null) {
                extraVO.setCollected(true);
            }
@@ -203,6 +212,7 @@
                data.put("type", 1);
                data.put("link", link);
                data.put("native", true);
                data.put("userLevel", userLijinMnager.getUserLevelInfo(uid, acceptData.getSystem()));
                out.print(JsonUtil.loadTrueResult(data));
            } catch (LiJinException e) {
                out.print(JsonUtil.loadFalseResult(e.getMsg()));
@@ -226,7 +236,7 @@
     * @param goodsDetailVO
     */
    private void loadLijinInfo(Long uid, GoodsDetailVO goodsDetailVO) {
        VIPEnum vipRank = goodsLijinMnager.getVIPRank(uid);
        VIPEnum vipRank = userLijinMnager.getVIPRank(uid);
        GoodsDetailVO.GoodsHongBaoListVO.UserLevelVO userLevelVO = goodsLijinMnager.getUserLevel(vipRank);
        if (goodsDetailVO.getGoods().getPriceList() != null && goodsDetailVO.getGoods().getPriceList().size() > 0)
            goodsDetailVO.getGoods().getPriceList().get(0).setUserLevel(userLevelVO);