|
@@ -37,6 +37,9 @@ public class UserService {
|
37
|
37
|
@Value("${app.table.app_user}")
|
38
|
38
|
private String k_app_user;
|
39
|
39
|
|
|
40
|
+ @Value("${app.type}")
|
|
41
|
+ private String appType;
|
|
42
|
+
|
40
|
43
|
/***
|
41
|
44
|
* 当前登录用户
|
42
|
45
|
* @return
|
|
@@ -75,28 +78,41 @@ public class UserService {
|
75
|
78
|
@Cacheable(cacheNames = {"user"},key = "#name")
|
76
|
79
|
})
|
77
|
80
|
public Map getUser(String name,String appid){
|
78
|
|
- String strSQL = "select t.id,t.name,null email,null avatar,t.is_super ,a.id staff_id,a.name staff,a.code staff_code,a.note,z.s_id,\n" +
|
79
|
|
- " case when a.gender = 1 then '男' else '女' end gender_name,a.tel,c.name department\n" +
|
80
|
|
- "from " + k_user + " t\n" +
|
81
|
|
- "LEFT JOIN k_user_staff z on z.u_id = t.id and z.app_id = {1}\n" +
|
82
|
|
- "LEFT JOIN k_staff a on a.app_id = z.app_id and a.id = z.s_id\n" +
|
83
|
|
- "LEFT JOIN k_staff_department b on b.s_id = a.id\n" +
|
84
|
|
- "LEFT JOIN k_department c on c.app_id = z.app_id and c.id = b.d_id\n" +
|
85
|
|
- "where t.name='{0}'";
|
86
|
|
-
|
87
|
|
-
|
88
|
|
- Map user = queryService.find(strSQL,name,appid);
|
89
|
|
-
|
90
|
|
-
|
91
|
|
- //查找部门信息
|
92
|
|
- strSQL = "select z.*\n" +
|
93
|
|
- "from k_staff_department t,k_department z\n" +
|
94
|
|
- "where t.s_id={0} and z.id = t.d_id order by t.type desc";
|
95
|
|
- if(null != user.get("staff_id") && !user.get("staff_id").toString().equals("")){
|
96
|
|
- List<Map> departments = queryService.select(strSQL,user.get("staff_id"));
|
97
|
|
- user.put("departments",departments);
|
98
|
|
- } else {
|
99
|
|
- user.put("departments",new ArrayList<Map>());
|
|
81
|
+ Map user = null;
|
|
82
|
+ String strSQL = "";
|
|
83
|
+ if(appType.equals("1")) { //中联账号体系
|
|
84
|
+
|
|
85
|
+ strSQL = "select t.id,t.name,null email,null avatar,t.is_super ,a.id staff_id,a.name staff,a.code staff_code,a.note,z.s_id,\n" +
|
|
86
|
+ " case when a.gender = 1 then '男' else '女' end gender_name,a.tel,c.name department\n" +
|
|
87
|
+ "from " + k_user + " t\n" +
|
|
88
|
+ "LEFT JOIN k_user_staff z on z.u_id = t.id and z.app_id = {1}\n" +
|
|
89
|
+ "LEFT JOIN k_staff a on a.app_id = z.app_id and a.id = z.s_id\n" +
|
|
90
|
+ "LEFT JOIN k_staff_department b on b.s_id = a.id\n" +
|
|
91
|
+ "LEFT JOIN k_department c on c.app_id = z.app_id and c.id = b.d_id\n" +
|
|
92
|
+ "where t.name='{0}'";
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+ user = queryService.find(strSQL, name, appid);
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+ //查找部门信息
|
|
99
|
+ strSQL = "select z.*\n" +
|
|
100
|
+ "from k_staff_department t,k_department z\n" +
|
|
101
|
+ "where t.s_id={0} and z.id = t.d_id order by t.type desc";
|
|
102
|
+ if (null != user.get("staff_id") && !user.get("staff_id").toString().equals("")) {
|
|
103
|
+ List<Map> departments = queryService.select(strSQL, user.get("staff_id"));
|
|
104
|
+ user.put("departments", departments);
|
|
105
|
+ } else {
|
|
106
|
+ user.put("departments", new ArrayList<Map>());
|
|
107
|
+ }
|
|
108
|
+ }else {
|
|
109
|
+ strSQL = "select t.id,t.name,null email,null avatar,t.is_super ,null staff_id,null staff,null staff_code, null note,null s_id,\n" +
|
|
110
|
+ " null gender_name,null tel,null department\n" +
|
|
111
|
+ "from " + k_user + " t\n" +
|
|
112
|
+ "where t.name='{0}'";
|
|
113
|
+
|
|
114
|
+ user = queryService.find(strSQL, name, appid);
|
|
115
|
+ user.put("departments", new ArrayList<Map>());
|
100
|
116
|
}
|
101
|
117
|
|
102
|
118
|
|
|
@@ -219,7 +235,7 @@ public class UserService {
|
219
|
235
|
"from k_role_priv t,k_module_priv z,k_module_priv_detail a\n" +
|
220
|
236
|
"where t.r_id in({0})\n" +
|
221
|
237
|
" and t.p_code = z.code and a.code = z.code\n" +
|
222
|
|
- " and a.type = 3";
|
|
238
|
+ " /*and a.type = 3*/";
|
223
|
239
|
|
224
|
240
|
List<Map> list = queryService.select(strSQL,roleIds);
|
225
|
241
|
load(list);
|