|
|
@@ -375,7 +375,7 @@ public class SysDeptServiceImpl implements ISysDeptService { |
|
|
|
} |
|
|
|
|
|
|
|
// 初始化清空表 |
|
|
|
if (!isUpdateSupport) |
|
|
|
if (isUpdateSupport) |
|
|
|
deptMapper.deleteAllDept(); // 事务 |
|
|
|
|
|
|
|
final Consumer<SysDept> updateOrInsertFunc = (dept) -> { |
|
|
@@ -397,7 +397,7 @@ public class SysDeptServiceImpl implements ISysDeptService { |
|
|
|
orgCodeLengthMap.forEach((orgCodeLength, sysDepts) -> { |
|
|
|
switch (orgCodeLength) { |
|
|
|
case 2: |
|
|
|
if (isUpdateSupport) { |
|
|
|
if (!isUpdateSupport) { |
|
|
|
sysDepts.forEach((x) -> { |
|
|
|
SysDept dept = deptMapper.selectDeptByImportCode(x.getImportCode()); |
|
|
|
if (null != dept) // 存在则更新名称 |
|
|
@@ -424,7 +424,7 @@ public class SysDeptServiceImpl implements ISysDeptService { |
|
|
|
} |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
if (isUpdateSupport) { |
|
|
|
if (!isUpdateSupport) { |
|
|
|
sysDepts.forEach(sysDept -> { |
|
|
|
SysDept parentDept = deptMapper.selectDeptByImportCode(StringUtils.substring(sysDept.getImportCode(), 0, 2)); |
|
|
|
if (Objects.nonNull(parentDept)) { |
|
|
@@ -459,7 +459,7 @@ public class SysDeptServiceImpl implements ISysDeptService { |
|
|
|
} |
|
|
|
break; |
|
|
|
case 6: |
|
|
|
if (isUpdateSupport) { |
|
|
|
if (!isUpdateSupport) { |
|
|
|
orderNnum.set(0); |
|
|
|
sysDepts.forEach(sysDept -> { |
|
|
|
SysDept parentDept = deptMapper.selectDeptByImportCode(StringUtils.substring(sysDept.getImportCode(), 0, 4)); |
|
|
@@ -495,7 +495,7 @@ public class SysDeptServiceImpl implements ISysDeptService { |
|
|
|
} |
|
|
|
break; |
|
|
|
case 9: |
|
|
|
if (isUpdateSupport) { |
|
|
|
if (!isUpdateSupport) { |
|
|
|
sysDepts.forEach(sysDept -> { |
|
|
|
SysDept parentDept = deptMapper.selectDeptByImportCode(StringUtils.substring(sysDept.getImportCode(), 0, 6)); |
|
|
|
if (Objects.nonNull(parentDept)) { |
|
|
@@ -526,7 +526,7 @@ public class SysDeptServiceImpl implements ISysDeptService { |
|
|
|
} |
|
|
|
break; |
|
|
|
case 12: |
|
|
|
if (isUpdateSupport) { |
|
|
|
if (!isUpdateSupport) { |
|
|
|
sysDepts.forEach(sysDept -> { |
|
|
|
SysDept parentDept = deptMapper.selectDeptByImportCode(StringUtils.substring(sysDept.getImportCode(), 0, 9)); |
|
|
|
if (Objects.nonNull(parentDept)) { |
|
|
@@ -557,7 +557,7 @@ public class SysDeptServiceImpl implements ISysDeptService { |
|
|
|
} |
|
|
|
break; |
|
|
|
case 14: |
|
|
|
if (isUpdateSupport) { |
|
|
|
if (!isUpdateSupport) { |
|
|
|
sysDepts.forEach(sysDept -> { |
|
|
|
SysDept parentDept = deptMapper.selectDeptByImportCode(StringUtils.substring(sysDept.getImportCode(), 0, 12)); |
|
|
|
if (Objects.nonNull(parentDept)) { |
|
|
|