添加会员余额变动通知
This commit is contained in:
@@ -62,4 +62,10 @@ public interface RabbitConstants {
|
|||||||
// 库存记录交换机
|
// 库存记录交换机
|
||||||
String EXCHANGE_STOCK_RECORD = "exchange.stock.record";
|
String EXCHANGE_STOCK_RECORD = "exchange.stock.record";
|
||||||
String ROUTING_STOCK_RECORD_SALE = "routing.stock.record.sale";
|
String ROUTING_STOCK_RECORD_SALE = "routing.stock.record.sale";
|
||||||
|
|
||||||
|
|
||||||
|
public static final String BALANCE_PUT="balance_put";
|
||||||
|
public static final String BALANCE_QUEUE_PUT="balance_queue_put";
|
||||||
|
|
||||||
|
public static final String BALANCE_ROUTINGKEY_PUT="balance_routingkey_put";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,15 @@ public class RabbitProducer implements RabbitTemplate.ConfirmCallback {
|
|||||||
rabbitTemplate.convertAndSend(RabbitConstants.CONS_MSG_COLLECT_PUT, RabbitConstants.CONS_MSG_COLLECT_ROUTINGKEY_PUT, content, correlationId);
|
rabbitTemplate.convertAndSend(RabbitConstants.CONS_MSG_COLLECT_PUT, RabbitConstants.CONS_MSG_COLLECT_ROUTINGKEY_PUT, content, correlationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void balance(String content){
|
||||||
|
CorrelationData correlationId = new CorrelationData(UUID.randomUUID().toString());
|
||||||
|
rabbitTemplate.convertAndSend(RabbitConstants.BALANCE_PUT, RabbitConstants.BALANCE_ROUTINGKEY_PUT, content, correlationId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
|
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
|
||||||
logger.info(" 回调id:" + correlationData);
|
logger.info(" 回调id:" + correlationData);
|
||||||
|
|||||||
@@ -420,6 +420,22 @@ public class PayService {
|
|||||||
data.put("orderId", orderInfo.getId());
|
data.put("orderId", orderInfo.getId());
|
||||||
data.put("plat", "miniApp");
|
data.put("plat", "miniApp");
|
||||||
mQUtils.sendStockSaleMsg(data);
|
mQUtils.sendStockSaleMsg(data);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject baObj=new JSONObject();
|
||||||
|
baObj.put("userId",userInfo.getId());
|
||||||
|
baObj.put("shopId",user.getShopId());
|
||||||
|
baObj.put("amount",orderInfo.getOrderAmount());
|
||||||
|
baObj.put("balance",user.getAmount());
|
||||||
|
baObj.put("type","消费");
|
||||||
|
baObj.put("time",flow.getCreateTime());
|
||||||
|
producer.balance(baObj.toString());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return Result.success(CodeEnum.SUCCESS, "1");
|
return Result.success(CodeEnum.SUCCESS, "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1193,6 +1209,18 @@ public class PayService {
|
|||||||
jsonObject.put("type", "wxMemberIn");
|
jsonObject.put("type", "wxMemberIn");
|
||||||
jsonObject.put("amount", memberIn.getAmount());
|
jsonObject.put("amount", memberIn.getAmount());
|
||||||
producer.putOrderCollect(jsonObject.toJSONString());
|
producer.putOrderCollect(jsonObject.toJSONString());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject baObj=new JSONObject();
|
||||||
|
baObj.put("userId", tbShopUser.getUserId());
|
||||||
|
baObj.put("shopId",tbShopUser.getShopId());
|
||||||
|
baObj.put("amount",memberIn.getAmount());
|
||||||
|
baObj.put("balance",tbShopUser.getAmount());
|
||||||
|
baObj.put("type","充值");
|
||||||
|
baObj.put("time",flow.getCreateTime());
|
||||||
|
producer.balance(baObj.toString());
|
||||||
|
|
||||||
return "SUCCESS";
|
return "SUCCESS";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user