|
@@ -1,6 +1,7 @@
|
|
|
package com.gis.listener;
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
+import cn.hutool.core.util.ArrayUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.http.HttpRequest;
|
|
@@ -91,13 +92,17 @@ public class SceneMigrateListener {
|
|
|
String messageId = message.getMessageProperties().getMessageId();
|
|
|
log.info("场景migrateSceneQueue开始,id:{},deliveryTag:{},消息体:{}", messageId,deliveryTag,msg);
|
|
|
OpenSceneMigrateDto param = JSONObject.parseObject(JSON.parse(msg).toString(), OpenSceneMigrateDto.class);
|
|
|
- if (StrUtil.isNotEmpty(param.getSceneCode())&&StrUtil.isEmpty(param.getSnCode())) {
|
|
|
- WorkEntity workEntity=workService.findByNum(param.getSceneCode());
|
|
|
- if (ObjectUtil.isNotNull(workEntity)) {
|
|
|
- workEntity.setSnCode(param.getToSnCode());
|
|
|
- workEntity.setUserId(param.getPhone());
|
|
|
- workService.update(workEntity);
|
|
|
+ if (param.getSceneCodes()!=null&& ArrayUtil.isNotEmpty(param.getSceneCodes()) &&StrUtil.isEmpty(param.getSnCode())) {
|
|
|
+ List<String> sceneCodes = param.getSceneCodes();
|
|
|
+ for (String sceneCode : sceneCodes) {
|
|
|
+ WorkEntity workEntity=workService.findByNum(sceneCode);
|
|
|
+ if (ObjectUtil.isNotNull(workEntity)) {
|
|
|
+ workEntity.setSnCode(param.getToSnCode());
|
|
|
+ workEntity.setUserId(param.getPhone());
|
|
|
+ workService.update(workEntity);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
channel.basicAck(deliveryTag, false);
|