yujian
2019-10-29 50361d9b29962f66b05df0732820840c6531f84f
Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div

# Conflicts:
# fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgMoneyDetail.java
# fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/MsgMoneyDetailServiceImpl.java
# fanli/src/main/java/com/yeshi/fanli/service/inter/money/msg/UserMoneyMsgNotificationService.java
# fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
6个文件已添加
12 文件已复制
30个文件已修改
4 文件已重命名
836 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserOrderController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/order/OrderMoneyRecievedMQMsgDTO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgAccountDetail.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgInviteDetail.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgMoneyDetail.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOrderDetail.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOtherDetail.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/MQJob.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/TaoLiJinJob.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/log/LogHelper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/money/InviteOrderSubsidyDebtMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/order/HongBaoOrderMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/extract/ExtractAuditRecordServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/extract/ExtractServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/MsgMoneyDetailServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/UserMoneyMsgNotificationServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/InviteOrderSubsidyServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderMoneySettleServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/tb/TaoBaoWeiQuanOrderServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/money/msg/UserMoneyMsgNotificationService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgMoneyDetailFactory.java 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/coupon/SystemCouponMessageListener.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/InviteOrderSubsidyMessageListener.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-dev/constant.properties 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-dev/rocket/consumer.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-dev/rocket/producer.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-dev/rocket/system-coupon-consumer.xml 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-dev/rocket/transactionProducer.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-dev/spring.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro-by/rocket/consumer.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro-by/rocket/producer.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro-by/rocket/system-coupon-consumer.xml 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro-by/rocket/transactionProducer.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro-by/spring.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro-job/rocket/consumer.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro-job/rocket/producer.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro-job/rocket/system-coupon-consumer.xml 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro-job/rocket/transactionProducer.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro-job/spring.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro/rocket/consumer.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro/rocket/producer.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro/rocket/system-coupon-consumer.xml 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro/rocket/transactionProducer.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro/spring.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/MyBatisProduce.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/TaoKeTest.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserOrderController.java
@@ -188,7 +188,7 @@
        // 判断是否需要显示订单找回提示
        if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
            if (state == 0 && page == 1) {
            if (state != null && state == 0 && page == 1) {
                if (redisManager.frequencyLimit("orderlist-" + acceptData.getDevice(), 15, 3)) {// 15秒内请求3次触发
                    // TODO 显示订单找回提醒
                }
fanli/src/main/java/com/yeshi/fanli/dto/order/OrderMoneyRecievedMQMsgDTO.java
@@ -19,6 +19,15 @@
    private String orderId;// 订单号
    private BigDecimal money;// 到账金额
    private Date date;// 到账时间
    private Boolean orderFirst;// 该订单是否是首次到账
    public Boolean getOrderFirst() {
        return orderFirst;
    }
    public void setOrderFirst(Boolean orderFirst) {
        this.orderFirst = orderFirst;
    }
    public OrderMoneyRecievedMQMsgDTO() {
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgAccountDetail.java
@@ -16,7 +16,13 @@
@Table("yeshi_ec_msg_account")
public class MsgAccountDetail {
    public enum MsgTypeAccountTypeEnum {
        bingding("账号绑定"), cancelBinding("取消绑定"), bingdingChange("绑定更换"), update("账号修改"), level("账号等级"), connect("账号合并"),taoBaoAuthFail("账号绑定");
        bingding("账号绑定"),
        cancelBinding("取消绑定"),
        bingdingChange("绑定更换"),
        update("账号修改"),
        level("账号等级"),
        connect("账号合并"),
        taoBaoAuthFail("账号绑定");
        private final String desc;
        private MsgTypeAccountTypeEnum(String desc) {
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgInviteDetail.java
@@ -17,7 +17,7 @@
@Table("yeshi_ec_msg_invite")
public class MsgInviteDetail {
    public enum MsgTypeInviteTypeEnum {
        invite("邀请消息"), exchangeCode("恭喜你,邀请码兑换成功"), receiveGift ("领取礼品");
        invite("邀请消息"), exchangeCode("恭喜你,邀请码兑换成功"), receiveGift("领取礼品");
        private final String desc;
        private MsgTypeInviteTypeEnum(String desc) {
@@ -29,25 +29,24 @@
        }
    }
    @Column(name="mi_id")
    @Column(name = "mi_id")
    private Long id;
    @Column(name="mi_uid")
    @Column(name = "mi_uid")
    private UserInfo user;
    @Column(name="mi_type")
    @Column(name = "mi_type")
    private MsgTypeInviteTypeEnum msgType;// 消息类型
    @Column(name="mi_invite_id")
    @Column(name = "mi_invite_id")
    private ThreeSale inviteUser;// 邀请信息
    @Column(name="mi_desc")
    @Column(name = "mi_desc")
    private String desc;// 说明
    @Column(name="mi_beizhu")
    @Column(name = "mi_beizhu")
    private String beiZhu;// 备注
    @Column(name="mi_read")
    @Column(name = "mi_read")
    private Boolean read;// 是否已读
    @Column(name="mi_create_time")
    @Column(name = "mi_create_time")
    private Date createTime;
    @Column(name="mi_update_time")
    @Column(name = "mi_update_time")
    private Date updateTime;
    public Long getId() {
        return id;
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgMoneyDetail.java
@@ -19,12 +19,24 @@
@Table("yeshi_ec_msg_money")
public class MsgMoneyDetail {
    public enum MsgTypeMoneyTypeEnum {
        share("分享奖金"), invite("邀请奖金"), fanli("返利到账"), extract("提现"), extractAutoWX("自动提现"), extractValid("提现账号验证"), shareWeiQuan(
                "分享奖金扣除"), inviteWeiQuan("邀请奖金扣除"), fanliWeiQuan("返利扣除"), orderReward("返利奖励"), systemEqualize("系统补齐"),fanliElme("返利到账"),
        redPackGiveOff("赠送红包完成"),redPackReceiveOff("赠送红包领取"),redPackExchangePass("红包提现成功"),redPackExchangeReject("红包提现失败");
        share("分享奖金"),
        invite("邀请奖金"),
        fanli("返利到账"),
        extract("提现"),
        extractAutoWX("自动提现"),
        extractValid("提现账号验证"),
        shareWeiQuan("分享奖金扣除"),
        inviteWeiQuan("邀请奖金扣除"),
        fanliWeiQuan("返利扣除"),
        orderReward("返利奖励"),
        systemEqualize("系统补齐"),
        fanliElme("返利到账"),
        subSidy("额外补贴"),
        redPackGiveOff("赠送红包完成"),
        redPackReceiveOff("赠送红包领取"),
        redPackExchangePass("红包提现成功"),
        redPackExchangeReject("红包提现失败");
        private final String desc;
        private MsgTypeMoneyTypeEnum(String desc) {
@@ -71,8 +83,7 @@
    private Boolean read;
    @Column(name = "mm_content") // 消息内容
    private String content;
    public Long getId() {
        return id;
    }
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOrderDetail.java
@@ -22,7 +22,7 @@
    public final static int STATE_SX = 4;// 未付款/已退款
    public enum MsgTypeOrderTypeEnum {
        fanli("返利订单"), share("分享订单"), invite("邀请订单"), found("订单找回"),elme("饿了么订单");
        fanli("返利订单"), share("分享订单"), invite("邀请订单"), found("订单找回"), elme("饿了么订单");
        private final String desc;
        private MsgTypeOrderTypeEnum(String desc) {
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOtherDetail.java
@@ -20,10 +20,18 @@
@Table("yeshi_ec_msg_other")
public class MsgOtherDetail {
    public enum MsgTypeOtherTypeEnum {
        couponMianDan("免单券"), couponWelfareMianDan("福利免单券"), freeCouponBuy("自购免单券"),
        freeCouponGive("赠送免单券"), couponReward("奖励券"), taoLiJin("推广红包"), give("赠送"), exchange("金币兑换")
        , couponActivate("免单券激活"), firstOrderReward("队员首单奖励邀请人金币"),systemGive("系统赠送");
        couponMianDan("免单券"),
        couponWelfareMianDan("福利免单券"),
        freeCouponBuy("自购免单券"),
        freeCouponGive("赠送免单券"),
        couponReward("奖励券"),
        taoLiJin("推广红包"),
        give("赠送"),
        exchange("金币兑换"),
        couponActivate("免单券激活"),
        firstOrderReward("队员首单奖励邀请人金币"),
        systemGive("系统赠送");
        private final String desc;
        private MsgTypeOtherTypeEnum(String desc) {
@@ -59,14 +67,13 @@
    // 淘礼金参数
    private MsgOtherTaoLiJinContentDTO taoLiJinContent;
    // 赠送信息
    private MsgOtherGiveContentDTO giveContent;
    // 金币兑换信息
    private MsgOtherExchangeContentDTO exchangeContent;
    public MsgOtherCouponContentDTO getCoupnContent() {
        return coupnContent;
    }
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java
@@ -21,23 +21,42 @@
    public UserMoneyDetail(Long id) {
        this.id = id;
    }
    public UserMoneyDetail() {
    }
    public enum UserMoneyDetailTypeEnum {
        share("分享奖金", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""), invite("邀请奖金", "http://img.flqapp.com/resource/money_detail/icon_invite.png", ""), inviteAndShare("奖金收入", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""), fanli("返利到账", "http://img.flqapp.com/resource/money_detail/icon_fanli.png",
                ""), fanliWeiQuan("返利扣除", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"), inviteWeiQuan("邀请奖金扣除", "http://img.flqapp.com/resource/money_detail/icon_invite.png", "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"), shareWeiQuan("分享奖金扣除", "http://img.flqapp.com/resource/money_detail/icon_share.png",
                        "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"), weiQuan("售后订单扣款", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"), systemEqualize("系统补齐", "http://img.flqapp.com/resource/money_detail/icon_system.png", ""), scoreConvert("金币兑换", "http://img.flqapp.com/resource/money_detail/icon_score.png",
                                ""), hongbao("官方红包", "http://img.flqapp.com/resource/money_detail/icon_hongbao.png", ""), hongbaoDeduct("红包退款", "http://img.flqapp.com/resource/money_detail/icon_hongbao.png",
                                        ""), buyScore("购买积分", "http://img.flqapp.com/resource/money_detail/icon_score.png", ""), extract("提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png",
                                                ""), extractVerify("提现验证", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""), extractReject("提现被拒", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),orderReward("返利奖励金","http://img.flqapp.com/resource/money_detail/icon_order_reward.png",""),repeatStatistic("重复统计返利/奖金扣除","http://img.flqapp.com/resource/money_detail/icon_fanli.png",""),
        elmeFanli("饿了么返利到账","http://img.flqapp.com/resource/money_detail/icon_fanli.png",""),
        redPackExchange("红包提现到余额", "http://img.flqapp.com/resource/money_detail/icon_score.png",""),
        extractAutoWX("自动提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
        extractAutoWXRefund("自动提现失败", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
        subsidy("额外补贴","","");
        share("分享奖金", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""),
        invite("邀请奖金", "http://img.flqapp.com/resource/money_detail/icon_invite.png", ""),
        inviteAndShare("奖金收入", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""),
        fanli("返利到账", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
        fanliWeiQuan("返利扣除",
                "http://img.flqapp.com/resource/money_detail/icon_fanli.png",
                "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"),
        inviteWeiQuan("邀请奖金扣除",
                "http://img.flqapp.com/resource/money_detail/icon_invite.png",
                "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"),
        shareWeiQuan("分享奖金扣除",
                "http://img.flqapp.com/resource/money_detail/icon_share.png",
                "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"),
        weiQuan("售后订单扣款",
                "http://img.flqapp.com/resource/money_detail/icon_fanli.png",
                "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"),
        systemEqualize("系统补齐", "http://img.flqapp.com/resource/money_detail/icon_system.png", ""),
        scoreConvert("金币兑换", "http://img.flqapp.com/resource/money_detail/icon_score.png", ""),
        hongbao("官方红包", "http://img.flqapp.com/resource/money_detail/icon_hongbao.png", ""),
        hongbaoDeduct("红包退款", "http://img.flqapp.com/resource/money_detail/icon_hongbao.png", ""),
        buyScore("购买积分", "http://img.flqapp.com/resource/money_detail/icon_score.png", ""),
        extract("提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
        extractVerify("提现验证", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
        extractReject("提现被拒", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
        orderReward("返利奖励金", "http://img.flqapp.com/resource/money_detail/icon_order_reward.png", ""),
        repeatStatistic("重复统计返利/奖金扣除", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
        elmeFanli("饿了么返利到账", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
        redPackExchange("红包提现到余额", "http://img.flqapp.com/resource/money_detail/icon_score.png", ""),
        extractAutoWX("自动提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
        extractAutoWXRefund("自动提现失败", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
        subsidy("额外补贴", "http://img.flqapp.com/resource/msg/icon_msg_subsidy.png", "");
        private final String desc;
        private final String picture;
@@ -73,10 +92,10 @@
    @Expose
    @Column(name = "umd_type")
    private UserMoneyDetailTypeEnum type;
    @Column(name = "umd_order_type")
    private Integer orderType;//和订单相关数据才处理
    private Integer orderType;// 和订单相关数据才处理
    @Expose
    @Column(name = "umd_title")
    private String title;// 标题
@@ -97,11 +116,11 @@
    private Date createTime;
    @Column(name = "umd_updatetime")
    private Date updateTime;
    private Integer state;//老版明细适用该字段
    private Integer state;// 老版明细适用该字段
    @Column(name = "umd_show")
    private Boolean show;//是否显示
    private Boolean show;// 是否显示
    public Boolean getShow() {
        return show;
@@ -214,7 +233,7 @@
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public Integer getOrderType() {
        return orderType;
    }
@@ -222,7 +241,5 @@
    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }
}
fanli/src/main/java/com/yeshi/fanli/job/MQJob.java
New file
@@ -0,0 +1,61 @@
package com.yeshi.fanli.job;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.Producer;
import com.aliyun.openservices.ons.api.SendResult;
import com.yeshi.fanli.entity.mq.MQUnSendInfo;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.mq.MQUnSendInfoService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
/**
 * 消息任务
 *
 * @author Administrator
 *
 */
@Component
public class MQJob {
    @Resource
    private MQUnSendInfoService mqUnSendInfoService;
    @Resource(name = "producer")
    private Producer producer;
    public MQJob() {
    }
    /**
     * 重新发送消息(2分钟重发一次)
     */
    @Scheduled(cron = "0 0/2 * * * ? ")
    public void retrySendMsg() {
        if (!Constant.IS_TASK)
            return;
        Long maxSendTime = System.currentTimeMillis() - 1000 * 60 * 10L;// 获取10分钟以前发送的消息
        List<MQUnSendInfo> list = mqUnSendInfoService.listByMaxSendTime(new Date(maxSendTime), 1, 50);
        if (list != null)
            for (MQUnSendInfo sendInfo : list) {
                Message msg = new Message(sendInfo.getTopic(), sendInfo.getTag(), sendInfo.getBody().getBytes());
                if (!StringUtil.isNullOrEmpty(sendInfo.getKey()))
                    msg.setKey(sendInfo.getKey());
                if (sendInfo.getDeliverTime() != null)
                    msg.setStartDeliverTime(sendInfo.getDeliverTime().getTime());
                SendResult sendResult = producer.send(msg);
                if (sendResult != null) {
                    mqUnSendInfoService.deleteByPrimaryKey(sendInfo.getId());
                    LogHelper.mqInfo("消息重发成功", sendInfo.getTopic(), sendInfo.getTag(), sendInfo.getBody());
                }
            }
    }
}
fanli/src/main/java/com/yeshi/fanli/job/TaoLiJinJob.java
@@ -138,8 +138,8 @@
     */
    @Scheduled(cron = "0 1 5 * * ? ")
    public void autoAddTLJBuyGoods2() {
        if (!Constant.IS_TASK)
            return;
        // if (!Constant.IS_TASK)
        // return;
        LogHelper.test("自购立减开始选品");
        String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd");
        // 重试3次
fanli/src/main/java/com/yeshi/fanli/log/LogHelper.java
@@ -94,6 +94,12 @@
        String error = errorMsg + "\ntopic:" + topic + "\ntag:" + tag + "\nbody:" + data;
        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;
        mqLogger.info(info);
    }
    /**
     * 登录信息
fanli/src/main/java/com/yeshi/fanli/mapping/money/InviteOrderSubsidyDebtMapper.xml
@@ -64,7 +64,7 @@
    </select>
    
    
    <select id="sumLeftMoneyByUid" resultType="java.math.BigDecimal">
    <select id="sumLeftMoneyByUid" resultType="java.math.BigDecimal" parameterType="java.lang.Long">
        select
        sum(sd_left_money)
        from yeshi_ec_invite_order_subsidy_debt where sd_uid =
fanli/src/main/java/com/yeshi/fanli/mapping/order/HongBaoOrderMapper.xml
@@ -143,8 +143,7 @@
        ON
        wo.`tmo_order_item_id`=co.`co_trade_id`
        WHERE co.`co_id`>0 AND
        wo.`tmo_id`>0
        wo.`tmo_id`>0 and wo.tmo_state!='维权失败'
    </select>
    <select id="sumWeiQuanOrderFanAmountByUid" resultType="java.math.BigDecimal">
fanli/src/main/java/com/yeshi/fanli/service/impl/money/extract/ExtractAuditRecordServiceImpl.java
@@ -1,7 +1,6 @@
package com.yeshi.fanli.service.impl.money.extract;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
fanli/src/main/java/com/yeshi/fanli/service/impl/money/extract/ExtractServiceImpl.java
@@ -172,6 +172,17 @@
        updateExtract.setId(id);
        updateExtract.setState(Extract.STATE_PROCESSING);
        extractMapper.updateByPrimaryKeySelective(updateExtract);
        //TODO 新版部署后删除
        // 改变资金记录状态
        UserMoneyDetail detail = userMoneyDetailService
                .selectByTypeAndUidAndIdentifyCode(UserMoneyDetailTypeEnum.extract, find.getUserInfo().getId(), find.getId());
        if (detail != null) {
            UserMoneyDetail update = new UserMoneyDetail(detail.getId());
            update.setShow(true);
            update.setUpdateTime(new Date());
            userMoneyDetailMapper.updateByPrimaryKeySelective(update);
        }
        transfer(find, admin); // 提现通过,支付宝转账
        return null;
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/MsgMoneyDetailServiceImpl.java
@@ -110,7 +110,7 @@
        } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.extractAutoWX) {
            if (detail.getMoney() == null || detail.getUser() == null)
                throw new MsgMoneyDetailException(2, "消息信息不全");
            MsgMoneyDetail msg = msgMoneyDetailMapper.selectBySourceIdAndMsgType(detail.getExtract().getId(),
                    MsgTypeMoneyTypeEnum.extractAutoWX);
            if (msg == null) {
@@ -135,6 +135,13 @@
            detail.setUpdateTime(new Date());
            detail.setRead(false);
            msgMoneyDetailMapper.insertSelective(detail);
        } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.subSidy) {
            if (detail.getMoney() == null || detail.getUser() == null)
                throw new MsgMoneyDetailException(2, "消息信息不全");
            detail.setCreateTime(new Date());
            detail.setUpdateTime(new Date());
            detail.setRead(false);
            msgMoneyDetailMapper.insertSelective(detail);
        }
        userMsgReadStateService.addMoneyMsgUnReadCount(detail.getUser().getId(), 1);
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/UserMoneyMsgNotificationServiceImpl.java
@@ -52,7 +52,7 @@
            e.printStackTrace();
        }
    }
    @Override
    public void extractFail(Extract extract, String stateDesc) {
        MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractFailMsg(extract, extract.getUserInfo().getId(),
@@ -297,4 +297,15 @@
        }
    }
    @Override
    public void inviteOrderSubSidy(Long uid, Date date, String from, BigDecimal money, BigDecimal balance) {
        MsgMoneyDetail detail = MsgMoneyDetailFactory.createInviteOrderSubSidyMsg(uid, date, from, money, balance,
                null);
        try {
            msgMoneyDetailService.addMsgMoneyDetail(detail);
        } catch (MsgMoneyDetailException e) {
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java
@@ -171,6 +171,7 @@
                        hasUpdate = true;
                }
            }
            /**
             * 通知用户的返利情况
             */
@@ -312,7 +313,7 @@
                        MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), fanliRate.divide(new BigDecimal(100))));
                if (mianDan)
                    hongBao.setMoney(commonOrder.getPayment());
            } else if (commonOrder.getState() == CommonOrder.STATE_JS) {
            } else if (commonOrder.getState() == CommonOrder.STATE_JS||commonOrder.getState() == CommonOrder.STATE_WQ) {
                hongBao.setState(HongBaoV2.STATE_KELINGQU);
                hongBao.setMoney(
                        MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), fanliRate.divide(new BigDecimal(100))));
@@ -542,7 +543,7 @@
                hongBao.setState(HongBaoV2.STATE_BUKELINGQU);
                hongBao.setMoney(
                        MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), fanliRate.divide(new BigDecimal(100))));
            } else if (commonOrder.getState() == CommonOrder.STATE_JS) {
            } else if (commonOrder.getState() == CommonOrder.STATE_JS||commonOrder.getState() == CommonOrder.STATE_WQ) {
                hongBao.setState(HongBaoV2.STATE_KELINGQU);
                hongBao.setMoney(
                        MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), fanliRate.divide(new BigDecimal(100))));
@@ -590,7 +591,7 @@
                    }
                    // 以实际收入为准计算预估收益
                    if (CommonOrder.STATE_JS == commonOrder.getState()) {
                    if (CommonOrder.STATE_JS == commonOrder.getState()||CommonOrder.STATE_WQ == commonOrder.getState()) {
                        childUpdate.setMoney(
                                MoneyBigDecimalUtil.mul(hongBao.getMoney(), rate.divide(new BigDecimal(100))));
                        if (commonOrder.getThirdCreateTime().getTime() > TimeUtil.convertToTimeTemp("2019-04-16",
@@ -690,7 +691,7 @@
                hongBao.setState(HongBaoV2.STATE_BUKELINGQU);
                hongBao.setMoney(
                        MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), fanliRate.divide(new BigDecimal(100))));
            } else if (commonOrder.getState() == CommonOrder.STATE_JS) {
            } else if (commonOrder.getState() == CommonOrder.STATE_JS||CommonOrder.STATE_WQ == commonOrder.getState()) {
                hongBao.setState(HongBaoV2.STATE_KELINGQU);
                hongBao.setMoney(
                        MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), fanliRate.divide(new BigDecimal(100))));
@@ -897,7 +898,7 @@
                hongBao.setState(HongBaoV2.STATE_BUKELINGQU);
                hongBao.setMoney(
                        MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), shareRate.divide(new BigDecimal(100))));
            } else if (commonOrder.getState() == CommonOrder.STATE_JS) {
            } else if (commonOrder.getState() == CommonOrder.STATE_JS||commonOrder.getState() == CommonOrder.STATE_WQ) {
                hongBao.setState(HongBaoV2.STATE_KELINGQU);
                hongBao.setMoney(
                        MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), shareRate.divide(new BigDecimal(100))));
@@ -949,7 +950,7 @@
                        child.setState(HongBaoV2.STATE_BUKELINGQU);
                        child.setMoney(MoneyBigDecimalUtil.mul(commonOrder.getEstimate(),
                                firstLevelRate.divide(new BigDecimal(100))));
                    } else if (commonOrder.getState() == CommonOrder.STATE_JS) {
                    } else if (commonOrder.getState() == CommonOrder.STATE_JS||commonOrder.getState() == CommonOrder.STATE_WQ) {
                        child.setState(HongBaoV2.STATE_KELINGQU);
                        child.setMoney(MoneyBigDecimalUtil.mul(commonOrder.geteIncome(),
                                firstLevelRate.divide(new BigDecimal(100))));
fanli/src/main/java/com/yeshi/fanli/service/impl/order/InviteOrderSubsidyServiceImpl.java
@@ -75,6 +75,9 @@
            // 修改状态
            InviteOrderSubsidy update = new InviteOrderSubsidy(old.getId());
            update.setMoney(orderSubsidy.getMoney());
            if (old.getState() == InviteOrderSubsidy.STATE_UNKNOWN) {// 状态未确定之前才可以更改原始补贴资金
                update.setOriginalMoney(orderSubsidy.getOriginalMoney());
            }
            update.setState(orderSubsidy.getState());
            update.setUpdateTime(new Date());
            inviteOrderSubsidyMapper.updateByPrimaryKeySelective(update);
@@ -147,10 +150,11 @@
                                rate = firstRate;
                            else
                                rate = secondRate;
                            BigDecimal money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(totalMoney, rate),
                            BigDecimal money = MoneyBigDecimalUtil.div(MoneyBigDecimalUtil.mul(totalMoney, rate),
                                    new BigDecimal(100));
                            InviteOrderSubsidy orderSubsidy = new InviteOrderSubsidy();
                            orderSubsidy.setMoney(money);
                            orderSubsidy.setOriginalMoney(money);
                            orderSubsidy.setUid(uid);
                            orderSubsidy.setOrderNo(orderId);
                            orderSubsidy.setSourceType(sourceType);
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderMoneySettleServiceImpl.java
@@ -422,7 +422,7 @@
    @Transactional
    @Override
    public void ziGouSettle(String orderId, int sourceType,String taskKey) throws OrderMoneySettleException {
    public void ziGouSettle(String orderId, int sourceType, String taskKey) throws OrderMoneySettleException {
        // 查询同一订单号的红包
        List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(sourceType, orderId);
        List<HongBaoV2> hongBaoList = new ArrayList<>();
@@ -466,6 +466,10 @@
            }
        }
        // if (userMoney.isEmpty()) {
        // throw new OrderMoneySettleException(1, "没有需要结算的订单");
        // }
        Iterator<Long> its = userMoney.keySet().iterator();
        while (its.hasNext()) {
@@ -486,8 +490,8 @@
            }
            userMoneyService.addUserMoney(uid, money, userMoneyDetail);
            List<Long> hbIdList=new ArrayList<>();
            List<Long> hbIdList = new ArrayList<>();
            // 添加资金明细与红包的映射关系
            for (HongBaoV2 v2 : userHongBao.get(uid)) {
                hbIdList.add(v2.getId());
@@ -498,7 +502,7 @@
                    LogHelper.errorDetailInfo(e);
                }
            }
            //添加结算映射
            // 添加结算映射
            hongBaoV2SettleTempService.addTemp(hbIdList, taskKey);
            // 站内信+推送
@@ -539,10 +543,9 @@
            } else
                throw new OrderMoneySettleException(e.getCode(), "维权处理出错:" + e.getMsg());
        }
        //添加结算映射
        // 添加结算映射
    }
    private HongBaoV2 filterWeiQuanINGHongBao(HongBaoV2 hongBao) {
@@ -961,7 +964,7 @@
            for (HongBaoV2SettleTemp temp : list) {
                Long hongBaoId = temp.getHongBaoId();
                HongBaoV2 hongBao = hongBaoV2Mapper.selectByPrimaryKey(hongBaoId);
                if (sourceType != null)
                if (hongBao != null)
                    sourceType = hongBao.getOrderType();
                if (hongBao.getParent() != null)
                    hongBao = hongBao.getParent();
@@ -1018,7 +1021,9 @@
                }
                // 添加资金
                userMoneyService.addUserMoney(uid, totalMoney, userMoneyDetail);
                // TODO 添加消息
                // 添加消息
                userMoneyMsgNotificationService.inviteOrderSubSidy(uid, new Date(), "系统自动下发", totalMoney,
                        userInfoMapper.selectAvailableByPrimaryKey(uid).getMyHongBao());
            }
        }
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
@@ -19,6 +19,7 @@
import org.yeshi.utils.NumberUtil;
import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.SendResult;
import com.aliyun.openservices.ons.api.transaction.LocalTransactionExecuter;
import com.aliyun.openservices.ons.api.transaction.TransactionProducer;
import com.aliyun.openservices.ons.api.transaction.TransactionStatus;
@@ -390,10 +391,29 @@
                return;
        }
        // 查询该订单之前是否有到账
        List<HongBaoOrder> list = hongBaoOrderMapper.listByOrderIdAndSourceType(
                hongBaoOrder.getCommonOrder().getOrderNo(), hongBaoOrder.getCommonOrder().getSourceType());
        List<Long> hongBaoIdList = new ArrayList<>();
        if (list != null) {
            for (HongBaoOrder ho : list) {
                hongBaoIdList.add(ho.getHongBaoV2().getId());
            }
        }
        List<HongBaoV2> allHongBaoList = hongBaoV2Mapper.listByIds(hongBaoIdList);
        boolean first = true;
        for (HongBaoV2 v2 : allHongBaoList)
            if (v2.getState() == HongBaoV2.STATE_YILINGQU) {
                first = false;
                break;
            }
        // 自购到账事务消息
        OrderMoneyRecievedMQMsgDTO mqMsg = new OrderMoneyRecievedMQMsgDTO(OrderMoneyRecievedMQMsgDTO.TYPE_ZIGOU,
                mainUser.getId(), hongBaoOrder.getCommonOrder().getSourceType(),
                hongBaoOrder.getCommonOrder().getOrderNo(), null, new Date());
        mqMsg.setOrderFirst(first);
        Message msg = new Message(MQTopicName.TOPIC_FANLI.name(), "actual", new Gson().toJson(mqMsg).getBytes());
        String key = mainUser.getId() + "-" + UUID.randomUUID().toString();
        msg.setKey(key);
@@ -502,6 +522,8 @@
        } catch (OrderMoneySettleException e) {
            e.printStackTrace();
        }
        if (1 > 0)
            return;
        try {
            orderMoneySettleService.inviteSettleJD(uid);
@@ -1179,7 +1201,7 @@
        Message msg = new Message(MQTopicName.TOPIC_ORDER.name(),
                String.format(MQTagConstant.TAG_ORDER_STATISTIC_PREFIX + "%s-%s", sourceType, hongBaoType),
                new Gson().toJson(mqMsg).getBytes());
        orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
        SendResult result = orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
            @Override
            public TransactionStatus execute(Message arg0, Object arg1) {
                int resultCode = 0;
@@ -1192,11 +1214,13 @@
                        e1.printStackTrace();
                    }
                }
                if (resultCode != 0)
                    return TransactionStatus.CommitTransaction;
                else
                    return TransactionStatus.RollbackTransaction;
                return TransactionStatus.CommitTransaction;
                // if (resultCode != 0)
                // return TransactionStatus.CommitTransaction;
                // else
                // return TransactionStatus.RollbackTransaction;
            }
        }, null);
        System.out.println(result);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/order/tb/TaoBaoWeiQuanOrderServiceImpl.java
@@ -12,6 +12,7 @@
import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum;
import com.yeshi.fanli.entity.order.CommonOrder;
import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
import com.yeshi.fanli.service.inter.order.CommonOrderService;
import com.yeshi.fanli.service.inter.order.msg.MsgOrderDetailService;
import com.yeshi.fanli.service.inter.order.msg.UserOrderMsgNotificationService;
import com.yeshi.fanli.service.inter.order.tb.TaoBaoWeiQuanOrderService;
@@ -27,6 +28,9 @@
    @Resource
    private MsgOrderDetailService msgOrderDetailService;
    @Resource
    private CommonOrderService commonOrderService;
    @Override
    public void addWeiQuanOrder(TaoBaoWeiQuanOrder order) {
@@ -53,6 +57,16 @@
            try {
                if (order.getState().contains("维权成功")) {
                    // 更改CommonOrder的状态
                    CommonOrder commonOrder = commonOrderService
                            .selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO, order.getOrderItemId());
                    if (commonOrder != null) {
                        CommonOrder updateCommonOrder = new CommonOrder(commonOrder.getId());
                        updateCommonOrder.setState(CommonOrder.STATE_WQ);
                        updateCommonOrder.setUpdateTime(new Date());
                        commonOrderService.updateByPrimaryKeySelective(updateCommonOrder);
                    }
                    List<MsgOrderDetail> msgList = msgOrderDetailService.listMsgOrderByOrderId(order.getOrderId());
                    for (MsgOrderDetail msg : msgList) {
                        if (msg.getType() == MsgTypeOrderTypeEnum.fanli) {
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -12,13 +12,16 @@
import org.springframework.context.annotation.Lazy;
import org.springframework.core.task.TaskExecutor;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import org.yeshi.utils.DateUtil;
import org.yeshi.utils.entity.DateInfo;
import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.SendResult;
import com.aliyun.openservices.ons.api.transaction.LocalTransactionExecuter;
import com.aliyun.openservices.ons.api.transaction.TransactionProducer;
import com.aliyun.openservices.ons.api.transaction.TransactionStatus;
@@ -160,6 +163,9 @@
    @Resource
    private TokenRecordService tokenRecordService;
    @Resource(name = "transactionManager")
    private DataSourceTransactionManager transactionManager;
    @Resource(name = "orderTransactionProducer")
    private TransactionProducer orderTransactionProducer;
@@ -880,78 +886,92 @@
            UserSystemCouponUseMQMsgDTO mqMsg = new UserSystemCouponUseMQMsgDTO(userSystemCoupon.getId(),
                    order.getOrderId(), sourceType);
            // 事务消息
            Message msg = new Message(MQTopicName.TOPIC_SYSTEM_COUPON_USE.name(),systemCoupon.getType().name(),
            Message msg = new Message(MQTopicName.TOPIC_SYSTEM_COUPON_USE.name(), systemCoupon.getType().name(),
                    new Gson().toJson(mqMsg).getBytes());
            orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
                @Override
                public TransactionStatus execute(Message arg0, Object arg1) {
                    try {
                        useRewardCouponCore(userSystemCoupon, money, hongBao, uid, order);
                        return TransactionStatus.CommitTransaction;
                    } catch (UserMoneyDetailException e) {
                        return TransactionStatus.RollbackTransaction;
            try {
                SendResult result = orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
                    @Override
                    public TransactionStatus execute(Message arg0, Object arg1) {
                        try {
                            useRewardCouponCore(userSystemCoupon, money, hongBao, uid, order);
                            return TransactionStatus.CommitTransaction;
                        } catch (Exception e) {
                            return TransactionStatus.RollbackTransaction;
                        }
                    }
                }
            }, null);
                }, null);
                System.out.println(result);
            } catch (Exception e) {
                throw new Exception();
            }
        }
    }
    @Transactional
    private void useRewardCouponCore(UserSystemCoupon userSystemCoupon, BigDecimal money, BigDecimal hongBao, Long uid,
            Order order) throws UserMoneyDetailException {
        // 1、插入红包数据
        HongBaoV2 hongBaoV2 = new HongBaoV2();
        hongBaoV2.setMoney(money);
        hongBaoV2.setType(HongBaoV2.TYPE_COUPON);
        hongBaoV2.setState(HongBaoV2.STATE_YILINGQU);
        hongBaoV2.setVersion(2);
        hongBaoV2.setCreateTime(new Date());
        hongBaoV2.setUpdateTime(new Date());
        hongBaoV2.setUserInfo(new UserInfo(uid));
        hongBaoV2.setPreGetTime(new Date());
        hongBaoV2.setGetTime(new Date());
        hongBaoV2Service.insertSelective(hongBaoV2);
        // 2.插入关联
        orderHongBaoMapService.addOrderHongBaoMap(hongBaoV2, order);
        // 3.插入资金明细,用户余额
        UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createOrderReward(order.getOrderId(),
                order.getOrderType(), money, new UserInfo(uid));
        userMoneyDetailService.addUserMoneyDetail(userMoneyDetail);
        userInfoService.addMoney(new UserInfo(uid), money);
        // 插入资金通知
        userMoneyMsgNotificationService.orderReward(uid, order.getOrderId(), order.getOrderType(), money,
                userInfoService.selectByPKey(uid).getMyHongBao());
        /* 用户券信息状态及记录处理 */
        Date date = new Date();
        // 更新券状态:已使用
        userSystemCoupon.setState(UserSystemCoupon.STATE_END_USE);
        userSystemCoupon.setUseTime(date);
        userSystemCoupon.setUpdateTime(date);
        userSystemCouponMapper.updateByPrimaryKeySelective(userSystemCoupon);
        // 插入使用券记录
        UserSystemCouponRecord couponRecord = new UserSystemCouponRecord();
        couponRecord.setState(UserSystemCouponRecord.STATE_SUCCESS);
        couponRecord.setGoodSource(order.getOrderType());
        couponRecord.setOrderNo(order.getOrderId());
        couponRecord.setUserSystemCoupon(userSystemCoupon);
        couponRecord.setCouponType(userSystemCoupon.getSystemCoupon().getType().name());
        couponRecord.setCreateTime(date);
        couponRecord.setUpdateTime(date);
        userSystemCouponRecordService.insertSelective(couponRecord);
        // 消息推送
    public void useRewardCouponCore(UserSystemCoupon userSystemCoupon, BigDecimal money, BigDecimal hongBao, Long uid,
            Order order) throws Exception {
        org.springframework.transaction.TransactionStatus transactionStatus = transactionManager
                .getTransaction(new DefaultTransactionDefinition());
        try {
            userOtherMsgNotificationService.rewardCouponUsed(userSystemCoupon, hongBao, money, order.getOrderId());
            // 1、插入红包数据
            HongBaoV2 hongBaoV2 = new HongBaoV2();
            hongBaoV2.setMoney(money);
            hongBaoV2.setType(HongBaoV2.TYPE_COUPON);
            hongBaoV2.setState(HongBaoV2.STATE_YILINGQU);
            hongBaoV2.setVersion(2);
            hongBaoV2.setCreateTime(new Date());
            hongBaoV2.setUpdateTime(new Date());
            hongBaoV2.setUserInfo(new UserInfo(uid));
            hongBaoV2.setPreGetTime(new Date());
            hongBaoV2.setGetTime(new Date());
            hongBaoV2Service.insertSelective(hongBaoV2);
            // 2.插入关联
            orderHongBaoMapService.addOrderHongBaoMap(hongBaoV2, order);
            // 3.插入资金明细,用户余额
            UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createOrderReward(order.getOrderId(),
                    order.getOrderType(), money, new UserInfo(uid));
            userMoneyDetailService.addUserMoneyDetail(userMoneyDetail);
            userInfoService.addMoney(new UserInfo(uid), money);
            /* 用户券信息状态及记录处理 */
            Date date = new Date();
            // 更新券状态:已使用
            userSystemCoupon.setState(UserSystemCoupon.STATE_END_USE);
            userSystemCoupon.setUseTime(date);
            userSystemCoupon.setUpdateTime(date);
            userSystemCouponMapper.updateByPrimaryKeySelective(userSystemCoupon);
            SystemCoupon coupon = systemCouponService.selectByPrimaryKey(userSystemCoupon.getSystemCoupon().getId());
            // 插入使用券记录
            UserSystemCouponRecord couponRecord = new UserSystemCouponRecord();
            couponRecord.setState(UserSystemCouponRecord.STATE_SUCCESS);
            couponRecord.setGoodSource(order.getOrderType());
            couponRecord.setOrderNo(order.getOrderId());
            couponRecord.setUserSystemCoupon(userSystemCoupon);
            couponRecord.setCouponType(coupon.getType().name());
            couponRecord.setCreateTime(date);
            couponRecord.setUpdateTime(date);
            userSystemCouponRecordService.insertSelective(couponRecord);
            // 插入资金通知
            userMoneyMsgNotificationService.orderReward(uid, order.getOrderId(), order.getOrderType(), money,
                    userInfoService.selectByPKey(uid).getMyHongBao());
            // 消息推送
            try {
                userOtherMsgNotificationService.rewardCouponUsed(userSystemCoupon, hongBao, money, order.getOrderId());
            } catch (Exception e) {
                LogHelper.errorDetailInfo(e);
            }
            transactionManager.commit(transactionStatus);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
            e.printStackTrace();
            transactionManager.rollback(transactionStatus);
            throw new Exception();
        }
    }
fanli/src/main/java/com/yeshi/fanli/service/inter/money/msg/UserMoneyMsgNotificationService.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.inter.money.msg;
import java.math.BigDecimal;
import java.util.Date;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
@@ -141,7 +142,7 @@
     */
    public void elmeFanli(Long uid, String orderId, BigDecimal money, BigDecimal balance);
    /*
    /**
     * 自动提现消息-微信
     * 
     * @param extractRecord
@@ -158,5 +159,16 @@
     * 红包消息
     */
    public void redPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu);
    /**
     * 补贴消息
     *
     * @param uid
     * @param date
     * @param from
     * @param money
     * @param balance
     */
    public void inviteOrderSubSidy(Long uid, Date date, String from, BigDecimal money, BigDecimal balance);
}
fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java
@@ -590,7 +590,7 @@
                StringUtil.Md5(UserMoneyDetailTypeEnum.subsidy.name() + "-" + orderType + "-" + uid + "-" + timeF));
        detail.setMoney(money);
        detail.setTitle(
                timeF + UserMoneyDetailTypeEnum.subsidy.getDesc() + "[" + Constant.getSourceName(orderType) + "]");
                timeF + UserMoneyDetailTypeEnum.subsidy.getDesc() + "【" + Constant.getSourceName(orderType) + "】");
        detail.setType(UserMoneyDetailTypeEnum.subsidy);
        detail.setDescInfo("邀请订单补贴");
        detail.setUpdateTime(new Date());
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgMoneyDetailFactory.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.util.factory.msg;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
@@ -61,15 +62,15 @@
    }
    /**
     *  自动提现
     * 自动提现
     * 
     * @param extract
     * @param uid
     * @param beiZhu
     * @return
     */
    public static MsgMoneyDetail createExtractAutoMsg(ExtractWeiXinRecord extractRecord, String stateDesc,
            String desc, String beiZhu) {
    public static MsgMoneyDetail createExtractAutoMsg(ExtractWeiXinRecord extractRecord, String stateDesc, String desc,
            String beiZhu) {
        if (extractRecord == null)
            return null;
        MsgMoneyDetail detail = new MsgMoneyDetail();
@@ -85,7 +86,6 @@
        return detail;
    }
    /**
     * 提现失败消息
     * 
@@ -346,8 +346,7 @@
        detail.setUser(new UserInfo(uid));
        return detail;
    }
    public static MsgMoneyDetail createElmeFanliMsg(Long uid, String orderId, BigDecimal money, BigDecimal balance,
            String beiZhu) {
        if (money == null || money == null || uid == null)
@@ -387,4 +386,36 @@
        return detail;
    }
    /**
     * 邀请订单补贴
     *
     * @param uid
     * @param date
     * @param from
     * @param money
     * @param balance
     * @param beiZhu
     * @return
     */
    public static MsgMoneyDetail createInviteOrderSubSidyMsg(Long uid, Date date, String from, BigDecimal money,
            BigDecimal balance, String beiZhu) {
        if (money == null || money == null || uid == null)
            return null;
        MsgMoneyDetail detail = new MsgMoneyDetail();
        detail.setBalance(balance);
        detail.setBeiZhu(beiZhu);
        detail.setCreateTime(new Date());
        detail.setMoney(money);
        detail.setMsgType(MsgTypeMoneyTypeEnum.subSidy);
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        detail.setStateDesc(String.format("%s年%s月额外补贴到账", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)));
        detail.setDesc(from);
        return detail;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -558,6 +558,33 @@
            return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
                    msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.subSidy) { // 额外补贴
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(msg.getStateDesc(), COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.getMoney()), COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("金额", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(msg.getDesc(), COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("来源", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.getBalance()), COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_subsidy.png",
                    msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackReceiveOff) { // 红包成功领取
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
@@ -641,16 +668,10 @@
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getBalance() + "", COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangeReject) { // 红包提现成功
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangeReject) { // 红包提现拒绝
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/coupon/SystemCouponMessageListener.java
New file
@@ -0,0 +1,36 @@
package com.yeshi.fanli.util.rocketmq.consumer.coupon;
import org.springframework.stereotype.Component;
import com.aliyun.openservices.ons.api.Action;
import com.aliyun.openservices.ons.api.ConsumeContext;
import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.MessageListener;
import com.google.gson.Gson;
import com.yeshi.fanli.dto.order.OrderMoneyRecievedMQMsgDTO;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.util.rocketmq.MQTopicName;
@Component
public class SystemCouponMessageListener implements MessageListener {
    @Override
    public Action consume(Message message, ConsumeContext context) {
        LogHelper.mqInfo("consumer-SystemCouponMessageListener", message.getTopic(), message.getTag(),
                new String(message.getBody()));
        if (MQTopicName.TOPIC_FANLI.name().equalsIgnoreCase(message.getTopic())) {
            OrderMoneyRecievedMQMsgDTO orderMoneyRecievedMQMsgDTO = new Gson().fromJson(new String(message.getBody()),
                    OrderMoneyRecievedMQMsgDTO.class);
            if (orderMoneyRecievedMQMsgDTO != null) {
                if (orderMoneyRecievedMQMsgDTO.getOrderFirst() != null
                        && orderMoneyRecievedMQMsgDTO.getOrderFirst() == true) {
                    // 首次到账返利
                    // TODO 业务代码添加
                    // 业务代码执行成功后返回
                    return Action.CommitMessage;
                }
            }
        }
        return Action.CommitMessage;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/InviteOrderSubsidyMessageListener.java
@@ -22,6 +22,7 @@
import com.yeshi.fanli.exception.money.OrderMoneySettleException;
import com.yeshi.fanli.exception.mq.MQUnSendInfoException;
import com.yeshi.fanli.exception.order.InviteOrderSubsidyException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.mq.MQUnSendInfoService;
import com.yeshi.fanli.service.inter.order.InviteOrderSubsidyService;
import com.yeshi.fanli.service.inter.order.OrderMoneySettleService;
@@ -59,9 +60,11 @@
    @Override
    public Action consume(Message message, ConsumeContext context) {
        if (!Constant.IS_TASK) {// 非任务服务器不能消费消息
            return Action.ReconsumeLater;
        }
        // if (!Constant.IS_TASK) {// 非任务服务器不能消费消息
        // return Action.ReconsumeLater;
        // }
        LogHelper.mqInfo("consumer:InviteOrderSubsidyMessageListener", message.getTopic(), message.getTag(),
                new String(message.getBody()));
        if (MQTopicName.TOPIC_ORDER.name().equalsIgnoreCase(message.getTopic())) {
            // 查询上级红包
@@ -148,7 +151,7 @@
        Message msg = new Message(MQTopicName.TOPIC_FANLI.name(), "delay", new Gson().toJson(dto).getBytes());
        msg.setKey(dto.getSourceType() + "_" + dto.getOrderId());
        long delayTime = System.currentTimeMillis() + 1000 * 60 * 60 * 24L * day;
        long delayTime = System.currentTimeMillis() + (Constant.IS_TEST ? 1000 * 30L : 1000 * 60 * 60 * 24L * day);
        msg.setStartDeliverTime(delayTime);
        SendResult sendResult = producer.send(msg);
        if (sendResult != null) {
fanli/src/main/resource/env-dev/constant.properties
@@ -1,3 +1,3 @@
task =false
outnetwork =false
test =false
test =true
fanli/src/main/resource/env-dev/rocket/consumer.xml
fanli/src/main/resource/env-dev/rocket/producer.xml
fanli/src/main/resource/env-dev/rocket/system-coupon-consumer.xml
New file
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    <bean id="systemCouponMessageListener"
        class="com.yeshi.fanli.util.rocketmq.consumer.coupon.SystemCouponMessageListener"></bean> <!--Listener 配置 -->
    <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
    <bean id="systemCouponConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
        init-method="start" destroy-method="shutdown">
        <property name="properties"> <!--消费者配置信息 -->
            <props>
                <prop key="AccessKey">LTAI4FwmTxVCuzTaoZtDiV8z</prop>
                <prop key="SecretKey">ixWg90QbYFKP6ae5xpAo2P1qwIyll5</prop>
                <prop key="GROUP_ID">GID_SYSTEM_COUPON</prop>
                <prop key="NAMESRV_ADDR">http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
                </prop>
                <!--将消费者线程数固定为 50 个 <prop key="ConsumeThreadNums">50</prop> -->
            </props>
        </property>
        <property name="subscriptionTable">
            <map>
                <!-- 系统券相关的消息订阅 -->
                <!-- 订阅到账 -->
                <entry value-ref="systemCouponMessageListener">
                    <key>
                        <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
                            <property name="topic" value="TOPIC_FANLI" />
                            <property name="expression" value="actual" />
                        </bean>
                    </key>
                </entry>
            </map>
        </property>
    </bean>
</beans>
fanli/src/main/resource/env-dev/rocket/transactionProducer.xml
fanli/src/main/resource/env-dev/spring.xml
copy from fanli/src/main/resource/spring.xml copy to fanli/src/main/resource/env-dev/spring.xml
File was copied from fanli/src/main/resource/spring.xml
@@ -49,9 +49,12 @@
        </property>
    </bean>
    
    <!--
    <import resource="classpath:/rocket/consumer.xml"/>
    <import resource="classpath:/rocket/system-coupon-consumer.xml"/>
    <import resource="classpath:/rocket/producer.xml"/>
    <import resource="classpath:/rocket/transactionProducer.xml"/>
     -->
    <!--异步定义推荐方式 <task:executor id="executor" pool-size="15" /> <task:scheduler 
        id="scheduler" pool-size="30" /> <task:annotation-driven executor="executor" 
fanli/src/main/resource/env-pro-by/rocket/consumer.xml
copy from fanli/src/main/resource/rocket/consumer.xml copy to fanli/src/main/resource/env-pro-by/rocket/consumer.xml
fanli/src/main/resource/env-pro-by/rocket/producer.xml
copy from fanli/src/main/resource/rocket/producer.xml copy to fanli/src/main/resource/env-pro-by/rocket/producer.xml
fanli/src/main/resource/env-pro-by/rocket/system-coupon-consumer.xml
New file
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    <bean id="systemCouponMessageListener"
        class="com.yeshi.fanli.util.rocketmq.consumer.coupon.SystemCouponMessageListener"></bean> <!--Listener 配置 -->
    <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
    <bean id="systemCouponConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
        init-method="start" destroy-method="shutdown">
        <property name="properties"> <!--消费者配置信息 -->
            <props>
                <prop key="AccessKey">LTAI4FwmTxVCuzTaoZtDiV8z</prop>
                <prop key="SecretKey">ixWg90QbYFKP6ae5xpAo2P1qwIyll5</prop>
                <prop key="GROUP_ID">GID_SYSTEM_COUPON</prop>
                <prop key="NAMESRV_ADDR">http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
                </prop>
                <!--将消费者线程数固定为 50 个 <prop key="ConsumeThreadNums">50</prop> -->
            </props>
        </property>
        <property name="subscriptionTable">
            <map>
                <!-- 系统券相关的消息订阅 -->
                <!-- 订阅到账 -->
                <entry value-ref="systemCouponMessageListener">
                    <key>
                        <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
                            <property name="topic" value="TOPIC_FANLI" />
                            <property name="expression" value="actual" />
                        </bean>
                    </key>
                </entry>
            </map>
        </property>
    </bean>
</beans>
fanli/src/main/resource/env-pro-by/rocket/transactionProducer.xml
copy from fanli/src/main/resource/rocket/transactionProducer.xml copy to fanli/src/main/resource/env-pro-by/rocket/transactionProducer.xml
fanli/src/main/resource/env-pro-by/spring.xml
File was renamed from fanli/src/main/resource/spring.xml
@@ -48,8 +48,10 @@
            </array>
        </property>
    </bean>
    <!--
    <import resource="classpath:/rocket/consumer.xml"/>
    <import resource="classpath:/rocket/system-coupon-consumer.xml"/>
     -->
    <import resource="classpath:/rocket/producer.xml"/>
    <import resource="classpath:/rocket/transactionProducer.xml"/>
fanli/src/main/resource/env-pro-job/rocket/consumer.xml
copy from fanli/src/main/resource/rocket/consumer.xml copy to fanli/src/main/resource/env-pro-job/rocket/consumer.xml
fanli/src/main/resource/env-pro-job/rocket/producer.xml
copy from fanli/src/main/resource/rocket/producer.xml copy to fanli/src/main/resource/env-pro-job/rocket/producer.xml
fanli/src/main/resource/env-pro-job/rocket/system-coupon-consumer.xml
New file
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    <bean id="systemCouponMessageListener"
        class="com.yeshi.fanli.util.rocketmq.consumer.coupon.SystemCouponMessageListener"></bean> <!--Listener 配置 -->
    <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
    <bean id="systemCouponConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
        init-method="start" destroy-method="shutdown">
        <property name="properties"> <!--消费者配置信息 -->
            <props>
                <prop key="AccessKey">LTAI4FwmTxVCuzTaoZtDiV8z</prop>
                <prop key="SecretKey">ixWg90QbYFKP6ae5xpAo2P1qwIyll5</prop>
                <prop key="GROUP_ID">GID_SYSTEM_COUPON</prop>
                <prop key="NAMESRV_ADDR">http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
                </prop>
                <!--将消费者线程数固定为 50 个 <prop key="ConsumeThreadNums">50</prop> -->
            </props>
        </property>
        <property name="subscriptionTable">
            <map>
                <!-- 系统券相关的消息订阅 -->
                <!-- 订阅到账 -->
                <entry value-ref="systemCouponMessageListener">
                    <key>
                        <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
                            <property name="topic" value="TOPIC_FANLI" />
                            <property name="expression" value="actual" />
                        </bean>
                    </key>
                </entry>
            </map>
        </property>
    </bean>
</beans>
fanli/src/main/resource/env-pro-job/rocket/transactionProducer.xml
copy from fanli/src/main/resource/rocket/transactionProducer.xml copy to fanli/src/main/resource/env-pro-job/rocket/transactionProducer.xml
fanli/src/main/resource/env-pro-job/spring.xml
copy from fanli/src/main/resource/spring.xml copy to fanli/src/main/resource/env-pro-job/spring.xml
File was copied from fanli/src/main/resource/spring.xml
@@ -50,6 +50,7 @@
    </bean>
    
    <import resource="classpath:/rocket/consumer.xml"/>
    <import resource="classpath:/rocket/system-coupon-consumer.xml"/>
    <import resource="classpath:/rocket/producer.xml"/>
    <import resource="classpath:/rocket/transactionProducer.xml"/>
fanli/src/main/resource/env-pro/rocket/consumer.xml
copy from fanli/src/main/resource/rocket/consumer.xml copy to fanli/src/main/resource/env-pro/rocket/consumer.xml
fanli/src/main/resource/env-pro/rocket/producer.xml
copy from fanli/src/main/resource/rocket/producer.xml copy to fanli/src/main/resource/env-pro/rocket/producer.xml
fanli/src/main/resource/env-pro/rocket/system-coupon-consumer.xml
New file
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    <bean id="systemCouponMessageListener"
        class="com.yeshi.fanli.util.rocketmq.consumer.coupon.SystemCouponMessageListener"></bean> <!--Listener 配置 -->
    <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
    <bean id="systemCouponConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
        init-method="start" destroy-method="shutdown">
        <property name="properties"> <!--消费者配置信息 -->
            <props>
                <prop key="AccessKey">LTAI4FwmTxVCuzTaoZtDiV8z</prop>
                <prop key="SecretKey">ixWg90QbYFKP6ae5xpAo2P1qwIyll5</prop>
                <prop key="GROUP_ID">GID_SYSTEM_COUPON</prop>
                <prop key="NAMESRV_ADDR">http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
                </prop>
                <!--将消费者线程数固定为 50 个 <prop key="ConsumeThreadNums">50</prop> -->
            </props>
        </property>
        <property name="subscriptionTable">
            <map>
                <!-- 系统券相关的消息订阅 -->
                <!-- 订阅到账 -->
                <entry value-ref="systemCouponMessageListener">
                    <key>
                        <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
                            <property name="topic" value="TOPIC_FANLI" />
                            <property name="expression" value="actual" />
                        </bean>
                    </key>
                </entry>
            </map>
        </property>
    </bean>
</beans>
fanli/src/main/resource/env-pro/rocket/transactionProducer.xml
copy from fanli/src/main/resource/rocket/transactionProducer.xml copy to fanli/src/main/resource/env-pro/rocket/transactionProducer.xml
fanli/src/main/resource/env-pro/spring.xml
copy from fanli/src/main/resource/spring.xml copy to fanli/src/main/resource/env-pro/spring.xml
File was copied from fanli/src/main/resource/spring.xml
@@ -48,8 +48,10 @@
            </array>
        </property>
    </bean>
    <!--
    <import resource="classpath:/rocket/consumer.xml"/>
    <import resource="classpath:/rocket/system-coupon-consumer.xml"/>
     -->
    <import resource="classpath:/rocket/producer.xml"/>
    <import resource="classpath:/rocket/transactionProducer.xml"/>
fanli/src/test/java/org/fanli/MyBatisProduce.java
@@ -4,23 +4,21 @@
import org.yeshi.utils.mybatis.ColumnParseUtil;
import org.yeshi.utils.mybatis.MyBatisMapperUtil;
import com.yeshi.fanli.entity.elme.ElmeHongBaoOrderMap;
import com.yeshi.fanli.entity.elme.ElmeOrder;
import com.yeshi.fanli.entity.push.DeviceActive;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.order.HongBaoV2SettleTemp;
//@Ignore
public class MyBatisProduce {
    @Test
    public void test3() {
        MyBatisMapperUtil.createMapper(ElmeOrder.class);
        MyBatisMapperUtil.createMapper(ElmeHongBaoOrderMap.class);
        MyBatisMapperUtil.createMapper(HongBaoV2SettleTemp.class);
    }
    @Test
    public void test1() {
        ColumnParseUtil.parseColumn(DeviceActive.class,
                "D:\\workspace\\fanli\\fanli-server\\fanli\\src\\main\\java\\com\\yeshi\\fanli\\mapping\\push\\DeviceActiveMapper.xml");
        ColumnParseUtil.parseColumn(HongBaoV2.class,
                "D:\\workspace\\fanli\\fanli-server\\fanli\\src\\main\\java\\com\\yeshi\\fanli\\mapping\\hongbao\\HongBaoV2Mapper.xml");
    }
}
fanli/src/test/java/org/fanli/TaoKeTest.java
@@ -49,26 +49,18 @@
    @Test
    public void test1() {
        System.out.println(TaoBaoUtil.filterTaoToken("¥RuPdYM9Knxe¥"));
        String url = TaoKeApiUtil.officialActivityConvert("19507100253", "1539329391766", "20211660");
        System.out.println(TaoBaoUtil.filterTaoToken(TaoKeApiUtil.getTKToken(
                "http://ec-1255749512.file.myqcloud.com/img/FloatAD/a43fdefe735c41f4955a261d43870ff8.png", "淘口令",
                url)));
    }
    @Test
    public void test2() {
        TaoBaoGoodsBrief goods = null;
        try {
            goods = TaoKeApiUtil.searchGoodsDetail(601535036423L);
            // goods = TaoKeApiUtil.searchGoodsDetail(601535036423L, new
            // TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
            // TaoBaoConstant.TAOBAO_AUTH_APPSECRET,
            // TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT));
        } catch (TaobaoGoodsDownException e2) {
            e2.printStackTrace();
        }
        System.out.println(goods);
        // goods = TaoKeApiUtil.searchGoodsDetail(auctionId);
        String link = TaoKeApiUtil.officialActivityConvert("87140050199", "1571120794546", "20211660");
        System.out.println(TaoKeApiUtil.getTKToken("http://","母婴预售",link));
        //https://s.click.taobao.com/t?e=m%3D2%26s%3DW%2Fys7R71JXMcQipKwQzePCperVdZeJviyK8Cckff7TVRAdhuF14FMXC%2FEJQELlNo5x%2BIUlGKNpVpS9y0ojX%2FfMsvmRQfeMsreH9%2FasRClvq63GoCXmcqkTiRUN2xVR4GdesO8XD8dsNdITvXwTxvKDqJgCOacH%2BU%2FVJqtNeEg5OOvkjnk315zzvflh4%2Fhqj8BmyXDtEFdgwjGkouqJtJeds5wF0j1Yhhp1953%2FcnpLUV6UUID4c8TeTEWJdP8jmRdTEuB5K8MGvkLv1nNhnYz%2FB0z8qlrv%2Bjr%2B%2FiM5RbEEle7auY0HPYWszlTEcWhO9mli2vZjCuAmyG1kYtrC7hgcEnE%2FQxigjMfFc2hYciEyAdpuz3kb9JWJVVX36lFeRKtwLUkdbL0syg%2BG8%2FlCRQJ1YlOPkYHNIul3paqKYwK75NNUki5Nwcg2GYz3Bez8Z8OusR9%2BDFlSU%2BcenL13XDY2hrrfx7OMbmkUtLKDKbz1CCoC2zoKs%2FmnEqY%2Bakgpmw&pvid=24980167&union_lens=lensId:0b013a8d_0cec_16df214d979_38a1
    }
    @Test