|
@@ -544,10 +544,34 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
|
|
|
|
|
|
@Override
|
|
|
public HttpRespMsg getAllCustom(HttpServletRequest request) {
|
|
|
- User user = userMapper.selectById(request.getHeader("token"));
|
|
|
- Integer companyId = user.getCompanyId();
|
|
|
+// User user = userMapper.selectById(request.getHeader("token"));
|
|
|
+// Integer companyId = user.getCompanyId();
|
|
|
+// HttpRespMsg msg = new HttpRespMsg();
|
|
|
+// msg.setData(customMapper.selectList(new QueryWrapper<Custom>().eq("company_id", companyId)));
|
|
|
+// return msg;
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
- msg.setData(customMapper.selectList(new QueryWrapper<Custom>().eq("company_id", companyId)));
|
|
|
+ User user = userMapper.selectById(request.getHeader("Token"));
|
|
|
+ boolean isAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部客户");
|
|
|
+ boolean isNotAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看负责部门客户");
|
|
|
+ List<Custom> list = new ArrayList<>();
|
|
|
+ Custom custom = new Custom();
|
|
|
+ custom.setCompanyId(user.getCompanyId());
|
|
|
+ custom.setIsDelete(0);
|
|
|
+ custom.setUserId(user.getId());
|
|
|
+ if (isAll) {
|
|
|
+ //查看全部客户
|
|
|
+ list = customMapper.getList(custom);
|
|
|
+// i = customMapper.getTotal(custom);
|
|
|
+ } else if (isNotAll) {
|
|
|
+ //查看负责部门线索 找出所处部门下所有的负责人
|
|
|
+ list = customMapper.getList1(custom);
|
|
|
+// i = customMapper.getTotal1(custom);
|
|
|
+ } else {
|
|
|
+ // 查看负责人为 自己 和 null的数据
|
|
|
+ list = customMapper.getList2(custom);
|
|
|
+// i = customMapper.getTotal2(custom);
|
|
|
+ }
|
|
|
+ msg.data = list;
|
|
|
return msg;
|
|
|
}
|
|
|
|