添加耗材
This commit is contained in:
@@ -114,4 +114,22 @@ public class RabbitConfig {
|
||||
public Binding bindingcons_Register() {
|
||||
return BindingBuilder.bind(queuePrint_Register()).to(printExchange_Register()).with(RabbitConstants.CONS_COLLECT_ROUTINGKEY_PUT);
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public DirectExchange cons_msg_Exchange_Register() {
|
||||
return new DirectExchange(RabbitConstants.CONS_MSG_COLLECT_PUT);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue queuecons_msg_Register() {
|
||||
return new Queue(RabbitConstants.CONS_MSG_COLLECT_QUEUE_PUT, true); //队列持久
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingcons_msg_Register() {
|
||||
return BindingBuilder.bind(queuePrint_Register()).to(printExchange_Register()).with(RabbitConstants.CONS_MSG_COLLECT_ROUTINGKEY_PUT);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -49,4 +49,14 @@ public interface RabbitConstants {
|
||||
|
||||
|
||||
public static final String CONS_COLLECT_ROUTINGKEY_PUT = "cons_collect_routingkey_put";
|
||||
|
||||
|
||||
public static final String CONS_MSG_COLLECT_PUT="cons_msg_collect_put";
|
||||
|
||||
public static final String CONS_MSG_COLLECT_QUEUE_PUT = "cons_msg_collect_queue_put";
|
||||
|
||||
|
||||
public static final String CONS_MSG_COLLECT_ROUTINGKEY_PUT = "cons_msg_collect_routingkey_put";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -51,7 +51,10 @@ public class RabbitProducer implements RabbitTemplate.ConfirmCallback {
|
||||
rabbitTemplate.convertAndSend(RabbitConstants.CONS_COLLECT_PUT, RabbitConstants.CONS_COLLECT_ROUTINGKEY_PUT, content, correlationId);
|
||||
}
|
||||
|
||||
|
||||
public void con_msg(String content){
|
||||
CorrelationData correlationId = new CorrelationData(UUID.randomUUID().toString());
|
||||
rabbitTemplate.convertAndSend(RabbitConstants.CONS_MSG_COLLECT_PUT, RabbitConstants.CONS_MSG_COLLECT_ROUTINGKEY_PUT, content, correlationId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
|
||||
|
||||
@@ -117,6 +117,16 @@ public class CartService {
|
||||
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = productSkuMapper.selectByPrimaryKey(Integer.valueOf(skuId));
|
||||
|
||||
|
||||
|
||||
|
||||
JSONObject objectMsg=new JSONObject();
|
||||
objectMsg.put("skuId",tbProductSkuWithBLOBs.getId());
|
||||
objectMsg.put("shopId",Integer.valueOf(shopId));
|
||||
|
||||
|
||||
producer.con_msg(objectMsg.toString());
|
||||
|
||||
|
||||
if (Integer.valueOf(tbProduct.getIsPauseSale()).equals(1)) {
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
jsonObject1.put("status", "fail");
|
||||
|
||||
Reference in New Issue
Block a user