| | |
| | | public R<PageInfo<TCrmClinicVO>> pageList(@RequestBody TCrmClinicQuery query) { |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | if(roleType == 2 || roleType == 3){ |
| | | if(roleType == 2){ |
| | | query.setUserId(userId); |
| | | query.setRoleType(roleType); |
| | | // 查询账号绑定的分公司 |
| | | TCrmBranch crmBranch = crmBranchService.getOne(Wrappers.lambdaQuery(TCrmBranch.class) |
| | | .eq(TCrmBranch::getUserId,userId) |
| | | .last("LIMIT 1")); |
| | | query.setBranchId(crmBranch.getId()); |
| | | } |
| | | if(roleType == 3){ |
| | | query.setUserId(userId); |
| | | query.setRoleType(roleType); |
| | | // 查询账号绑定的业务员 |
| | | TCrmSalesperson crmSalesperson = crmSalespersonService.getOne(Wrappers.lambdaQuery(TCrmSalesperson.class) |
| | | .eq(TCrmSalesperson::getUserId,userId) |
| | | .last("LIMIT 1")); |
| | | query.setSalespersonId(crmSalesperson.getId()); |
| | | } |
| | | return R.ok(crmClinicService.pageList(query)); |
| | | } |