2 文件已重命名
55个文件已修改
2个文件已添加
| | |
| | | @Field |
| | | @org.yeshi.utils.mybatis.Column(name = "material_lib_type") |
| | | private Integer materialLibType;//物料库类型 |
| | | |
| | | private String materialLibTypes;//物料库类型 |
| | | |
| | | private String description;//推荐语 |
| | | |
| | |
| | | public void setDescription(String description) { |
| | | this.description = description; |
| | | } |
| | | |
| | | |
| | | public String getMaterialLibTypes() { |
| | | return materialLibTypes; |
| | | } |
| | | |
| | | public void setMaterialLibTypes(String materialLibTypes) { |
| | | this.materialLibTypes = materialLibTypes; |
| | | } |
| | | } |
| | |
| | | </dependency> |
| | | |
| | | |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.dubbo</groupId> |
| | | <artifactId>dubbo</artifactId> |
| | |
| | | <version>3.21.0-GA</version> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>com.ks</groupId> |
| | | <artifactId>facade-vip</artifactId> |
| | | <version>0.0.1</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ks</groupId> |
| | | <artifactId>facade-lijin</artifactId> |
| | | <version>0.0.2</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ks</groupId> |
| | | <artifactId>lib-common</artifactId> |
| | | <version>0.0.1</version> |
| | | </dependency> |
| | | |
| | | |
| | | |
| | | </dependencies> |
| | | <build> |
| | | <plugins> |
| | |
| | | import org.yeshi.utils.wx.WXUtil; |
| | | |
| | | import com.aliyun.openservices.ons.api.Message; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum; |
| | | import com.yeshi.fanli.dto.mq.order.body.BanLiShopOrderMQMsg; |
| | | import com.yeshi.fanli.entity.bus.activity.ActivityRuleUser; |
| | |
| | | if (goodsBrief == null) |
| | | continue; |
| | | // 商品VO |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55",system); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55",system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(SystemEnum.blks)); |
| | | GoodsDetailVO goodsVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, paramsDTO); |
| | | |
| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo; |
| | |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(acceptData.getSystem()); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(acceptData.getSystem()); |
| | | BigDecimal vipFanLiRate = hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,acceptData.getSystem()); |
| | | ConfigParamsDTO params = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, vipFanLiRate); |
| | | GoodsMoneyConfigParamsDTO params = new GoodsMoneyConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, vipFanLiRate); |
| | | |
| | | if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | try { |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.jd.JDFilter; |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(acceptData.getSystem()); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(acceptData.getSystem()); |
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, |
| | | GoodsMoneyConfigParamsDTO configParamsDTO = new GoodsMoneyConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, acceptData.getSystem())); |
| | | |
| | | |
| | |
| | | package com.yeshi.fanli.controller.client.lijin; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.yeshi.common.entity.taobao.TaoBaoShop; |
| | | import com.yeshi.common.entity.taobao.TaoKeAppInfo; |
| | | import com.yeshi.common.vo.ClientTextStyleVO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.dto.suning.SuningGoodsInfo; |
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.user.ShamUser; |
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2; |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | | import com.yeshi.fanli.exception.pdd.PDDApiException; |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; |
| | | import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service; |
| | | import com.yeshi.fanli.service.inter.pdd.PDDAuthService; |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService; |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService; |
| | | import com.yeshi.fanli.service.inter.user.ShamUserService; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.TaoBaoConstant; |
| | | import com.yeshi.fanli.util.ThreadUtil; |
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil; |
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOLijinFactory; |
| | | import com.yeshi.fanli.util.factory.goods.ShopInfoVOFactory; |
| | | import com.yeshi.fanli.util.jd.JDApiUtil; |
| | | import com.yeshi.fanli.util.jd.JDUtil; |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil; |
| | | import com.yeshi.fanli.util.suning.SuningApiUtil; |
| | | import com.yeshi.fanli.util.suning.SuningUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.fanli.util.vipshop.VipShopApiUtil; |
| | | import com.yeshi.fanli.lijin.vo.GoodsDetailVO; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.yeshi.utils.JsonUtil; |
| | | import org.yeshi.utils.MoneyBigDecimalUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Controller |
| | | @RequestMapping("api/lijin/goods") |
| | |
| | | @Resource |
| | | private PDDAuthService pddAuthService; |
| | | |
| | | @Resource |
| | | private CollectionGoodsV2Service collectionGoodsV2Service; |
| | | |
| | | @Resource |
| | | private ShamUserService shamUserService; |
| | | |
| | | @Resource |
| | | private TaoBaoShopService taoBaoShopService; |
| | | |
| | | /** |
| | | * 获取商品详情 |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | @RequestMapping("getGoodsDetail") |
| | | @ResponseBody |
| | | public String getGoodsDetail(AcceptData acceptData, int goodsType, String goodsId, Long uid, String from) { |
| | | |
| | | public void getGoodsDetail(AcceptData acceptData, int goodsType, String goodsId, Long uid, String from, PrintWriter out) { |
| | | GoodsDetailVO goodsDetailVO = new GoodsDetailVO(); |
| | | GoodsDetailVO.GoodsExtraVO extraVO = new GoodsDetailVO.GoodsExtraVO(); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = new GoodsMoneyConfigParamsDTO(); |
| | | paramsDTO.setFanLiRate(new BigDecimal("60")); |
| | | // 领券人列表 |
| | | List<ShamUser> listCouponUser = new ArrayList<>(); |
| | | switch (goodsType) { |
| | | case Constant |
| | | .SOURCE_TYPE_TAOBAO: |
| | | TaoBaoGoodsBrief taobaoGoods = getTaoBaoGoods(Long.parseLong(goodsId)); |
| | | if (taobaoGoods == null) { |
| | | TaoBaoGoodsBrief goods = getTaoBaoGoods(Long.parseLong(goodsId)); |
| | | |
| | | |
| | | goodsDetailVO.setGoods(GoodsDetailVOLijinFactory.convertTaoBao(goods, paramsDTO)); |
| | | // 店铺信息 |
| | | TaoBaoShop shop = taoBaoShopService.getTaoBaoShop(goods.getId(), goods.getSellerId()); |
| | | if (shop != null) { |
| | | String shopLink = shop.getShopLink(); |
| | | if (StringUtil.isNullOrEmpty(shopLink)) { |
| | | shop.setShopLink(TaoBaoUtil.getShopLink(shop.getId())); |
| | | } |
| | | goodsDetailVO.getGoods().setShopInfo(ShopInfoVOFactory.convertTaoBaoShop(shop)); |
| | | } |
| | | |
| | | extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img.html?id=" + goodsId); |
| | | |
| | | break; |
| | | |
| | | case Constant |
| | | .SOURCE_TYPE_JD: |
| | | JDGoods jdGoods = getJDGoods(Long.parseLong(goodsId)); |
| | | goodsDetailVO.setGoods(GoodsDetailVOLijinFactory.convertJDGoods(jdGoods, paramsDTO)); |
| | | extraVO.setDetailUrl("https://in.m.jd.com/product/jieshao/video/" + goodsId + ".html"); |
| | | |
| | | break; |
| | | |
| | | case Constant |
| | | .SOURCE_TYPE_PDD: |
| | | PDDGoodsDetail pddGoodsDetail = getPDDGoods(Long.parseLong(goodsId), uid); |
| | | |
| | | goodsDetailVO.setGoods(GoodsDetailVOLijinFactory.convertPDDGoods(pddGoodsDetail, paramsDTO)); |
| | | extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img_pdd.html?id=" + goodsId); |
| | | break; |
| | | |
| | | case Constant |
| | | .SOURCE_TYPE_VIP: |
| | | VIPGoodsInfo vipGoodsInfo = VipShopApiUtil.getGoodsDetail(goodsId); |
| | | |
| | | goodsDetailVO.setGoods(GoodsDetailVOLijinFactory.convertVIPGoods(vipGoodsInfo, paramsDTO)); |
| | | break; |
| | | |
| | | case Constant |
| | | .SOURCE_TYPE_SUNING: |
| | | String[] ids = SuningUtil.getGoodsIdDetail(goodsId); |
| | | SuningGoodsInfo suningGoodsInfo = SuningApiUtil.getGoodsDetail(ids[1], ids[0]); |
| | | |
| | | goodsDetailVO.setGoods(GoodsDetailVOLijinFactory.convertSuningGoods(suningGoodsInfo, paramsDTO)); |
| | | extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img_suning.html?id=" |
| | | + suningGoodsInfo.getCommodityInfo().getCommodityCode() + "&supplierCode=" |
| | | + suningGoodsInfo.getCommodityInfo().getSupplierCode()); |
| | | break; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | return null; |
| | | //是否收藏 |
| | | extraVO.setCollected(false); |
| | | if (uid != null) { |
| | | CollectionGoodsV2 collectionGoodsV2 = collectionGoodsV2Service.findByUidAndAuctionId(uid, Long.parseLong(goodsDetailVO.getGoods().getGoodsId()), goodsType); |
| | | if (collectionGoodsV2 != null) { |
| | | extraVO.setCollected(true); |
| | | } |
| | | } |
| | | |
| | | if (goodsDetailVO.getGoods().getTempCoupon() != null && goodsDetailVO.getGoods().getTempCoupon().getAmount() != null |
| | | && goodsDetailVO.getGoods().getTempCoupon().getAmount().compareTo(new BigDecimal(0)) > 0) { |
| | | listCouponUser = shamUserService.listRandCouponUser(5, 1, 300); |
| | | } |
| | | extraVO.setFanliValid(true); |
| | | extraVO.setBuyValid(true); |
| | | extraVO.setListCouponUser(listCouponUser); |
| | | goodsDetailVO.setExtra(extraVO); |
| | | loadLijinInfo(goodsDetailVO.getGoods()); |
| | | |
| | | |
| | | //清除临时信息 |
| | | goodsDetailVO.getGoods().setTempCoupon(null); |
| | | if (goodsDetailVO.getGoods().getLabels() == null) |
| | | goodsDetailVO.getGoods().setLabels(new ArrayList<>()); |
| | | goodsDetailVO.getGoods().getLabels().add(new ClientTextStyleVO("天猫", "#FF2C4A")); |
| | | out.print(JsonUtil.loadTrueResult(new Gson().toJson(goodsDetailVO))); |
| | | } |
| | | |
| | | /** |
| | | * 加载礼金信息 |
| | | * |
| | | * @param goodsInfoVO |
| | | */ |
| | | private void loadLijinInfo(GoodsDetailVO.GoodsInfoVO goodsInfoVO) { |
| | | //虚拟数据 |
| | | List<BigDecimal> lijinList = new ArrayList<>(); |
| | | lijinList.add(new BigDecimal("1")); |
| | | lijinList.add(new BigDecimal("2")); |
| | | lijinList.add(new BigDecimal("2.5")); |
| | | |
| | | GoodsDetailVO.GoodsHongBaoListVO.UserLevelVO userLevelVO = new GoodsDetailVO.GoodsHongBaoListVO.UserLevelVO(); |
| | | userLevelVO.setVipRank(1); |
| | | userLevelVO.setDesc("升级为铂金会员红包可提高100%"); |
| | | userLevelVO.setLink("http://www.baidu.com"); |
| | | |
| | | if (goodsInfoVO.getPriceList() == null) { |
| | | goodsInfoVO.setPriceList(new ArrayList<>()); |
| | | } |
| | | |
| | | goodsInfoVO.getPriceList().get(0).setUserLevel(userLevelVO); |
| | | |
| | | for (BigDecimal money : lijinList) { |
| | | GoodsDetailVO.GoodsHongBaoListVO price = new GoodsDetailVO.GoodsHongBaoListVO(); |
| | | price.setType(2); |
| | | price.setSubMoney("¥" + money); |
| | | price.setUserLevel(userLevelVO); |
| | | |
| | | //最终价格计算=券后价-礼金 |
| | | price.setFinalMoney("¥" + goodsInfoVO.getCouponPrice().subtract(money).toString()); |
| | | |
| | | List<GoodsDetailVO.GoodsHongBaoListVO.PriceInfo> priceInfos = new ArrayList<>(); |
| | | |
| | | priceInfos.add(new GoodsDetailVO.GoodsHongBaoListVO.PriceInfo("原价", goodsInfoVO.getZkPrice())); |
| | | |
| | | if (goodsInfoVO.getTempCoupon() != null) { |
| | | priceInfos.add(new GoodsDetailVO.GoodsHongBaoListVO.PriceInfo("优惠券", "-¥" + MoneyBigDecimalUtil.getWithNoZera(goodsInfoVO.getTempCoupon().getAmount()).toString())); |
| | | } |
| | | |
| | | priceInfos.add(new GoodsDetailVO.GoodsHongBaoListVO.PriceInfo("首单礼金", "-¥1")); |
| | | |
| | | priceInfos.add(new GoodsDetailVO.GoodsHongBaoListVO.PriceInfo("礼金", "-" + "¥" + money)); |
| | | price.setPriceDetails(priceInfos); |
| | | goodsInfoVO.getPriceList().add(0, price); |
| | | } |
| | | |
| | | //计算最大的礼金面额 |
| | | goodsInfoVO.getMoneyInfo().setHongBaoMoney("¥3"); |
| | | } |
| | | |
| | | |
| | | private TaoBaoGoodsBrief getTaoBaoGoods(Long id) { |
| | | try { |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | private JDGoods getJDGoods(Long id) { |
| | | JDGoods jdGoods = JDApiUtil.queryGoodsDetail(id); // 高级接口 |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | |
| | | ConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), UserLevelEnum.daRen, acceptData.getSystem()); |
| | | /* 遍历列表数据 */ |
| | | for (QualityFactory selectionGoods : listQuery) { |
| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import com.yeshi.fanli.entity.bus.user.UserRankings; |
| | |
| | | List<PullNewGoods> list = pullNewGoodsService.listQuery((page-1)*Constant.PAGE_SIZE, Constant.PAGE_SIZE); |
| | | if (list != null && list.size() > 0) { |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(acceptData.getSystem())); |
| | | |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.taobao.ShareHotGoods; |
| | | import com.yeshi.fanli.entity.taobao.TLJBuyGoods; |
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | |
| | | ConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),null); |
| | | for (TLJBuyGoods goods : goodsList) { |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = goods.getGoods(); |
| | |
| | | goodsList = goodsList.size() > 10 ? goodsList.subList(0, 10) : goodsList; |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | ConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),null); |
| | | for (ShareHotGoods hotGoods : goodsList) { |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods(); |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.brand.BrandGoodsCahe; |
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | // 商品信息过滤 |
| | | listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief); |
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | // 商品信息过滤 |
| | | listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief); |
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | JSONArray array = new JSONArray(); |
| | | |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.common.CommonContentNav; |
| | | import com.yeshi.fanli.dto.common.CommonContentResult; |
| | | import com.yeshi.fanli.dto.common.CommonContentTypeEnum; |
| | |
| | | if (result != null) |
| | | goodsList = result.getGoodsList(); |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) { |
| | | GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO); |
| | |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (JDGoods goods : goodsList) { |
| | |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (PDDGoodsDetail goods : goodsList) { |
| | |
| | | import com.google.gson.JsonPrimitive; |
| | | import com.google.gson.JsonSerializationContext; |
| | | import com.google.gson.JsonSerializer; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.dto.suning.SuningGoodsInfo; |
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo; |
| | |
| | | } |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (CollectionGoodsV2 collectionGoodsV2 : collectionGoodsList) { |
| | |
| | | JSONArray array = new JSONArray(); |
| | | if (list != null && list.size() > 0) { |
| | | Gson gson = gsonBuilder.create(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | for (ScanHistoryV2 sh : list) { |
| | | CommonGoods commonGoods = sh.getCommonGoods(); |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.lijin.manager.GoodsLijinMnager; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass; |
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass; |
| | |
| | | @RequestMapping("api/v2/class") |
| | | public class GoodsClassControllerV2 { |
| | | |
| | | @Resource |
| | | private GoodsClassService goodsClassService; |
| | | @Resource |
| | | private GoodsClassService goodsClassService; |
| | | |
| | | @Resource |
| | | private GoodsSubClassLabelService goodsSubClassLabelService; |
| | | @Resource |
| | | private GoodsSubClassLabelService goodsSubClassLabelService; |
| | | |
| | | @Resource |
| | | private GoodsSubClassService goodsSubClassService; |
| | | @Resource |
| | | private GoodsSubClassService goodsSubClassService; |
| | | |
| | | @Resource(name = "taskExecutor") |
| | | private TaskExecutor executor; |
| | | @Resource(name = "taskExecutor") |
| | | private TaskExecutor executor; |
| | | |
| | | @Resource |
| | | private QualityGoodsService qualityGoodsService; |
| | | @Resource |
| | | private QualityGoodsService qualityGoodsService; |
| | | |
| | | @Resource |
| | | private TaoKeGoodsService taoKeGoodsService; |
| | | @Resource |
| | | private TaoKeGoodsService taoKeGoodsService; |
| | | |
| | | @Resource |
| | | private TaoBaoClassService taoBaoClassService; |
| | | @Resource |
| | | private TaoBaoClassService taoBaoClassService; |
| | | |
| | | @Resource |
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService; |
| | | @Resource |
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService; |
| | | |
| | | @Resource |
| | | private LabelClassService labelClassService; |
| | | @Resource |
| | | private LabelClassService labelClassService; |
| | | |
| | | @Resource |
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService; |
| | | @Resource |
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService; |
| | | |
| | | /** |
| | | * 一级分类 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "listClass", method = RequestMethod.POST) |
| | | public void listClass(AcceptData acceptData, PrintWriter out) { |
| | | List<GoodsClass> list = goodsClassService.getEffectiveClassCache(); |
| | | if (list == null) { |
| | | list = new ArrayList<GoodsClass>(); |
| | | } |
| | | @Resource |
| | | private GoodsLijinMnager goodsLijinMnager; |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | /** |
| | | * 一级分类 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "listClass", method = RequestMethod.POST) |
| | | public void listClass(AcceptData acceptData, PrintWriter out) { |
| | | List<GoodsClass> list = goodsClassService.getEffectiveClassCache(); |
| | | if (list == null) { |
| | | list = new ArrayList<GoodsClass>(); |
| | | } |
| | | |
| | | /** |
| | | * 二级分类、标签 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "listSubMap", method = RequestMethod.POST) |
| | | public void listSubMap(AcceptData acceptData, Long cid, PrintWriter out) { |
| | | if (cid == null) { |
| | | out.print(JsonUtil.loadFalseResult("参数不能为空")); |
| | | return; |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | List<GoodsSubClassLabelVO> list = goodsSubClassLabelService.listSubMapCache(cid); |
| | | if (list == null) { |
| | | list = new ArrayList<GoodsSubClassLabelVO>(); |
| | | } |
| | | /** |
| | | * 二级分类、标签 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "listSubMap", method = RequestMethod.POST) |
| | | public void listSubMap(AcceptData acceptData, Long cid, PrintWriter out) { |
| | | if (cid == null) { |
| | | out.print(JsonUtil.loadFalseResult("参数不能为空")); |
| | | return; |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | List<GoodsSubClassLabelVO> list = goodsSubClassLabelService.listSubMapCache(cid); |
| | | if (list == null) { |
| | | list = new ArrayList<GoodsSubClassLabelVO>(); |
| | | } |
| | | |
| | | /** |
| | | * 分类下的精选商品 |
| | | */ |
| | | @RequestMapping("getClassGoods") |
| | | public void getClassGoods(AcceptData acceptData, long gcid, int page, PrintWriter out) { |
| | | GoodsClass goodsClass = goodsClassService.getGoodsClassCache(gcid); |
| | | if (goodsClass == null) { |
| | | out.print(JsonUtil.loadFalseResult("不存在该分类")); |
| | | return; |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | if (page < 1) |
| | | page = 1; |
| | | /** |
| | | * 分类下的精选商品 |
| | | */ |
| | | @RequestMapping("getClassGoods") |
| | | public void getClassGoods(AcceptData acceptData, Long uid, long gcid, int page, PrintWriter out) { |
| | | GoodsClass goodsClass = goodsClassService.getGoodsClassCache(gcid); |
| | | if (goodsClass == null) { |
| | | out.print(JsonUtil.loadFalseResult("不存在该分类")); |
| | | return; |
| | | } |
| | | |
| | | int pageSize = Constant.PAGE_SIZE; |
| | | if (page < 1) |
| | | page = 1; |
| | | |
| | | List<QualityFactory> listQuery = qualityGoodsService.listQueryByClassId((page - 1) * pageSize, pageSize, gcid); |
| | | // 总条数 |
| | | long counttotal = 5000; |
| | | int pageSize = Constant.PAGE_SIZE; |
| | | |
| | | List<TaoBaoGoodsBrief> updateGoodsList = new ArrayList<>(); |
| | | List<QualityFactory> listQuery = qualityGoodsService.listQueryByClassId((page - 1) * pageSize, pageSize, gcid); |
| | | // 总条数 |
| | | long counttotal = 5000; |
| | | |
| | | // 精选库数据小于10时,网络进行查询 |
| | | if (listQuery == null || listQuery.size() < 10) { |
| | | long count = qualityGoodsService.countQueryClassId(gcid); |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); |
| | | page = page - totalPage; |
| | | if (page < 1) |
| | | page = 1; |
| | | List<TaoBaoGoodsBrief> updateGoodsList = new ArrayList<>(); |
| | | |
| | | // 淘宝类目id |
| | | String taoBaoCatIds = taoBaoClassService.getTaoBaoCatIds(gcid); |
| | | // 精选库数据小于10时,网络进行查询 |
| | | if (listQuery == null || listQuery.size() < 10) { |
| | | long count = qualityGoodsService.countQueryClassId(gcid); |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); |
| | | page = page - totalPage; |
| | | if (page < 1) |
| | | page = 1; |
| | | |
| | | SearchFilter filter = null; |
| | | // 淘宝类目id |
| | | String taoBaoCatIds = taoBaoClassService.getTaoBaoCatIds(gcid); |
| | | |
| | | String searchParam = goodsClass.getSearchParam(); |
| | | if (!StringUtil.isNullOrEmpty(searchParam)) { |
| | | Gson gs = new Gson(); |
| | | filter = gs.fromJson(searchParam, SearchFilter.class); |
| | | } else { |
| | | filter = new SearchFilter(); |
| | | } |
| | | SearchFilter filter = null; |
| | | |
| | | filter.setMaterialId("6707"); |
| | | filter.setPage(page); |
| | | filter.setPageSize(pageSize); |
| | | filter.setCateIds(taoBaoCatIds); |
| | | String searchParam = goodsClass.getSearchParam(); |
| | | if (!StringUtil.isNullOrEmpty(searchParam)) { |
| | | Gson gs = new Gson(); |
| | | filter = gs.fromJson(searchParam, SearchFilter.class); |
| | | } else { |
| | | filter = new SearchFilter(); |
| | | } |
| | | |
| | | JSONObject result = taoKeGoodsService.searchWuLiaoV2(filter,acceptData.getPlatform(),acceptData.getVersion(), acceptData.getSystem()); |
| | | out.print(JsonUtil.loadTrueResult(result)); |
| | | return; |
| | | } |
| | | filter.setMaterialId("6707"); |
| | | filter.setPage(page); |
| | | filter.setPageSize(pageSize); |
| | | filter.setCateIds(taoBaoCatIds); |
| | | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | JSONObject result = taoKeGoodsService.searchWuLiaoV2(filter, acceptData.getPlatform(), acceptData.getVersion(), acceptData.getSystem()); |
| | | out.print(JsonUtil.loadTrueResult(result)); |
| | | return; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | // 精选库数据 |
| | | JSONArray array = new JSONArray(); |
| | | for (QualityFactory selectionGoods : listQuery) { |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = selectionGoods.getTaoBaoGoodsBrief(); |
| | | if (taoBaoGoodsBrief == null) { |
| | | continue; |
| | | } |
| | | updateGoodsList.add(taoBaoGoodsBrief); |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO); |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | } |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("nav", null); |
| | | data.put("count", counttotal); |
| | | data.put("result", array); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | try { |
| | | taoBaoGoodsUpdateService.addUpdateQueueAsync(updateGoodsList); |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | /** |
| | | * 获取二级分类商品 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param scid |
| | | * @param filter |
| | | * @param order |
| | | * 来源:【推荐:0 | 综合:4 、综合只看有券 1 、综合只看天猫 1 | 价格:低到高3 高到低2 | 销量:1】 |
| | | * 排序值:【销量由高到低: 1 ; 销量由低到高 5; 价格从高到低: 2 ; 价格从低到高:3 ; 推广量高到低:4 ; |
| | | * 其他默认: 销量由高到低】 |
| | | * |
| | | * @param startprice |
| | | * 起始价格 |
| | | * @param endprice |
| | | * 结束价格 |
| | | * @param fastFilter |
| | | * fastFilter 有券 [{"type":"quantype"}] 天猫商品 [{"type":"shoptype"}] |
| | | * @param totalSales |
| | | * 销量以上 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getSubGoods", method = RequestMethod.POST) |
| | | public void getSecondClassGoods(AcceptData acceptData, int page, long scid, String filter, String order, |
| | | String startprice, String endprice, String fastFilter, Integer totalSales, PrintWriter out) { |
| | | // 精选库数据 |
| | | JSONArray array = new JSONArray(); |
| | | List<TaoBaoGoodsBrief> goodsBriefs = new ArrayList<>(); |
| | | for (QualityFactory selectionGoods : listQuery) { |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = selectionGoods.getTaoBaoGoodsBrief(); |
| | | if (taoBaoGoodsBrief == null) { |
| | | continue; |
| | | } |
| | | updateGoodsList.add(taoBaoGoodsBrief); |
| | | goodsBriefs.add(taoBaoGoodsBrief); |
| | | } |
| | | |
| | | try { |
| | | GoodsSubClass goodsSubClass = goodsSubClassService.getSubClassByPrimaryKeyCache(scid); |
| | | if (goodsSubClass == null) { |
| | | out.print(JsonUtil.loadFalseResult("不存在该分类")); |
| | | return; |
| | | } |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBriefs, paramsDTO); |
| | | for (GoodsDetailVO vo : voList) |
| | | array.add(gson.toJson(vo)); |
| | | |
| | | // 统计点击量 |
| | | if (page == 1) { |
| | | goodsSubClassService.countClick(acceptData, goodsSubClass); |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("nav", null); |
| | | data.put("count", counttotal); |
| | | data.put("result", array); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | try { |
| | | taoBaoGoodsUpdateService.addUpdateQueueAsync(updateGoodsList); |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | |
| | | SearchFilter sf = new SearchFilter(); |
| | | String catesId = ""; |
| | | // 查询是否有淘宝分类ID |
| | | List<TaoBaoClass> tbClassList = taoBaoClassService.listBySystemSubCid(0, 10, goodsSubClass.getId()); |
| | | if (tbClassList != null && tbClassList.size() > 0) |
| | | for (TaoBaoClass tbc : tbClassList) { |
| | | catesId += tbc.getCategoryId() + ","; |
| | | } |
| | | if (catesId.endsWith(",")) |
| | | catesId = catesId.substring(0, catesId.length() - 1); |
| | | sf.setCateIds(catesId); |
| | | /** |
| | | * 获取二级分类商品 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param scid |
| | | * @param filter |
| | | * @param order 来源:【推荐:0 | 综合:4 、综合只看有券 1 、综合只看天猫 1 | 价格:低到高3 高到低2 | 销量:1】 |
| | | * 排序值:【销量由高到低: 1 ; 销量由低到高 5; 价格从高到低: 2 ; 价格从低到高:3 ; 推广量高到低:4 ; |
| | | * 其他默认: 销量由高到低】 |
| | | * @param startprice 起始价格 |
| | | * @param endprice 结束价格 |
| | | * @param fastFilter fastFilter 有券 [{"type":"quantype"}] 天猫商品 [{"type":"shoptype"}] |
| | | * @param totalSales 销量以上 |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getSubGoods", method = RequestMethod.POST) |
| | | public void getSecondClassGoods(AcceptData acceptData, Long uid, int page, long scid, String filter, String order, |
| | | String startprice, String endprice, String fastFilter, Integer totalSales, PrintWriter out) { |
| | | |
| | | // 按分类名称搜索 |
| | | if (!StringUtil.isNullOrEmpty(catesId)) { |
| | | String searchParam = goodsSubClass.getSearchJson(); |
| | | Gson gs = new Gson(); |
| | | SearchFilter searchfilter = gs.fromJson(searchParam, SearchFilter.class); |
| | | searchfilter.setCateIds(catesId); |
| | | searchfilter.setPage(page); |
| | | searchfilter.setPageSize(20); |
| | | if (Integer.parseInt(order) == 0) |
| | | searchfilter.setMaterialId("6707"); |
| | | taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter, |
| | | totalSales); |
| | | TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiao(searchfilter,null,null); |
| | | long count = searchResult.getPageEntity().getTotalCount(); |
| | | try { |
| | | GoodsSubClass goodsSubClass = goodsSubClassService.getSubClassByPrimaryKeyCache(scid); |
| | | if (goodsSubClass == null) { |
| | | out.print(JsonUtil.loadFalseResult("不存在该分类")); |
| | | return; |
| | | } |
| | | |
| | | List<TaoBaoGoodsBrief> resultGoodsList = searchResult.getTaoBaoGoodsBriefs(); |
| | | // 查询是否超过了最大的商品数 |
| | | if ((resultGoodsList == null || resultGoodsList.size() < 20) |
| | | && !StringUtil.isNullOrEmpty(goodsSubClass.getKey())) { |
| | | if (resultGoodsList == null) |
| | | resultGoodsList = new ArrayList<>(); |
| | | // 统计点击量 |
| | | if (page == 1) { |
| | | goodsSubClassService.countClick(acceptData, goodsSubClass); |
| | | } |
| | | |
| | | // 需要根据关键字查询 |
| | | searchfilter.setCateIds(null); |
| | | searchfilter.setPage((int) (count % 20 == 0 ? count / 20 - 1 : count / 20)); |
| | | searchfilter.setPageSize(20); |
| | | searchfilter.setKey(goodsSubClass.getKey()); |
| | | TaoBaoSearchResult searchResult2 = TaoKeApiUtil.searchWuLiao(searchfilter,null,null); |
| | | if (searchResult2 != null) { |
| | | List<TaoBaoGoodsBrief> resultListTemp = searchResult2.getTaoBaoGoodsBriefs(); |
| | | if (resultListTemp != null) |
| | | resultGoodsList.addAll(resultListTemp); |
| | | } |
| | | } |
| | | SearchFilter sf = new SearchFilter(); |
| | | String catesId = ""; |
| | | // 查询是否有淘宝分类ID |
| | | List<TaoBaoClass> tbClassList = taoBaoClassService.listBySystemSubCid(0, 10, goodsSubClass.getId()); |
| | | if (tbClassList != null && tbClassList.size() > 0) |
| | | for (TaoBaoClass tbc : tbClassList) { |
| | | catesId += tbc.getCategoryId() + ","; |
| | | } |
| | | if (catesId.endsWith(",")) |
| | | catesId = catesId.substring(0, catesId.length() - 1); |
| | | sf.setCateIds(catesId); |
| | | |
| | | Gson gson2 = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().create(); |
| | | // 按分类名称搜索 |
| | | if (!StringUtil.isNullOrEmpty(catesId)) { |
| | | String searchParam = goodsSubClass.getSearchJson(); |
| | | Gson gs = new Gson(); |
| | | SearchFilter searchfilter = gs.fromJson(searchParam, SearchFilter.class); |
| | | searchfilter.setCateIds(catesId); |
| | | searchfilter.setPage(page); |
| | | searchfilter.setPageSize(20); |
| | | if (Integer.parseInt(order) == 0) |
| | | searchfilter.setMaterialId("6707"); |
| | | taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter, |
| | | totalSales); |
| | | TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiao(searchfilter, null, null); |
| | | long count = searchResult.getPageEntity().getTotalCount(); |
| | | |
| | | JSONArray array = new JSONArray(); |
| | | if (resultGoodsList != null) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | for (TaoBaoGoodsBrief goods : resultGoodsList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | array.add(gson2.toJson(goodsDetailVO)); |
| | | } |
| | | } |
| | | JSONObject result = new JSONObject(); |
| | | result.put("result", array); |
| | | result.put("count", result.optLong("count") + count); |
| | | out.print(JsonUtil.loadTrueResult(result)); |
| | | return; |
| | | } else { |
| | | String searchParam = goodsSubClass.getSearchJson(); |
| | | Gson gs = new Gson(); |
| | | SearchFilter searchfilter = gs.fromJson(searchParam, SearchFilter.class); |
| | | searchfilter.setCateIds(catesId); |
| | | searchfilter.setPage(page); |
| | | searchfilter.setPageSize(20); |
| | | if (Integer.parseInt(order) == 0) |
| | | searchfilter.setMaterialId("6707"); |
| | | searchfilter.setKey(goodsSubClass.getKey()); |
| | | taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter, |
| | | totalSales); |
| | | List<TaoBaoGoodsBrief> resultGoodsList = searchResult.getTaoBaoGoodsBriefs(); |
| | | // 查询是否超过了最大的商品数 |
| | | if ((resultGoodsList == null || resultGoodsList.size() < 20) |
| | | && !StringUtil.isNullOrEmpty(goodsSubClass.getKey())) { |
| | | if (resultGoodsList == null) |
| | | resultGoodsList = new ArrayList<>(); |
| | | |
| | | JSONObject result = taoKeGoodsService.searchWuLiaoV2(searchfilter,acceptData.getPlatform(),acceptData.getVersion(),acceptData.getSystem()); |
| | | out.print(JsonUtil.loadTrueResult(result)); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | out.print(JsonUtil.loadFalseResult("数据异常")); |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | | } |
| | | // 需要根据关键字查询 |
| | | searchfilter.setCateIds(null); |
| | | searchfilter.setPage((int) (count % 20 == 0 ? count / 20 - 1 : count / 20)); |
| | | searchfilter.setPageSize(20); |
| | | searchfilter.setKey(goodsSubClass.getKey()); |
| | | TaoBaoSearchResult searchResult2 = TaoKeApiUtil.searchWuLiao(searchfilter, null, null); |
| | | if (searchResult2 != null) { |
| | | List<TaoBaoGoodsBrief> resultListTemp = searchResult2.getTaoBaoGoodsBriefs(); |
| | | if (resultListTemp != null) |
| | | resultGoodsList.addAll(resultListTemp); |
| | | } |
| | | } |
| | | |
| | | Gson gson2 = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().create(); |
| | | |
| | | JSONArray array = new JSONArray(); |
| | | if (resultGoodsList != null) { |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, resultGoodsList, paramsDTO); |
| | | for (GoodsDetailVO vo : voList) { |
| | | array.add(gson2.toJson(vo)); |
| | | } |
| | | } |
| | | JSONObject result = new JSONObject(); |
| | | result.put("result", array); |
| | | result.put("count", result.optLong("count") + count); |
| | | out.print(JsonUtil.loadTrueResult(result)); |
| | | return; |
| | | } else { |
| | | String searchParam = goodsSubClass.getSearchJson(); |
| | | Gson gs = new Gson(); |
| | | SearchFilter searchfilter = gs.fromJson(searchParam, SearchFilter.class); |
| | | searchfilter.setCateIds(catesId); |
| | | searchfilter.setPage(page); |
| | | searchfilter.setPageSize(20); |
| | | if (Integer.parseInt(order) == 0) |
| | | searchfilter.setMaterialId("6707"); |
| | | searchfilter.setKey(goodsSubClass.getKey()); |
| | | taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter, |
| | | totalSales); |
| | | |
| | | JSONObject result = taoKeGoodsService.searchWuLiaoV2(searchfilter, acceptData.getPlatform(), acceptData.getVersion(), acceptData.getSystem()); |
| | | out.print(JsonUtil.loadTrueResult(result)); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | out.print(JsonUtil.loadFalseResult("数据异常")); |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | @Resource |
| | | private PDDAuthService pddAuthService; |
| | | |
| | | private ConfigParamsDTO getParamsDTO(String platform, String version, Long uid, SystemEnum system) { |
| | | private GoodsMoneyConfigParamsDTO getParamsDTO(String platform, String version, Long uid, SystemEnum system) { |
| | | UserLevelEnum level = UserLevelEnum.daRen; |
| | | if (uid != null && uid > 0) { |
| | | level = userLevelManager.getUserLevel(uid); |
| | |
| | | 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); |
| | |
| | | // 保存缓存 |
| | | 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)) { |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | list = list.subList(0, 10); |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null, acceptData.getSystem()); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null, acceptData.getSystem()); |
| | | List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>(); |
| | | |
| | | for (JDGoods goods : list) { |
| | |
| | | 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)); |
| | |
| | | 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) { |
| | |
| | | } |
| | | |
| | | List<GoodsDetailVO> listExtra = new ArrayList<GoodsDetailVO>(); |
| | | ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null, acceptData.getSystem()); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null, acceptData.getSystem()); |
| | | goodsList.parallelStream().forEach(goods -> { |
| | | if (goods != null) { |
| | | listExtra.add(GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO)); |
| | |
| | | |
| | | 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())); |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.yeshi.utils.JsonUtil; |
| | | |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.goods.facade.dto.taobao.dataoke.DaTaoKeGoodsResult; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | |
| | | |
| | | List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>(); |
| | | if (detailList != null) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (DaTaoKeDetailV2 detail : detailList) { |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.homemodule.Special; |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | |
| | | List<JDGoods> goodsList = jdGoodsService.specialSearch(page, cid,acceptData.getSystem()); |
| | | JSONArray array = new JSONArray(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | |
| | | import org.yeshi.utils.JsonUtil; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.homemodule.Special; |
| | | import com.yeshi.fanli.exception.pdd.PDDOrderException; |
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service; |
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService; |
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialService; |
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService; |
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService; |
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService; |
| | | import com.yeshi.fanli.service.inter.pdd.PDDGoodsService; |
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory; |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO; |
| | |
| | | JSONArray array = new JSONArray(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | Gson gson = JsonUtil.getApiCommonGson(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | for (PDDGoodsDetail goods : goodsList) { |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.lijin.manager.GoodsLijinMnager; |
| | | import com.yeshi.goods.facade.dto.taobao.dataoke.DingDongTime; |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | |
| | | @RequestMapping("api/v2/recommend") |
| | | public class RecommendControllerV2 { |
| | | |
| | | @Resource |
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService; |
| | | @Resource |
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService; |
| | | |
| | | @Resource |
| | | private QualityGoodsService qualityGoodsService; |
| | | @Resource |
| | | private QualityGoodsService qualityGoodsService; |
| | | |
| | | @Resource |
| | | private RedisManager redisManager; |
| | | @Resource |
| | | private RedisManager redisManager; |
| | | |
| | | @Resource |
| | | private HomeRecommendGoodsService homeRecommendGoodsService; |
| | | @Resource |
| | | private HomeRecommendGoodsService homeRecommendGoodsService; |
| | | |
| | | @Resource |
| | | private ConfigService configService; |
| | | @Resource |
| | | private ConfigService configService; |
| | | |
| | | @Resource |
| | | private MonitorService monitorService; |
| | | @Resource |
| | | private MonitorService monitorService; |
| | | |
| | | @Resource |
| | | private QualityFlashSaleService qualityFlashSaleService; |
| | | @Resource |
| | | private QualityFlashSaleService qualityFlashSaleService; |
| | | |
| | | @Resource |
| | | private RecommendGoodsDeleteHistoryService recommendGoodsDeleteHistoryService; |
| | | @Resource |
| | | private RecommendGoodsDeleteHistoryService recommendGoodsDeleteHistoryService; |
| | | |
| | | @Resource |
| | | private JumpDetailV2Service jumpDetailV2Service; |
| | | @Resource |
| | | private JumpDetailV2Service jumpDetailV2Service; |
| | | |
| | | @Resource |
| | | private DeviceSexService deviceSexService; |
| | | @Resource |
| | | private DeviceSexService deviceSexService; |
| | | |
| | | @Resource |
| | | private SpecialService specialService; |
| | | @Resource |
| | | private SpecialService specialService; |
| | | |
| | | @Resource |
| | | private SwiperPictureService swiperPictureService; |
| | | @Resource |
| | | private SwiperPictureService swiperPictureService; |
| | | |
| | | @Resource |
| | | private JDGoodsService jdGoodsService; |
| | | @Resource |
| | | private JDGoodsService jdGoodsService; |
| | | |
| | | @Resource |
| | | private PDDGoodsService pddGoodsService; |
| | | @Resource |
| | | private PDDGoodsService pddGoodsService; |
| | | |
| | | @Resource |
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService; |
| | | @Resource |
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService; |
| | | |
| | | @Resource |
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service; |
| | | @Resource |
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service; |
| | | |
| | | @Resource |
| | | private DaTaoKeGoodsService daTaoKeGoodsService; |
| | | @Resource |
| | | private DaTaoKeGoodsService daTaoKeGoodsService; |
| | | |
| | | @Resource |
| | | private HongBaoV2CountService hongBaoV2CountService; |
| | | |
| | | @Resource |
| | | private HongBaoManageService hongBaoManageService; |
| | | @Resource |
| | | private HongBaoV2CountService hongBaoV2CountService; |
| | | |
| | | /** |
| | | * 新版推荐专题管理(1.5.3) |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getRecommendIndex") |
| | | public void getRecommendIndex(AcceptData acceptData, Long uid, PrintWriter out) { |
| | | try { |
| | | // 获取设备定义性别 |
| | | int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice(),acceptData.getSystem()); |
| | | @Resource |
| | | private HongBaoManageService hongBaoManageService; |
| | | |
| | | // 1、专题模块 |
| | | JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex,acceptData.getSystem()); |
| | | @Resource |
| | | private GoodsLijinMnager goodsLijinMnager; |
| | | |
| | | // 2、顶部轮播图 |
| | | List<BannerVO> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("index_top", |
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()); |
| | | /** |
| | | * 新版推荐专题管理(1.5.3) |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getRecommendIndex") |
| | | public void getRecommendIndex(AcceptData acceptData, Long uid, PrintWriter out) { |
| | | try { |
| | | // 获取设备定义性别 |
| | | int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice(), acceptData.getSystem()); |
| | | |
| | | List<BannerVO> topPicList = new ArrayList<>(); |
| | | if (oldtopPicList != null && oldtopPicList.size() > 0) |
| | | topPicList.addAll(oldtopPicList); |
| | | // 1、专题模块 |
| | | JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex, acceptData.getSystem()); |
| | | |
| | | root.put("topPicList", JsonUtil.getApiCommonGson().toJson(topPicList)); |
| | | // 2、顶部轮播图 |
| | | List<BannerVO> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("index_top", |
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()), acceptData.getSystem()); |
| | | |
| | | // 3、邀请有奖 |
| | | List<BannerVO> invitePicList = null; |
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform()) |
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()),acceptData.getSystem())) { |
| | | // 如果IOS当前版本处于审核状态就不返回 |
| | | } else { |
| | | invitePicList = swiperPictureService.getByBannerCardAndVersion("index_invite", acceptData.getPlatform(), |
| | | Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()); |
| | | } |
| | | List<BannerVO> topPicList = new ArrayList<>(); |
| | | if (oldtopPicList != null && oldtopPicList.size() > 0) |
| | | topPicList.addAll(oldtopPicList); |
| | | |
| | | if (invitePicList == null) { |
| | | invitePicList = new ArrayList<BannerVO>(); |
| | | } |
| | | root.put("invitePicList", JsonUtil.getApiCommonGson().toJson(invitePicList)); |
| | | root.put("topPicList", JsonUtil.getApiCommonGson().toJson(topPicList)); |
| | | |
| | | // 4、IOS的底部网页链接 |
| | | String platform = acceptData.getPlatform(); |
| | | if ("ios".equalsIgnoreCase(platform)) { |
| | | root.put("htmlLink", configService.getValue(ConfigKeyEnum.indexHtmlLinkIos.getKey(),acceptData.getSystem())); |
| | | } |
| | | // 3、邀请有奖 |
| | | List<BannerVO> invitePicList = null; |
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform()) |
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()), acceptData.getSystem())) { |
| | | // 如果IOS当前版本处于审核状态就不返回 |
| | | } else { |
| | | invitePicList = swiperPictureService.getByBannerCardAndVersion("index_invite", acceptData.getPlatform(), |
| | | Integer.parseInt(acceptData.getVersion()), acceptData.getSystem()); |
| | | } |
| | | |
| | | root.put("spikeGoods", getSpikeGoodsContent(acceptData)); |
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) |
| | | root.put("scoreExchange", getScoreExchangeInfo(acceptData)); |
| | | if (invitePicList == null) { |
| | | invitePicList = new ArrayList<BannerVO>(); |
| | | } |
| | | root.put("invitePicList", JsonUtil.getApiCommonGson().toJson(invitePicList)); |
| | | |
| | | if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion())) |
| | | root.put("searchDiscovery", getSearchDiscoveryInfo(acceptData)); |
| | | // 4、IOS的底部网页链接 |
| | | String platform = acceptData.getPlatform(); |
| | | if ("ios".equalsIgnoreCase(platform)) { |
| | | root.put("htmlLink", configService.getValue(ConfigKeyEnum.indexHtmlLinkIos.getKey(), acceptData.getSystem())); |
| | | } |
| | | |
| | | out.print(JsonUtil.loadTrueResult(root)); |
| | | } catch (Exception e) { |
| | | out.print(JsonUtil.loadFalseResult(1, "获取数据失败")); |
| | | try { |
| | | LogHelper.errorDetailInfo(e); |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | root.put("spikeGoods", getSpikeGoodsContent(acceptData)); |
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) |
| | | root.put("scoreExchange", getScoreExchangeInfo(acceptData)); |
| | | |
| | | /** |
| | | * 限时秒杀 1.5.3 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getSpikeGoods") |
| | | public void getSpikeGoods(AcceptData acceptData, PrintWriter out) { |
| | | JSONObject root = getSpikeGoodsContent(acceptData); |
| | | out.print(JsonUtil.loadTrueResult(root)); |
| | | } |
| | | if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion())) |
| | | root.put("searchDiscovery", getSearchDiscoveryInfo(acceptData)); |
| | | |
| | | private JSONObject getSpikeGoodsContent(AcceptData acceptData) { |
| | | long nowTime = System.currentTimeMillis(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTimeInMillis(nowTime); |
| | | List<DingDongTime> dtoList = DaTaoKeUtil.getDingDongQiangTime(calendar); |
| | | int dateNum = Integer.parseInt(TimeUtil.getGernalTime(nowTime, "ddHH")); |
| | | String timeStr = null; |
| | | int nextPos = 0; |
| | | for (int i = 0; i < dtoList.size() - 1; i++) { |
| | | if (dateNum >= Integer.parseInt(dtoList.get(i).getTime()) |
| | | && dateNum < Integer.parseInt(dtoList.get(i + 1).getTime())) { |
| | | timeStr = dtoList.get(i).getTime(); |
| | | nextPos = i + 1; |
| | | break; |
| | | } |
| | | } |
| | | out.print(JsonUtil.loadTrueResult(root)); |
| | | } catch (Exception e) { |
| | | out.print(JsonUtil.loadFalseResult(1, "获取数据失败")); |
| | | try { |
| | | LogHelper.errorDetailInfo(e); |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (timeStr == null) |
| | | timeStr = dtoList.get(dtoList.size() - 1).getTime(); |
| | | /** |
| | | * 限时秒杀 1.5.3 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getSpikeGoods") |
| | | public void getSpikeGoods(AcceptData acceptData, PrintWriter out) { |
| | | JSONObject root = getSpikeGoodsContent(acceptData); |
| | | out.print(JsonUtil.loadTrueResult(root)); |
| | | } |
| | | |
| | | long nextTime = nowTime + 1000 * 60 * 60L;// 默认为1小时 |
| | | if (nextPos < dtoList.size()) { |
| | | nextTime = TimeUtil.convertToTimeTemp( |
| | | TimeUtil.getGernalTime(nowTime, "yyyyMM") + dtoList.get(nextPos).getTime(), "yyyyMMddHH"); |
| | | } |
| | | private JSONObject getSpikeGoodsContent(AcceptData acceptData) { |
| | | long nowTime = System.currentTimeMillis(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTimeInMillis(nowTime); |
| | | List<DingDongTime> dtoList = DaTaoKeUtil.getDingDongQiangTime(calendar); |
| | | int dateNum = Integer.parseInt(TimeUtil.getGernalTime(nowTime, "ddHH")); |
| | | String timeStr = null; |
| | | int nextPos = 0; |
| | | for (int i = 0; i < dtoList.size() - 1; i++) { |
| | | if (dateNum >= Integer.parseInt(dtoList.get(i).getTime()) |
| | | && dateNum < Integer.parseInt(dtoList.get(i + 1).getTime())) { |
| | | timeStr = dtoList.get(i).getTime(); |
| | | nextPos = i + 1; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | JSONArray array = null; |
| | | String timekey = RedisKeyEnum.getRedisKey(RedisKeyEnum.spikeGoodsHourNew,acceptData.getPlatform() +"-"+acceptData.getVersion()); |
| | | String cachekey = RedisKeyEnum.getRedisKey(RedisKeyEnum.spikeGoodsListNew,acceptData.getPlatform() +"-"+acceptData.getVersion()); |
| | | if (timeStr == null) |
| | | timeStr = dtoList.get(dtoList.size() - 1).getTime(); |
| | | |
| | | |
| | | Calendar nowCalendar = Calendar.getInstance(); |
| | | nowCalendar.setTimeInMillis(nowTime); |
| | | int hour = nowCalendar.get(Calendar.HOUR_OF_DAY); |
| | | long nextTime = nowTime + 1000 * 60 * 60L;// 默认为1小时 |
| | | if (nextPos < dtoList.size()) { |
| | | nextTime = TimeUtil.convertToTimeTemp( |
| | | TimeUtil.getGernalTime(nowTime, "yyyyMM") + dtoList.get(nextPos).getTime(), "yyyyMMddHH"); |
| | | } |
| | | |
| | | String timeValue = redisManager.getCommonString(timekey); |
| | | if (timeValue == null || !timeValue.equals(hour + "")) { |
| | | redisManager.cacheCommonString(timekey, hour + "", 60 * 30); |
| | | } else { |
| | | String cacheValue = redisManager.getCommonString(cachekey); |
| | | if (!StringUtil.isNullOrEmpty(cacheValue)) { |
| | | array = JSONArray.fromObject(cacheValue); |
| | | } |
| | | } |
| | | JSONArray array = null; |
| | | String timekey = RedisKeyEnum.getRedisKey(RedisKeyEnum.spikeGoodsHourNew, acceptData.getPlatform() + "-" + acceptData.getVersion()); |
| | | String cachekey = RedisKeyEnum.getRedisKey(RedisKeyEnum.spikeGoodsListNew, acceptData.getPlatform() + "-" + acceptData.getVersion()); |
| | | |
| | | JumpDetailV2 jumpDetail = null; |
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("spike_goods_list"); |
| | | } else { |
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("web"); |
| | | } |
| | | |
| | | if (array == null) { |
| | | array = new JSONArray(); |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | Calendar nowCalendar = Calendar.getInstance(); |
| | | nowCalendar.setTimeInMillis(nowTime); |
| | | int hour = nowCalendar.get(Calendar.HOUR_OF_DAY); |
| | | |
| | | // 缓存中不存在 |
| | | List<DaTaoKeDetailV2> listGoods = daTaoKeGoodsDetailV2Service.getDingDongQiangData(timeStr); |
| | | if (listGoods == null) { |
| | | listGoods = new ArrayList<>(); |
| | | } |
| | | String timeValue = redisManager.getCommonString(timekey); |
| | | if (timeValue == null || !timeValue.equals(hour + "")) { |
| | | redisManager.cacheCommonString(timekey, hour + "", 60 * 30); |
| | | } else { |
| | | String cacheValue = redisManager.getCommonString(cachekey); |
| | | if (!StringUtil.isNullOrEmpty(cacheValue)) { |
| | | array = JSONArray.fromObject(cacheValue); |
| | | } |
| | | } |
| | | |
| | | if (listGoods != null && listGoods.size() > 3) |
| | | listGoods = listGoods.subList(0, 3); |
| | | JumpDetailV2 jumpDetail = null; |
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("spike_goods_list"); |
| | | } else { |
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("web"); |
| | | } |
| | | |
| | | /* 遍历列表数据 */ |
| | | if (array == null) { |
| | | array = new JSONArray(); |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | |
| | | ConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | // 缓存中不存在 |
| | | List<DaTaoKeDetailV2> listGoods = daTaoKeGoodsDetailV2Service.getDingDongQiangData(timeStr); |
| | | if (listGoods == null) { |
| | | listGoods = new ArrayList<>(); |
| | | } |
| | | |
| | | for (DaTaoKeDetailV2 detail : listGoods) { |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(detail); |
| | | if (taoBaoGoodsBrief == null) { |
| | | continue; |
| | | } |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO); |
| | | if (listGoods != null && listGoods.size() > 3) |
| | | listGoods = listGoods.subList(0, 3); |
| | | |
| | | JSONObject params = new JSONObject(); |
| | | params.put("url", configService.getValue(ConfigKeyEnum.spikeGoodsLink.getKey(),acceptData.getSystem()) + "?id=" + taoBaoGoodsBrief.getAuctionId()); |
| | | /* 遍历列表数据 */ |
| | | |
| | | JSONObject goods = new JSONObject(); |
| | | goods.put("goods", gson.toJson(detailVO)); |
| | | goods.put("params", params); |
| | | goods.put("jumpDetail", jumpDetail); |
| | | GoodsMoneyConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | // 1.5.4及以后返回 |
| | | if (VersionUtil.greaterThan_1_5_40(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | array.add(goods); |
| | | } else { |
| | | array.add(goods.optJSONObject("goods")); |
| | | } |
| | | } |
| | | for (DaTaoKeDetailV2 detail : listGoods) { |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(detail); |
| | | if (taoBaoGoodsBrief == null) { |
| | | continue; |
| | | } |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO); |
| | | |
| | | // 缓存半个小时 |
| | | redisManager.cacheCommonString(cachekey, array.toString(), 60 * 30); |
| | | } |
| | | JSONObject params = new JSONObject(); |
| | | params.put("url", configService.getValue(ConfigKeyEnum.spikeGoodsLink.getKey(), acceptData.getSystem()) + "?id=" + taoBaoGoodsBrief.getAuctionId()); |
| | | |
| | | // 获取今天的数据 |
| | | JSONObject goods = new JSONObject(); |
| | | goods.put("goods", gson.toJson(detailVO)); |
| | | goods.put("params", params); |
| | | goods.put("jumpDetail", jumpDetail); |
| | | |
| | | Long endTime = nextTime - nowTime; |
| | | // 1.5.4及以后返回 |
| | | if (VersionUtil.greaterThan_1_5_40(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | array.add(goods); |
| | | } else { |
| | | array.add(goods.optJSONObject("goods")); |
| | | } |
| | | } |
| | | |
| | | JSONObject root = new JSONObject(); |
| | | // 缓存半个小时 |
| | | redisManager.cacheCommonString(cachekey, array.toString(), 60 * 30); |
| | | } |
| | | |
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | root.put("time", nextTime); |
| | | root.put("endTime", endTime > 0 ? endTime : 0); |
| | | JSONArray imgArray = new JSONArray(); |
| | | if (array != null) |
| | | for (int i = 0; i < array.size(); i++) { |
| | | imgArray.add(array.optJSONObject(i).optJSONObject("goods").optString("picUrl")); |
| | | } |
| | | root.put("imgList", imgArray); |
| | | JSONObject params = new JSONObject(); |
| | | params.put("url", configService.getValue(ConfigKeyEnum.spikeGoodsLink.getKey(),acceptData.getSystem())); |
| | | root.put("params", params); |
| | | root.put("jumpDetail", jumpDetail); |
| | | root.put("name", "限时秒杀"); |
| | | root.put("desc", "整点更新,好物抢购"); |
| | | } else { |
| | | root.put("time", nextTime); |
| | | root.put("endTime", endTime > 0 ? endTime : 0); |
| | | root.put("listgoods", array); |
| | | JSONObject params = new JSONObject(); |
| | | params.put("url", configService.getValue(ConfigKeyEnum.spikeGoodsLink.getKey(),acceptData.getSystem())); |
| | | root.put("params", params); |
| | | root.put("jumpDetail", jumpDetail); |
| | | } |
| | | // 获取今天的数据 |
| | | |
| | | root.put("time", nextTime); |
| | | root.put("endTime", endTime > 0 ? endTime : 0); |
| | | root.put("listgoods", array); |
| | | Long endTime = nextTime - nowTime; |
| | | |
| | | return root; |
| | | } |
| | | JSONObject root = new JSONObject(); |
| | | |
| | | /** |
| | | * 限时秒杀列表 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping("getSpikTime") |
| | | public void getSpikTime(AcceptData acceptData, PrintWriter out) { |
| | | List<DingDongTime> timeList = DaTaoKeUtil.getDingDongQiangTime(Calendar.getInstance()); |
| | | List<SpikeTimeVO> list = new ArrayList<SpikeTimeVO>(); |
| | | for (int i = 0; i < timeList.size(); i++) { |
| | | SpikeTimeVO spikeTime1 = new SpikeTimeVO(); |
| | | spikeTime1.setTime(timeList.get(i).getTime().subSequence(2, 4) + ":00"); |
| | | if (timeList.get(i).getState() <= 0) |
| | | spikeTime1.setState("进行中"); |
| | | else |
| | | spikeTime1.setState("即将开始"); |
| | | if (timeList.get(i).getState() == 0) |
| | | spikeTime1.setChecked(true); |
| | | spikeTime1.setRequestTime(timeList.get(i).getTime()); |
| | | list.add(spikeTime1); |
| | | } |
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | root.put("time", nextTime); |
| | | root.put("endTime", endTime > 0 ? endTime : 0); |
| | | JSONArray imgArray = new JSONArray(); |
| | | if (array != null) |
| | | for (int i = 0; i < array.size(); i++) { |
| | | imgArray.add(array.optJSONObject(i).optJSONObject("goods").optString("picUrl")); |
| | | } |
| | | root.put("imgList", imgArray); |
| | | JSONObject params = new JSONObject(); |
| | | params.put("url", configService.getValue(ConfigKeyEnum.spikeGoodsLink.getKey(), acceptData.getSystem())); |
| | | root.put("params", params); |
| | | root.put("jumpDetail", jumpDetail); |
| | | root.put("name", "限时秒杀"); |
| | | root.put("desc", "整点更新,好物抢购"); |
| | | } else { |
| | | root.put("time", nextTime); |
| | | root.put("endTime", endTime > 0 ? endTime : 0); |
| | | root.put("listgoods", array); |
| | | JSONObject params = new JSONObject(); |
| | | params.put("url", configService.getValue(ConfigKeyEnum.spikeGoodsLink.getKey(), acceptData.getSystem())); |
| | | root.put("params", params); |
| | | root.put("jumpDetail", jumpDetail); |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", list.size()); |
| | | data.put("list", list); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | root.put("time", nextTime); |
| | | root.put("endTime", endTime > 0 ? endTime : 0); |
| | | root.put("listgoods", array); |
| | | |
| | | /** |
| | | * 限时秒杀列表 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param out |
| | | */ |
| | | @RequestMapping("getSpikeGoodsList") |
| | | public void getSpikeGoodsList(AcceptData acceptData, Integer page, Long goodsId, String qtime, PrintWriter out) { |
| | | List<DaTaoKeDetailV2> detailList0 = daTaoKeGoodsDetailV2Service.getDingDongQiangData(qtime); |
| | | if (detailList0 == null) |
| | | detailList0 = new ArrayList<>(); |
| | | return root; |
| | | } |
| | | |
| | | List<DaTaoKeDetailV2> detailList = new ArrayList<>(); |
| | | detailList.addAll(detailList0); |
| | | JSONArray array = new JSONArray(); |
| | | if (page == 1 && goodsId != null && detailList != null) { |
| | | for (int i = 0; i < detailList.size(); i++) { |
| | | if (detailList.get(i).getGoodsId().longValue() == goodsId) { |
| | | DaTaoKeDetailV2 goods = detailList.get(i); |
| | | detailList.remove(i); |
| | | detailList.add(0, goods); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 限时秒杀列表 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping("getSpikTime") |
| | | public void getSpikTime(AcceptData acceptData, PrintWriter out) { |
| | | List<DingDongTime> timeList = DaTaoKeUtil.getDingDongQiangTime(Calendar.getInstance()); |
| | | List<SpikeTimeVO> list = new ArrayList<SpikeTimeVO>(); |
| | | for (int i = 0; i < timeList.size(); i++) { |
| | | SpikeTimeVO spikeTime1 = new SpikeTimeVO(); |
| | | spikeTime1.setTime(timeList.get(i).getTime().subSequence(2, 4) + ":00"); |
| | | if (timeList.get(i).getState() <= 0) |
| | | spikeTime1.setState("进行中"); |
| | | else |
| | | spikeTime1.setState("即将开始"); |
| | | if (timeList.get(i).getState() == 0) |
| | | spikeTime1.setChecked(true); |
| | | spikeTime1.setRequestTime(timeList.get(i).getTime()); |
| | | list.add(spikeTime1); |
| | | } |
| | | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | if (detailList != null) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", list.size()); |
| | | data.put("list", list); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | for (DaTaoKeDetailV2 detail : detailList) { |
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(detail), paramsDTO))); |
| | | } |
| | | } |
| | | /** |
| | | * 限时秒杀列表 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param out |
| | | */ |
| | | @RequestMapping("getSpikeGoodsList") |
| | | public void getSpikeGoodsList(AcceptData acceptData, Integer page, Long goodsId, String qtime, PrintWriter out) { |
| | | List<DaTaoKeDetailV2> detailList0 = daTaoKeGoodsDetailV2Service.getDingDongQiangData(qtime); |
| | | if (detailList0 == null) |
| | | detailList0 = new ArrayList<>(); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", detailList.size()); |
| | | data.put("list", array); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | List<DaTaoKeDetailV2> detailList = new ArrayList<>(); |
| | | detailList.addAll(detailList0); |
| | | JSONArray array = new JSONArray(); |
| | | if (page == 1 && goodsId != null && detailList != null) { |
| | | for (int i = 0; i < detailList.size(); i++) { |
| | | if (detailList.get(i).getGoodsId().longValue() == goodsId) { |
| | | DaTaoKeDetailV2 goods = detailList.get(i); |
| | | detailList.remove(i); |
| | | detailList.add(0, goods); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 金币兑换信息 |
| | | * |
| | | * @param acceptData |
| | | * @return |
| | | */ |
| | | private JSONObject getScoreExchangeInfo(AcceptData acceptData) { |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | if (detailList != null) { |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | JSONObject root = new JSONObject(); |
| | | JSONArray array = new JSONArray(); |
| | | array.add("http://img.flqapp.com/resource/integral/integral_home_icon_2.png"); |
| | | array.add("http://img.flqapp.com/resource/integral/integral_home_icon_1.png"); |
| | | root.put("imgList", array); |
| | | JSONObject params = new JSONObject(); |
| | | params.put("balanceMore", true); |
| | | root.put("params", params); |
| | | root.put("jumpDetail", jumpDetailV2Service.getByTypeCache("integralExchange", |
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()))); |
| | | for (DaTaoKeDetailV2 detail : detailList) { |
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(detail), paramsDTO))); |
| | | } |
| | | } |
| | | |
| | | root.put("name", "金币兑换"); |
| | | root.put("desc", "每日签到,惊喜不停"); |
| | | root.put("tagImg", "http://img.flqapp.com/resource/score_exchange_tag.png"); |
| | | return root; |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", detailList.size()); |
| | | data.put("list", array); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | /** |
| | | * 金币兑换信息 |
| | | * |
| | | * @param acceptData |
| | | * @return |
| | | */ |
| | | private JSONObject getSearchDiscoveryInfo(AcceptData acceptData) { |
| | | JSONArray array = new JSONArray(); |
| | | String keys = configService.getSearchDiscoveryKeys(acceptData.getSystem()); |
| | | if (!StringUtil.isNullOrEmpty(keys)) { |
| | | JSONArray arrayKeys = JSONArray.fromObject(keys); |
| | | for (int i = 0; i < arrayKeys.size(); i++) { |
| | | String name = arrayKeys.get(i).toString(); |
| | | JSONObject params = new JSONObject(); |
| | | params.put("content", name); |
| | | /** |
| | | * 金币兑换信息 |
| | | * |
| | | * @param acceptData |
| | | * @return |
| | | */ |
| | | private JSONObject getScoreExchangeInfo(AcceptData acceptData) { |
| | | |
| | | SearchKeyVO keyVO = new SearchKeyVO(); |
| | | keyVO.setName(name); |
| | | keyVO.setParams(params.toString()); |
| | | array.add(keyVO); |
| | | } |
| | | } |
| | | JSONObject root = new JSONObject(); |
| | | JSONArray array = new JSONArray(); |
| | | array.add("http://img.flqapp.com/resource/integral/integral_home_icon_2.png"); |
| | | array.add("http://img.flqapp.com/resource/integral/integral_home_icon_1.png"); |
| | | root.put("imgList", array); |
| | | JSONObject params = new JSONObject(); |
| | | params.put("balanceMore", true); |
| | | root.put("params", params); |
| | | root.put("jumpDetail", jumpDetailV2Service.getByTypeCache("integralExchange", |
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()))); |
| | | |
| | | JSONObject params = new JSONObject(); |
| | | params.put("url", configService.getValue(ConfigKeyEnum.searchDiscoveryH5Link.getKey(),acceptData.getSystem())); |
| | | root.put("name", "金币兑换"); |
| | | root.put("desc", "每日签到,惊喜不停"); |
| | | root.put("tagImg", "http://img.flqapp.com/resource/score_exchange_tag.png"); |
| | | return root; |
| | | } |
| | | |
| | | JSONObject root = new JSONObject(); |
| | | root.put("picture", "http://img.flqapp.com/resource/home_search_found.png"); |
| | | root.put("params", params); |
| | | root.put("jumpDetail", jumpDetailV2Service.getByTypeCache("web", |
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()))); |
| | | /** |
| | | * 金币兑换信息 |
| | | * |
| | | * @param acceptData |
| | | * @return |
| | | */ |
| | | private JSONObject getSearchDiscoveryInfo(AcceptData acceptData) { |
| | | JSONArray array = new JSONArray(); |
| | | String keys = configService.getSearchDiscoveryKeys(acceptData.getSystem()); |
| | | if (!StringUtil.isNullOrEmpty(keys)) { |
| | | JSONArray arrayKeys = JSONArray.fromObject(keys); |
| | | for (int i = 0; i < arrayKeys.size(); i++) { |
| | | String name = arrayKeys.get(i).toString(); |
| | | JSONObject params = new JSONObject(); |
| | | params.put("content", name); |
| | | |
| | | root.put("jumpResult", jumpDetailV2Service.getByTypeCache("search_goods_result", |
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()))); |
| | | root.put("keyList", array); |
| | | return root; |
| | | } |
| | | SearchKeyVO keyVO = new SearchKeyVO(); |
| | | keyVO.setName(name); |
| | | keyVO.setParams(params.toString()); |
| | | array.add(keyVO); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 首页底部商品推荐 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getGoodList") |
| | | public void getGoodList(AcceptData acceptData, Integer goodsType, Integer page, HttpServletRequest request, |
| | | PrintWriter out) { |
| | | JSONObject params = new JSONObject(); |
| | | params.put("url", configService.getValue(ConfigKeyEnum.searchDiscoveryH5Link.getKey(), acceptData.getSystem())); |
| | | |
| | | JSONObject root = new JSONObject(); |
| | | root.put("picture", "http://img.flqapp.com/resource/home_search_found.png"); |
| | | root.put("params", params); |
| | | root.put("jumpDetail", jumpDetailV2Service.getByTypeCache("web", |
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()))); |
| | | |
| | | root.put("jumpResult", jumpDetailV2Service.getByTypeCache("search_goods_result", |
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()))); |
| | | root.put("keyList", array); |
| | | return root; |
| | | } |
| | | |
| | | /** |
| | | * 首页底部商品推荐 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getGoodList") |
| | | public void getGoodList(AcceptData acceptData, Long uid, Integer goodsType, Integer page, HttpServletRequest request, |
| | | PrintWriter out) { |
| | | |
| | | if (goodsType == null || page == null) { |
| | | out.print(JsonUtil.loadFalseResult("参数信息不正常")); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | taoBaoGuessUserLikeByDevice(acceptData, uid, page, request, out); |
| | | return; |
| | | } |
| | | |
| | | if (goodsType == null || page == null) { |
| | | out.print(JsonUtil.loadFalseResult("参数信息不正常")); |
| | | return; |
| | | } |
| | | if (goodsType == Constant.SOURCE_TYPE_JD) { |
| | | getIndexJDGoods(acceptData, page, out); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | taoBaoGuessUserLikeByDevice(acceptData, page, request, out); |
| | | return; |
| | | } |
| | | if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | getIndexPDDGoods(acceptData, page, out); |
| | | return; |
| | | } |
| | | out.print(JsonUtil.loadFalseResult("商品类型错误")); |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", new JSONArray()); |
| | | data.put("count", 0); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | } |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_JD) { |
| | | getIndexJDGoods(acceptData, page, out); |
| | | return; |
| | | } |
| | | /** |
| | | * 根据设备信息获取猜你喜欢的内容 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param request |
| | | * @param out |
| | | */ |
| | | public void taoBaoGuessUserLikeByDevice(AcceptData acceptData, Long uid, int page, HttpServletRequest request, |
| | | PrintWriter out) { |
| | | int pageSize = Constant.PAGE_SIZE; |
| | | JSONArray array = new JSONArray(); |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create(); |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | getIndexPDDGoods(acceptData, page, out); |
| | | return; |
| | | } |
| | | out.print(JsonUtil.loadFalseResult("商品类型错误")); |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", new JSONArray()); |
| | | data.put("count", 0); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | } |
| | | String idfa = acceptData.getIdfa(); |
| | | String imei = acceptData.getImei(); |
| | | if (VersionUtil.greaterThan_1_5_70(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | List<TaoBaoGoodsBrief> goodsList = homeRecommendGoodsService.listGoodsByPage(null, acceptData.getDevice(), |
| | | imei, idfa, page); |
| | | |
| | | /** |
| | | * 根据设备信息获取猜你喜欢的内容 |
| | | * @param acceptData |
| | | * @param page |
| | | * @param request |
| | | * @param out |
| | | */ |
| | | public void taoBaoGuessUserLikeByDevice(AcceptData acceptData, int page, HttpServletRequest request, |
| | | PrintWriter out) { |
| | | int pageSize = Constant.PAGE_SIZE; |
| | | JSONArray array = new JSONArray(); |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create(); |
| | | if (page < 4) {// 前三页加入更新 |
| | | try { |
| | | taoBaoGoodsUpdateService.addUpdateQueueAsync(goodsList); |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | |
| | | String idfa = acceptData.getIdfa(); |
| | | String imei = acceptData.getImei(); |
| | | if (VersionUtil.greaterThan_1_5_70(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | List<TaoBaoGoodsBrief> goodsList = homeRecommendGoodsService.listGoodsByPage(null, acceptData.getDevice(), |
| | | imei, idfa, page); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | if (page < 4) {// 前三页加入更新 |
| | | try { |
| | | taoBaoGoodsUpdateService.addUpdateQueueAsync(goodsList); |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO); |
| | | |
| | | for (TaoBaoGoodsBrief goods : goodsList) { |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | if (page < 3) |
| | | detailVO.setRecommend(true); |
| | | for (GoodsDetailVO vo : voList) { |
| | | if (page < 3) |
| | | vo.setRecommend(true); |
| | | try { |
| | | array.add(gson.toJson(vo)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | try { |
| | | array.add(gson.toJson(detailVO)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | if (page == 1) { |
| | | List<TLJBuyGoods> list = homeRecommendGoodsService.getZiGouLiJianHotGoods(acceptData.getDevice()); |
| | | if (list != null && list.size() > 0) { |
| | | BigDecimal rateBuy = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE; |
| | | GoodsMoneyConfigParamsDTO paramsBuy = new GoodsMoneyConfigParamsDTO(rateBuy, rateBuy, Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, acceptData.getSystem())); |
| | | for (int i = list.size() - 1; i >= 0; i--) { |
| | | TLJBuyGoods goods = list.get(i); |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods.getGoods(), paramsBuy); |
| | | |
| | | if (page == 1) { |
| | | List<TLJBuyGoods> list = homeRecommendGoodsService.getZiGouLiJianHotGoods(acceptData.getDevice()); |
| | | if (list != null && list.size() > 0) { |
| | | BigDecimal rateBuy = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE; |
| | | ConfigParamsDTO paramsBuy = new ConfigParamsDTO(rateBuy, rateBuy, Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,acceptData.getSystem())); |
| | | for (int i = list.size() - 1; i >= 0; i--) { |
| | | TLJBuyGoods goods = list.get(i); |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods.getGoods(), paramsBuy); |
| | | String hongBao = TaoBaoUtil.getGoodsHongBaoInfo(goods.getGoods(), |
| | | TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE, false); |
| | | |
| | | String hongBao = TaoBaoUtil.getGoodsHongBaoInfo(goods.getGoods(), |
| | | TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE,false); |
| | | ReduceHongBao reduceHongBao = new ReduceHongBao(); |
| | | reduceHongBao.setLeft(goods.getLeftHongBaoCount()); |
| | | reduceHongBao.setMoney(hongBao); |
| | | reduceHongBao.setName("付款立减 "); |
| | | reduceHongBao.setTip(""); |
| | | reduceHongBao.setTotal(goods.getTotalHongBaoCount()); |
| | | |
| | | ReduceHongBao reduceHongBao = new ReduceHongBao(); |
| | | reduceHongBao.setLeft(goods.getLeftHongBaoCount()); |
| | | reduceHongBao.setMoney(hongBao); |
| | | reduceHongBao.setName("付款立减 "); |
| | | reduceHongBao.setTip(""); |
| | | reduceHongBao.setTotal(goods.getTotalHongBaoCount()); |
| | | OtherInfo otherInfo = new OtherInfo(); |
| | | otherInfo.setReduceHongBao(reduceHongBao); |
| | | |
| | | OtherInfo otherInfo = new OtherInfo(); |
| | | otherInfo.setReduceHongBao(reduceHongBao); |
| | | detailVO.setOtherInfo(otherInfo); |
| | | detailVO.setPictureTag(new ClientTextStyleVO("立减TOP" + (i + 1), "#E5005C", "#FCE431", null)); |
| | | detailVO.setRecommend(true); |
| | | array.add(0, gson.toJson(detailVO)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | detailVO.setOtherInfo(otherInfo); |
| | | detailVO.setPictureTag(new ClientTextStyleVO("立减TOP" + (i + 1), "#E5005C", "#FCE431", null)); |
| | | detailVO.setRecommend(true); |
| | | array.add(0, gson.toJson(detailVO)); |
| | | } |
| | | } |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", array); |
| | | data.put("count", 1000); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | return; |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", array); |
| | | data.put("count", 1000); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | return; |
| | | } |
| | | // 从推荐来 |
| | | if (page <= 1) { |
| | | array.clear(); |
| | | if (!StringUtil.isNullOrEmpty(imei) || !StringUtil.isNullOrEmpty(idfa)) { |
| | | long startTime = java.lang.System.currentTimeMillis(); |
| | | |
| | | // 从推荐来 |
| | | if (page <= 1) { |
| | | array.clear(); |
| | | if (!StringUtil.isNullOrEmpty(imei) || !StringUtil.isNullOrEmpty(idfa)) { |
| | | long startTime = java.lang.System.currentTimeMillis(); |
| | | TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(page, 50, imei, idfa, ""); |
| | | |
| | | TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(page, 50, imei, idfa,""); |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) { |
| | | // 筛选 |
| | | List<GoodsDetailVO> goodsList = new ArrayList<>(); |
| | | |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) { |
| | | // 筛选 |
| | | List<GoodsDetailVO> goodsList = new ArrayList<>(); |
| | | List<TaoBaoGoodsBrief> gList = recommendGoodsDeleteHistoryService |
| | | .filterGoods(acceptData.getDevice(), result.getTaoBaoGoodsBriefs()); |
| | | |
| | | List<TaoBaoGoodsBrief> gList = recommendGoodsDeleteHistoryService |
| | | .filterGoods(acceptData.getDevice(), result.getTaoBaoGoodsBriefs()); |
| | | // filter |
| | | try { |
| | | gList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(gList); |
| | | } catch (Exception e) { |
| | | } |
| | | |
| | | // filter |
| | | try { |
| | | gList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(gList); |
| | | } catch (Exception e) { |
| | | } |
| | | // 设备推荐 |
| | | if (gList != null) { |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | // 设备推荐 |
| | | if (gList != null) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | for (TaoBaoGoodsBrief goods : gList) { |
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponInfo()) && goods.getCouponAmount() != null |
| | | && goods.getCouponAmount().compareTo(new BigDecimal("5")) >= 0 |
| | | && goods.getBiz30day() > 1000 |
| | | && !StringUtil.isNullOrEmpty(goods.getPictUrlWhite())) { |
| | | List<TaoBaoGoodsBrief> deviceGoodsList = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goods : gList) { |
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponInfo()) && goods.getCouponAmount() != null |
| | | && goods.getCouponAmount().compareTo(new BigDecimal("5")) >= 0 |
| | | && goods.getBiz30day() > 1000 |
| | | && !StringUtil.isNullOrEmpty(goods.getPictUrlWhite())) { |
| | | deviceGoodsList.add(goods); |
| | | } |
| | | } |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, deviceGoodsList, paramsDTO); |
| | | for (GoodsDetailVO vo : voList) { |
| | | vo.setRecommend(true); |
| | | } |
| | | goodsList.addAll(voList); |
| | | } |
| | | |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | detailVO.setRecommend(true); |
| | | goodsList.add(detailVO); |
| | | } |
| | | } |
| | | } |
| | | |
| | | try { |
| | | monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, |
| | | (int) (java.lang.System.currentTimeMillis() - startTime), "推荐数量:" + goodsList.size())); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | try { |
| | | monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, |
| | | (int) (java.lang.System.currentTimeMillis() - startTime), "推荐数量:" + goodsList.size())); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | Collections.shuffle(goodsList); |
| | | goodsList = goodsList.size() > 20 ? goodsList.subList(0, 20) : goodsList; |
| | | for (GoodsDetailVO goods : goodsList) { |
| | | array.add(gson.toJson(goods)); |
| | | } |
| | | } else { |
| | | try { |
| | | monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, |
| | | (int) (java.lang.System.currentTimeMillis() - startTime), "无推荐")); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | JSONArray localArray = qualityGoodsService.getRecommendToIndexV2((page - 1) * pageSize, pageSize,acceptData.getPlatform(),acceptData.getVersion(),acceptData.getSystem()); |
| | | array.addAll(localArray); |
| | | } else {// 从精选库来 |
| | | array = qualityGoodsService.getRecommendToIndexV2((page - 1) * pageSize, pageSize,acceptData.getPlatform(),acceptData.getVersion(),acceptData.getSystem()); |
| | | if (array == null) { |
| | | out.print(JsonUtil.loadFalseResult("没有更多了")); |
| | | return; |
| | | } |
| | | } |
| | | Collections.shuffle(goodsList); |
| | | goodsList = goodsList.size() > 20 ? goodsList.subList(0, 20) : goodsList; |
| | | for (GoodsDetailVO goods : goodsList) { |
| | | array.add(gson.toJson(goods)); |
| | | } |
| | | } else { |
| | | try { |
| | | monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, |
| | | (int) (java.lang.System.currentTimeMillis() - startTime), "无推荐")); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | JSONArray localArray = qualityGoodsService.getRecommendToIndexV2((page - 1) * pageSize, pageSize, acceptData.getPlatform(), acceptData.getVersion(), acceptData.getSystem()); |
| | | array.addAll(localArray); |
| | | } else {// 从精选库来 |
| | | array = qualityGoodsService.getRecommendToIndexV2((page - 1) * pageSize, pageSize, acceptData.getPlatform(), acceptData.getVersion(), acceptData.getSystem()); |
| | | if (array == null) { |
| | | out.print(JsonUtil.loadFalseResult("没有更多了")); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", array); |
| | | data.put("count", 1000); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", array); |
| | | data.put("count", 1000); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | /** |
| | | * 京东首页商品 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param out |
| | | */ |
| | | private void getIndexJDGoods(AcceptData acceptData, int page, PrintWriter out) { |
| | | JDSearchResult result = jdGoodsService.getIndexJDGoods(page,acceptData.getSystem()); |
| | | long count = 0; |
| | | JSONObject data = new JSONObject(); |
| | | JSONArray array = new JSONArray(); |
| | | if (result != null) { |
| | | PageEntity pageEntity = result.getPageEntity(); |
| | | if (pageEntity != null) { |
| | | count = pageEntity.getTotalCount(); |
| | | } |
| | | /** |
| | | * 京东首页商品 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param out |
| | | */ |
| | | private void getIndexJDGoods(AcceptData acceptData, int page, PrintWriter out) { |
| | | JDSearchResult result = jdGoodsService.getIndexJDGoods(page, acceptData.getSystem()); |
| | | long count = 0; |
| | | JSONObject data = new JSONObject(); |
| | | JSONArray array = new JSONArray(); |
| | | if (result != null) { |
| | | PageEntity pageEntity = result.getPageEntity(); |
| | | if (pageEntity != null) { |
| | | count = pageEntity.getTotalCount(); |
| | | } |
| | | |
| | | List<JDGoods> goodsList = result.getGoodsList(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | List<JDGoods> goodsList = result.getGoodsList(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | for (JDGoods goods : goodsList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO); |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | } |
| | | } |
| | | } |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | for (JDGoods goods : goodsList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO); |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | data.put("list", array); |
| | | data.put("count", count); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | data.put("list", array); |
| | | data.put("count", count); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | /** |
| | | * 爆款排行商品-实时热销榜 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param out |
| | | */ |
| | | private void getIndexPDDGoods(AcceptData acceptData, int page, PrintWriter out) { |
| | | PDDGoodsResult result = pddGoodsService.getTopGoodsList(page, 1); |
| | | int count = 0; |
| | | JSONArray array = new JSONArray(); |
| | | if (result != null) { |
| | | count = result.getTotalCount(); |
| | | Gson gson = JsonUtil.getApiCommonGson(); |
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | /** |
| | | * 爆款排行商品-实时热销榜 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param out |
| | | */ |
| | | private void getIndexPDDGoods(AcceptData acceptData, int page, PrintWriter out) { |
| | | PDDGoodsResult result = pddGoodsService.getTopGoodsList(page, 1); |
| | | int count = 0; |
| | | JSONArray array = new JSONArray(); |
| | | if (result != null) { |
| | | count = result.getTotalCount(); |
| | | Gson gson = JsonUtil.getApiCommonGson(); |
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | for (PDDGoodsDetail goods : goodsList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO); |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | } |
| | | } |
| | | } |
| | | for (PDDGoodsDetail goods : goodsList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO); |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", array); |
| | | data.put("count", count); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", array); |
| | | data.put("count", count); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | /** |
| | | * 搜索发现列表 |
| | | * |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param page |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getSearchDiscoveryTop") |
| | | public void getSearchDiscoveryTop(AcceptData acceptData, Long uid, Integer page, String callback, PrintWriter out) { |
| | | int count = 0; |
| | | List<SearchKeyTOPVO> list = new ArrayList<SearchKeyTOPVO>(); |
| | | /** |
| | | * 搜索发现列表 |
| | | * |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param page |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getSearchDiscoveryTop") |
| | | public void getSearchDiscoveryTop(AcceptData acceptData, Long uid, Integer page, String callback, PrintWriter out) { |
| | | int count = 0; |
| | | List<SearchKeyTOPVO> list = new ArrayList<SearchKeyTOPVO>(); |
| | | |
| | | String keys = configService.getSearchDiscoveryKeys(acceptData.getSystem()); |
| | | if (!StringUtil.isNullOrEmpty(keys)) { |
| | | JSONArray arrayKeys = JSONArray.fromObject(keys); |
| | | if (arrayKeys != null && arrayKeys.size() > 0) { |
| | | count = arrayKeys.size(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | String keys = configService.getSearchDiscoveryKeys(acceptData.getSystem()); |
| | | if (!StringUtil.isNullOrEmpty(keys)) { |
| | | JSONArray arrayKeys = JSONArray.fromObject(keys); |
| | | if (arrayKeys != null && arrayKeys.size() > 0) { |
| | | count = arrayKeys.size(); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | int j = 1; |
| | | for (int i = (page - 1) * 3; i < arrayKeys.size(); i++) { |
| | | if (j > 3) |
| | | break; |
| | | int j = 1; |
| | | for (int i = (page - 1) * 3; i < arrayKeys.size(); i++) { |
| | | if (j > 3) |
| | | break; |
| | | |
| | | String words = arrayKeys.get(i).toString(); |
| | | List<GoodsDetailVO> listGoods = new ArrayList<GoodsDetailVO>(); |
| | | String words = arrayKeys.get(i).toString(); |
| | | List<GoodsDetailVO> listGoods = new ArrayList<GoodsDetailVO>(); |
| | | |
| | | List<DaTaoKeDetailV2> listTaoKe = daTaoKeGoodsService.getSearchDiscoveryGoods(words); |
| | | if (listTaoKe != null && listTaoKe.size() > 0) { |
| | | for (DaTaoKeDetailV2 daTaoKeDetailV2 : listTaoKe) { |
| | | listGoods.add( |
| | | GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(daTaoKeDetailV2), paramsDTO)); |
| | | if (listGoods.size() >= 3) |
| | | break; |
| | | } |
| | | } |
| | | List<DaTaoKeDetailV2> listTaoKe = daTaoKeGoodsService.getSearchDiscoveryGoods(words); |
| | | if (listTaoKe != null && listTaoKe.size() > 0) { |
| | | for (DaTaoKeDetailV2 daTaoKeDetailV2 : listTaoKe) { |
| | | listGoods.add( |
| | | GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(daTaoKeDetailV2), paramsDTO)); |
| | | if (listGoods.size() >= 3) |
| | | break; |
| | | } |
| | | } |
| | | |
| | | SearchKeyTOPVO keyTOPVO = new SearchKeyTOPVO(); |
| | | keyTOPVO.setName(words); |
| | | keyTOPVO.setListGoods(listGoods); |
| | | list.add(keyTOPVO); |
| | | SearchKeyTOPVO keyTOPVO = new SearchKeyTOPVO(); |
| | | keyTOPVO.setName(words); |
| | | keyTOPVO.setListGoods(listGoods); |
| | | list.add(keyTOPVO); |
| | | |
| | | j++; |
| | | } |
| | | } |
| | | } |
| | | j++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation(); |
| | | Gson gson = gsonBuilder.create(); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", count); |
| | | data.put("list", gson.toJson(list)); |
| | | if (!StringUtil.isNullOrEmpty(callback)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } else |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation(); |
| | | Gson gson = gsonBuilder.create(); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", count); |
| | | data.put("list", gson.toJson(list)); |
| | | if (!StringUtil.isNullOrEmpty(callback)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } else |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | /** |
| | | * 获取专题渠道活动 |
| | | * |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param callback |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getSpecialChannelActivity") |
| | | public void getSpecialChannelActivity(AcceptData acceptData, Long uid, String callback, PrintWriter out) { |
| | | /** |
| | | * 获取专题渠道活动 |
| | | * |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param callback |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getSpecialChannelActivity") |
| | | public void getSpecialChannelActivity(AcceptData acceptData, Long uid, String callback, PrintWriter out) { |
| | | |
| | | int platformCode = Constant.getPlatformCode(acceptData.getPlatform()); |
| | | int platformCode = Constant.getPlatformCode(acceptData.getPlatform()); |
| | | |
| | | List<Special> list = specialService.listByPlaceKey("special_channel_activity", platformCode, |
| | | Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()); |
| | | List<Special> list = specialService.listByPlaceKey("special_channel_activity", platformCode, |
| | | Integer.parseInt(acceptData.getVersion()), acceptData.getSystem()); |
| | | |
| | | long time = System.currentTimeMillis(); |
| | | // 删除尚未启用的过期的 |
| | | for (int i = 0; i < list.size(); i++) { |
| | | Special special = list.get(i); |
| | | if (special.getState() == 1L) { |
| | | list.remove(i--); |
| | | } else { |
| | | if (special.getStartTime() != null && special.getEndTime() != null) { |
| | | if (time < special.getStartTime().getTime() || time > special.getEndTime().getTime()) { |
| | | list.remove(i--); |
| | | } else// 设置倒计时 |
| | | { |
| | | special.setCountDownTime((special.getEndTime().getTime() - time) / 1000); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | long time = System.currentTimeMillis(); |
| | | // 删除尚未启用的过期的 |
| | | for (int i = 0; i < list.size(); i++) { |
| | | Special special = list.get(i); |
| | | if (special.getState() == 1L) { |
| | | list.remove(i--); |
| | | } else { |
| | | if (special.getStartTime() != null && special.getEndTime() != null) { |
| | | if (time < special.getStartTime().getTime() || time > special.getEndTime().getTime()) { |
| | | list.remove(i--); |
| | | } else// 设置倒计时 |
| | | { |
| | | special.setCountDownTime((special.getEndTime().getTime() - time) / 1000); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation(); |
| | | Gson gson = gsonBuilder.create(); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", list.size()); |
| | | data.put("list", gson.toJson(list)); |
| | | if (!StringUtil.isNullOrEmpty(callback)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } else |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation(); |
| | | Gson gson = gsonBuilder.create(); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", list.size()); |
| | | data.put("list", gson.toJson(list)); |
| | | if (!StringUtil.isNullOrEmpty(callback)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } else |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | /** |
| | | * 获取专题渠道活动 |
| | | * |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getGuide") |
| | | public void getGuide(AcceptData acceptData, Long uid, PrintWriter out) { |
| | | String tips = null; |
| | | if (uid == null || uid <= 0) { |
| | | tips = configService.getValue(ConfigKeyEnum.tipGuideNewUser.getKey(),acceptData.getSystem()); |
| | | } else { |
| | | long rebateOrder = hongBaoV2CountService.countRebateOrder(uid); |
| | | long shareOrInviteOrder = hongBaoV2CountService.countShareOrInviteOrder(uid); |
| | | if (rebateOrder + shareOrInviteOrder >= 3) { |
| | | // 熟客版 |
| | | } else if (rebateOrder <= 0 && shareOrInviteOrder <= 0) { |
| | | // 新人版 |
| | | tips = configService.getValue(ConfigKeyEnum.tipGuideNewUser.getKey(),acceptData.getSystem()); |
| | | } else if (rebateOrder > 0 && shareOrInviteOrder <= 0) { |
| | | // 省钱版 |
| | | tips = configService.getValue(ConfigKeyEnum.tipGuideSaveMoney.getKey(),acceptData.getSystem()); |
| | | } else { |
| | | // 赚钱版 |
| | | tips = configService.getValue(ConfigKeyEnum.tipGuideShareInvite.getKey(),acceptData.getSystem()); |
| | | } |
| | | } |
| | | /** |
| | | * 获取专题渠道活动 |
| | | * |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getGuide") |
| | | public void getGuide(AcceptData acceptData, Long uid, PrintWriter out) { |
| | | String tips = null; |
| | | if (uid == null || uid <= 0) { |
| | | tips = configService.getValue(ConfigKeyEnum.tipGuideNewUser.getKey(), acceptData.getSystem()); |
| | | } else { |
| | | long rebateOrder = hongBaoV2CountService.countRebateOrder(uid); |
| | | long shareOrInviteOrder = hongBaoV2CountService.countShareOrInviteOrder(uid); |
| | | if (rebateOrder + shareOrInviteOrder >= 3) { |
| | | // 熟客版 |
| | | } else if (rebateOrder <= 0 && shareOrInviteOrder <= 0) { |
| | | // 新人版 |
| | | tips = configService.getValue(ConfigKeyEnum.tipGuideNewUser.getKey(), acceptData.getSystem()); |
| | | } else if (rebateOrder > 0 && shareOrInviteOrder <= 0) { |
| | | // 省钱版 |
| | | tips = configService.getValue(ConfigKeyEnum.tipGuideSaveMoney.getKey(), acceptData.getSystem()); |
| | | } else { |
| | | // 赚钱版 |
| | | tips = configService.getValue(ConfigKeyEnum.tipGuideShareInvite.getKey(), acceptData.getSystem()); |
| | | } |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(tips)) { |
| | | out.print(JsonUtil.loadFalseResult("暂无提示")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(tips)) { |
| | | out.print(JsonUtil.loadFalseResult("暂无提示")); |
| | | return; |
| | | } |
| | | |
| | | JSONObject data = JSONObject.fromObject(tips); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | JSONObject data = JSONObject.fromObject(tips); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | } |
| | |
| | | import javax.servlet.http.HttpSession; |
| | | |
| | | 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 org.springframework.core.task.TaskExecutor; |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.jd.JDFilter; |
| | | import com.yeshi.fanli.dto.jd.JDSearchFilter; |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult; |
| | |
| | | import com.yeshi.fanli.exception.user.TokenRecordException; |
| | | import com.yeshi.fanli.service.inter.brand.BrandInfoService; |
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service; |
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService; |
| | | import com.yeshi.fanli.service.inter.config.ConfigService; |
| | | import com.yeshi.fanli.service.inter.config.SuperHotSearchService; |
| | | import com.yeshi.fanli.service.inter.help.AppPageNotificationService; |
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService; |
| | | import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService; |
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService; |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService; |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService; |
| | | import com.yeshi.goods.facade.service.DaTaoKeGoodsDetailV2Service; |
| | | import com.yeshi.fanli.service.inter.user.HistorySearchService; |
| | | import com.yeshi.fanli.service.inter.user.TokenRecordService; |
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralGetService; |
| | | import com.yeshi.fanli.service.manger.ClipboardAnalysisManager; |
| | | import com.yeshi.fanli.service.manger.IClipboardAnalysisResult; |
| | | import com.yeshi.fanli.service.manger.goods.jd.JDGoodsLinkParseManager; |
| | | import com.yeshi.common.entity.PageEntity; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | |
| | | |
| | | @Resource |
| | | private PDDAuthService pddAuthService; |
| | | |
| | | @Resource |
| | | private GoodsLijinMnager goodsLijinMnager; |
| | | |
| | | |
| | | /** |
| | |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd") |
| | | .create(); |
| | | data.put("type", 3); |
| | | |
| | | |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertCommonGoods(goods, |
| | | orderHongBaoMoneyComputeService.getShowComputeRate( |
| | | acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem())); |
| | | |
| | | goodsDetailVO = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBrief, goodsDetailVO); |
| | | |
| | | data.put("goods", |
| | | gson.toJson( |
| | | GoodsDetailVOFactory.convertCommonGoods(goods, |
| | | orderHongBaoMoneyComputeService.getShowComputeRate( |
| | | acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem())))); |
| | | gson.toJson(goodsDetailVO)); |
| | | // 跳转详情 |
| | | if (VersionUtil.greaterThan_2_1_3(acceptData.getPlatform(), |
| | | acceptData.getVersion())) { |
| | |
| | | data.put("type", 3); |
| | | data.put("goods", |
| | | gson.toJson( |
| | | GoodsDetailVOFactory.convertCommonGoods(goods, |
| | | orderHongBaoMoneyComputeService.getShowComputeRate( |
| | | acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem())))); |
| | | goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goods, |
| | | GoodsDetailVOFactory.convertCommonGoods(goods, |
| | | orderHongBaoMoneyComputeService.getShowComputeRate( |
| | | acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()))))); |
| | | // if |
| | | // (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), |
| | | // acceptData.getVersion())) { |
| | |
| | | |
| | | /*--------- 京东商品 -------*/ |
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_JD) { |
| | | searchJDGoods(acceptData, searchkey, page, filter, order, ap, out); |
| | | searchJDGoods(acceptData, uid, searchkey, page, filter, order, ap, out); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | /*-------- 唯品会商品 ------*/ |
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_VIP) { |
| | | searchVIPGoods(acceptData, searchkey, page, filter, order, ap, out); |
| | | searchVIPGoods(acceptData, uid, searchkey, page, filter, order, ap, out); |
| | | return; |
| | | } |
| | | |
| | | /*-------- 苏宁商品 ------*/ |
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_SUNING) { |
| | | searchSuningGoods(acceptData, searchkey, page, filter, order, ap, out); |
| | | searchSuningGoods(acceptData, uid, searchkey, page, filter, order, ap, out); |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | for (TaoBaoGoodsBrief goods : taoBaoGoodsBriefs) { |
| | | list.add(GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO)); |
| | | } |
| | | List<GoodsDetailVO> list = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, taoBaoGoodsBriefs, paramsDTO); |
| | | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().create(); |
| | |
| | | * @param ap |
| | | * @param out |
| | | */ |
| | | private void searchJDGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order, |
| | | private void searchJDGoods(AcceptData acceptData, Long uid, String key, Integer page, String filter, Integer order, |
| | | AppPageNotification ap, PrintWriter out) { |
| | | |
| | | JDSearchResult result = null; |
| | |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | for (JDGoods goods : goodsList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO); |
| | | |
| | | |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO); |
| | | |
| | | for (GoodsDetailVO vo : voList) { |
| | | if (hasCoupon) { |
| | | if (goodsDetailVO.isHasCoupon()) { |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | if (vo.isHasCoupon()) { |
| | | array.add(gson.toJson(vo)); |
| | | } |
| | | } else { |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | array.add(gson.toJson(vo)); |
| | | } |
| | | } |
| | | } |
| | |
| | | Gson gson = JsonUtil.getApiCommonGson(); |
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | for (PDDGoodsDetail goods : goodsList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO); |
| | | for (GoodsDetailVO goodsDetailVO : voList) { |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | } |
| | | } |
| | |
| | | * @Title: searchVIPGoods |
| | | * @Description: |
| | | */ |
| | | private void searchVIPGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order, |
| | | private void searchVIPGoods(AcceptData acceptData, Long uid, String key, Integer page, String filter, Integer order, |
| | | AppPageNotification ap, PrintWriter out) { |
| | | VIPSearchFilter searchFilter = new VIPSearchFilter(); |
| | | searchFilter.setKeyword(key); |
| | |
| | | Gson gson = JsonUtil.getApiCommonGson(); |
| | | List<VIPGoodsInfo> goodsList = result.getGoodsList(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | for (VIPGoodsInfo goods : goodsList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertVIPGoods(goods, paramsDTO); |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO); |
| | | for (GoodsDetailVO goodsDetailVO : voList) { |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | } |
| | | } |
| | |
| | | * @Title: searchVIPGoods |
| | | * @Description: |
| | | */ |
| | | private void searchSuningGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order, |
| | | private void searchSuningGoods(AcceptData acceptData, Long uid, String key, Integer page, String filter, Integer order, |
| | | AppPageNotification ap, PrintWriter out) { |
| | | SuningQueryModel searchFilter = new SuningQueryModel(); |
| | | searchFilter.setKeyword(key); |
| | |
| | | if (resultList != null) { |
| | | Gson gson = JsonUtil.getApiCommonGson(); |
| | | 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); |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, resultList, paramsDTO); |
| | | for (GoodsDetailVO goodsDetailVO : voList) { |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo; |
| | | import com.yeshi.fanli.dto.jd.JDPingouInfo; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | |
| | | TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(uid, goodsId, relationId, null); |
| | | |
| | | if (taoBaoLink != null && taoBaoLink.getGoods() != null && needGoods) { |
| | | ConfigParamsDTO dto = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version, acceptData.getSystem()); |
| | | GoodsMoneyConfigParamsDTO dto = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version, acceptData.getSystem()); |
| | | GoodsDetailVO goodsInfo = GoodsDetailVOFactory.convertTaoBao(taoBaoLink.getGoods(), dto); |
| | | shareInfo.setGoodsInfo(goodsInfo); |
| | | } |
| | |
| | | if (needGoods) { |
| | | shareInfo |
| | | .setGoodsInfo(GoodsDetailVOFactory.convertPDDGoods(goods, |
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()), |
| | | new GoodsMoneyConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()), |
| | | hongBaoManageService.getShareRate(acceptData.getSystem()), Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, acceptData.getSystem())))); |
| | | } |
| | |
| | | if (needGoods) { |
| | | shareInfo |
| | | .setGoodsInfo(GoodsDetailVOFactory.convertVIPGoods(goods, |
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()), |
| | | new GoodsMoneyConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()), |
| | | hongBaoManageService.getShareRate(acceptData.getSystem()), Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, acceptData.getSystem())))); |
| | | } |
| | |
| | | if (needGoods) { |
| | | shareInfo |
| | | .setGoodsInfo(GoodsDetailVOFactory.convertSuningGoods(goods, |
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()), |
| | | new GoodsMoneyConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()), |
| | | hongBaoManageService.getShareRate(acceptData.getSystem()), Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, acceptData.getSystem())))); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | |
| | | } |
| | | |
| | | GoodsDetailVO goodsDetail = null; |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(acceptData.getSystem())); |
| | | |
| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.user.UserGoodsStorage; |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (UserGoodsStorage userGoodsStorage : listStorage) { |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.suning.SuningGoodsInfo; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.homemodule.Special; |
| | |
| | | try { |
| | | JSONArray array = new JSONArray(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | |
| | | import com.google.gson.TypeAdapter; |
| | | import com.google.gson.stream.JsonReader; |
| | | import com.google.gson.stream.JsonWriter; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies; |
| | |
| | | } |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (ShareHotGoods hotGoods : listHot) { |
| | |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | |
| | | BigDecimal proportion = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE; |
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(proportion, proportion, Constant.MAX_REWARD_RATE, |
| | | GoodsMoneyConfigParamsDTO paramsDTO = new GoodsMoneyConfigParamsDTO(proportion, proportion, Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,acceptData.getSystem())); |
| | | for (TLJBuyGoods hotGoods : listHot) { |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods(); |
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (TLJFreeBuyGoods freeGoods : listFree) { |
| | |
| | | |
| | | import com.yeshi.fanli.dto.vip.UserVIPLevel; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo; |
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService; |
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | import com.google.gson.JsonPrimitive; |
| | | import com.google.gson.JsonSerializationContext; |
| | | import com.google.gson.JsonSerializer; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.aitaoker.QrcodeLoginDTO; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | |
| | | if (list.size() > 0) { |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | for (UserCloudGoods cloudGoods : list) { |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.homemodule.Special; |
| | |
| | | try { |
| | | JSONArray array = new JSONArray(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | |
| | | package com.yeshi.fanli.controller.h5; |
| | | |
| | | import com.yeshi.common.entity.taobao.TaoKeAppInfo; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; |
| | | import com.yeshi.fanli.entity.taobao.SearchFilter; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult; |
| | | import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException; |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; |
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService; |
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService; |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; |
| | | import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager; |
| | |
| | | sf.setPageSize(20); |
| | | sf.setKey(key); |
| | | sf.setSort(TaoBaoUtil.SORT_TOTAL_SALES_HIGH_TO_LOW); |
| | | ConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", |
| | | GoodsMoneyConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", |
| | | "60", SystemEnum.flq); |
| | | |
| | | List<GoodsDetailVO> goodsList = new ArrayList<>(); |
| | |
| | | } |
| | | |
| | | |
| | | private ConfigParamsDTO getParamsDTO(String platform, String version, Long uid, SystemEnum system) { |
| | | private GoodsMoneyConfigParamsDTO getParamsDTO(String platform, String version, Long uid, SystemEnum system) { |
| | | UserLevelEnum level = UserLevelEnum.daRen; |
| | | if (level == null) |
| | | level = UserLevelEnum.daRen; |
| | |
| | | |
| | | tb.setImgList(finalImgList); |
| | | |
| | | ConfigParamsDTO paramsDTO = getParamsDTO("android", "60", null, SystemEnum.flq); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = getParamsDTO("android", "60", null, SystemEnum.flq); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | |
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | |
| | | import com.google.gson.JsonPrimitive; |
| | | import com.google.gson.JsonSerializationContext; |
| | | import com.google.gson.JsonSerializer; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.WXMPAcceptData; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2; |
| | |
| | | } |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | |
| | |
| | | JSONArray array = new JSONArray(); |
| | | if (list != null && list.size() > 0) { |
| | | Gson gson = gsonBuilder.create(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | for (ScanHistoryV2 sh : list) { |
| | | CommonGoods commonGoods = sh.getCommonGoods(); |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.WXMPAcceptData; |
| | | import com.yeshi.fanli.dto.jd.JDCategoryInfo; |
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo; |
| | |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult; |
| | | import com.yeshi.fanli.dto.pdd.PDDPromotionUrl; |
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter; |
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory; |
| | | import com.yeshi.fanli.entity.bus.user.ShamUser; |
| | |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | for (JDGoods goods : goodsList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO); |
| | |
| | | // 保存缓存 |
| | | jdGoodsCacheUtil.saveGoodsInfo(jdGoods); |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | paramsDTO.setMaxRewardRate(null); |
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO); |
| | |
| | | return; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | paramsDTO.setMaxRewardRate(null); |
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO); |
| | |
| | | list = list.subList(0, 10); |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>(); |
| | | |
| | |
| | | goodsList = goodsList.subList(0, 10); |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService |
| | | .getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion(),acceptData.getSystem()); |
| | | for (PDDGoodsDetail goods : goodsList) { |
| | | listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO)); |
| | |
| | | out.print(JsonUtil.loadFalseResult(2, "商品已下架")); |
| | | return; |
| | | } |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | GoodsDetailVO goods = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO); |
| | | |
| | |
| | | out.print(JsonUtil.loadFalseResult(2, "商品已下架")); |
| | | return; |
| | | } |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | GoodsDetailVO goods = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO); |
| | | |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.WXMPAcceptData; |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | |
| | | |
| | | List<JDGoods> goodsList = result.getGoodsList(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | |
| | | Gson gson = JsonUtil.getApiCommonGson(); |
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (PDDGoodsDetail goods : goodsList) { |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.WXMPAcceptData; |
| | | import com.yeshi.fanli.dto.jd.JDFilter; |
| | | import com.yeshi.fanli.dto.jd.JDSearchFilter; |
| | |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | for (JDGoods goods : goodsList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO); |
| | |
| | | Gson gson = JsonUtil.getApiCommonGson(); |
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (PDDGoodsDetail goods : goodsList) { |
File was renamed from fanli/src/main/java/com/yeshi/fanli/dto/ConfigParamsDTO.java |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | public class ConfigParamsDTO { |
| | | public class GoodsMoneyConfigParamsDTO { |
| | | // 返利比例 |
| | | private BigDecimal fanLiRate; |
| | | // 分享比例 |
| | |
| | | this.vipFanLiRate = vipFanLiRate; |
| | | } |
| | | |
| | | public ConfigParamsDTO() { |
| | | public GoodsMoneyConfigParamsDTO() { |
| | | |
| | | } |
| | | |
| | | public ConfigParamsDTO(BigDecimal fanLiRate, BigDecimal shareRate, BigDecimal maxRewardRate, BigDecimal vipRate) { |
| | | public GoodsMoneyConfigParamsDTO(BigDecimal fanLiRate, BigDecimal shareRate, BigDecimal maxRewardRate, BigDecimal vipRate) { |
| | | this.fanLiRate = fanLiRate; |
| | | this.shareRate = shareRate; |
| | | this.maxRewardRate = maxRewardRate; |
| | |
| | | package com.yeshi.fanli.dto.pdd; |
| | | |
| | | import com.google.gson.annotations.SerializedName; |
| | | import com.yeshi.fanli.entity.goods.BaseGoodsInfo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | import com.google.gson.annotations.SerializedName; |
| | | |
| | | public class PDDGoodsDetail implements Serializable { |
| | | public class PDDGoodsDetail extends BaseGoodsInfo implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | |
| | | package com.yeshi.fanli.dto.suning; |
| | | |
| | | public class SuningGoodsInfo { |
| | | import com.yeshi.fanli.entity.goods.BaseGoodsInfo; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class SuningGoodsInfo extends BaseGoodsInfo implements Serializable { |
| | | |
| | | private SuningAdvanceSale advanceSale; |
| | | private SuningCategoryInfo categoryInfo; |
| | |
| | | package com.yeshi.fanli.dto.vip.goods; |
| | | |
| | | import com.yeshi.fanli.entity.goods.BaseGoodsInfo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @author Administrator |
| | | * |
| | | */ |
| | | public class VIPGoodsInfo { |
| | | public class VIPGoodsInfo extends BaseGoodsInfo implements Serializable { |
| | | private String goodsId;// 商品id |
| | | private String goodsName;// 商品名称 |
| | | private String goodsDesc;// 商品描述,字段暂不输出 |
| | |
| | | SystemFunction.bindPhone, SystemFunction.threeSale, SystemFunction.cloudOrder, SystemFunction.godenCorn, SystemFunction.redPack,SystemFunction.faQuan,SystemFunction.fanli,SystemFunction.vip |
| | | }, 1, "板栗快省","板栗快省"), |
| | | flq("com.fanliunion.android", "com.xyj.ec.flq-ios", new String[]{}, new SystemFunction[]{SystemFunction.faQuan,SystemFunction.fanli}, 11, "返利联盟","淘拼团"), |
| | | yhqjx("com.youhuiquan.android","com.youhuiquanjx.ios",new String[]{}, new SystemFunction[]{SystemFunction.faQuan}, 12, "优惠券精选","淘拼团"); |
| | | yhqjx("com.youhuiquan.android","com.youhuiquanjx.ios",new String[]{}, new SystemFunction[]{SystemFunction.faQuan,SystemFunction.lijinSub}, 12, "优惠券精选","淘拼团"); |
| | | private String packageName; |
| | | private String bundleId; |
| | | private int systemId; |
| | |
| | | redPack("红包"), |
| | | faQuan("发圈"), |
| | | vip("超级会员"), |
| | | fanli("是否需要返利") |
| | | ; |
| | | fanli("是否需要返利"), |
| | | lijinSub("礼金立减"); |
| | | |
| | | private SystemFunction(String desc) { |
| | | |
New file |
| | |
| | | package com.yeshi.fanli.entity.goods; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class BaseGoodsInfo implements Serializable { |
| | | } |
| | |
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo; |
| | | import com.yeshi.fanli.dto.jd.JDPingouInfo; |
| | | import com.yeshi.fanli.dto.jd.JDShopInfo; |
| | | import com.yeshi.fanli.entity.goods.BaseGoodsInfo; |
| | | |
| | | /** |
| | | * 京东商品 |
| | |
| | | * @author Administrator |
| | | * |
| | | */ |
| | | public class JDGoods implements Serializable { |
| | | public class JDGoods extends BaseGoodsInfo implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.goods.facade.dto.taobao.dataoke.DaTaoKeGoodsResult; |
| | | import com.yeshi.goods.facade.dto.taobao.haodanku.HDKGoodsListResultDTO; |
| | | import com.yeshi.goods.facade.dto.taobao.haodanku.HDKWXCircleContentDTO; |
| | |
| | | totalMoney = totalMoney.add(money); |
| | | picture.setGoodsVO( |
| | | GoodsDetailVOFactory.convertJDGoods(jdGoods, |
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(SystemEnum.blks), |
| | | new GoodsMoneyConfigParamsDTO(hongBaoManageService.getFanLiRate(SystemEnum.blks), |
| | | hongBaoManageService.getShareRate(SystemEnum.blks), null, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, SystemEnum.blks)))); |
| | | picture.setGoodState(0); |
| | |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.jd.JDCommissionInfo; |
| | | import com.yeshi.fanli.dto.jd.JDFilter; |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult; |
| | |
| | | BigDecimal limitPrice = new BigDecimal(2); |
| | | List<FreeGoodsCoupon> listExist = freeGoodsCouponService.listByType(0, 100, Constant.SOURCE_TYPE_TAOBAO); |
| | | |
| | | ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", SystemEnum.blks); |
| | | GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", SystemEnum.blks); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(SystemEnum.blks)); |
| | | |
| | | // 信息更新 |
| | |
| | | BigDecimal limitPrice = new BigDecimal(2); |
| | | List<FreeGoodsCoupon> listExist = freeGoodsCouponService.listByType(0, 100, Constant.SOURCE_TYPE_JD); |
| | | |
| | | ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55",SystemEnum.blks); |
| | | GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55",SystemEnum.blks); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(SystemEnum.blks)); |
| | | |
| | | // 信息更新 |
| | |
| | | BigDecimal limitPrice = new BigDecimal(2); |
| | | List<FreeGoodsCoupon> listExist = freeGoodsCouponService.listByType(0, 100, Constant.SOURCE_TYPE_PDD); |
| | | |
| | | ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55",SystemEnum.blks); |
| | | GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55",SystemEnum.blks); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(SystemEnum.blks)); |
| | | |
| | | // 信息更新 |
New file |
| | |
| | | package com.yeshi.fanli.lijin.manager; |
| | | |
| | | import com.ks.lijin.pojo.DTO.MoneyInfo; |
| | | import com.ks.lijin.service.LijinCreateService; |
| | | import com.ks.vip.pojo.DO.VipGradePotence; |
| | | import com.ks.vip.pojo.Enums.VIPEnum; |
| | | import com.ks.vip.service.VipCenterService; |
| | | import com.ks.vip.service.VipGradePotenceService; |
| | | import com.ks.vip.service.VipGradeService; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.dto.suning.SuningGoodsInfo; |
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.SystemFunction; |
| | | import com.yeshi.fanli.entity.goods.BaseGoodsInfo; |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException; |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; |
| | | import com.yeshi.fanli.util.CommonGoodsUtil; |
| | | import com.yeshi.fanli.util.SystemInfoUtil; |
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory; |
| | | import com.yeshi.fanli.util.jd.JDUtil; |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil; |
| | | import com.yeshi.fanli.util.suning.SuningUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.fanli.util.vipshop.VipShopUtil; |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | | import org.apache.dubbo.config.annotation.Reference; |
| | | import org.springframework.stereotype.Component; |
| | | import org.yeshi.utils.MoneyBigDecimalUtil; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | @Component |
| | | public class GoodsLijinMnager { |
| | | |
| | | @Reference(version = "1.0") |
| | | private LijinCreateService lijinCreateService; |
| | | |
| | | @Reference(version = "1.0") |
| | | private VipCenterService vipCenterService; |
| | | |
| | | @Reference(version = "1.0") |
| | | private VipGradePotenceService vipGradePotenceService; |
| | | |
| | | |
| | | @Reference(version = "1.0") |
| | | private VipGradeService vipGradeService; |
| | | |
| | | |
| | | private String getUid(Long uid) { |
| | | if (uid == null) |
| | | return null; |
| | | return "tejia-" + uid; |
| | | } |
| | | |
| | | private void loadMaterialLibsType(List<TaoBaoGoodsBrief> goodsBriefList) { |
| | | |
| | | List<Long> auctionIds = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goodsBrief : goodsBriefList) { |
| | | auctionIds.add(goodsBrief.getAuctionId()); |
| | | } |
| | | |
| | | try { |
| | | List<TaoBaoGoodsBrief> tempList = TaoKeApiUtil.getBatchGoodsInfo(auctionIds); |
| | | Map<Long, TaoBaoGoodsBrief> tempMap = new HashMap<>(); |
| | | for (TaoBaoGoodsBrief temp : tempList) { |
| | | tempMap.put(temp.getAuctionId(), temp); |
| | | } |
| | | for (TaoBaoGoodsBrief goodsBrief : goodsBriefList) { |
| | | if (tempMap.get(goodsBrief.getAuctionId()) != null) { |
| | | goodsBrief.setMaterialLibType(tempMap.get(goodsBrief.getAuctionId()).getMaterialLibType()); |
| | | goodsBrief.setMaterialLibTypes(tempMap.get(goodsBrief.getAuctionId()).getMaterialLibTypes()); |
| | | } |
| | | } |
| | | } catch (TaoKeApiException e) { |
| | | e.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void loadTBMoneyInfo(SystemEnum system, Map<String, MoneyInfo> lijinMap, TaoBaoGoodsBrief goods, GoodsDetailVO detailVO) { |
| | | if (SystemInfoUtil.hasFunctions(system, SystemFunction.lijinSub)) { |
| | | //设置礼金 |
| | | MoneyInfo moneyInfo = lijinMap.get(goods.getAuctionId() + ""); |
| | | //券后价格 |
| | | BigDecimal couponPrice = TaoBaoUtil.getCouponPrice(goods); |
| | | BigDecimal finalPrice = null; |
| | | if (moneyInfo != null && moneyInfo.getLijinAmount() != null) {//有礼金 |
| | | detailVO.getMoneyInfo().setHongBaoMoney("¥" + moneyInfo.getLijinAmount()); |
| | | detailVO.getMoneyInfo().setFanliMoney(null); |
| | | finalPrice = couponPrice.subtract(moneyInfo.getLijinAmount()); |
| | | } else {//无礼金 |
| | | finalPrice = couponPrice.subtract(moneyInfo.getFanliAmount() == null ? new BigDecimal(0) : moneyInfo.getFanliAmount()); |
| | | detailVO.getMoneyInfo().setFanliMoney("¥" + moneyInfo.getFanliAmount()); |
| | | } |
| | | //设置价格 |
| | | detailVO.getMoneyInfo().setFinalMoney("¥" + finalPrice); |
| | | } |
| | | } |
| | | |
| | | |
| | | public GoodsDetailVO loadTBMoneyInfo(SystemEnum system, Long uid, TaoBaoGoodsBrief goodsBrief, GoodsDetailVO detailVO) { |
| | | List<TaoBaoGoodsBrief> goodsBriefs = new ArrayList<>(); |
| | | goodsBriefs.add(goodsBrief); |
| | | Map<String, MoneyInfo> lijinMap = null; |
| | | if (SystemInfoUtil.hasFunctions(system, SystemFunction.lijinSub)) { |
| | | loadMaterialLibsType(goodsBriefs); |
| | | lijinMap = getTBLijinList(uid, goodsBriefs); |
| | | } |
| | | for (TaoBaoGoodsBrief goods : goodsBriefs) { |
| | | try { |
| | | loadTBMoneyInfo(system, lijinMap, goods, detailVO); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return detailVO; |
| | | } |
| | | |
| | | |
| | | public List<GoodsDetailVO> loadTBMoneyInfo(SystemEnum system, Long uid, List<TaoBaoGoodsBrief> goodsBriefList, GoodsMoneyConfigParamsDTO paramsDTO) { |
| | | Map<String, MoneyInfo> lijinMap = null; |
| | | if (SystemInfoUtil.hasFunctions(system, SystemFunction.lijinSub)) { |
| | | loadMaterialLibsType(goodsBriefList); |
| | | lijinMap = getTBLijinList(uid, goodsBriefList); |
| | | } |
| | | List<GoodsDetailVO> voList = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goods : goodsBriefList) { |
| | | try { |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | loadTBMoneyInfo(system, lijinMap, goods, detailVO); |
| | | voList.add(detailVO); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return voList; |
| | | } |
| | | |
| | | |
| | | public List<GoodsDetailVO> loadOtherMoneyInfo(SystemEnum system, Long uid, List<? extends BaseGoodsInfo> goodsList, GoodsMoneyConfigParamsDTO paramsDTO) { |
| | | List<GoodsDetailVO> voList = new ArrayList<>(); |
| | | if (goodsList == null || goodsList.size() == 0) |
| | | return voList; |
| | | |
| | | BigDecimal fanliRate = null; |
| | | if (system == SystemEnum.yhqjx) { |
| | | fanliRate = getFanLiRate(uid); |
| | | } |
| | | |
| | | BigDecimal couponPrice = null; |
| | | BigDecimal fanliMoney = null; |
| | | |
| | | for (BaseGoodsInfo goods : goodsList) { |
| | | GoodsDetailVO detailVO = null; |
| | | if (goods instanceof JDGoods) { |
| | | detailVO = GoodsDetailVOFactory.convertJDGoods((JDGoods) goods, paramsDTO); |
| | | if (fanliRate != null) { |
| | | couponPrice = JDUtil.getCouponPrice((JDGoods) goods); |
| | | fanliMoney = JDUtil.getGoodsFanLiMoney((JDGoods) goods, fanliRate); |
| | | } |
| | | } else if (goods instanceof PDDGoodsDetail) { |
| | | detailVO = GoodsDetailVOFactory.convertPDDGoods((PDDGoodsDetail) goods, paramsDTO); |
| | | if (fanliRate != null) { |
| | | couponPrice = PinDuoDuoUtil.getCouponPrice((PDDGoodsDetail) goods); |
| | | fanliMoney = PinDuoDuoUtil.getGoodsFanLiMoney((PDDGoodsDetail) goods, fanliRate); |
| | | } |
| | | } else if (goods instanceof VIPGoodsInfo) { |
| | | detailVO = GoodsDetailVOFactory.convertVIPGoods((VIPGoodsInfo) goods, paramsDTO); |
| | | if (fanliRate != null) { |
| | | couponPrice = VipShopUtil.getCouponPrice((VIPGoodsInfo) goods); |
| | | fanliMoney = VipShopUtil.getGoodsFanLiMoney((VIPGoodsInfo) goods, fanliRate); |
| | | } |
| | | } else if (goods instanceof SuningGoodsInfo) { |
| | | detailVO = GoodsDetailVOFactory.convertSuningGoods((SuningGoodsInfo) goods, paramsDTO); |
| | | if (fanliRate != null) { |
| | | couponPrice = SuningUtil.getCouponPrice((SuningGoodsInfo) goods); |
| | | fanliMoney = SuningUtil.getGoodsFanLiMoney((SuningGoodsInfo) goods, fanliRate); |
| | | } |
| | | } |
| | | |
| | | if (couponPrice != null && fanliMoney != null) { |
| | | detailVO.getMoneyInfo().setFanliMoney("¥" + fanliMoney); |
| | | detailVO.getMoneyInfo().setFinalMoney("¥" + couponPrice.subtract(fanliMoney)); |
| | | } |
| | | voList.add(detailVO); |
| | | } |
| | | |
| | | return voList; |
| | | } |
| | | |
| | | |
| | | public GoodsDetailVO loadOtherMoneyInfo(SystemEnum system, Long uid, CommonGoods goods, GoodsDetailVO goodsDetailVO) { |
| | | if (goodsDetailVO == null) |
| | | return null; |
| | | |
| | | BigDecimal fanliRate = null; |
| | | if (system == SystemEnum.yhqjx) { |
| | | fanliRate = getFanLiRate(uid); |
| | | } |
| | | |
| | | if (fanliRate != null) { |
| | | BigDecimal fanliMoney = CommonGoodsUtil.getCommission(goods, fanliRate); |
| | | BigDecimal couponPrice = CommonGoodsUtil.getAfterUseCouplePrice(goods); |
| | | goodsDetailVO.getMoneyInfo().setFanliMoney("¥" + fanliMoney); |
| | | goodsDetailVO.getMoneyInfo().setFinalMoney("¥" + couponPrice.subtract(fanliMoney)); |
| | | } |
| | | |
| | | return goodsDetailVO; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 批量获取淘宝礼金面额 |
| | | * |
| | | * @param goodsBriefList |
| | | * @return |
| | | */ |
| | | private Map<String, MoneyInfo> getTBLijinList(Long uid, List<TaoBaoGoodsBrief> goodsBriefList) { |
| | | Map<String, MoneyInfo> map = new HashMap<>(); |
| | | List<MoneyInfo> moneyInfos = lijinCreateService.getMoneyInfo(getUid(uid), goodsBriefList); |
| | | for (MoneyInfo moneyInfo : moneyInfos) { |
| | | map.put(moneyInfo.getGoodsId(), moneyInfo); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取返利比例 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | private BigDecimal getFanLiRate(Long uid) { |
| | | //加载返利信息 |
| | | VIPEnum rank = vipCenterService.getVIPEnumByUid(getUid(uid)); |
| | | if (rank == null) |
| | | rank = vipGradeService.getDefaultGrade().getIdentity(); |
| | | VipGradePotence potence = vipGradePotenceService.getPotenceByVipEnum(rank); |
| | | //获取返利比例 |
| | | BigDecimal fanliRate = potence.getRebatePercent(); |
| | | return fanliRate; |
| | | } |
| | | |
| | | |
| | | } |
File was renamed from fanli/src/main/java/com/yeshi/fanli/vo/goods/lijin/GoodsDetailVO.java |
| | |
| | | package com.yeshi.fanli.vo.goods.lijin; |
| | | package com.yeshi.fanli.lijin.vo; |
| | | |
| | | import com.yeshi.common.vo.ClientTextStyleVO; |
| | | import com.yeshi.fanli.entity.bus.user.ShamUser; |
| | |
| | | import com.yeshi.fanli.vo.goods.MoneyInfoVO; |
| | | import com.yeshi.fanli.vo.goods.ShopInfoVO; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | public class GoodsDetailVO { |
| | |
| | | private MoneyInfoVO moneyInfo; |
| | | private List<GoodsHongBaoListVO> priceList; |
| | | private String zkPrice; |
| | | private BigDecimal couponPrice; |
| | | |
| | | |
| | | public BigDecimal getCouponPrice() { |
| | | return couponPrice; |
| | | } |
| | | |
| | | public void setCouponPrice(BigDecimal couponPrice) { |
| | | this.couponPrice = couponPrice; |
| | | } |
| | | |
| | | public String getZkPrice() { |
| | | return zkPrice; |
| | |
| | | this.desc = desc; |
| | | } |
| | | |
| | | static class UserLevelVO { |
| | | public static class UserLevelVO { |
| | | //VIP等级 0-初级 1-青铜 2-白银 3-铂金 |
| | | private int vipRank; |
| | | private String desc; |
| | |
| | | import org.yeshi.utils.JsonUtil; |
| | | |
| | | import com.yeshi.fanli.dao.mybatis.brand.BrandClassShopMapper; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.brand.BrandClass; |
| | | import com.yeshi.fanli.entity.brand.BrandClassShop; |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | |
| | | count = taoBaoShopService.countBrandShopinfo(cid); |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,system); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,system); |
| | | |
| | | // 淘宝商品信息过滤 |
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo); |
| | |
| | | return listInfo; |
| | | |
| | | |
| | | ConfigParamsDTO paramsDTO = |
| | | GoodsMoneyConfigParamsDTO paramsDTO = |
| | | orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,system); |
| | | // 淘宝商品信息过滤 |
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo); |
| | |
| | | import org.yeshi.utils.tencentcloud.COSManager; |
| | | |
| | | import com.yeshi.fanli.dao.mybatis.brand.BrandInfoMapper; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.entity.brand.BrandClass; |
| | | import com.yeshi.fanli.entity.brand.BrandGoodsCahe; |
| | |
| | | if (list == null || list.size() == 0) |
| | | return null; |
| | | |
| | | ConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,system); |
| | | GoodsMoneyConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,system); |
| | | |
| | | List<BrandInfoVO> listInfo = new ArrayList<BrandInfoVO>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | |
| | | if (list == null || list.size() == 0) |
| | | return null; |
| | | |
| | | ConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version, system); |
| | | GoodsMoneyConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version, system); |
| | | |
| | | BrandInfoVO brand = list.get(0); |
| | | List<BrandGoodsCahe> listGoods = brandGoodsCaheService.getByBrandId(1, 3, brand.getId()); |
| | |
| | | import org.yeshi.utils.taobao.TbImgUtil; |
| | | |
| | | import com.yeshi.fanli.dao.dynamic.DynamicInfoDao; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.goods.facade.dto.taobao.TaoBaoShopDTO; |
| | | import com.yeshi.fanli.entity.bus.activity.ActivityRuleUser; |
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser; |
| | |
| | | |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(SystemEnum.blks); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(SystemEnum.blks); |
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,SystemEnum.blks)); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = new GoodsMoneyConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,SystemEnum.blks)); |
| | | |
| | | for (DynamicInfo dynamicInfo : list) { |
| | | DynamicInfo dynamicNew = new DynamicInfo(); |
| | |
| | | import org.yeshi.utils.tencentcloud.COSManager; |
| | | |
| | | import com.yeshi.fanli.dao.dynamic.GoodsEvaluateDao; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.dto.suning.SuningGoodsInfo; |
| | |
| | | GoodsDetailVO goodsDetailVO = null; |
| | | JDGoods jdGoods = null; |
| | | PDDGoodsDetail pddGoods = null; |
| | | ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | try { |
| | |
| | | |
| | | public GoodsDetailVO getGoodsDetailVO(Long goodsId, Integer goodsType, SystemEnum system) throws GoodsEvaluateException { |
| | | GoodsDetailVO goodsDetail = null; |
| | | ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | try { |
| | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", goodsEvaluate.getSystem()); |
| | | GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", goodsEvaluate.getSystem()); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(goodsEvaluate.getSystem())); |
| | | // 是否2个小时之内已更新 |
| | | Date updateTime = goodsEvaluate.getUpdateTime(); |
| | |
| | | } |
| | | } |
| | | |
| | | private GoodsDetailVO getGoodsNewInfo(String goodsId, int goodsType, ConfigParamsDTO paramsDTO) { |
| | | private GoodsDetailVO getGoodsNewInfo(String goodsId, int goodsType, GoodsMoneyConfigParamsDTO paramsDTO) { |
| | | GoodsDetailVO vo = null; |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoGoodsBrief goods; |
| | |
| | | imgs.addAll(goodsBrief.getImgList()); |
| | | |
| | | // 商品VO |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, paramsDTO); |
| | | |
| | |
| | | } |
| | | |
| | | // 商品VO |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, paramsDTO); |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, paramsDTO); |
| | | |
| | |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | continue; |
| | | } |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | |
| | | continue; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO); |
| | | |
| | |
| | | continue; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | |
| | | continue; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertVIPGoods(goods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | continue; |
| | | } |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertSuningGoods(goods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dao.mybatis.lable.LabelGoodsMapper; |
| | | import com.yeshi.fanli.dao.mybatis.lable.QualityFactoryMapper; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.bus.lable.Label; |
| | | import com.yeshi.fanli.entity.bus.lable.LabelGoods; |
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory; |
| | |
| | | } catch (Exception e) { |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,system); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,system); |
| | | |
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) { |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO); |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory; |
| | | import com.yeshi.fanli.entity.taobao.SearchFilter; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | |
| | | int fh = sf.getHongbao(); |
| | | boolean ft = sf.isTmall(); |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,system); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,system); |
| | | |
| | | if (fq == 0 && fh == 0 && !ft) { |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.order.UserTeamLevel; |
| | | import com.yeshi.fanli.dto.order.UserTeamRate; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version, UserLevelEnum userLevel,SystemEnum system) { |
| | | public GoodsMoneyConfigParamsDTO getShowComputeRate(String platform, String version, UserLevelEnum userLevel, SystemEnum system) { |
| | | BigDecimal fanLiRate = getFanliRate(new Date(), userLevel,system); |
| | | BigDecimal shareRate = fanLiRate; |
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, |
| | | GoodsMoneyConfigParamsDTO paramsDTO = new GoodsMoneyConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, |
| | | getFanliRate(new Date(), UserLevelEnum.superVIP,system)); |
| | | if (VersionUtil.greaterThan_2_0_5(platform, version)) { |
| | | paramsDTO.setMaxRewardRate(null); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version,SystemEnum system) { |
| | | public GoodsMoneyConfigParamsDTO getShowComputeRate(String platform, String version, SystemEnum system) { |
| | | return getShowComputeRate(platform, version, UserLevelEnum.daRen,system); |
| | | } |
| | | |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.yeshi.fanli.dao.mybatis.HongBaoManageMapper; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoManage; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version, UserLevelEnum userLevel, SystemEnum system) { |
| | | public GoodsMoneyConfigParamsDTO getShowComputeRate(String platform, String version, UserLevelEnum userLevel, SystemEnum system) { |
| | | |
| | | BigDecimal fanLiRate = getFanLiRate(userLevel,system); |
| | | BigDecimal shareRate = getShareRate(userLevel,system); |
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, |
| | | GoodsMoneyConfigParamsDTO paramsDTO = new GoodsMoneyConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, |
| | | getFanLiRate(UserLevelEnum.superVIP,system)); |
| | | if (VersionUtil.greaterThan_2_0_5(platform, version)) { |
| | | paramsDTO.setMaxRewardRate(null); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version, SystemEnum system) { |
| | | public GoodsMoneyConfigParamsDTO getShowComputeRate(String platform, String version, SystemEnum system) { |
| | | |
| | | BigDecimal fanLiRate = getFanLiRate(UserLevelEnum.daRen,system); |
| | | BigDecimal shareRate = getShareRate(UserLevelEnum.daRen,system); |
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, |
| | | GoodsMoneyConfigParamsDTO paramsDTO = new GoodsMoneyConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, |
| | | getFanLiRate(UserLevelEnum.superVIP,system)); |
| | | if (VersionUtil.greaterThan_2_0_5(platform, version)) { |
| | | paramsDTO.setMaxRewardRate(null); |
| | |
| | | import org.yeshi.utils.tencentcloud.COSManager; |
| | | |
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoShopMapper; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBriefExtra; |
| | |
| | | return null; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,UserLevelEnum.daRen,system); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,UserLevelEnum.daRen,system); |
| | | |
| | | for (TaoBaoShopVO taoBaoShopVO : list) { |
| | | |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.order.UserTeamLevel; |
| | | import com.yeshi.fanli.dto.order.UserTeamRate; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | |
| | | */ |
| | | public interface OrderHongBaoMoneyComputeService { |
| | | |
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version, UserLevelEnum userLevel,SystemEnum system); |
| | | public GoodsMoneyConfigParamsDTO getShowComputeRate(String platform, String version, UserLevelEnum userLevel, SystemEnum system); |
| | | |
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version,SystemEnum system); |
| | | public GoodsMoneyConfigParamsDTO getShowComputeRate(String platform, String version, SystemEnum system); |
| | | |
| | | /** |
| | | * 获取基础的返利金额 |
| | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoManage; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; |
| | | |
| | |
| | | * @param version |
| | | * @return |
| | | */ |
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version,UserLevelEnum userLevel, SystemEnum system); |
| | | public GoodsMoneyConfigParamsDTO getShowComputeRate(String platform, String version, UserLevelEnum userLevel, SystemEnum system); |
| | | |
| | | |
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version, SystemEnum system); |
| | | public GoodsMoneyConfigParamsDTO getShowComputeRate(String platform, String version, SystemEnum system); |
| | | |
| | | /** |
| | | * 获取基础的返利比例 |
| | |
| | | |
| | | import org.yeshi.utils.taobao.TbImgUtil; |
| | | |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.common.GoodsOtherInfoDTO; |
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo; |
| | | import com.yeshi.fanli.dto.jd.JDPingouInfo; |
| | |
| | | * @param fanLiRate 返利比例 |
| | | * @return |
| | | */ |
| | | public static GoodsDetailVO convertCommonGoods(CommonGoods goods, ConfigParamsDTO params) { |
| | | public static GoodsDetailVO convertCommonGoods(CommonGoods goods, GoodsMoneyConfigParamsDTO params) { |
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO(); |
| | | goodsInfo.setGoodsId(goods.getGoodsId() + ""); |
| | | goodsInfo.setTitle(goods.getTitle()); |
| | |
| | | * @param fanLiRate 返利比例 |
| | | * @return |
| | | */ |
| | | public static GoodsDetailVO convertTaoBaoGoodsBriefExtra(TaoBaoGoodsBriefExtra goods, ConfigParamsDTO params) { |
| | | public static GoodsDetailVO convertTaoBaoGoodsBriefExtra(TaoBaoGoodsBriefExtra goods, GoodsMoneyConfigParamsDTO params) { |
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO(); |
| | | goodsInfo.setBaoyou(true); |
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_TAOBAO); |
| | |
| | | * @param fanLiRate 返利比例 |
| | | * @return |
| | | */ |
| | | public static GoodsDetailVO convertTaoBao(TaoBaoGoodsBrief goods, ConfigParamsDTO params) { |
| | | public static GoodsDetailVO convertTaoBao(TaoBaoGoodsBrief goods, GoodsMoneyConfigParamsDTO params) { |
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO(); |
| | | goodsInfo.setBaoyou(true); |
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_TAOBAO); |
| | |
| | | * @param fanLiRate 返利比例 |
| | | * @return |
| | | */ |
| | | public static GoodsDetailVO convertJDGoods(JDGoods goods, ConfigParamsDTO params) { |
| | | public static GoodsDetailVO convertJDGoods(JDGoods goods, GoodsMoneyConfigParamsDTO params) { |
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO(); |
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_JD); |
| | | goodsInfo.setGoodsId(goods.getSkuId() + ""); |
| | |
| | | * @param fanLiRate 返利比例 |
| | | * @return |
| | | */ |
| | | public static GoodsDetailVO convertPDDGoods(PDDGoodsDetail goods, ConfigParamsDTO params) { |
| | | public static GoodsDetailVO convertPDDGoods(PDDGoodsDetail goods, GoodsMoneyConfigParamsDTO params) { |
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO(); |
| | | goodsInfo.setBaoyou(true); |
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_PDD); |
| | |
| | | return goodsInfo; |
| | | } |
| | | |
| | | public static GoodsDetailVO convertVIPGoods(VIPGoodsInfo goods, ConfigParamsDTO params) { |
| | | public static GoodsDetailVO convertVIPGoods(VIPGoodsInfo goods, GoodsMoneyConfigParamsDTO params) { |
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO(); |
| | | goodsInfo.setBaoyou(true); |
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_VIP); |
| | |
| | | return goodsInfo; |
| | | } |
| | | |
| | | public static GoodsDetailVO convertSuningGoods(SuningGoodsInfo goods, ConfigParamsDTO params) { |
| | | public static GoodsDetailVO convertSuningGoods(SuningGoodsInfo goods, GoodsMoneyConfigParamsDTO params) { |
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO(); |
| | | goodsInfo.setBaoyou(true); |
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_SUNING); |
| | |
| | | package com.yeshi.fanli.util.factory.goods; |
| | | |
| | | import com.yeshi.common.vo.ClientTextStyleVO; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo; |
| | | import com.yeshi.fanli.dto.jd.JDPingouInfo; |
| | | import com.yeshi.fanli.dto.jd.JDShopInfo; |
| | |
| | | import com.yeshi.fanli.vo.goods.CouponInfoVO; |
| | | import com.yeshi.fanli.vo.goods.MoneyInfoVO; |
| | | import com.yeshi.fanli.vo.goods.ShopInfoVO; |
| | | import com.yeshi.fanli.vo.goods.lijin.GoodsDetailVO; |
| | | import com.yeshi.fanli.vo.goods.lijin.GoodsDetailVO.GoodsInfoVO; |
| | | import com.yeshi.fanli.vo.goods.lijin.GoodsDetailVO.GoodsRightsVO; |
| | | import com.yeshi.fanli.lijin.vo.GoodsDetailVO; |
| | | import com.yeshi.fanli.lijin.vo.GoodsDetailVO.GoodsInfoVO; |
| | | import com.yeshi.fanli.lijin.vo.GoodsDetailVO.GoodsRightsVO; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | | import org.yeshi.utils.MoneyBigDecimalUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | |
| | | public class GoodsDetailVOLijinFactory { |
| | | |
| | | |
| | | public static GoodsInfoVO convertTaoBao(TaoBaoGoodsBrief goods, ConfigParamsDTO params) { |
| | | public static GoodsInfoVO convertTaoBao(TaoBaoGoodsBrief goods, GoodsMoneyConfigParamsDTO params) { |
| | | GoodsInfoVO goodsInfo = new GoodsInfoVO(); |
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_TAOBAO); |
| | | goodsInfo.setGoodsId(goods.getAuctionId() + ""); |
| | |
| | | String provcity = goods.getProvcity(); |
| | | if (!StringUtil.isNullOrEmpty(provcity)) { |
| | | String[] arr = provcity.split("\\s+"); |
| | | goodsInfo.setAddress(arr[arr.length - 1]); |
| | | goodsInfo.setAddress(StringUtil.concat(Arrays.asList(arr),"·")); |
| | | } |
| | | |
| | | List<String> imgList = goods.getImgList(); |
| | |
| | | } |
| | | |
| | | goodsInfo.setZkPrice(getMoneyDesc(goods.getZkPrice())); |
| | | goodsInfo.setCouponPrice(TaoBaoUtil.getCouponPrice(goods)); |
| | | |
| | | //-----------资金信息-------------- |
| | | MoneyInfoVO moneyInfoVO = new MoneyInfoVO(); |
| | |
| | | boolean isSpecialGoods = TaoBaoUtil.isSpecialGoods(goods.getMaterialLibType()); |
| | | BigDecimal buyCommission = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getFanLiRate(), !isSpecialGoods); |
| | | moneyInfoVO.setFanliMoney("¥" + buyCommission); |
| | | moneyInfoVO.setFinalMoney(getMoneyDesc(TaoBaoUtil.getCouponPrice(goods).subtract(buyCommission))); |
| | | moneyInfoVO.setFinalMoney(getMoneyDesc(goodsInfo.getCouponPrice().subtract(buyCommission))); |
| | | goodsInfo.setMoneyInfo(moneyInfoVO); |
| | | // moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, params.getShareRate(), true)); |
| | | |
| | |
| | | TaoBaoCouponUtil.getCoupleUrl(goods.getCouponActivityId(), null, goods.getAuctionId() + "")); |
| | | coupon.setStartFee(goods.getCouponStartFee()); |
| | | coupon.setShopCoupon(goods.isShopCoupon()); |
| | | goodsInfo.setTempCoupon(coupon); |
| | | couponInfoVOList.add(coupon); |
| | | |
| | | goodsInfo.setCouponInfoList(couponInfoVOList); |
| | |
| | | } |
| | | |
| | | |
| | | public static GoodsInfoVO convertJDGoods(JDGoods goods, ConfigParamsDTO params) { |
| | | public static GoodsInfoVO convertJDGoods(JDGoods goods, GoodsMoneyConfigParamsDTO params) { |
| | | GoodsInfoVO goodsInfo = new GoodsInfoVO(); |
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_JD); |
| | | goodsInfo.setGoodsId(goods.getSkuId() + ""); |
| | |
| | | zkPrice = pinGouInfo.getPingouPrice(); |
| | | } |
| | | goodsInfo.setZkPrice(getMoneyDesc(zkPrice)); |
| | | |
| | | goodsInfo.setCouponPrice(JDUtil.getCouponPrice(goods)); |
| | | |
| | | // 资金信息 |
| | | MoneyInfoVO moneyInfoVO = new MoneyInfoVO(); |
| | |
| | | } |
| | | |
| | | |
| | | public static GoodsInfoVO convertPDDGoods(PDDGoodsDetail goods, ConfigParamsDTO params) { |
| | | public static GoodsInfoVO convertPDDGoods(PDDGoodsDetail goods, GoodsMoneyConfigParamsDTO params) { |
| | | |
| | | boolean bijia = false; |
| | | |
| | |
| | | |
| | | BigDecimal zkPrice = MoneyBigDecimalUtil.div(new BigDecimal(goods.getMinGroupPrice()), new BigDecimal(100)).setScale(2); |
| | | goodsInfo.setZkPrice(getMoneyDesc(zkPrice)); |
| | | goodsInfo.setCouponPrice(PinDuoDuoUtil.getCouponPrice(goods)); |
| | | Boolean hasCoupon = goods.getHasCoupon(); |
| | | if (hasCoupon != null && hasCoupon) { |
| | | BigDecimal hundred = new BigDecimal(100); |
| | |
| | | return fillFanliPrice(fillRights(goodsInfo), bijia); |
| | | } |
| | | |
| | | public static GoodsInfoVO convertVIPGoods(VIPGoodsInfo goods, ConfigParamsDTO params) { |
| | | public static GoodsInfoVO convertVIPGoods(VIPGoodsInfo goods, GoodsMoneyConfigParamsDTO params) { |
| | | GoodsInfoVO goodsInfo = new GoodsInfoVO(); |
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_VIP); |
| | | goodsInfo.setGoodsId(Long.parseLong(goods.getGoodsId()) + ""); |
| | |
| | | |
| | | goodsInfo.setSalesCount(""); |
| | | goodsInfo.setZkPrice(getMoneyDesc(new BigDecimal(goods.getVipPrice()))); |
| | | goodsInfo.setCouponPrice(new BigDecimal(goods.getVipPrice())); |
| | | |
| | | // 资金信息 |
| | | MoneyInfoVO moneyInfoVO = new MoneyInfoVO(); |
| | |
| | | return fillFanliPrice(fillRights(goodsInfo), false); |
| | | } |
| | | |
| | | public static GoodsInfoVO convertSuningGoods(SuningGoodsInfo goods, ConfigParamsDTO params) { |
| | | public static GoodsInfoVO convertSuningGoods(SuningGoodsInfo goods, GoodsMoneyConfigParamsDTO params) { |
| | | GoodsInfoVO goodsInfo = new GoodsInfoVO(); |
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_SUNING); |
| | | goodsInfo.setGoodsId(SuningUtil.getConcatGoodsIId(goods.getCommodityInfo().getSupplierCode(), |
| | |
| | | zkPrice = goods.getCommodityInfo().getSnPrice(); |
| | | } |
| | | goodsInfo.setZkPrice(getMoneyDesc(new BigDecimal(zkPrice))); |
| | | |
| | | goodsInfo.setCouponPrice(SuningUtil.getCouponPrice(goods)); |
| | | |
| | | goodsInfo.setShopType(CommonGoods.SHOP_TYPE_SUNING); |
| | | |
| | |
| | | if (item.optBoolean("free_shipment")) |
| | | goods.setFreeShipment(1); |
| | | |
| | | goods.setMaterialLibTypes(item.optString("material_lib_type")); |
| | | |
| | | if (!StringUtil.isNullOrEmpty(item.optString("material_lib_type"))) { |
| | | try { |
| | | String materialLibType = item.optString("material_lib_type"); |
| | |
| | | package com.yeshi.fanli.vo.goods; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | |
| | |
| | | @Expose |
| | | private String hongBaoMoney; |
| | | |
| | | @Expose |
| | | private String finalMoney;//最终价格 |
| | | |
| | | |
| | | private String maxRateInfo;// 最大比例信息 |
| | | |
| | | private String maxCompositionInfo;//最大构成信息 |
| | | |
| | | //原始佣金比例 |
| | | private BigDecimal commissionRate; |
| | | |
| | | |
| | | public String getFinalMoney() { |
| | |
| | | this.hongBaoMoney = hongBaoMoney; |
| | | } |
| | | |
| | | public BigDecimal getCommissionRate() { |
| | | return commissionRate; |
| | | } |
| | | |
| | | public void setCommissionRate(BigDecimal commissionRate) { |
| | | this.commissionRate = commissionRate; |
| | | } |
| | | } |
| | |
| | | <dubbo:parameter key="qos.port" value="33333"></dubbo:parameter> |
| | | </dubbo:application> |
| | | |
| | | <dubbo:annotation package="com.yeshi.fanli"></dubbo:annotation> |
| | | |
| | | <dubbo:registry address="zookeeper://193.112.35.168:2181"/> |
| | | |
| | | <!-- url=dubbo://192.168.3.122:20882/com.yeshi.goods.facade.service.TaoBaoCouponCacheService --> |
| | |
| | | </profile> |
| | | </profiles> |
| | | |
| | | <repositories> |
| | | <repository> |
| | | <id>nexus</id> |
| | | <name>nexus</name> |
| | | <url>http://193.112.35.168:8081/nexus/content/groups/public/</url> |
| | | </repository> |
| | | </repositories> |
| | | |
| | | <dependencies> |
| | | |
| | | <dependency> |