| | |
| | | import com.yeshi.fanli.dto.mq.BaseMQMsgBody;
|
| | | import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.order.body.OrderMoneyRecievedMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | 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
|
| | |
| | | message.getTag(), new String(message.getBody()));
|
| | | String tag = message.getTag();
|
| | | BaseMQMsgBody baseBody = new Gson().fromJson(new String(message.getBody()), BaseMQMsgBody.class);
|
| | | if (baseBody.isTest() != Constant.IS_TEST)
|
| | | return Action.ReconsumeLater;
|
| | |
|
| | | if (MQTopicName.TOPIC_ORDER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | if (tag.equalsIgnoreCase(OrderTopicTagEnum.orderFanLiActual.name()))// 实时到账
|
| | |
| | | if (orderMoneyRecievedMQMsgDTO.getOrderFirst() != null
|
| | | && orderMoneyRecievedMQMsgDTO.getOrderFirst() == true) {
|
| | | // 首次到账返利
|
| | | // TODO 业务代码添加
|
| | |
|
| | | |
| | | // 激活免单券
|
| | | userSystemCouponService.triggerFreeCouponActivate(orderMoneyRecievedMQMsgDTO.getUid());
|
| | | userSystemCouponService.triggerFreeCouponActivate(orderMoneyRecievedMQMsgDTO.getUid(),
|
| | | orderMoneyRecievedMQMsgDTO.getOrderId(), orderMoneyRecievedMQMsgDTO.getSourceType());
|
| | |
|
| | | // 业务代码执行成功后返回
|
| | | return Action.CommitMessage;
|
| | | }
|
| | | }
|
| | | }
|
| | | } else if (MQTopicName.TOPIC_USER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | if (UserTopicTagEnum.systemCouponDrawback.name().equalsIgnoreCase(tag)) {// 券退回
|
| | | UserSystemCouponUseMQMsg userSystemCouponUseMQMsg = new Gson().fromJson(new String(message.getBody()),
|
| | | UserSystemCouponUseMQMsg.class);
|
| | | //处理券退回
|
| | | userSystemCouponService.sendBackByGiveId(userSystemCouponUseMQMsg.getUserSystemCouponId());
|
| | | |
| | | // 业务代码执行成功后返回
|
| | | return Action.CommitMessage;
|
| | | }
|
| | | }
|
| | | return Action.CommitMessage;
|
| | | }
|