| | |
| | | } |
| | | |
| | | /** |
| | | * 查看crm分公司管理详情 |
| | | */ |
| | | @ApiOperation(value = "查看crm分公司解绑详情") |
| | | @GetMapping(value = "/getDetailUnbindById") |
| | | public R<TCrmBranchLiftVO> getDetailUnbindById(@RequestParam String id) { |
| | | |
| | | TCrmBranchLift crmBranchLift = crmBranchLiftService.getById(id); |
| | | |
| | | if(Objects.isNull(crmBranchLift)){ |
| | | return R.fail("未找到该解绑信息"); |
| | | } |
| | | |
| | | TCrmBranchLiftVO crmBranchLiftVO = new TCrmBranchLiftVO(); |
| | | BeanUtils.copyProperties(crmBranchLift, crmBranchLiftVO); |
| | | |
| | | TCrmBranch crmBranch = crmBranchService.getById(crmBranchLift.getBranchId()); |
| | | TCrmBranchVO crmBranchVO = new TCrmBranchVO(); |
| | | BeanUtils.copyProperties(crmBranch, crmBranchVO); |
| | | // 查询负责区域 |
| | | List<TCrmBranchArea> crmBranchAreas = crmBranchAreaService.list(Wrappers.lambdaQuery(TCrmBranchArea.class) |
| | | .eq(TCrmBranchArea::getAreaType, 1) |
| | | .eq(TCrmBranchArea::getBranchId, crmBranchLift.getBranchId())); |
| | | crmBranchVO.setCrmBranchAreas(crmBranchAreas); |
| | | // 查询管辖区域 |
| | | List<TCrmBranchArea> jurisdictionBranchAreas = crmBranchAreaService.list(Wrappers.lambdaQuery(TCrmBranchArea.class) |
| | | .eq(TCrmBranchArea::getAreaType, 2) |
| | | .eq(TCrmBranchArea::getBranchId, crmBranchLift.getBranchId())); |
| | | crmBranchVO.setJurisdictionBranchAreas(jurisdictionBranchAreas); |
| | | // 职位薪资 |
| | | List<TCrmPosition> crmPositions = crmPositionService.list(); |
| | | List<TCrmBranchSalary> crmBranchSalaries = crmBranchSalaryService.list(Wrappers.lambdaQuery(TCrmBranchSalary.class).eq(TCrmBranchSalary::getBranchId, id)); |
| | | for (TCrmBranchSalary crmBranchSalary : crmBranchSalaries) { |
| | | crmPositions.stream().filter(crmPosition -> Objects.equals(crmPosition.getId(), crmBranchSalary.getPositionId())).findFirst().ifPresent(crmPosition -> crmBranchSalary.setPositionName(crmPosition.getPositionName())); |
| | | } |
| | | crmBranchVO.setCrmBranchSalaries(crmBranchSalaries); |
| | | |
| | | crmBranchLiftVO.setCrmBranchVO(crmBranchVO); |
| | | |
| | | return R.ok(crmBranchLiftVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除crm分公司管理 |
| | | */ |
| | | @Log(title = "crm分公司管理信息-删除crm分公司管理", businessType = BusinessType.DELETE) |