| | |
| | | for (LargeResourceImport largeResourceImport : largeResourceImports) { |
| | | if (!StringUtils.hasLength(largeResourceImport.getTypeParentName())){ |
| | | result.append("第"+i+"行:[", "一级类型名称"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getTypeChildrenName())){ |
| | | result.append("第"+i+"行:[", "二级类型名称"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getResourceUnit())){ |
| | | result.append("第"+i+"行:[", "资源单位"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getResourceNameDesc())){ |
| | | result.append("第"+i+"行:[", "资源名称描述"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getResourceSource())){ |
| | | result.append("第"+i+"行:[", "资源来源"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getQuantityScale())){ |
| | | result.append("第"+i+"行:[", "数量规模"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getContactPerson())){ |
| | | result.append("第"+i+"行:[", "联系人"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getContactNumber())){ |
| | | result.append("第"+i+"行:[", "联系电话"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (largeResourceImport.getContactNumber().matches("^1[3-9]\\\\d{9}$")){ |
| | | if (!largeResourceImport.getContactNumber().matches("^$|^1[3-9]\\d{9}$")){ |
| | | result.append("第"+i+"行:[", "联系电话"+"]格式不正确"); |
| | | i++; |
| | | continue; |
| | | } |
| | | TLargeResource largeResource = new TLargeResource(); |
| | |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(parent)){ |
| | | result.append("第"+i+"行:[", "一级类型名称"+"]不存在"); |
| | | i++; |
| | | continue; |
| | | } |
| | | largeResource.setTypeParentId(parent.getId()); |
| | |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(children)){ |
| | | result.append("第"+i+"行:[", "二级类型名称"+"]不存在"); |
| | | i++; |
| | | continue; |
| | | } |
| | | largeResource.setTypeChildrenId(children.getId()); |