فهرست منبع

20220807 修复了bug

lifuquan 2 سال پیش
والد
کامیت
29d86c0ed2

+ 1 - 250
doc/接口文档/acl提供给流程的接口.md

@@ -390,256 +390,7 @@ Content-Type: application/json
 
 {
   "city": 130200,
-  "role": [4],
+  "role": [],
   "user": []
 }
 ```
-
-```json
-HTTP/1.1 200 
-Content-Type: application/json
-Transfer-Encoding: chunked
-Date: Fri, 05 Aug 2022 07:49:11 GMT
-Connection: close
-
-{
-  "success": true,
-  "code": 1,
-  "message": "成功",
-  "data": [
-    {
-      "name": "河北省",
-      "child": [
-        {
-          "name": "省公司",
-          "child": [
-            {
-              "name": "河北省",
-              "userName": "王玉龙",
-              "userId": 24,
-              "child": []
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "name": "唐山市",
-      "child": [
-        {
-          "name": "市公司",
-          "child": [
-            {
-              "name": "唐山市",
-              "userName": "郭栋",
-              "userId": 219,
-              "child": []
-            },
-            {
-              "name": "唐山市",
-              "userName": "测试用户_李四喜",
-              "userId": 4,
-              "child": []
-            },
-            {
-              "name": "唐山市",
-              "userName": "王振",
-              "userId": 30,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "路南区",
-          "child": [
-            {
-              "name": "路南区",
-              "userName": "夏杰",
-              "userId": 236,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "路北区",
-          "child": [
-            {
-              "name": "路北区",
-              "userName": "陈琳",
-              "userId": 237,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "古冶区",
-          "child": [
-            {
-              "name": "古冶区",
-              "userName": "李志香",
-              "userId": 224,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "开平区",
-          "child": [
-            {
-              "name": "开平区",
-              "userName": "王跃东",
-              "userId": 234,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "丰南区",
-          "child": [
-            {
-              "name": "丰南区",
-              "userName": "张力山",
-              "userId": 235,
-              "child": []
-            },
-            {
-              "name": "丰南区",
-              "userName": "冯雪征",
-              "userId": 240,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "丰润区",
-          "child": [
-            {
-              "name": "丰润区",
-              "userName": "刘雅光",
-              "userId": 223,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "曹妃甸区",
-          "child": [
-            {
-              "name": "曹妃甸区",
-              "userName": "苏晓辉",
-              "userId": 226,
-              "child": []
-            },
-            {
-              "name": "曹妃甸区",
-              "userName": "贾鹏莹",
-              "userId": 232,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "滦南县",
-          "child": [
-            {
-              "name": "滦南县",
-              "userName": "王晓红",
-              "userId": 228,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "乐亭县",
-          "child": [
-            {
-              "name": "乐亭县",
-              "userName": "苏惠芳",
-              "userId": 225,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "迁西县",
-          "child": [
-            {
-              "name": "迁西县",
-              "userName": "程成",
-              "userId": 220,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "玉田县",
-          "child": [
-            {
-              "name": "玉田县",
-              "userName": "高振宇",
-              "userId": 221,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "遵化市",
-          "child": [
-            {
-              "name": "遵化市",
-              "userName": "张灵芝",
-              "userId": 230,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "迁安市",
-          "child": [
-            {
-              "name": "迁安市",
-              "userName": "訾悦馨",
-              "userId": 233,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "滦州市",
-          "child": [
-            {
-              "name": "滦州市",
-              "userName": "张望然",
-              "userId": 231,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "海港区",
-          "child": [
-            {
-              "name": "海港区",
-              "userName": "颜君明",
-              "userId": 229,
-              "child": []
-            }
-          ]
-        },
-        {
-          "name": "高开区",
-          "child": [
-            {
-              "name": "高开区",
-              "userName": "王梦云",
-              "userId": 227,
-              "child": []
-            }
-          ]
-        }
-      ]
-    }
-  ]
-}
-
-```

BIN
doc/部署文档/jar包/1.9/aclTousu.jar


+ 1 - 1
doc/部署文档/正式环境/正式环境版本更新文档.md

@@ -224,7 +224,7 @@ Content-Type: application/json
 
 {
   "city": 130200,
-  "role": [4],
+  "role": [6],
   "user": []
 }
 ```

+ 14 - 11
src/main/java/com/nokia/service/FlowService.java

@@ -73,10 +73,12 @@ public class FlowService {
         List<Integer> cityIds = new ArrayList<>();
         // areas 用于构建树结构的前两层
         List<Area> areas = new ArrayList<>();
-        if (userTreeReq.getCity() == -1) {
-            // 如果这里给的是河北省,那么需要取全部
+        // 这里检查一下查找条件的role不为空
+        List<Integer> queryRoles = (userTreeReq.getRole() == null || userTreeReq.getRole().size() == 0) ? null
+                : userTreeReq.getRole();
+        if (userTreeReq.getCity() == -1 || queryRoles == null) {
+            // 如果这里给的是河北省 或者 role 为空,那么需要取全部
             areas = areaDao.getAll();
-            cityIds = null;
         } else {
             // 都需要添加省级用户
             areas.add(areaDao.getByAreaId(-1));
@@ -84,6 +86,12 @@ public class FlowService {
             areas.add(areaDao.getByAreaId(userTreeReq.getCity()));
             // 添加地市对应的区县
             areas.addAll(areaDao.getByParentId(userTreeReq.getCity()));
+        }
+        // query用的cityIds
+        if (userTreeReq.getCity() == -1) {
+            // 如果这里给的是河北省,那么需要取全部
+            cityIds = null;
+        } else {
             cityIds.add(-1);
             cityIds.add(userTreeReq.getCity());
         }
@@ -134,12 +142,9 @@ public class FlowService {
                 second.put(areas.get(i).getAreaId(), list.size() - 1);
             }
         }
-        System.out.println(result);
-        System.out.println(second);
-        System.out.println("---------------");
-        List<User> users = userDao.getByRoleIds(userTreeReq.getRole(), cityIds);
-        System.out.println(users);
-        System.out.println("---------------");
+
+        // 查询符合条件的用户
+        List<User> users = userDao.getByRoleIds(queryRoles, cityIds);
         // key 区域(市公司或区域) value 一个列表,列表内放区域内全部的用户信息
         Map<Area, Object> userMap = new LinkedHashMap<>();
         // 将用户归类
@@ -156,8 +161,6 @@ public class FlowService {
             userList.add(map);
             userMap.put(area, userList);
         }
-        System.out.println(userMap);
-        System.out.println("---------------");
         // 把归类后的用户放入第三层
         for (Entry<Area, Object> entry : userMap.entrySet()) {
             if (entry.getKey().getTypeCode() < 3) {