Commit 99f76038 authored by jiaorz's avatar jiaorz

添加积分消息队列接口

parent d50a1cf1
...@@ -142,19 +142,21 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> { ...@@ -142,19 +142,21 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
if(num>0){ if(num>0){
//支付成功,添加积分 //支付成功,添加积分
OrderPay pay= list.get(0); OrderPay pay= list.get(0);
if(pay.getStatus() == 1) { OrderPay newValue = mapper.selectOneByExample(orderPay);
log.info("支付回调信息:newValue = {}", newValue);
if(newValue.getStatus() == 1) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("userId", pay.getUserId()); jsonObject.put("userId", newValue.getUserId());
jsonObject.put("amount", pay.getAmount()); jsonObject.put("amount", newValue.getAmount());
jsonObject.put("channelId", pay.getOrderNo()); jsonObject.put("channelId", newValue.getOrderNo());
if(pay.getChannel() == 1) {//租车 if(newValue.getChannel() == 1) {//租车
jsonObject.put("integralRuleCode", "RENTRV"); jsonObject.put("integralRuleCode", "RENTRV");
} else if(pay.getChannel() == 2) { //旅游 } else if(newValue.getChannel() == 2) { //旅游
jsonObject.put("integralRuleCode", "BUYROUT"); jsonObject.put("integralRuleCode", "BUYROUT");
} else if(pay.getChannel() == 3) { //会员 } else if(newValue.getChannel() == 3) { //会员
jsonObject.put("integralRuleCode", "BUYMEMBER"); jsonObject.put("integralRuleCode", "BUYMEMBER");
} }
log.info("支付订单号:orderNo = {}, orderType = {}", pay.getOrderNo(), pay.getChannel()); log.info("支付订单号:orderNo = {}, orderType = {}", newValue.getOrderNo(), newValue.getChannel());
log.info("支付成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}", MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString()); log.info("支付成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}", MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
mqServiceBiZ.sendMessage(MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString()); mqServiceBiZ.sendMessage(MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment