java110
2022-06-08 24f890886d5a634f9f1ae2dd73652a05a4e2d2cf
service-job/src/main/java/com/java110/job/adapt/hcIot/community/AddCommunityToIotAdapt.java
@@ -56,27 +56,26 @@
    @Override
    public void execute(Business business, List<Business> businesses) throws Exception{
        JSONObject data = business.getData();
        JSONArray businessCommunitys = null;
        JSONArray businessCommunitys = new JSONArray();
        if (data.containsKey(CommunityPo.class.getSimpleName())) {
            Object bObj = data.get(CommunityPo.class.getSimpleName());
            if (bObj instanceof JSONObject) {
                businessCommunitys = new JSONArray();
                businessCommunitys.add(bObj);
            } else if (bObj instanceof List) {
                businessCommunitys = JSONArray.parseArray(JSONObject.toJSONString(bObj));
            } else {
                businessCommunitys = (JSONArray) bObj;
            }
            for (int bMachineIndex = 0; bMachineIndex < businessCommunitys.size(); bMachineIndex++) {
                JSONObject businessCommunity = businessCommunitys.getJSONObject(bMachineIndex);
                doAddCommunity(business, businessCommunity);
            }
        }else {
            if (data instanceof JSONObject) {
                businessCommunitys = new JSONArray();
                businessCommunitys.add(data);
            }
        }
        for (int bMachineIndex = 0; bMachineIndex < businessCommunitys.size(); bMachineIndex++) {
            JSONObject businessCommunity = businessCommunitys.getJSONObject(bMachineIndex);
            doAddCommunity(business, businessCommunity);
        }
    }
    /**