From bf4bab696aeaaf94b6d95781e7607f17771f3d5c Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期三, 08 六月 2022 09:55:33 +0800
Subject: [PATCH] 优化小区无法同步 问题
---
service-job/src/main/java/com/java110/job/adapt/hcIot/community/AddCommunityToIotAdapt.java | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/service-job/src/main/java/com/java110/job/adapt/hcIot/community/AddCommunityToIotAdapt.java b/service-job/src/main/java/com/java110/job/adapt/hcIot/community/AddCommunityToIotAdapt.java
index 94f02a4..cdd6271 100755
--- a/service-job/src/main/java/com/java110/job/adapt/hcIot/community/AddCommunityToIotAdapt.java
+++ b/service-job/src/main/java/com/java110/job/adapt/hcIot/community/AddCommunityToIotAdapt.java
@@ -56,9 +56,9 @@
@Override
public void execute(Business business, List<Business> businesses) throws Exception{
JSONObject data = business.getData();
+ JSONArray businessCommunitys = null;
if (data.containsKey(CommunityPo.class.getSimpleName())) {
Object bObj = data.get(CommunityPo.class.getSimpleName());
- JSONArray businessCommunitys = null;
if (bObj instanceof JSONObject) {
businessCommunitys = new JSONArray();
businessCommunitys.add(bObj);
@@ -71,6 +71,11 @@
JSONObject businessCommunity = businessCommunitys.getJSONObject(bMachineIndex);
doAddCommunity(business, businessCommunity);
}
+ }else {
+ if (data instanceof JSONObject) {
+ businessCommunitys = new JSONArray();
+ businessCommunitys.add(data);
+ }
}
}
--
Gitblit v1.8.0