|
@@ -23,9 +23,9 @@ public class OrgBuilderImplSgiip extends OrgBuilder {
|
23
|
23
|
// String deptsql = "select id,dept_code,dept_name,parent_id,order_no from to_horizon_dept where id!='root_node_id' order by order_no";
|
24
|
24
|
|
25
|
25
|
String deptsql = "";
|
26
|
|
- deptsql += " select d.id,d.dept_code,d.dept_name, ( select a.id from sgiip.sys_department a where a.dept_code = d.f_id ) as parent_id ,";
|
|
26
|
+ deptsql += " select d.id,d.dept_code,d.dept_name, ( select a.id from SGIIP.sys_department a where a.dept_code = d.f_id and a.cancel_flag = '0') as parent_id ,";
|
27
|
27
|
deptsql += " 'D' as type ,0 as order_no ";
|
28
|
|
- deptsql += " from sgiip.sys_department d where d.cancel_flag = '0' and d.dept_code!='D' ";
|
|
28
|
+ deptsql += " from SGIIP.sys_department d where d.cancel_flag = '0' and d.dept_code!='D' ";
|
29
|
29
|
|
30
|
30
|
|
31
|
31
|
List<Map<String, Object>> deptmap = Access.getMultiMap(deptsql, null, dbIdentifier);
|
|
@@ -33,7 +33,7 @@ public class OrgBuilderImplSgiip extends OrgBuilder {
|
33
|
33
|
List<OrgData> datas = Lists.newArrayList();
|
34
|
34
|
//处理根部门
|
35
|
35
|
OrgData data_r = new OrgData();
|
36
|
|
- data_r.setId("1");
|
|
36
|
+ data_r.setId("42CA714042F611B294EBBFC341F14635");
|
37
|
37
|
data_r.setName("部门导航");
|
38
|
38
|
data_r.setParentId("0");
|
39
|
39
|
data_r.setType("D");
|
|
@@ -46,7 +46,7 @@ public class OrgBuilderImplSgiip extends OrgBuilder {
|
46
|
46
|
String sort = map.get("order_no") == null ? "" : map.get("order_no").toString();
|
47
|
47
|
|
48
|
48
|
if ("0".equals(parentId)) {
|
49
|
|
- parentId = "1"; //部门导航、最顶层
|
|
49
|
+ parentId = "42CA714042F611B294EBBFC341F14635"; //部门导航、最顶层
|
50
|
50
|
}
|
51
|
51
|
//一个data对象封装一个部门信息
|
52
|
52
|
OrgData data_d = new OrgData();
|
|
@@ -75,7 +75,7 @@ public class OrgBuilderImplSgiip extends OrgBuilder {
|
75
|
75
|
// String usersql = "select u.id,u.login_name,u.name,tor.dept_id from to_horizon_user u,tor_horizon_user_dept tor where u.id = tor.user_id";
|
76
|
76
|
// String usersql = "select u.id,u.user_name as login_name,u.user_desc,tor.dept_id from sgiip.sys_user u,sgiip.sys_user_department tor where u.id = tor.user_id";
|
77
|
77
|
String usersql = "";
|
78
|
|
- usersql += " SELECT u.id,u.user_name as LOGIN_NAME,u.user_desc as NAME,tor.DEPT_ID ,'' as type FROM sgiip.sys_user u,sgiip.sys_user_department tor WHERE u.ID = tor.USER_ID";
|
|
78
|
+ usersql += " SELECT u.id,u.user_name as LOGIN_NAME,u.user_desc as NAME,tor.DEPT_ID ,'' as type FROM SGIIP.sys_user u,SGIIP.sys_user_department tor WHERE u.ID = tor.USER_ID";
|
79
|
79
|
usersql += " union all";
|
80
|
80
|
usersql += " select '1' as id ,'admin' as login_name ,'超级管理员' as NAME ,'0' as DEPT_ID ,'' as type from dual";
|
81
|
81
|
|
|
@@ -164,7 +164,7 @@ public class OrgBuilderImplSgiip extends OrgBuilder {
|
164
|
164
|
String deptsql = "";
|
165
|
165
|
deptsql += " select d.id,d.post_code,d.post_name, 'position_root' as parent_id,";
|
166
|
166
|
deptsql += " 'P' as type ,0 as order_no";
|
167
|
|
- deptsql += " from sgiip.sys_post d where d.cancel_flag = '0'";
|
|
167
|
+ deptsql += " from SGIIP.sys_post d where d.cancel_flag = '0'";
|
168
|
168
|
|
169
|
169
|
|
170
|
170
|
List<Map<String, Object>> deptmap = Access.getMultiMap(deptsql, null, dbIdentifier);
|
|
@@ -207,7 +207,7 @@ public class OrgBuilderImplSgiip extends OrgBuilder {
|
207
|
207
|
|
208
|
208
|
|
209
|
209
|
private Map<String, List<User>> getUsersAndPost(String dbIdentifier) {
|
210
|
|
- String usersql = " SELECT u.id,u.user_name as LOGIN_NAME,u.user_desc as NAME,tor.post_ID ,'' as type FROM sgiip.sys_user u,sgiip.sys_user_post tor WHERE u.ID = tor.USER_ID ";
|
|
210
|
+ String usersql = " SELECT u.id,u.user_name as LOGIN_NAME,u.user_desc as NAME,tor.post_ID ,'' as type FROM SGIIP.sys_user u,SGIIP.sys_user_post tor WHERE u.ID = tor.USER_ID ";
|
211
|
211
|
List<Map<String, Object>> userMap = Access.getMultiMap(usersql, null, dbIdentifier);
|
212
|
212
|
Map<String, List<User>> usersAndDept = new HashMap<String, List<User>>();
|
213
|
213
|
for (Map<String, Object> map : userMap) {
|
|
@@ -282,7 +282,7 @@ public class OrgBuilderImplSgiip extends OrgBuilder {
|
282
|
282
|
// String sql="SELECT u.id,u.LOGIN_NAME,'F;D' as type,u.NAME,tor.DEPT_ID FROM TO_HORIZON_USER u,TOR_HORIZON_USER_DEPT tor WHERE u.ID = tor.USER_ID";
|
283
|
283
|
|
284
|
284
|
String sql = "";
|
285
|
|
- sql += " SELECT u.id,u.user_name as LOGIN_NAME,u.user_desc as NAME,tor.DEPT_ID ,'' as type FROM sgiip.sys_user u,sgiip.sys_user_department tor WHERE u.ID = tor.USER_ID";
|
|
285
|
+ sql += " SELECT u.id,u.user_name as LOGIN_NAME,u.user_desc as NAME,tor.DEPT_ID ,'' as type FROM SGIIP.sys_user u,SGIIP.sys_user_department tor WHERE u.ID = tor.USER_ID";
|
286
|
286
|
sql += " union all";
|
287
|
287
|
sql += " select '1' as id ,'admin' as login_name ,'超级管理员' as NAME ,'0' as DEPT_ID ,'' as type from dual";
|
288
|
288
|
|
|
@@ -304,7 +304,7 @@ public class OrgBuilderImplSgiip extends OrgBuilder {
|
304
|
304
|
u.setId(id);
|
305
|
305
|
u.setUserName(name);
|
306
|
306
|
u.setLoginName(loginName);
|
307
|
|
- u.setPasswd("1234");//密码,一般设置默认统一的密码
|
|
307
|
+ u.setPasswd("xxjsgs@1234");//密码,一般设置默认统一的密码
|
308
|
308
|
u.setDepartment(listDept);
|
309
|
309
|
u.setOrderNo(1);//用户排序,可选
|
310
|
310
|
|