Commit 36a51b68d93972bcb9693df02805ea04cb103c40

Authored by YunaiV
1 parent 6f882ca2

crm:code review 数据权限

yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImpl.java
@@ -42,6 +42,7 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { @@ -42,6 +42,7 @@ public class CrmCustomerServiceImpl implements CrmCustomerService {
42 42
43 @Resource 43 @Resource
44 private CrmPermissionService crmPermissionService; 44 private CrmPermissionService crmPermissionService;
  45 +
45 @Resource 46 @Resource
46 private AdminUserApi adminUserApi; 47 private AdminUserApi adminUserApi;
47 48
@@ -101,7 +102,7 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { @@ -101,7 +102,7 @@ public class CrmCustomerServiceImpl implements CrmCustomerService {
101 @Override 102 @Override
102 public PageResult<CrmCustomerDO> getCustomerPage(CrmCustomerPageReqVO pageReqVO, Long userId) { 103 public PageResult<CrmCustomerDO> getCustomerPage(CrmCustomerPageReqVO pageReqVO, Long userId) {
103 boolean admin = false; 104 boolean admin = false;
104 - if (admin) { // 1.1. 情况一: TODO 如果是管理员 105 + if (admin) { // 1.1. 情况一: TODO 如果是管理员; TODO @puhui999:要不如果是超管,就复用 selectPage;
105 customerMapper.selectPageWithAdmin(pageReqVO, userId); 106 customerMapper.selectPageWithAdmin(pageReqVO, userId);
106 } 107 }
107 // 1.2. 情况二:获取当前用户能看的分页数据 108 // 1.2. 情况二:获取当前用户能看的分页数据
@@ -176,7 +177,7 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { @@ -176,7 +177,7 @@ public class CrmCustomerServiceImpl implements CrmCustomerService {
176 @Override 177 @Override
177 @Transactional(rollbackFor = Exception.class) 178 @Transactional(rollbackFor = Exception.class)
178 public void receiveCustomer(List<Long> ids, Long ownerUserId) { 179 public void receiveCustomer(List<Long> ids, Long ownerUserId) {
179 - // 1. 校验存在 180 + // 1.1 校验存在
180 List<CrmCustomerDO> customers = customerMapper.selectBatchIds(ids); 181 List<CrmCustomerDO> customers = customerMapper.selectBatchIds(ids);
181 if (customers.size() != ids.size()) { 182 if (customers.size() != ids.size()) {
182 throw exception(CUSTOMER_NOT_EXISTS); 183 throw exception(CUSTOMER_NOT_EXISTS);