wuxw
2024-01-22 a40c2eb885bcdb697c2e16dae4f43cb6cd718973
service-job/src/main/java/com/java110/job/adapt/hcGov/location/EditLocationToHcGovAdapt.java
@@ -20,8 +20,8 @@
import com.java110.dto.community.CommunityAttrDto;
import com.java110.dto.community.CommunityDto;
import com.java110.dto.community.CommunityLocationDto;
import com.java110.dto.communityLocationAttr.CommunityLocationAttrDto;
import com.java110.entity.order.Business;
import com.java110.dto.community.CommunityLocationAttrDto;
import com.java110.dto.system.Business;
import com.java110.intf.community.ICommunityInnerServiceSMO;
import com.java110.intf.community.ICommunityLocationAttrInnerServiceSMO;
import com.java110.intf.community.ICommunityLocationInnerServiceSMO;
@@ -67,24 +67,30 @@
    @Override
    public void execute(Business business, List<Business> businesses) {
        JSONObject data = business.getData();
        JSONArray  businessCommunityLocations = new JSONArray();
        if (data.containsKey(CommunityLocationPo.class.getSimpleName())) {
            Object bObj = data.get(CommunityLocationPo.class.getSimpleName());
            JSONArray businessCommunityLocations = null;
            if (bObj instanceof JSONObject) {
                businessCommunityLocations = new JSONArray();
                businessCommunityLocations.add(bObj);
            } else if (bObj instanceof List) {
                businessCommunityLocations = JSONArray.parseArray(JSONObject.toJSONString(bObj));
            } else {
                businessCommunityLocations = (JSONArray) bObj;
            }
            //JSONObject businessCommunityLocation = data.getJSONObject("businessCommunityLocation");
            for (int bCommunityLocationIndex = 0; bCommunityLocationIndex < businessCommunityLocations.size(); bCommunityLocationIndex++) {
                JSONObject businessCommunityLocation = businessCommunityLocations.getJSONObject(bCommunityLocationIndex);
                doAddCommunityLocation(business, businessCommunityLocation);
        }else {
            if (data instanceof JSONObject) {
                businessCommunityLocations.add(data);
            }
        }
        //JSONObject businessCommunityLocation = data.getJSONObject("businessCommunityLocation");
        for (int bCommunityLocationIndex = 0; bCommunityLocationIndex < businessCommunityLocations.size(); bCommunityLocationIndex++) {
            JSONObject businessCommunityLocation = businessCommunityLocations.getJSONObject(bCommunityLocationIndex);
            doAddCommunityLocation(business, businessCommunityLocation);
        }
    }
    private void doAddCommunityLocation(Business business, JSONObject businessCommunityLocation) {