MassMaintIframe.jsp
8.34 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
<!DOCTYPE html>
<%@ page import="weaver.general.Util"%>
<%@page import="weaver.hrm.common.database.dialect.DialectUtil"%>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<jsp:useBean id="FieldRecord" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="DataRecord" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page" />
<jsp:useBean id="GetShowCondition" class="weaver.workflow.workflow.GetShowCondition" scope="page" />
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%
//矩阵id
String matrixid = Util.null2String(request.getParameter("matrixid"));
//需要展示相关人员的信息
String objid = Util.null2String(request.getParameter("objid"));
String objidname = "";
if(!"".equals(objid)){
objidname = ResourceComInfo.getLastname(objid);
}
// 是否 初始化 count 值标志。 0 是不初始化
String countinit = Util.null2String(request.getParameter("countinit"));
String method = Util.null2String(request.getParameter("method"));
boolean isOracle = FieldRecord.getDBType().equals("oracle");
int totalcount = 0;
StringBuffer backfileds = new StringBuffer();
StringBuffer wheresql = new StringBuffer();
String sql = "";
//存储字段的所有信息
List<Properties> proplist = new ArrayList<Properties>();
//根据 matrixid olduserid 查询符合条件的记录数
if("queryrecord".equals(method)){
//查询在 matrixid 矩阵中,涉及 olduserid 有多少条记录
//判断表名是否创建
sql ="select * from MatrixFieldInfo where matrixid="+matrixid+" order by fieldtype , priority asc";
int count = 0;
FieldRecord.execute(sql);
totalcount = FieldRecord.getCounts();
if(!isOracle && !DialectUtil.isMySql(FieldRecord.getDBType())){
while(FieldRecord.next()){//表格已创建,找出所有的字段
String str = FieldRecord.getString("fieldname");
//存储数据
Properties prop = new Properties();
prop.put("fieldname",str);
prop.put("colwidth",FieldRecord.getString("colwidth"));
prop.put("displayname",FieldRecord.getString("displayname"));
prop.put("browsertypeid",FieldRecord.getString("browsertypeid"));
prop.put("browservalue",FieldRecord.getString("browservalue"));
prop.put("custombrowser",FieldRecord.getString("custombrowser"));
proplist.add(prop);
count ++;
if(totalcount == count){//最后一条记录
backfileds.append("','+"+str+"+',' as "+ str);
//只获取 取值 字段
if(!"0".equals(FieldRecord.getString("fieldtype"))){
wheresql.append(str+" like '%,"+objid+",%'");
}
}else{//非最后一条记录
backfileds.append("','+"+str+"+',' as "+ str+",");
if(!"0".equals(FieldRecord.getString("fieldtype"))){
wheresql.append(str+" like '%,"+objid+",%' or ");
}
}
}
}else if(DialectUtil.isMySql(FieldRecord.getDBType())){
while(FieldRecord.next()){//表格已创建,找出所有的字段
String str = FieldRecord.getString("fieldname");
count ++;
//存储数据
Properties prop = new Properties();
prop.put("fieldname",str);
prop.put("colwidth",FieldRecord.getString("colwidth"));
prop.put("displayname",FieldRecord.getString("displayname"));
prop.put("browsertypeid",FieldRecord.getString("browsertypeid"));
prop.put("browservalue",FieldRecord.getString("browservalue"));
prop.put("custombrowser",FieldRecord.getString("custombrowser"));
proplist.add(prop);
if(totalcount == count){//最后一条记录
backfileds.append("concat(',',"+str+",',') as "+ str);
if(!"0".equals(FieldRecord.getString("fieldtype"))){
wheresql.append(str+" like '%,"+objid+",%'");
}
}else{//非最后一条记录
backfileds.append("concat(',',"+str+",',') as "+ str+",");
if(!"0".equals(FieldRecord.getString("fieldtype"))){
wheresql.append(str+" like '%,"+objid+",%' or ");
}
}
}
}else{
while(FieldRecord.next()){//表格已创建,找出所有的字段
String str = FieldRecord.getString("fieldname");
count ++;
//存储数据
Properties prop = new Properties();
prop.put("fieldname",str);
prop.put("colwidth",FieldRecord.getString("colwidth"));
prop.put("displayname",FieldRecord.getString("displayname"));
prop.put("browsertypeid",FieldRecord.getString("browsertypeid"));
prop.put("browservalue",FieldRecord.getString("browservalue"));
prop.put("custombrowser",FieldRecord.getString("custombrowser"));
proplist.add(prop);
if(totalcount == count){//最后一条记录
backfileds.append("','||"+str+"||',' as "+ str);
if(!"0".equals(FieldRecord.getString("fieldtype"))){
wheresql.append(str+" like '%,"+objid+",%'");
}
}else{//非最后一条记录
backfileds.append("','||"+str+"||',' as "+ str+",");
if(!"0".equals(FieldRecord.getString("fieldtype"))){
wheresql.append(str+" like '%,"+objid+",%' or ");
}
}
}
}
if(!"".equals(backfileds+"")){//说明有字段,有表
if(!isOracle){
sql = "select * from (select "+backfileds+" from Matrixtable_"+matrixid+") as matrixtable ";
}else{
sql = "select * from (select "+backfileds+" from Matrixtable_"+matrixid+") matrixtable ";
}
if(!"".equals(wheresql.toString())){
sql += " where " + wheresql.toString();
}
System.out.println(">>>>>:"+sql);
DataRecord.execute(sql);
totalcount = DataRecord.getCounts();
}else{
totalcount = 0;
}
}
%>
<style>
table.result {
width: 100%;
}
table.result thead{
background: #ECFDEA;
}
table.result th{
color: #999;
font-weight: 400;
padding: 5px;
height: 21px;
background-color: rgb(248,248,248);
border-bottom: 2px solid #B7E0FE;
}
table.result td{
line-height: 20px;
padding: 5px;
text-align: center;
height: 23px;
border-bottom: 1px solid #e9e9e9;
}
</style>
<HTML>
<HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<script type="text/javascript">
$(function () {
<% if(!"0".equals(countinit)){ %>
parent.initCount(<%=totalcount %>);
parent.initUpdateCount(0);
<% } %>
var searchLength = "<%=objidname.length() %>";
jQuery(".result td").each(function (){
var text=jQuery(this).text();
if(searchLength>0){
innerText=text.toLowerCase();
bindex=innerText.indexOf("<%=objidname%>");
if(bindex!=-1){
searchStr=text.substr(bindex,searchLength);
innerHtml="<label class='search_view'><font color='#39ae1f'><%=objidname%></font></label>";
text=text.replace(searchStr,innerHtml);
}
}
jQuery(this).html(text);
});
});
</script>
</head>
<%
String imagefilename = "/images/hdMaintenance_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(33923, user.getLanguage());
String needfav = "1";
String needhelp = "";
%>
<BODY>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<table class="result" cellspacing="0">
<thead>
<tr>
<%
for(Properties prop : proplist){ %>
<th width="<%=prop.getProperty("colwidth") %>px"><%=prop.getProperty("displayname") %></th>
<%} %>
</tr>
</thead>
<tbody>
<% if(totalcount !=0){ %>
<% while(DataRecord.next()){ %>
<tr>
<% for(Properties prop : proplist){
String fielddbtype = "";
if(!prop.getProperty("custombrowser").equals("0")&&!prop.getProperty("custombrowser").equals("")){
fielddbtype = prop.getProperty("browservalue");
}
%>
<td><%=GetShowCondition.getShowCN("3",prop.getProperty("browsertypeid"),DataRecord.getString(prop.getProperty("fieldname")),"0",fielddbtype) %></td>
<%} %>
</tr>
<%} %>
<%}else{ %>
<tr>
<td colspan="<%= proplist.size() %>"><%=SystemEnv.getHtmlLabelName(22521, user.getLanguage()) %></td>
</tr>
<%} %>
</tbody>
</table>
</BODY>
</HTML>