| | |
| | | }
|
| | | }
|
| | | title = title.replace("【邀请码】", inviteCode);
|
| | | title = title.replace("【邀请链接】", UserUtil.getInviteShortLink(uid));
|
| | | title = title.replace("【邀请链接】", Constant.YINGYONGBAO_LINK);
|
| | | data.put("title", title);
|
| | |
|
| | | } else { // 有图分享
|
| | |
| | | *
|
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | |
|
| | | public enum FrequencyEnum {
|
| | | everyday("每天"), onlyOne("只有一次");
|
| | | private final String desc;
|
| | |
| | | return desc;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | public enum TaskUniqueKeyEnum {
|
| | | dailySign1("第1天签到"), dailySign2("第2天签到"),dailySign3("第3天签到"),dailySign4("第4天签到"), dailySign5("第5天签到"),
|
| | | dailySign6("第6天签到"), dailySign7("第7天签到"), recommendSearch("完成搜索"), taoLiJinBuy("点击立减"),
|
| | | inviteLevelOne("直接邀请"),inviteLevelTwo("间接邀请"), buyReduce("自购立减"), shareSingleGoods("分享单个商品"), |
| | | shareMultipleGoods("分享多个商品"), shareInvite("邀请素材"), shareTLJGoods("爆款商品") , |
| | | giveRebateCoupon("返利奖励券"), giveFreeCoupon("赠送免单券"),giveTaoLiJin("赠送推广红包"),inShop("浏览店铺"),
|
| | | inShopLevelOne("一级队员浏览店铺"),inShopLevelTwo("二级队员浏览店铺"),scanPush("浏览推荐记录"),scanGoods("浏览商品详情页"),
|
| | | scanSearchResult("浏览搜索结果页"),scanHomeBanner("浏览横幅专题"),scanSpecial("浏览首页专题"),scanTBCart("浏览购物车页"),
|
| | | closeRecommendGoods("关闭推荐商品"),couponRebate("点击领券返利"),couponRebateLevelOne("浏览购物车页"),couponRebateLevelTwo("浏览购物车页"),
|
| | | rebateOrder("完成返利订单"),inviteOrderLevelOne("一级队员邀请订单"),inviteOrderLevelTwo("二级队员邀请订单"),shareOrder("分享订单"),
|
| | | bindWeiXin("微信授权"),bindPhone("绑定手机"),bindTaoBao("淘宝授权"), setWeiXinNum("添加微信号"),setGender("首次设置性别"),
|
| | | setPortrait("首次修改头像"), setNickName("修改昵称"),bindAlipay("绑定支付宝"),inviteActivate("激活邀请");
|
| | | |
| | | dailySign1("第1天签到"),
|
| | | dailySign2("第2天签到"),
|
| | | dailySign3("第3天签到"),
|
| | | dailySign4("第4天签到"),
|
| | | dailySign5("第5天签到"),
|
| | | dailySign6("第6天签到"),
|
| | | dailySign7("第7天签到"),
|
| | | recommendSearch("完成搜索"),
|
| | | taoLiJinBuy("点击立减"),
|
| | | inviteLevelOne("直接邀请"),
|
| | | inviteLevelTwo("间接邀请"),
|
| | | buyReduce("自购立减"),
|
| | | shareSingleGoods("分享单个商品"),
|
| | | shareMultipleGoods("分享多个商品"),
|
| | | shareInvite("邀请素材"),
|
| | | shareTLJGoods("爆款商品"),
|
| | | giveRebateCoupon("返利奖励券"),
|
| | | giveFreeCoupon("赠送免单券"),
|
| | | giveTaoLiJin("赠送推广红包"),
|
| | | inShop("浏览店铺"),
|
| | | inShopLevelOne("一级队员浏览店铺"),
|
| | | inShopLevelTwo("二级队员浏览店铺"),
|
| | | scanPush("浏览推荐记录"),
|
| | | scanGoods("浏览商品详情页"),
|
| | | scanSearchResult("浏览搜索结果页"),
|
| | | scanHomeBanner("浏览横幅专题"),
|
| | | scanSpecial("浏览首页专题"),
|
| | | scanTBCart("浏览购物车页"),
|
| | | closeRecommendGoods("关闭推荐商品"),
|
| | | couponRebate("点击领券返利"),
|
| | | couponRebateLevelOne("浏览购物车页"),
|
| | | couponRebateLevelTwo("浏览购物车页"),
|
| | | rebateOrder("完成返利订单"),
|
| | | inviteOrderLevelOne("一级队员邀请订单"),
|
| | | inviteOrderLevelTwo("二级队员邀请订单"),
|
| | | shareOrder("分享订单"),
|
| | | bindWeiXin("微信授权"),
|
| | | bindPhone("绑定手机"),
|
| | | bindTaoBao("淘宝授权"),
|
| | | setWeiXinNum("添加微信号"),
|
| | | setGender("首次设置性别"),
|
| | | setPortrait("首次修改头像"),
|
| | | setNickName("修改昵称"),
|
| | | bindAlipay("绑定支付宝"),
|
| | | inviteActivate("激活邀请");
|
| | |
|
| | | private final String desc;
|
| | |
|
| | | private TaskUniqueKeyEnum(String desc) {
|
| | |
| | | return desc;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Column(name = "it_id")
|
| | | private Long id;
|
| | |
|
| | | @Column(name = "it_cid")
|
| | | private IntegralTaskClass taskClass ; |
| | | |
| | | private IntegralTaskClass taskClass;
|
| | |
|
| | | @Column(name = "it_name")
|
| | | private String name;// 名称
|
| | |
|
| | |
| | |
|
| | | @Column(name = "it_frequency")
|
| | | private FrequencyEnum frequency; // 频率
|
| | | |
| | |
|
| | | @Column(name = "it_gold_coin")
|
| | | private Integer goldCoin; // 基础金币
|
| | |
|
| | | @Column(name = "it_upper_limit")
|
| | | private Integer upperLimit; // 限制
|
| | | |
| | | private Integer upperLimit; // 限制
|
| | |
|
| | | @Column(name = "it_double_num")
|
| | | private Integer doubleNum; // 加倍数量
|
| | | |
| | |
|
| | | @Column(name = "it_state")
|
| | | private Integer state; // 状态: 1启用 0停用
|
| | | |
| | |
|
| | | @Column(name = "it_create_time")
|
| | | private Date createTime;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | 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;
|
| | | String info = extraInfo+"\nmsgId:"+msgId + "\ntopic:" + topic + "\ntag:" + tag + "\nbody:" + data;
|
| | | mqLogger.info(info);
|
| | | }
|
| | |
|
| | |
| | | } else if (hongBao.getState() == HongBaoV2.STATE_BUKELINGQU) {
|
| | | firstHongbao.setMoney(
|
| | | MoneyBigDecimalUtil.mul(hongBao.getMoney(), firstRate.divide(new BigDecimal(100))));
|
| | | }else if(hongBao.getState() == HongBaoV2.STATE_SHIXIAO)
|
| | | {
|
| | | firstHongbao.setMoney(new BigDecimal(0));
|
| | | }
|
| | | hongBaoV2Mapper.insertSelective(firstHongbao);
|
| | | // 用户通知
|
| | |
| | | import com.yeshi.fanli.dto.mq.user.body.UserSystemCouponUseMQMsg;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | @Component
|
New file |
| | |
| | | package com.yeshi.fanli.util.rocketmq.consumer.integral;
|
| | |
|
| | | 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.mq.order.OrderTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.order.body.OrderMoneyRecievedMQMsg;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | /**
|
| | | * 金币消息监听
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Component
|
| | | public class IntegralMessageListener implements MessageListener {
|
| | | public IntegralMessageListener() {
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | |
|
| | | LogHelper.mqInfo("consumer:IntegralMessageListener", message.getMsgID(), message.getTopic(), message.getTag(),
|
| | | new String(message.getBody()));
|
| | | String tag = message.getTag();
|
| | |
|
| | | if (MQTopicName.TOPIC_ORDER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | if (OrderTopicTagEnum.orderFanLiActual.name().equalsIgnoreCase(tag)) {// 实时到账
|
| | | OrderMoneyRecievedMQMsg msg = new Gson().fromJson(new String(message.getBody()),
|
| | | OrderMoneyRecievedMQMsg.class);
|
| | | if (msg != null && msg.getType() == OrderMoneyRecievedMQMsg.TYPE_ZIGOU) {// 自购到账
|
| | | // 得金币
|
| | | } else if (msg != null && msg.getType() == OrderMoneyRecievedMQMsg.TYPE_SHARE) {// 分享订单
|
| | |
|
| | | } else if (msg != null && msg.getType() == OrderMoneyRecievedMQMsg.TYPE_INVITE) {// 邀请订单
|
| | |
|
| | | }
|
| | | return Action.CommitMessage;
|
| | | }
|
| | | }
|
| | | return Action.CommitMessage;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | rocketmq.AccessKey=LTAI4FwmTxVCuzTaoZtDiV8z |
| | | rocketmq.SecretKey=ixWg90QbYFKP6ae5xpAo2P1qwIyll5 |
| | | rocketmq.NAMESRV_ADDR=http://MQ_INST_1205444665315884_Bbkj89nI.mq-internet-access.mq-internet.aliyuncs.com:80 |
| | | #测试 http://MQ_INST_1205444665315884_Bbkj89nI.mq-internet-access.mq-internet.aliyuncs.com:80 |
| | | #正式 http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80 |
| | | rocketmq.NAMESRV_ADDR=http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80 |
| | | |
| | | |
| | |
| | | </map>
|
| | | </property>
|
| | | </bean>
|
| | |
|
| | |
|
| | | <!-- 金币消息订阅 -->
|
| | | <bean id="integralMessageListener"
|
| | | class="com.yeshi.fanli.util.rocketmq.consumer.integral.IntegralMessageListener"></bean>
|
| | | <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
|
| | | <bean id="integralConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--消费者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">${rocketmq.AccessKey}</prop>
|
| | | <prop key="SecretKey">${rocketmq.SecretKey}</prop>
|
| | | <prop key="GROUP_ID">GID_INTEGRAL</prop>
|
| | | <prop key="NAMESRV_ADDR">${rocketmq.NAMESRV_ADDR}</prop>
|
| | | <prop key="ConsumeThreadNums">50</prop>
|
| | | </props>
|
| | | </property>
|
| | | <property name="subscriptionTable">
|
| | | <map>
|
| | | <!-- 产生订单,订单到账 -->
|
| | | <entry value-ref="integralMessageListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_ORDER" />
|
| | | <property name="expression" value="orderFanLiActual" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | | </map>
|
| | | </property>
|
| | | </bean>
|
| | |
|
| | |
|
| | |
|
| | | </beans> |