| | |
| | | import com.java110.api.smo.assetImport.IImportOwnerRoomSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import com.java110.dto.RoomDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.entity.assetImport.ImportOwnerRoomDto; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | |
| | | return false; |
| | | } |
| | | |
| | | private boolean hasRoomSpecialCharacters(String str) { |
| | | if ( str.contains("#") || str.contains("?") || str.contains("&")) { |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 数据格式校验 |
| | | * |
| | |
| | | if (hasSpecialCharacters(importOwnerRoomDto.getUnitNum())) { |
| | | throw new IllegalArgumentException((roomIndex + 1) + "行单元中包含特殊符号 - # ? & 请删除!"); |
| | | } |
| | | if (hasSpecialCharacters(importOwnerRoomDto.getRoomNum())) { |
| | | if (hasRoomSpecialCharacters(importOwnerRoomDto.getRoomNum())) { |
| | | throw new IllegalArgumentException((roomIndex + 1) + "行单元中包含特殊符号 - # ? & 请删除!"); |
| | | } |
| | | |
| | | if (!StringUtil.isNumber(importOwnerRoomDto.getLayer())) { |
| | | throw new IllegalArgumentException((roomIndex + 1) + "行楼层不是有效数字"); |
| | | } |
| | | // if (!StringUtil.isNumber(importOwnerRoomDto.getLayer())) { |
| | | // throw new IllegalArgumentException((roomIndex + 1) + "行楼层不是有效数字"); |
| | | // } |
| | | |
| | | if (!StringUtil.isNumber(importOwnerRoomDto.getLayerCount())) { |
| | | throw new IllegalArgumentException((roomIndex + 1) + "行总楼层不是有效数字"); |
| | |
| | | throw new IllegalArgumentException((roomIndex + 1) + "行性别不能为空"); |
| | | } |
| | | |
| | | if (StringUtil.isEmpty(importOwnerRoomDto.getAge())) { |
| | | throw new IllegalArgumentException((roomIndex + 1) + "行年龄不能为空"); |
| | | } |
| | | // if (StringUtil.isEmpty(importOwnerRoomDto.getAge())) { |
| | | // throw new IllegalArgumentException((roomIndex + 1) + "行年龄不能为空"); |
| | | // } |
| | | //系统目前 在香港台湾 以及新加坡等地都有商用 所以 并不是中国大陆手机号规则 所以不做严格校验 |
| | | //烦请专业测试团队勿喷 |
| | | if (StringUtil.isEmpty(importOwnerRoomDto.getTel())) { |
| | | throw new IllegalArgumentException((roomIndex + 1) + "行手机号不能为空"); |
| | | } |
| | | |
| | | if (StringUtil.isEmpty(importOwnerRoomDto.getIdCard())) { |
| | | throw new IllegalArgumentException((roomIndex + 1) + "行身份证号不能为空"); |
| | | if (importOwnerRoomDto.getTel().length() > 11) { |
| | | throw new IllegalArgumentException((roomIndex + 1) + "行手机号超过11位,请核实"); |
| | | } |
| | | |
| | | if (importOwnerRoomDto.getIdCard().length() > 18) { |
| | | // if (StringUtil.isEmpty(importOwnerRoomDto.getIdCard())) { |
| | | // throw new IllegalArgumentException((roomIndex + 1) + "行身份证号不能为空"); |
| | | // } |
| | | |
| | | if (!StringUtil.isEmpty(importOwnerRoomDto.getIdCard()) && importOwnerRoomDto.getIdCard().length() > 18) { |
| | | throw new IllegalArgumentException((roomIndex + 1) + " 的身份证超过18位,请核实"); |
| | | } |
| | | if (!StringUtil.isNumber(importOwnerRoomDto.getOwnerTypeCd())) { |
| | | throw new IllegalArgumentException((roomIndex + 1) + "行业主类型不能为空"); |
| | | } |
| | | |
| | | if(RoomDto.STATE_FREE.equals(importOwnerRoomDto.getRoomState()) && !StringUtil.isEmpty(importOwnerRoomDto.getOwnerName())){ |
| | | throw new IllegalArgumentException((roomIndex + 1) + "行房屋状态为未销售状态,不能包含业主信息"); |
| | | } |
| | | |
| | | if(!RoomDto.STATE_FREE.equals(importOwnerRoomDto.getRoomState()) && StringUtil.isEmpty(importOwnerRoomDto.getOwnerName())){ |
| | | throw new IllegalArgumentException((roomIndex + 1) + "行房屋状态不是未销售状态,必须包含业主信息"); |
| | | } |
| | | |
| | | // 如果是业主 跳过 |
| | | if (OwnerDto.OWNER_TYPE_CD_OWNER.equals(importOwnerRoomDto.getOwnerTypeCd())) { |
| | | continue; |
| | |
| | | // 校验成员之前是否存在 业主角色 |
| | | hasOwnerType = false; |
| | | for (int preRoomIndex = 0; preRoomIndex < roomIndex; preRoomIndex++) { |
| | | tmpImportOwnerRoomDto = ownerRooms.get(roomIndex); |
| | | tmpImportOwnerRoomDto = ownerRooms.get(preRoomIndex); |
| | | |
| | | if (tmpImportOwnerRoomDto.getFloorNum().equals(importOwnerRoomDto.getFloorNum()) |
| | | && tmpImportOwnerRoomDto.getUnitNum().equals(importOwnerRoomDto.getUnitNum()) |
| | | && tmpImportOwnerRoomDto.getRoomNum().equals(importOwnerRoomDto.getRoomNum()) |
| | | && OwnerDto.OWNER_TYPE_CD_OWNER.equals(tmpImportOwnerRoomDto.getOwnerTypeCd())) { |
| | | hasOwnerType = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | |
| | | Assert.hasValue(os[8], (osIndex + 1) + "行建筑面积不能为空"); |
| | | Assert.hasValue(os[9], (osIndex + 1) + "行室内面积不能为空"); |
| | | Assert.hasValue(os[10], (osIndex + 1) + "行租金不能为空"); |
| | | if (os.length > 11) { |
| | | Assert.hasValue(os[11], (osIndex + 1) + "行业主名称不能为空"); |
| | | Assert.hasValue(os[12], (osIndex + 1) + "行性别不能为空"); |
| | | Assert.hasValue(os[13], (osIndex + 1) + "行年龄不能为空"); |
| | | Assert.hasValue(os[11], (osIndex + 1) + "行房屋状态不能为空"); |
| | | if (os.length > 12 && !StringUtil.isNullOrNone(os[12])) { |
| | | Assert.hasValue(os[12], (osIndex + 1) + "行业主名称不能为空"); |
| | | Assert.hasValue(os[13], (osIndex + 1) + "行性别不能为空"); |
| | | // Assert.hasValue(os[14], (osIndex + 1) + "行年龄不能为空"); |
| | | Assert.hasValue(os[14], (osIndex + 1) + "行手机号不能为空"); |
| | | Assert.hasValue(os[15], (osIndex + 1) + "行身份证不能为空"); |
| | | //Assert.hasValue(os[15], (osIndex + 1) + "行身份证不能为空"); |
| | | Assert.hasValue(os[16], (osIndex + 1) + "行业主类型不能为空"); |
| | | } |
| | | |
| | |
| | | importOwnerRoomDto.setBuiltUpArea(os[8].toString().trim()); |
| | | importOwnerRoomDto.setRoomArea(os[9].toString().trim()); |
| | | importOwnerRoomDto.setRoomRent(os[10].toString().trim()); |
| | | if (os.length > 11) { |
| | | importOwnerRoomDto.setOwnerName(os[11].toString().trim()); |
| | | importOwnerRoomDto.setSex("男".equals(os[12].toString().trim()) ? "0" : "1"); |
| | | String age = StringUtil.isNullOrNone(os[13]) ? CommonUtil.getAgeByCertId(os[15].toString().trim()) : os[13].toString().trim(); |
| | | importOwnerRoomDto.setAge(age); |
| | | importOwnerRoomDto.setRoomState(os[11].toString().trim()); |
| | | if (os.length > 12 && !StringUtil.isNullOrNone(os[12])) { |
| | | importOwnerRoomDto.setOwnerName(os[12].toString().trim()); |
| | | importOwnerRoomDto.setSex("男".equals(os[13].toString().trim()) ? "0" : "1"); |
| | | // String age = StringUtil.isNullOrNone(os[14]) ? CommonUtil.getAgeByCertId(os[16].toString().trim()) : os[14].toString().trim(); |
| | | importOwnerRoomDto.setAge("1"); |
| | | importOwnerRoomDto.setTel(os[14].toString().trim()); |
| | | importOwnerRoomDto.setIdCard(os[15].toString().trim()); |
| | | String idCard = StringUtil.isNullOrNone(os[15])?"": os[15].toString().trim(); |
| | | importOwnerRoomDto.setIdCard(idCard); |
| | | importOwnerRoomDto.setOwnerTypeCd(os[16].toString().trim()); |
| | | } |
| | | |
| | | |
| | | |
| | | ownerRoomDtos.add(importOwnerRoomDto); |
| | | |
| | | } |