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