get.jsp
12.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.*" %>
<%@ page import="java.util.*" %>
<%@ page import="weaver.hrm.*" %>
<%@ page import="weaver.systeminfo.*" %>
<%@ page import="weaver.general.*" %>
<%@ page import="java.lang.reflect.Method"%>
<%@ page import="weaver.conn.RecordSet"%>
<%@ page import="weaver.hrm.resource.ResourceComInfo"%>
<%@ page import="weaver.hrm.company.DepartmentComInfo"%>
<jsp:useBean id="cci" class="weaver.hrm.company.CompanyComInfo" scope="page" />
<jsp:useBean id="sci" class="weaver.hrm.company.SubCompanyComInfo" scope="page" />
<jsp:useBean id="dci" class="weaver.hrm.company.DepartmentComInfo" scope="page" />
<jsp:useBean id="rci" class="weaver.hrm.resource.ResourceComInfo" scope="page" />
<%
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
User user = HrmUserVarify.getUser(request , response);
if(user == null) return ;
int o = Util.getIntValue(Util.null2String(request.getParameter("o")));
int ot = Util.getIntValue(Util.null2String(request.getParameter("ot")));
String name = "";
String type = "";
String id = "";
String mobile = "";
String tel = "";
String mail = "";
if(ot==0&&o==0) {
cci.setTofirstRow();
cci.next();
name = cci.getCompanyname();
type = "0";
id = cci.getCompanyid();
%>
<a href="javascript:clickOrg(<%=type%>,<%=id%>);">
<div style="position:relative;height:38px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF',endColorstr='#D7E0E5' );background: -webkit-gradient(linear, left top, left bottom, from(#FFFFFF),to(#D7E0E5) );background: -moz-linear-gradient(top, #FFFFFF, #D7E0E5);" id="t_<%=type%>_<%=id%>" expand=0 isload=0>
<div id="i_<%=type%>_<%=id%>" style="position:absolute;left:10px;top:10px;right:10p x;height:30px;line-height:30px;"><img src="/mobile/plugin/6/images/icon1_wev8.png"></div>
<div id="l_<%=type%>_<%=id%>" style="position:absolute;left:40px;top:7px;right:10px;height:30px;line-height:30px;padding-right: 20px;" class="text-ellipsis"><%=name %></div>
<div style="position:absolute;top:10px;right:10px;height:30px;line-height:30px;"><img src="/mobile/plugin/6/images/icon4_wev8.png"></div>
</div>
</a>
<div style="border-top: solid 1px #C5C5C5;border-bottom: solid 1px #EBEBEB;" id="s_<%=type%>_<%=id%>"></div>
<%
} else if(ot==0&&o>0) {
sci.setTofirstRow();
while(sci.next()) {
if(Util.getIntValue(sci.getCompanyid())!=o || Util.getIntValue(sci.getSupsubcomid(), 0)!=0 || Util.getIntValue(sci.getCompanyiscanceled())==1) continue;
name = sci.getSubCompanyname();
type = "1";
id = sci.getSubCompanyid();
%>
<div style="position:relative;height:35px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#EFEFEF',endColorstr='#FFFFFF' );background: -webkit-gradient(linear, left top, left bottom, from(#EFEFEF),to(#FFFFFF) );background: -moz-linear-gradient(top, #EFEFEF, #FFFFFF);" id="t_<%=type%>_<%=id%>" expand=0 isload=0>
<a href="javascript:clickOrg(<%=type%>,<%=id%>);">
<div id="i_<%=type%>_<%=id%>" style="position:absolute;left:10px;top:8px;right:10px;height:30px;line-height:30px;"><img src="/mobile/plugin/6/images/icon1_wev8.png"></div>
<div id="l_<%=type%>_<%=id%>" style="position:absolute;left:40px;top:5px;right:10px;height:30px;line-height:30px;padding-right: 20px;" class="text-ellipsis"><%=name %></div>
<div style="position:absolute;top:10px;right:10px;height:30px;line-height:30px;"><img src="/mobile/plugin/6/images/icon4_wev8.png"></div>
</a>
</div>
<div style="border-top: solid 1px #C5C5C5;border-bottom: solid 1px #EBEBEB;" id="s_<%=type%>_<%=id%>"></div>
<%
}
%>
<%
} else if(ot==1&&o>0) {
%>
<%=getUserList(user,ot,o) %>
<%
dci.setTofirstRow();
while(dci.next()) {
int departmentsupdepid = Util.getIntValue(dci.getDepartmentsupdepid(), 0);
if(departmentsupdepid > 0) {
int supdepididx = dci.getIdIndexKey(""+departmentsupdepid);
if(supdepididx == -1) departmentsupdepid = 0;
}
if(Util.getIntValue(dci.getSubcompanyid1())!=o || departmentsupdepid!=0 || Util.getIntValue(dci.getDeparmentcanceled())==1) continue;
name = dci.getDepartmentname();
type = "2";
id = dci.getDepartmentid();
%>
<a href="javascript:clickOrg(<%=type%>,<%=id%>);">
<div style="position:relative;width:100%;height:35px;" id="t_<%=type%>_<%=id%>" expand=0 isload=0>
<div id="i_<%=type%>_<%=id%>" style="position:absolute;left:10px;top:8px;right:10px;height:30px;line-height:30px;"><img src="/mobile/plugin/6/images/icon2_wev8.png"></div>
<div id="l_<%=type%>_<%=id%>" style="position:absolute;left:40px;top:5px;right:10px;height:30px;line-height:30px;" class="text-ellipsis"><%=name %></div>
</div>
</a>
<div style="" id="s_<%=type%>_<%=id%>"></div>
<%
}
sci.setTofirstRow();
while(sci.next()) {
if(Util.getIntValue(sci.getSupsubcomid())!=o || Util.getIntValue(sci.getSupsubcomid(), 0)==0 || Util.getIntValue(sci.getCompanyiscanceled())==1) continue;
name = sci.getSubCompanyname();
type = "1";
id = sci.getSubCompanyid();
%>
<a href="javascript:clickOrg(<%=type%>,<%=id%>);">
<div style="position:relative;height:35px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#EFEFEF',endColorstr='#FFFFFF' );background: -webkit-gradient(linear, left top, left bottom, from(#EFEFEF),to(#FFFFFF) );background: -moz-linear-gradient(top, #EFEFEF, #FFFFFF);" id="t_<%=type%>_<%=id%>" expand=0 isload=0>
<div id="i_<%=type%>_<%=id%>" style="position:absolute;left:10px;top:8px;right:10p x;height:30px;line-height:30px;"><img src="/mobile/plugin/6/images/icon1_wev8.png"></div>
<div id="l_<%=type%>_<%=id%>" style="position:absolute;left:40px;top:5px;right:10px;height:30px;line-height:30px;padding-right: 20px;" class="text-ellipsis"><%=name %></div>
<div style="position:absolute;top:10px;right:10px;height:30px;line-height:30px;"><img src="/mobile/plugin/6/images/icon4_wev8.png"></div>
</div>
</a>
<div style="border-top: solid 1px #C5C5C5;border-bottom: solid 1px #EBEBEB;" id="s_<%=type%>_<%=id%>"></div>
<%
}
} else if(ot==2&&o>0) {
%>
<%=getUserList(user,ot,o) %>
<%
dci.setTofirstRow();
while(dci.next()) {
if(Util.getIntValue(dci.getDepartmentsupdepid())!=o || Util.getIntValue(dci.getDepartmentsupdepid(), 0)==0 || Util.getIntValue(dci.getDeparmentcanceled())==1) continue;
name = dci.getDepartmentname();
type = "2";
id = dci.getDepartmentid();
%>
<a href="javascript:clickOrg(<%=type%>,<%=id%>);">
<div style="position:relative;width:100%;height:35px;" id="t_<%=type%>_<%=id%>" expand=0 isload=0>
<div id="i_<%=type%>_<%=id%>" style="position:absolute;left:10px;top:8px;right:10p x;height:30px;line-height:30px;"><img src="/mobile/plugin/6/images/icon2_wev8.png"></div>
<div id="l_<%=type%>_<%=id%>" style="position:absolute;left:40px;top:5px;right:10px;height:30px;line-height:30px;" class="text-ellipsis"><%=name %></div>
</div>
</a>
<div style="" id="s_<%=type%>_<%=id%>"></div>
<%
}
}
%>
<%!
public String getUserList(User user,int type,int pid){
String html = "";
try{
String sql = "";//加入分权控制
try{
Class pvm = Class.forName("weaver.hrm.appdetach.AppDetachComInfo");
Method m = pvm.getDeclaredMethod("getScopeSqlByHrmResourceSearch",String.class);
sql = (String)m.invoke(pvm.newInstance(),user.getUID()+"");
}catch(Exception e){
}
if(sql.equals("")){//没有分权 从缓存获取人员
ResourceComInfo resourceComInfo = new ResourceComInfo();
resourceComInfo.setTofirstRow();
DepartmentComInfo dci = new DepartmentComInfo();
while(resourceComInfo.next()){
if(type==1){
if(Util.getIntValue(resourceComInfo.getSubCompanyID())!=pid||
dci.getIdIndexKey(resourceComInfo.getDepartmentID())>-1||
(Util.getIntValue(resourceComInfo.getStatus())!=0&&Util.getIntValue(resourceComInfo.getStatus())!=1&&
Util.getIntValue(resourceComInfo.getStatus())!=2&&Util.getIntValue(resourceComInfo.getStatus())!=3))
continue;
}else if(type==2){
if(Util.getIntValue(resourceComInfo.getDepartmentID())!=pid||
(Util.getIntValue(resourceComInfo.getStatus())!=0&&Util.getIntValue(resourceComInfo.getStatus())!=1&&
Util.getIntValue(resourceComInfo.getStatus())!=2&&Util.getIntValue(resourceComInfo.getStatus())!=3))
continue;
}
String id = Util.null2String(resourceComInfo.getResourceid());
String lastname = Util.null2String(resourceComInfo.getLastname());
String mobile = Util.null2String(resourceComInfo.getMobile()).trim();
String tel = Util.null2String(resourceComInfo.getTelephone()).trim();
String mail = Util.null2String(resourceComInfo.getEmail()).trim();
html+=getUserInfo(3,id,lastname,mobile,tel,mail);
}
}else{
RecordSet rs = new RecordSet();
String sql2 = "select * from HrmResource where (status =0 or status =1 or status =2 or status =3)";
if(type==1){
sql2+=" and subcompanyid1 = "+pid+" and (departmentid = '' or departmentid is null)";
}else if(type==2){
sql2+=" and departmentid = "+pid;
}
sql2+=" and "+sql;
rs.executeSql(sql2);
while(rs.next()){
String id = Util.null2String(rs.getString("id"));
String lastname = Util.null2String(rs.getString("lastname"));
String mobile = Util.null2String(rs.getString("mobile"));
String tel = Util.null2String(rs.getString("telephone"));
String mail = Util.null2String(rs.getString("email"));
html+=getUserInfo(3,id,lastname,mobile,tel,mail);
}
}
}catch(Exception e){
}
return html;
}
public String getUserInfo(int type,String id,String name,String mobile,String tel,String mail){
String userInfo = "<div style='position:relative;width:100%;height:150px;' id='t_"+type+"_"+id+"' expand=0 isload=0>"+
"<div id='b_"+type+"_"+id+"' style='position:absolute;left:10px;top:0px;right:10px;height:135px;border:solid 1px #C6C6C6;border-radius:5px;background:#F2F2F2;'>"+
"<div style='position:absolute;left:40px;top:-10px;height:6px;display:block;'><img src='/mobile/plugin/6/images/userinfoflag_wev8.png'></div>"+
"<div style='position:absolute;left:20px;top:10px;right:10px;height:20px;line-height:30px;'><img src='/mobile/plugin/6/images/icon3_wev8.png'></div>"+
"<div style='position:absolute;left:50px;top:5px;right:10px;height:30px;line-height:30px;' class='text-ellipsis'>"+name+"</div>";
if(!"".equals(mobile)) {
userInfo+="<a href='tel:"+mobile+"'>"+
"<div style='position:absolute;left:45px;top:35px;right:10px;height:20px;line-height:30px;'>"+
"<img src='/mobile/plugin/6/images/mobile_wev8.png'></div>"+
"<div style='position:absolute;left:70px;top:29px;right:10px;height:20px;line-height:30px;'>: "+mobile+"</div>"+
"</a>";
} else {
userInfo+="<div style='position:absolute;left:45px;top:35px;right:10px;height:20px;line-height:30px;'>"+
"<img src='/mobile/plugin/6/images/mobile_wev8.png'></div>"+
"<div style='position:absolute;left:70px;top:29px;right:10px;height:20px;line-height:30px;'>:</div>";
}
if(!"".equals(mobile)){
userInfo+="<a href='sms:"+mobile+"'>"+
"<div style='position:absolute;left:45px;top:60px;right:10px;height:20px;line-height:30px;'>"+
"<img src='/mobile/plugin/6/images/sms_wev8.png'></div>"+
"<div style='position:absolute;left:70px;top:52px;right:10px;height:20px;line-height:30px;'>: 发送短信</div>"+
"</a>";
} else {
userInfo+="<div style='position:absolute;left:45px;top:60px;right:10px;height:20px;line-height:30px;'>"+
"<img src='/mobile/plugin/6/images/sms_wev8.png'></div>"+
"<div style='position:absolute;left:70px;top:52px;right:10px;height:20px;line-height:30px;'>:</div>";
}
if(!"".equals(tel)) {
userInfo+="<a href='tel:"+tel+"'>"+
"<div style='position:absolute;left:45px;top:85px;right:10px;height:20px;line-height:30px;'>"+
"<img src='/mobile/plugin/6/images/tel_wev8.png'></div>"+
"<div style='position:absolute;left:70px;top:79px;right:10px;height:20px;line-height:30px;'>: "+tel+"</div>"+
"</a>";
} else {
userInfo+="<div style='position:absolute;left:45px;top:85px;right:10px;height:20px;line-height:30px;'>"+
"<img src='/mobile/plugin/6/images/tel_wev8.png'></div>"+
"<div style='position:absolute;left:70px;top:79px;right:10px;height:20px;line-height:30px;'>:</div>";
}
if(!"".equals(mail)) {
userInfo+="<a href='mailto:"+mail+"'>"+
"<div style='position:absolute;left:45px;top:110px;right:10px;height:20px;line-height:30px;'>"+
"<img src='/mobile/plugin/6/images/mail_wev8.png'></div>"+
"<div style='position:absolute;left:70px;top:104px;right:10px;height:30px;line-height:30px;' class='text-ellipsis'>: "+mail+"</div>"+
"</a>";
} else {
userInfo+="<div style='position:absolute;left:45px;top:110px;right:10px;height:20px;line-height:30px;'>"+
"<img src='/mobile/plugin/6/images/mail_wev8.png'></div>";
}
userInfo+="</div></div>";
return userInfo;
}
%>