| | |
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackBalance;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopGoods;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay;
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "goodsList")
|
| | | public void goodsList(AcceptData acceptData, int page, String callback, PrintWriter out) {
|
| | | public void goodsList(AcceptData acceptData, int page,Long uid, String callback, PrintWriter out) {
|
| | | if (page <= 0)
|
| | | page = 1;
|
| | | List<BanLiShopGoods> goodsList = banLiShopGoodsService.listGoods(null, BanLiShopGoods.STATE_ONLINE, page,
|
| | |
| | | }
|
| | | data.put("data", goodsList);
|
| | | data.put("count", count);
|
| | | |
| | | RedPackBalance redPackBalance = redPackBalanceService.selectByPrimaryKey(uid);
|
| | | if (redPackBalance != null && redPackBalance.getState() == RedPackBalance.STATE_LOCKED) {
|
| | | data.put("redPackLock", true);
|
| | | } else {
|
| | | data.put("redPackLock", false);
|
| | | }
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | else
|
| | |
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.fasterxml.jackson.core.util.VersionUtil;
|
| | | import com.yeshi.fanli.controller.client.v2.ShareControllerV2;
|
| | | import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | |
| | | }
|
| | | TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId);
|
| | | TaoBaoGoodsBrief goods = taoBaoLink.getGoods();
|
| | | |
| | | data.put("clickUrl", ShareControllerV2.getERCodeContent(goods, taoBaoLink.getTaoToken()));
|
| | | if (!com.yeshi.fanli.util.VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(),
|
| | | acceptData.getVersion()))
|
| | | data.put("clickUrl", ShareControllerV2.getERCodeContent(goods, taoBaoLink.getTaoToken()));
|
| | |
|
| | | data.put("token", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
|
| | | // 测试
|
| | |
| | | commentTexts.add("口令3");
|
| | | commentTexts.add("口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令");
|
| | | data.put("commentTexts", commentTexts);
|
| | | data.put("wxErCode", "这是微信分享二维码内容");
|
| | | |
| | | |
| | | data.put("wxErCode", ShareControllerV2.getERCodeContent(goods, taoBaoLink.getTaoToken()));
|
| | |
|
| | | }
|
| | |
|
| | | } else if (cid == 4) { // 邀请分享
|
| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackBalance;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackExchange;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackWinInvite;
|
| | |
| | |
|
| | | @Resource
|
| | | private RedPackWinInviteService redPackWinInviteService;
|
| | | |
| | | @Resource |
| | |
|
| | | @Resource
|
| | | private RedPackWinNewUserService redPackWinNewUserService;
|
| | |
|
| | | @Resource
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | | |
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | |
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("balance", redPackBalanceService.getBalance(uid));
|
| | | data.put("ruleLink", redPackConfigService.getValueByKey("invite_reward_rule_link"));
|
| | | data.put("shareLink", UserInviteUtil.getShareUrl(uid));
|
| | |
|
| | | RedPackBalance redPackBalance = redPackBalanceService.selectByPrimaryKey(uid);
|
| | | if (redPackBalance != null && redPackBalance.getState() == RedPackBalance.STATE_LOCKED) {
|
| | | data.put("redPackLock", true);
|
| | | } else {
|
| | | data.put("redPackLock", false);
|
| | | }
|
| | |
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | |
| | | } else
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 新人红包详情
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | | RedPackWinDetailVO winDetail = redPackWinNewUserService.receiveReward(uid);
|
| | | if (winDetail == null) {
|
| | |
| | | }
|
| | | winDetail.setLogo(Constant.systemCommonConfig.getDefaultPortrait());
|
| | | winDetail.setLogoLight(Constant.systemCommonConfig.getDefaultPortrait());
|
| | | |
| | |
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("url", redPackConfigService.getValueByKey("goods_shop_link_h5"));
|
| | | winDetail.setParams(params.toString());
|
| | |
| | | List<SwiperPicture> topPicList = new ArrayList<>();
|
| | | if (oldtopPicList != null && oldtopPicList.size() > 0)
|
| | | topPicList.addAll(oldtopPicList);
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("detail", JsonUtil.getApiCommonGson().toJson(winDetail));
|
| | | data.put("banner", JsonUtil.getApiCommonGson().toJson(topPicList));
|
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "红包已被抢光啦"));
|
| | | }
|
| | |
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
|
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
|
| | |
| | | commentTexts.add("口令3");
|
| | | commentTexts.add("口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令");
|
| | | shareInfo.setCommentTexts(commentTexts);
|
| | | shareInfo.setWxErCode("这是微信分享二维码内容");
|
| | |
|
| | | TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, goodsId, relationId);
|
| | |
|
| | |
| | | }
|
| | | shareInfo.setDescText(descText);
|
| | | // 测试
|
| | | shareInfo.setClickUrl(getERCodeContent(taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | | // 2.0.2之前
|
| | | if (!VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | shareInfo.setClickUrl(getERCodeContent(taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | |
|
| | | shareInfo.setWxErCode(getERCodeContent(taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | |
|
| | | // 提示图文内容
|
| | | String imgs = configService.get("goods_share_notify_imgs");
|
| | |
| | | SendResult sendResult = producer.send(msg);
|
| | | if (sendResult != null) {
|
| | | mqUnSendInfoService.deleteByPrimaryKey(sendInfo.getId());
|
| | | LogHelper.mqInfo("消息重发成功", sendInfo.getTopic(), sendInfo.getTag(), sendInfo.getBody());
|
| | | LogHelper.mqInfo("消息重发成功",sendResult.getMessageId(), sendInfo.getTopic(), sendInfo.getTag(), sendInfo.getBody());
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | mqLogger.error(error);
|
| | | }
|
| | |
|
| | | public static void mqInfo(String extraInfo, String topic, String tag, Object data) {
|
| | | String info = extraInfo+"\n"+ "topic:" + topic + "\ntag:" + tag + "\nbody:" + data;
|
| | | public static void mqInfo(String extraInfo,String msgId, String topic, String tag, Object data) {
|
| | | String info = extraInfo+"\nmsgId"+msgId + "\ntopic:" + topic + "\ntag:" + tag + "\nbody:" + data;
|
| | | mqLogger.info(info);
|
| | | }
|
| | |
|
| | |
| | | || order.getBalancePaymentState() == BanLiShopOrder.PAY_STATE_PAID)
|
| | | && (order.getMoneyPaymentState() == null
|
| | | || order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_PAID))// 其他待支付项已经支付
|
| | | {
|
| | | update.setState(BanLiShopOrder.STATE_PAID);
|
| | | update.setStateDesc("支付成功");
|
| | | }
|
| | | banLiShopOrderService.udpateSelectiveByPrimaryKey(update);
|
| | | if (update.getState() != null && update.getState() == BanLiShopOrder.STATE_PAID) {
|
| | | paySuccess(order);
|
| | |
| | | || order.getBalancePaymentState() == BanLiShopOrder.PAY_STATE_PAID)
|
| | | && (order.getHongBaoPaymentState() == null
|
| | | || order.getHongBaoPaymentState() == BanLiShopOrder.PAY_STATE_PAID))// 其他待支付项已经支付
|
| | | {
|
| | | update.setState(BanLiShopOrder.STATE_PAID);
|
| | | update.setStateDesc("支付成功");
|
| | | }
|
| | | banLiShopOrderService.udpateSelectiveByPrimaryKey(update);
|
| | | if (update.getState() != null && update.getState() == BanLiShopOrder.STATE_PAID) {
|
| | | paySuccess(order);
|
| | |
| | | package com.yeshi.fanli.util.factory.shop;
|
| | |
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopOrder;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.vo.shop.BanLiShopOrderGoodsVO;
|
| | | import com.yeshi.fanli.vo.shop.BanLiShopOrderVO;
|
| | |
| | | private static String getPaidMoney(BanLiShopOrder order) {
|
| | | if (order.getMoneyPaymentState() == null || order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_NOPAY
|
| | | || order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_REFUND) {
|
| | | return "0";
|
| | | return "0.00";
|
| | | } else
|
| | | return order.getMoneyPayment().toString();
|
| | | return order.getMoneyPayment().setScale(2).toString();
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | | LogHelper.mqInfo("consumer-SystemCouponMessageListener", message.getTopic(), message.getTag(),
|
| | | new String(message.getBody()));
|
| | | LogHelper.mqInfo("consumer-SystemCouponMessageListener", message.getMsgID(), message.getTopic(),
|
| | | message.getTag(), new String(message.getBody()));
|
| | | String tag = message.getTag();
|
| | | BaseMQMsgBody baseBody = new Gson().fromJson(new String(message.getBody()), BaseMQMsgBody.class);
|
| | | if (baseBody.isTest() != Constant.IS_TEST)
|
| | |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | LogHelper.mqInfo("consumer:BanLiShopOrderMessageListener", message.getTopic(), message.getTag(),
|
| | | LogHelper.mqInfo("consumer:BanLiShopOrderMessageListener",message.getMsgID(), message.getTopic(), message.getTag(),
|
| | | new String(message.getBody()));
|
| | | String tag = message.getTag();
|
| | |
|
| | |
| | | BaseMQMsgBody baseBody = new Gson().fromJson(new String(message.getBody()), BaseMQMsgBody.class);
|
| | | if (baseBody.isTest() != Constant.IS_TEST)
|
| | | return Action.ReconsumeLater;
|
| | | LogHelper.mqInfo("consumer:InviteOrderSubsidyMessageListener", message.getTopic(), message.getTag(),
|
| | | LogHelper.mqInfo("consumer:InviteOrderSubsidyMessageListener", message.getMsgID(),message.getTopic(), message.getTag(),
|
| | | new String(message.getBody()));
|
| | | String tag = message.getTag();
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | | LogHelper.mqInfo("consumer-RedPackMessageListener", message.getTopic(), message.getTag(),
|
| | | LogHelper.mqInfo("consumer-RedPackMessageListener",message.getMsgID(), message.getTopic(), message.getTag(),
|
| | | new String(message.getBody()));
|
| | | String tag = message.getTag();
|
| | | if (tag == null)
|
| | |
| | | Map<String, String> map = WXPayUtil.produceOrder(params);
|
| | | if ("ios".equalsIgnoreCase(platform))
|
| | | return map.get("mweb_url") + "&redirect_url="
|
| | | + URLEncoder.encode("shop.banliapp.com://shop.banliapp.com/order.html?from=pay", "UTF-8");
|
| | | + URLEncoder.encode("shop.banliapp.com://shop.banliapp.com/wx_pay_finish.html", "UTF-8");
|
| | | else
|
| | | return map.get("mweb_url") + "&redirect_url="
|
| | | + URLEncoder.encode("http://shop.banliapp.com/order.html?from=pay", "UTF-8");
|
| | | + URLEncoder.encode("http://shop.banliapp.com/wx_pay_finish.html", "UTF-8");
|
| | | |
| | | |
| | | } catch (WXPlaceOrderParamsException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|