Procházet zdrojové kódy

用户相关bug修改

zhouyy před 4 měsíci
rodič
revize
66b1628562

+ 5 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CustomController.java

@@ -85,6 +85,11 @@ public class CustomController {
         return customService.pinCutom(custom,request);
     }
 
+    @RequestMapping("getPrivilegedCustom")
+    public HttpRespMsg getPrivilegedCustom(HttpServletRequest request) {
+        return customService.getPrivilegedCustom(request);
+    }
+
     @RequestMapping("getAllCustom")
     public HttpRespMsg getAllCustom(HttpServletRequest request) {
         return customService.getAllCustom(request);

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/CustomService.java

@@ -66,4 +66,6 @@ public interface CustomService extends IService<Custom> {
     HttpRespMsg pinCutom(Custom custom, HttpServletRequest request);
 
     HttpRespMsg undoPin(Custom custom, HttpServletRequest request);
+
+    HttpRespMsg getPrivilegedCustom(HttpServletRequest request);
 }

+ 28 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/CustomServiceImpl.java

@@ -931,6 +931,34 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
         return respMsg;
     }
 
+    @Override
+    public HttpRespMsg getPrivilegedCustom(HttpServletRequest request) {
+        HttpRespMsg msg = new HttpRespMsg();
+        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;
+    }
+
 
     private Custom setNull(Custom clue) {
         if (clue.getPlate1() == "") {