|
@@ -28,6 +28,7 @@ import com.fjhx.customer.utils.code.CodeEnum;
|
|
|
import com.fjhx.tenant.entity.dict.dto.DictTenantDataSelectDto;
|
|
|
import com.fjhx.tenant.entity.dict.vo.DictTenantDataVo;
|
|
|
import com.fjhx.tenant.service.dict.DictTenantDataService;
|
|
|
+import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
@@ -68,7 +69,19 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
|
public Page<CustomerVo> selPage(CustomerSelectDto dto) {
|
|
|
IWrapper<CustomerVo> wrapper = IWrapper.getWrapper();
|
|
|
wrapper.like(Customer::getName, dto.getKeyword());
|
|
|
- wrapper.eq("c", Customer::getUserId, dto.getUserId());
|
|
|
+
|
|
|
+ SysUser sysUser = UserUtil.getUserInfo();
|
|
|
+ //不是业务员看所有私海客户
|
|
|
+ wrapper.isNotNull("c.user_id");
|
|
|
+ //是业务员只能看自己的客户(如果业务员是部门负责人/部门总监可以看本部门以及下级部门的客户)
|
|
|
+ if (StringUtils.isNotEmpty(sysUser.getUserCode())) {
|
|
|
+ List<Long> authIdList = this.getAuthIdList();
|
|
|
+ if (authIdList.size() == 0) {
|
|
|
+ return new Page<>();
|
|
|
+ }
|
|
|
+ wrapper.in("c", Customer::getId, authIdList);
|
|
|
+ }
|
|
|
+
|
|
|
Page<CustomerVo> page = baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
CustomizeAreaUtil.setAreaName(page.getRecords());
|
|
|
return page;
|