admin
2021-05-21 84dd8c1579ea198aff6ca8afac05a5e8f6af9faf
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -15,6 +15,7 @@
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.entity.SystemFunction;
import com.yeshi.fanli.exception.pdd.PDDApiException;
import com.yeshi.fanli.lijin.manager.GoodsLijinMnager;
import com.yeshi.fanli.service.inter.pdd.PDDAuthService;
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.util.*;
@@ -30,7 +31,7 @@
import org.yeshi.utils.taobao.TbImgUtil;
import com.google.gson.Gson;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO;
import com.yeshi.fanli.dto.jd.JDCategoryInfo;
import com.yeshi.fanli.dto.jd.JDCouponInfo;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
@@ -217,7 +218,10 @@
    @Resource
    private PDDAuthService pddAuthService;
    private ConfigParamsDTO getParamsDTO(String platform, String version, Long uid, SystemEnum system) {
    @Resource
    private GoodsLijinMnager goodsLijinMnager;
    private GoodsMoneyConfigParamsDTO getParamsDTO(String platform, String version, Long uid, SystemEnum system) {
        UserLevelEnum level = UserLevelEnum.daRen;
        if (uid != null && uid > 0) {
            level = userLevelManager.getUserLevel(uid);
@@ -447,7 +451,7 @@
            LogHelper.errorDetailInfo(e);
        }
        ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid, acceptData.getSystem());
        GoodsMoneyConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid, acceptData.getSystem());
        paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(acceptData.getSystem()));
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
@@ -722,7 +726,7 @@
        // 保存缓存
        jdGoodsCacheUtil.saveGoodsInfo(jdGoods);
        ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid, acceptData.getSystem());
        GoodsMoneyConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid, acceptData.getSystem());
        paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(acceptData.getSystem()));
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO);
        if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
@@ -947,7 +951,7 @@
            return;
        }
        ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid, acceptData.getSystem());
        GoodsMoneyConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid, acceptData.getSystem());
        paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(acceptData.getSystem()));
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO);
@@ -1154,7 +1158,7 @@
            return;
        }
        ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid, acceptData.getSystem());
        GoodsMoneyConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid, acceptData.getSystem());
        paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(acceptData.getSystem()));
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertVIPGoods(vipGoodsInfo, paramsDTO);
@@ -1294,7 +1298,7 @@
            return;
        }
        ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid, acceptData.getSystem());
        GoodsMoneyConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid, acceptData.getSystem());
        paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(acceptData.getSystem()));
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertSuningGoods(suningGoodsInfo, paramsDTO);
@@ -1482,7 +1486,7 @@
     * @param out
     */
    @RequestMapping(value = "getRecommendGoods", method = RequestMethod.POST)
    public void getRecommendGoods(AcceptData acceptData, String id, Integer goodsType, PrintWriter out) {
    public void getRecommendGoods(AcceptData acceptData, String id, Long uid, Integer goodsType, PrintWriter out) {
        if (goodsType == null) {
            goodsType = Constant.SOURCE_TYPE_TAOBAO;
        }
@@ -1500,12 +1504,8 @@
                    list = list.subList(0, 10);
                }
                ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null, acceptData.getSystem());
                List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>();
                for (JDGoods goods : list) {
                    listDetailVO.add(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO));
                }
                GoodsMoneyConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null, acceptData.getSystem());
                List<GoodsDetailVO> listDetailVO = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, list, paramsDTO); //new ArrayList<GoodsDetailVO>();
                // 取偶数个数据
                if (listDetailVO.size() % 2 != 0) {
@@ -1541,11 +1541,9 @@
                                goodsList = goodsList.subList(0, 10);
                            }
                            ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(),
                            GoodsMoneyConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(),
                                    null, acceptData.getSystem());
                            for (PDDGoodsDetail goods : goodsList) {
                                listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO));
                            }
                            listDetailVO = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO);
                        }
                    }
                }
@@ -1587,13 +1585,9 @@
                List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>();
                if (resultList != null) {
                    if (resultList != null && resultList.size() > 0) {
                        ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
                        GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
                                acceptData.getVersion(), acceptData.getSystem());
                        for (SuningGoodsInfo goods : resultList) {
                            GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertSuningGoods(goods, paramsDTO);
                            listDetailVO.add(goodsDetailVO);
                        }
                        listDetailVO = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, resultList, paramsDTO);
                    }
                }
@@ -1611,12 +1605,9 @@
            }
            List<GoodsDetailVO> listExtra = new ArrayList<GoodsDetailVO>();
            ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null, acceptData.getSystem());
            goodsList.parallelStream().forEach(goods -> {
                if (goods != null) {
                    listExtra.add(GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO));
                }
            });
            GoodsMoneyConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null, acceptData.getSystem());
            listExtra = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO);
            List<GoodsDetailVO> listQuality = new ArrayList<GoodsDetailVO>();
            // 取偶数个数据
@@ -2121,7 +2112,7 @@
        Map<String, GoodsDetailVO> tempGoodsList = new HashMap<>();
        ConfigParamsDTO params = new ConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()),
        GoodsMoneyConfigParamsDTO params = new GoodsMoneyConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()),
                hongBaoManageService.getShareRate(acceptData.getSystem()), new BigDecimal(80),
                hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, acceptData.getSystem()));