| | |
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendBanner;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
|
| | | import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendBanner;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsGroupService;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserShareGoodsGroupService userShareGoodsGroupService;
|
| | | |
| | | @Resource
|
| | | private UserTaoLiJinRecordService userTaoLiJinRecordService;
|
| | | |
| | |
|
| | | /**
|
| | | *
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 处理条件
|
| | | * |
| | | * @param uid
|
| | | * @param tid
|
| | | * @param out
|
| | | */
|
| | | private void doTaoLiJin(String callback, Long uid, Long tid, PrintWriter out) {
|
| | | // 查询商品淘礼金
|
| | | UserTaoLiJinRecord record = userTaoLiJinRecordService.selectByPrimaryKey(tid);
|
| | | if (record == null) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("商品信息获取失败")));
|
| | | return;
|
| | | }
|
| | | |
| | | Long auctionId = record.getGoodsId();
|
| | | String tljLink = record.getSendUrl();
|
| | | BigDecimal tljMoney= record.getPerFace();
|
| | | |
| | | TaoBaoGoodsBrief goods = null;
|
| | | try {
|
| | | goods = redisManager.getTaoBaoGoodsBrief(auctionId);
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | }
|
| | |
|
| | | if (goods == null) {// 已经下线
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("商品信息获取失败")));
|
| | | return;
|
| | | }
|
| | |
|
| | | String token = redisManager.getTLJToken(tljLink);
|
| | | if (StringUtil.isNullOrEmpty(token)) {
|
| | | token = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), tljLink);
|
| | | }
|
| | |
|
| | | // 券后价
|
| | | BigDecimal afterCouponPrice = TaoBaoUtil.getAfterUseCouplePrice(goods);
|
| | | TaoBaoLink link = new TaoBaoLink();
|
| | | link.setTaoToken(token);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("title", goods.getTitle());
|
| | | if (goods.getImgList() == null)
|
| | | goods.setImgList(new ArrayList<>());
|
| | | goods.getImgList().add(0, TbImgUtil.getTBSizeImg(goods.getPictUrl(), 300));
|
| | | data.put("imgs", goods.getImgList());
|
| | | data.put("couponPrice", afterCouponPrice);
|
| | | // 老版本兼容
|
| | | data.put("quanPrice", afterCouponPrice);
|
| | | data.put("zkPrice", goods.getZkPrice());
|
| | | data.put("shareContent", "长按复制本段文字,打开【手机淘宝】即可领取【特别优惠券】购买下单,");
|
| | | data.put("token", link.getTaoToken());
|
| | | data.put("reservePrice", goods.getReservePrice());
|
| | | data.put("shopType", goods.getUserType() == 1 ? 2 : 1);
|
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponInfo()) && !"无".equalsIgnoreCase(goods.getCouponInfo())) {
|
| | | data.put("couponAmount", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()));
|
| | | data.put("coupon", true);
|
| | | } else {
|
| | | data.put("coupon", false);
|
| | | }
|
| | | |
| | | data.put("tljMoney", tljMoney);
|
| | | |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | |
|
| | | /**
|
| | | *
|
| | | * 方法说明: 获取商品详情
|
| | | *
|
| | |
| | |
|
| | | @SuppressWarnings("unused")
|
| | | @RequestMapping(value = "getGoodsDetail", method = RequestMethod.GET)
|
| | | public void getGoodsDetail(final AcceptData acceptData, final String id, String uid, String callback,
|
| | | public void getGoodsDetail(final AcceptData acceptData, final String id, String tid, String uid, String callback,
|
| | | PrintWriter out) {
|
| | | long begin = java.lang.System.currentTimeMillis();
|
| | | if (StringUtil.isNullOrEmpty(id)) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请上传id"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(uid)) {
|
| | | uid = AESUtil.decrypt(uid, Constant.UIDAESKEY);
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(tid)) {
|
| | | tid = AESUtil.decrypt(tid, Constant.UIDAESKEY);
|
| | | doTaoLiJin(callback, StringUtil.isNullOrEmpty(uid) || Long.parseLong(uid) == 0 ? null : Long.parseLong(uid),
|
| | | Long.parseLong(tid), out);
|
| | | return;
|
| | | }
|
| | |
|
| | | TaoBaoGoodsBrief goods = null;
|
| | |
| | | goods.setImgList(new ArrayList<>());
|
| | | goods.getImgList().add(0, TbImgUtil.getTBSizeImg(goods.getPictUrl(), 300));
|
| | | data.put("imgs", goods.getImgList());
|
| | | data.put("couponPrice", afterCouponPrice);
|
| | | // 老版本兼容
|
| | | data.put("quanPrice", afterCouponPrice);
|
| | | data.put("zkPrice", goods.getZkPrice());
|
| | | data.put("shareContent", "长按复制本段文字,打开【手机淘宝】即可领取【特别优惠券】购买下单,");
|
| | | data.put("token", link.getTaoToken());
|
| | | data.put("quan", !StringUtil.isNullOrEmpty(goods.getCouponInfo()));
|
| | | data.put("reservePrice", goods.getReservePrice());
|
| | | data.put("shopType", goods.getUserType() == 1 ? 2 : 1);
|
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponInfo()) && !"无".equalsIgnoreCase(goods.getCouponInfo())) {
|
| | | data.put("couponAmount", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()));
|
| | | data.put("coupon", true);
|
| | | // 老版本兼容
|
| | | data.put("quan", true);
|
| | | } else {
|
| | | data.put("coupon", false);
|
| | | // 老版本兼容
|
| | | data.put("quan", true);
|
| | | }
|
| | | |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | |
|
| | | final String tempUid = uid;
|