|
@@ -26,12 +26,13 @@ public class ReceiverMessage {
|
|
|
System.out.println("接受时间:" + System.currentTimeMillis());
|
|
|
System.out.println("接受消息:" + content);
|
|
|
String[] split = content.split("-");
|
|
|
- if(split.length>1){
|
|
|
+ if (split.length > 1) {
|
|
|
String orderId = split[1];
|
|
|
GoodsOrderInfo goodsOrderInfo = orderInfoService.selectByPrimaryKey(orderId);
|
|
|
- if(!StringUtils.isEmpty(goodsOrderInfo)){
|
|
|
+ if (!StringUtils.isEmpty(goodsOrderInfo)) {
|
|
|
Integer orderStatus = goodsOrderInfo.getOrderStatus();
|
|
|
- if(orderStatus.intValue() ==1){
|
|
|
+ Integer state = goodsOrderInfo.getState();
|
|
|
+ if (orderStatus.intValue() == 1 && state.intValue() == 1) {
|
|
|
orderInfoService.rollbackOrderInfo(orderId);
|
|
|
System.out.println("取消订单:" + content);
|
|
|
}
|