Showing
1 changed file
with
18 additions
and
2 deletions
| @@ -377,7 +377,14 @@ public class ContractDistributorStandardController extends DefaultBaseController | @@ -377,7 +377,14 @@ public class ContractDistributorStandardController extends DefaultBaseController | ||
| 377 | //部门 | 377 | //部门 |
| 378 | List<String> depts = getSysUserBo.getDepts(); | 378 | List<String> depts = getSysUserBo.getDepts(); |
| 379 | if (org.apache.commons.collections.CollectionUtils.isNotEmpty(depts)) { | 379 | if (org.apache.commons.collections.CollectionUtils.isNotEmpty(depts)) { |
| 380 | - vo.setDeptId(depts.get(0)); | 380 | + SysDept sysDept = sysDeptService.findById(depts.get(0)); |
| 381 | + vo.setDeptId(sysDept.getId()); | ||
| 382 | + if (sysDept.getName().endsWith("区域") && StringUtils.isNotBlank(sysDept.getParentId())) { // 如果是**区域,则查询上一层次是否为**办事处,获取办事处code | ||
| 383 | + SysDept parentSysDept = sysDeptService.findById(sysDept.getParentId()); | ||
| 384 | + if (parentSysDept != null && parentSysDept.getName().endsWith("办事处")) { | ||
| 385 | + vo.setDeptId(sysDept.getParentId()); | ||
| 386 | + } | ||
| 387 | + } | ||
| 381 | } | 388 | } |
| 382 | } | 389 | } |
| 383 | 390 | ||
| @@ -435,7 +442,16 @@ public class ContractDistributorStandardController extends DefaultBaseController | @@ -435,7 +442,16 @@ public class ContractDistributorStandardController extends DefaultBaseController | ||
| 435 | if (CollectionUtils.isNotEmpty(depts)) { | 442 | if (CollectionUtils.isNotEmpty(depts)) { |
| 436 | String deptId = depts.get(0); | 443 | String deptId = depts.get(0); |
| 437 | SysDept sysDept = sysDeptService.findById(deptId); | 444 | SysDept sysDept = sysDeptService.findById(deptId); |
| 438 | - stringBuilder.append(sysDept.getCode()); | 445 | + if (sysDept.getName().endsWith("区域") && StringUtils.isNotBlank(sysDept.getParentId())) { // 如果是**区域,则查询上一层次是否为**办事处,获取办事处code |
| 446 | + SysDept parentSysDept = sysDeptService.findById(sysDept.getParentId()); | ||
| 447 | + if (parentSysDept != null && parentSysDept.getName().endsWith("办事处")) { | ||
| 448 | + stringBuilder.append(parentSysDept.getCode()); | ||
| 449 | + } else { | ||
| 450 | + stringBuilder.append(sysDept.getCode()); | ||
| 451 | + } | ||
| 452 | + } else { | ||
| 453 | + stringBuilder.append(sysDept.getCode()); | ||
| 454 | + } | ||
| 439 | } | 455 | } |
| 440 | } | 456 | } |
| 441 | 457 |