admin
2019-11-08 15f831b6e153cedea957bd08802380759a234c6a
MQ日志调整
13个文件已修改
92 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/MQJob.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/log/LogHelper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderPayServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/shop/BanLiShopOrderGoodsVOFactory.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/coupon/SystemCouponMessageListener.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/BanLiShopOrderMessageListener.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/InviteOrderSubsidyMessageListener.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/redpack/RedPackMessageListener.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/wx/BanLiShopWXPayUtil.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java
@@ -15,6 +15,7 @@
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;
@@ -76,7 +77,7 @@
     * @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,
@@ -91,6 +92,14 @@
        }
        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
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java
@@ -17,6 +17,7 @@
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;
@@ -1073,8 +1074,9 @@
                    }
                    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()));
                    // 测试
@@ -1084,9 +1086,8 @@
                    commentTexts.add("口令3");
                    commentTexts.add("口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令");
                    data.put("commentTexts", commentTexts);
                    data.put("wxErCode", "这是微信分享二维码内容");
                    data.put("wxErCode", ShareControllerV2.getERCodeContent(goods, taoBaoLink.getTaoToken()));
                }
            } else if (cid == 4) { // 邀请分享
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java
@@ -29,6 +29,7 @@
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;
@@ -77,8 +78,8 @@
    @Resource
    private RedPackWinInviteService redPackWinInviteService;
    @Resource
    @Resource
    private RedPackWinNewUserService redPackWinNewUserService;
    @Resource
@@ -86,10 +87,10 @@
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private JumpDetailV2Service jumpDetailV2Service;
    @Resource
    private SwiperPictureService swiperPictureService;
@@ -380,10 +381,18 @@
            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())) {
@@ -397,10 +406,10 @@
        } else
            out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 新人红包详情
     *
     * @param acceptData
     * @param uid
     * @param out
@@ -411,7 +420,7 @@
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        try {
            RedPackWinDetailVO winDetail = redPackWinNewUserService.receiveReward(uid);
            if (winDetail == null) {
@@ -420,7 +429,7 @@
            }
            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());
@@ -433,11 +442,11 @@
            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, "红包已被抢光啦"));
        }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
@@ -67,6 +67,7 @@
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;
@@ -264,7 +265,6 @@
            commentTexts.add("口令3");
            commentTexts.add("口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令");
            shareInfo.setCommentTexts(commentTexts);
            shareInfo.setWxErCode("这是微信分享二维码内容");
            TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, goodsId, relationId);
@@ -318,7 +318,11 @@
            }
            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");
fanli/src/main/java/com/yeshi/fanli/job/MQJob.java
@@ -53,7 +53,7 @@
                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());
                }
            }
    }
fanli/src/main/java/com/yeshi/fanli/log/LogHelper.java
@@ -95,8 +95,8 @@
        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);
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderPayServiceImpl.java
@@ -102,7 +102,10 @@
                    || 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);
@@ -138,7 +141,10 @@
                    || 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);
fanli/src/main/java/com/yeshi/fanli/util/factory/shop/BanLiShopOrderGoodsVOFactory.java
@@ -1,6 +1,7 @@
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;
@@ -63,9 +64,9 @@
    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();
    }
}
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/coupon/SystemCouponMessageListener.java
@@ -25,8 +25,8 @@
    @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)
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/BanLiShopOrderMessageListener.java
@@ -49,7 +49,7 @@
        } 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();
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/InviteOrderSubsidyMessageListener.java
@@ -66,7 +66,7 @@
        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();
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/redpack/RedPackMessageListener.java
@@ -40,7 +40,7 @@
    @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)
fanli/src/main/java/com/yeshi/fanli/util/wx/BanLiShopWXPayUtil.java
@@ -49,10 +49,12 @@
            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) {