| | |
| | | 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; |
| | |
| | | @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) { |