|
@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
+import java.util.Arrays;
|
|
|
|
|
|
/**
|
|
|
* 场景封存解封 mq
|
|
@@ -36,21 +37,25 @@ public class ScenePayStatusConsumer {
|
|
|
try {
|
|
|
String messageId = message.getMessageProperties().getMessageId();
|
|
|
String msg = new String(message.getBody(), StandardCharsets.UTF_8);
|
|
|
- log.info("接受下单结果mq--messageId:{},msg:{}",messageId,msg);
|
|
|
+ log.info("接受mq--messageId:{},msg:{}",messageId,msg);
|
|
|
|
|
|
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
|
|
msg = msg.substring(1, msg.length() - 1);
|
|
|
|
|
|
msg = StringEscapeUtils.unescapeJava(msg);
|
|
|
|
|
|
- ScenePayStatusVo order = JSONObject.parseObject(msg, ScenePayStatusVo.class);
|
|
|
- if(order == null){
|
|
|
+ ScenePayStatusVo vo = JSONObject.parseObject(msg, ScenePayStatusVo.class);
|
|
|
+ if(vo == null){
|
|
|
return;
|
|
|
}
|
|
|
- sceneProService.lockOrUnLockBySpace(order.getCameraId());
|
|
|
+ if(vo.getSceneId() != null && vo.getPayStatus() != null){
|
|
|
+ sceneProService.lockOrUnLockScenes(Arrays.asList(vo.getSceneId()),vo.getPayStatus());
|
|
|
+ }else if(vo.getCameraId() != null){
|
|
|
+ sceneProService.lockOrUnLockBySpace(vo.getCameraId());
|
|
|
+ }
|
|
|
|
|
|
}catch (Exception e){
|
|
|
- log.error("order-payResult----消费失败",e);
|
|
|
+ log.error("scene-pay-status----消费失败",e);
|
|
|
}finally {
|
|
|
|
|
|
}
|