Showing
1 changed file
with
2 additions
and
1 deletions
| @@ -63,6 +63,7 @@ public class CustomerShortImportListener extends ExcelImportListener<CustomerSho | @@ -63,6 +63,7 @@ public class CustomerShortImportListener extends ExcelImportListener<CustomerSho | ||
| 63 | } | 63 | } |
| 64 | data.setDeptId(office.getId()); | 64 | data.setDeptId(office.getId()); |
| 65 | // 区域 | 65 | // 区域 |
| 66 | + deptWrapper.clear(); | ||
| 66 | deptWrapper.eq(SysDept::getName, data.getRegionName()); | 67 | deptWrapper.eq(SysDept::getName, data.getRegionName()); |
| 67 | SysDept region = sysDeptService.getOne(deptWrapper); | 68 | SysDept region = sysDeptService.getOne(deptWrapper); |
| 68 | if (region == null) { | 69 | if (region == null) { |
| @@ -75,7 +76,7 @@ public class CustomerShortImportListener extends ExcelImportListener<CustomerSho | @@ -75,7 +76,7 @@ public class CustomerShortImportListener extends ExcelImportListener<CustomerSho | ||
| 75 | + "]不属于[" + data.getDeptName() + "],请检查后再次导入!"); | 76 | + "]不属于[" + data.getDeptName() + "],请检查后再次导入!"); |
| 76 | } | 77 | } |
| 77 | List<String> regionNameList = regionList.stream().map(SysDept::getName).collect(Collectors.toList()); | 78 | List<String> regionNameList = regionList.stream().map(SysDept::getName).collect(Collectors.toList()); |
| 78 | - if (regionNameList.contains(region.getName())) { | 79 | + if (!regionNameList.contains(region.getName())) { |
| 79 | throw new DefaultClientException("第" + context.readRowHolder().getRowIndex() + "行,[" + data.getRegionName() | 80 | throw new DefaultClientException("第" + context.readRowHolder().getRowIndex() + "行,[" + data.getRegionName() |
| 80 | + "]不属于[" + data.getDeptName() + "],请检查后再次导入!"); | 81 | + "]不属于[" + data.getDeptName() + "],请检查后再次导入!"); |
| 81 | } | 82 | } |