| | |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.room.RoomDto; |
| | | import com.java110.dto.system.ComponentValidateResult; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.ImportExcelUtils; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | |
| | | List<Object[]> oList = ImportExcelUtils.listFromSheet(sheet); |
| | | ImportOwnerRoomDto importOwnerRoomDto = null; |
| | | for (int osIndex = 0; osIndex < oList.size(); osIndex++) { |
| | | if (osIndex < 7) { |
| | | if (osIndex < 5) { |
| | | continue; |
| | | } |
| | | Object[] os = oList.get(osIndex); |
| | | |
| | | if (oList.get(osIndex)[0] == null) { |
| | | break; |
| | | } |
| | | Object[] os = new Object[170]; |
| | | try { |
| | | System.arraycopy(oList.get(osIndex), 0, os, 0, oList.get(osIndex).length); |
| | | } catch (ArrayIndexOutOfBoundsException e) { |
| | | throw new IllegalArgumentException("Excel长度过长!"); |
| | | } |
| | | // Assert.hasValue(os[3], (osIndex + 1) + "行项目编码不能为空"); |
| | | Assert.hasValue("住宅物业费 导入新模板中" + os[5], (osIndex + 1) + "行路不能为空"); |
| | | Assert.hasValue("住宅物业费 导入新模板中" + os[5], (osIndex + 1) + "行路不能为空"); |
| | | Assert.hasValue("住宅物业费 导入新模板中" + os[7], (osIndex + 1) + "行门号不能为空"); |
| | | Assert.hasValue("住宅物业费 导入新模板中" + os[8], (osIndex + 1) + "行室号不能为空"); |
| | | Assert.hasValue("住宅物业费 导入新模板中" + os[10], (osIndex + 1) + "行业主地址不能为空"); |
| | | Assert.hasValue("住宅物业费 导入新模板中" + os[16], (osIndex + 1) + "行住宅面积不能为空"); |
| | | os[169] = result.getUserId(); |
| | | |
| | | |
| | | ownerRoomDtos.add(os); |
| | | } |
| | | sheet = ImportExcelUtils.getSheet(workbook, " 商铺物业费 导入新模板"); |
| | | oList = ImportExcelUtils.listFromSheet(sheet); |
| | | for (int osIndex = 0; osIndex < oList.size(); osIndex++) { |
| | | if (osIndex < 5) { |
| | | continue; |
| | | } |
| | | |
| | | if (oList.get(osIndex)[0] == null) { |
| | | break; |
| | | } |
| | | Object[] os = new Object[170]; |
| | | System.arraycopy(oList.get(osIndex), 0, os, 0, oList.get(osIndex).length); |
| | | // Assert.hasValue(os[3], (osIndex + 1) + "行项目编码不能为空"); |
| | | Assert.hasValue("商铺物业费 导入新模板中" + os[5], (osIndex + 1) + "行路不能为空"); |
| | | Assert.hasValue("商铺物业费 导入新模板中" + os[7], (osIndex + 1) + "行门号不能为空"); |
| | | Assert.hasValue("商铺物业费 导入新模板中" + os[8], (osIndex + 1) + "行室号不能为空"); |
| | | // Assert.hasValue(os[9], (osIndex + 1) + "行门室号不能为空"); |
| | | Assert.hasValue("商铺物业费 导入新模板中" + os[10], (osIndex + 1) + "行业主地址不能为空"); |
| | | Assert.hasValue("商铺物业费 导入新模板中" + os[16], (osIndex + 1) + "行住宅面积不能为空"); |
| | | os[169] = result.getUserId(); |
| | | |
| | | |
| | | ownerRoomDtos.add(os); |
| | | } |
| | | if (ownerRoomDtos.size() == 0) { |
| | | throw new IllegalArgumentException("sheet内容为空"); |
| | | } |
| | | } |
| | | |