convertPage.jsp
2.3 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
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.*" %>
<%@ page import="weaver.conn.*" %>
<%@page import="com.weaver.formmodel.util.StringHelper"%>
<%@page import="weaver.hrm.User"%>
<%@page import="weaver.hrm.HrmUserVarify"%>
<%
User user = HrmUserVarify.getUser(request, response);
if(user==null) {
response.sendRedirect("/login/Login.jsp");
return;
}
String modeid = StringHelper.null2String(request.getParameter("modeid"));//421
String key = StringHelper.null2String(request.getParameter("key"));//obj1
String val = StringHelper.null2String(request.getParameter("val"));
if(StringHelper.isEmpty(modeid)){
response.sendRedirect("/notice/noright.jsp");
return;
}
RecordSet rs = new RecordSet();
String sql = "";
String formid = "";
sql = "SELECT a.formid,b.tablename FROM modeinfo a ,workflow_bill b WHERE a.formid=b.id AND a.id="+modeid;
rs.execute(sql);
if(rs.next()){
formid = rs.getString("formid");
String tablename = rs.getString("tablename");
sql = "select id from "+tablename+" where "+key+"='"+val+"'";
}
if(!StringHelper.isEmpty(modeid)){
sql += " and formmodeid="+modeid;
}
rs.execute(sql);
String url = "";
if(rs.next()){
String billid = rs.getString("id");
String params = request.getQueryString();
String[] arr = params.split("&");
String param = "";
for (int i = 0; i < arr.length; i++) {
String s = arr[i];
if(s.startsWith("modeid=")||s.startsWith("key=")||s.startsWith("val=")||s.startsWith("pkfield=")){
continue;
}else{
param += "&"+s;
}
}
url = "/spa/cube/index.jsp#/main/cube/card?type=0&modeId="+modeid+"&formId="+formid+"&billid="+billid+"&opentype=0"+param;
response.sendRedirect(url);
return;
}
String msg = "no data";
%>
<html>
<style>
TABLE.ViewForm {
WIDTH: 100%;
border: 0;
margin: 0;
border-collapse: collapse;
BACKGROUND-COLOR: #F7F7F7;
padding: 15px;
}
tr.Section th{
margin: 10px;
line-height: 35px;
}
</style>
<body>
<table class="ViewForm">
<tbody>
<tr>
<td valign="top">
<table>
<tbody>
<tr class="Section">
<th style="font-size: 8pt">
<%=msg %>
</th>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>