| | |
| | | package com.java110.api.importData.adapt; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.components.ValueUtil; |
| | | import com.java110.api.importData.DefaultImportDataAdapt; |
| | | import com.java110.api.importData.IImportDataCleaningAdapt; |
| | | import com.java110.dto.community.CommunityDto; |
| | |
| | | |
| | | public void setCommunityId(CarInoutPo po, Object[] os, List<Map<String, Object>> maps) { |
| | | for (Map<String, Object> map : maps) { |
| | | if (ValueUtil.defaultValue(os[1]).isEmpty() && ValueUtil.defaultValue(os[2]).isEmpty()){ |
| | | if (Vtil.defaultValue(os[1]) == null && Vtil.defaultValue(os[2]) == null){ |
| | | throw new IllegalArgumentException("小区名称和小区编号均为空"); |
| | | } |
| | | if (ValueUtil.defaultValue(os[1]).isEmpty()) { |
| | | if (Vtil.defaultValue(map.get("name")).contains(ValueUtil.defaultValue(os[2]))) { |
| | | if (Vtil.defaultValue(os[1]) == null) { |
| | | if (Vtil.defaultValue(map.get("name")).contains(Vtil.defaultValue(os[2]))) { |
| | | po.setCommunityId(map.get("communityId").toString()); |
| | | return; |
| | | } |
| | | } else if (ValueUtil.defaultValue(os[2]).isEmpty()){ |
| | | if (Vtil.defaultValue(map.get("communityCode")).equals(ValueUtil.defaultValue(os[1]))) { |
| | | } else if (Vtil.defaultValue(os[2]) == null){ |
| | | if (Vtil.defaultValue(map.get("communityCode")).equals(Vtil.defaultValue(os[1]))) { |
| | | po.setCommunityId(map.get("communityId").toString()); |
| | | return; |
| | | } |
| | | } else { |
| | | if (Vtil.defaultValue(map.get("communityCode")).equals(ValueUtil.defaultValue(os[1])) && Vtil.defaultValue(map.get("name")).contains(ValueUtil.defaultValue(os[2]))) { |
| | | if (Vtil.defaultValue(map.get("communityCode")).equals(Vtil.defaultValue(os[1])) && Vtil.defaultValue(map.get("name")).contains(Vtil.defaultValue(os[2]))) { |
| | | po.setCommunityId(map.get("communityId").toString()); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | throw new IllegalArgumentException("未查询到小区:" + Vtil.appendHyphenToRight(ValueUtil.defaultValue(os[1])) + ValueUtil.defaultValue(os[2])); |
| | | throw new IllegalArgumentException("未查询到小区:" + Vtil.appendHyphenToRight(Vtil.defaultValue(os[1])) + Vtil.defaultValue(os[2])); |
| | | } |
| | | |
| | | public String defaultValue(Object o) { |