|
@@ -1,5 +1,6 @@
|
|
package com.hcloud.microserver.h5.config.mq.listener;
|
|
package com.hcloud.microserver.h5.config.mq.listener;
|
|
|
|
|
|
|
|
+import com.hcloud.microserver.h5.facade.carbon.entity.GoodsOrderInfo;
|
|
import com.hcloud.microserver.h5.facade.carbon.forms.GoodsOrderInfoForm;
|
|
import com.hcloud.microserver.h5.facade.carbon.forms.GoodsOrderInfoForm;
|
|
import com.hcloud.microserver.h5.config.mq.MQConstant;
|
|
import com.hcloud.microserver.h5.config.mq.MQConstant;
|
|
import com.hcloud.microserver.h5.service.OrderDetailInfoService;
|
|
import com.hcloud.microserver.h5.service.OrderDetailInfoService;
|
|
@@ -8,6 +9,7 @@ import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
//监听hello队列,有消息时进行消费
|
|
//监听hello队列,有消息时进行消费
|
|
@Component
|
|
@Component
|
|
@@ -26,12 +28,13 @@ public class ReceiverMessage {
|
|
String[] split = content.split("-");
|
|
String[] split = content.split("-");
|
|
if(split.length>1){
|
|
if(split.length>1){
|
|
String orderId = split[1];
|
|
String orderId = split[1];
|
|
- GoodsOrderInfoForm orderInfoBO = orderDetailInfoService.info(orderId);
|
|
|
|
-
|
|
|
|
- Integer orderStatus = orderInfoBO.getOrderStatus();
|
|
|
|
- if(orderStatus.intValue() ==1){
|
|
|
|
- orderInfoService.rollbackOrderInfo(orderId);
|
|
|
|
- System.out.println("取消订单:" + content);
|
|
|
|
|
|
+ GoodsOrderInfo goodsOrderInfo = orderInfoService.selectByPrimaryKey(orderId);
|
|
|
|
+ if(!StringUtils.isEmpty(goodsOrderInfo)){
|
|
|
|
+ Integer orderStatus = goodsOrderInfo.getOrderStatus();
|
|
|
|
+ if(orderStatus.intValue() ==1){
|
|
|
|
+ orderInfoService.rollbackOrderInfo(orderId);
|
|
|
|
+ System.out.println("取消订单:" + content);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|