| | |
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.factory.goods.ShopInfoVOFactory;
|
| | |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.goods.MoneyInfoVO;
|
| | | import com.yeshi.fanli.vo.goods.OtherInfo;
|
| | | import com.yeshi.fanli.vo.goods.ShareInfoVO;
|
| | | import com.yeshi.fanli.vo.goods.ShareVO;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.tlj.ReduceHongBao;
|
| | | import com.yeshi.fanli.vo.tlj.SpreadHongBao;
|
| | |
| | | @Resource
|
| | | private TLJBuyGoodsService tljBuyGoodsService;
|
| | |
|
| | | |
| | | /**
|
| | | * 获取商品详情
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param source
|
| | | * @param uid
|
| | | * @param from
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getDetail", method = RequestMethod.POST)
|
| | | public void getDetail(AcceptData acceptData, Long id, Integer goodsType, Long uid, String from, PrintWriter out) {
|
| | | if (id == null || goodsType == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品id和商品平台不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 淘宝商品
|
| | | if (Constant.SOURCE_TYPE_TAOBAO == goodsType) {
|
| | | getTaoBaoGoodsDetial(acceptData, id, uid, from, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | // 京东商品
|
| | | if (Constant.SOURCE_TYPE_JD == goodsType) {
|
| | | getJDGoodsDetial(acceptData, id, uid, from, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | // 拼多多商品
|
| | | if (Constant.SOURCE_TYPE_PDD == goodsType) {
|
| | | getPDDGoodsDetial(acceptData, id, uid, from, out);
|
| | | return;
|
| | | }
|
| | | }
|
| | | @Resource
|
| | | private JDGoodsCacheUtil jdGoodsCacheUtil;
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @param from
|
| | | * @param out
|
| | | */
|
| | | public void getTaoBaoGoodsDetial(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | @RequestMapping(value = "getDetailTB", method = RequestMethod.POST)
|
| | | public void getDetialTB(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | if (id == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请上传id"));
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品id不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | |
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(tb, null, fanLiRate, shareRate);
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate, shareRate);
|
| | |
|
| | | // 店铺信息
|
| | | TaoBaoShop shop = taoBaoShopService.getTaoBaoShop(goods.getAuctionId(), goods.getSellerId());
|
| | | TaoBaoShop shop = taoBaoShopService.getTaoBaoShop(id, goods.getSellerId());
|
| | | if (shop != null) {
|
| | | String shopLink = shop.getShopLink();
|
| | | if (StringUtil.isNullOrEmpty(shopLink)) {
|
| | |
| | |
|
| | | SpreadHongBao spreadHongBao = new SpreadHongBao();
|
| | | if (isNewUser) {
|
| | | spreadHongBao.setMoney("¥1");
|
| | | spreadHongBao.setMoney("1");
|
| | | } else {
|
| | | moneyType = 2;
|
| | | fanliValid = false;
|
| | | spreadHongBao.setMoney("¥" + spreadMoney.toString());
|
| | | spreadHongBao.setMoney(spreadMoney.toString());
|
| | |
|
| | | ClientTextStyleVO textStyleVO1 = new ClientTextStyleVO();
|
| | | textStyleVO1.setContent("分享");
|
| | |
| | | ReduceHongBao reduceHongBao = new ReduceHongBao();
|
| | | reduceHongBao.setLeft(buyGoods.getLeftHongBaoCount());
|
| | | reduceHongBao.setMoney(tljHongBao);
|
| | | reduceHongBao.setName("付款立减 ¥" + tljHongBao);
|
| | | reduceHongBao.setName("付款立减 ");
|
| | | reduceHongBao.setTip("当日领取,当日内使用,过期失效");
|
| | | reduceHongBao.setTotal(buyGoods.getTotalHongBaoCount());
|
| | |
|
| | |
| | |
|
| | | // 分享路径
|
| | | String shareUrl = String.format("%s?id=" + id, Constant.systemCommonConfig.getAppShareInfoUrl());
|
| | | ShareInfoVO shareInfoVO = new ShareInfoVO();
|
| | | ShareVO shareInfoVO = new ShareVO();
|
| | | shareInfoVO.setUrl(shareUrl);
|
| | | shareInfoVO.setHelpLink(helpLink);
|
| | | extraVO.setShareInfo(shareInfoVO);
|
| | | extraVO.setShare(shareInfoVO);
|
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
|
| | |
| | | * @param from
|
| | | * @param out
|
| | | */
|
| | | public void getJDGoodsDetial(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | @RequestMapping(value = "getDetailJD", method = RequestMethod.POST)
|
| | | public void getDetialJD(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | // 系统验证
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | |
| | | out.print(JsonUtil.loadFalseResult(2, "商品不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | // 保存缓存
|
| | | jdGoodsCacheUtil.saveGoodsInfo(jdGoods);
|
| | | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
| | | // 分享路径
|
| | | String shareUrl = String.format("%s?id=" + jdGoods.getSkuId(),
|
| | | Constant.systemCommonConfig.getAppShareInfoUrl());
|
| | | ShareInfoVO shareInfoVO = new ShareInfoVO();
|
| | | ShareVO shareInfoVO = new ShareVO();
|
| | | shareInfoVO.setUrl(shareUrl);
|
| | | shareInfoVO.setHelpLink(helpLink);
|
| | | extraVO.setShareInfo(shareInfoVO);
|
| | | extraVO.setShare(shareInfoVO);
|
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 京东商品详情
|
| | | * 拼多多商品详情
|
| | | *
|
| | | * @param acceptData
|
| | | * @param id
|
| | |
| | | * @param from
|
| | | * @param out
|
| | | */
|
| | | public void getPDDGoodsDetial(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | @RequestMapping(value = "getDetailPDD", method = RequestMethod.POST)
|
| | | public void getDetialPDD(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | // 系统验证
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | |
| | | String version = acceptData.getVersion();
|
| | | extraVO.setIosOnling(configService.iosOnLining(Integer.parseInt(version)));
|
| | | }
|
| | |
|
| | | |
| | | // 图文详情
|
| | | extraVO.setDetailUrl("http://apph5.yeshitv.com/apppage/goods_img_pdd.html?id="+ id);
|
| | |
|
| | | Long inOrderCount30Days = pddGoods.getSoldQuantity();
|
| | | List<ShamUser> listShareUser = new ArrayList<ShamUser>();
|
| | |
| | | }
|
| | | // 分享路径
|
| | | String shareUrl = String.format("%s?id=" + id, Constant.systemCommonConfig.getAppShareInfoUrl());
|
| | | ShareInfoVO shareInfoVO = new ShareInfoVO();
|
| | | ShareVO shareInfoVO = new ShareVO();
|
| | | shareInfoVO.setUrl(shareUrl);
|
| | | shareInfoVO.setHelpLink(helpLink);
|
| | | extraVO.setShareInfo(shareInfoVO);
|
| | | extraVO.setShare(shareInfoVO);
|
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
|