billWeekPlan_custompage.jsp
11.8 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
<%@ page import="weaver.systeminfo.SystemEnv" %>
<%@ page import="weaver.hrm.User" %>
<%@ page import="weaver.hrm.HrmUserVarify" %>
<%@ page import="weaver.general.Util" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<html>
<body>
<%
User user = HrmUserVarify.getUser(request, response);
%>
<table id="table1">
<tbody id="title1">
<tr id="" name="" class="" style="height: 30px;">
<td rowspan="1" colspan="2" >
<%--本周原工作计划--%>
<div data-cellmark="main_-1_1" align="center"><span style="font-size: 9pt;font-family: Verdana;font-weight: bold;"><%=SystemEnv.getHtmlLabelName(20561, user.getLanguage())%></span></div>
</td>
</tr>
<tr id="" name="" class="" style="height: 30px;"><td></td></tr>
</tbody>
</table>
<div id="div-1">
<div data-cellmark="main_-1">
<div class="excelDetailTableDiv" id="dTableArea_-1" data-groupid="2" data-allowxscroll="false">
<div class="excelDetailFixedHead" style="display: none;">
<table class="excelDetailTable" id="oTable-1_head" style="width: 100%;">
<tbody>
<tr class="detailControlWidth">
<td class="" style="width: 9%;"></td>
<td class="" style="width: 30%;"></td>
<td class="" style="width: 30%;"></td>
<td class="" style="width: 30%;"></td>
</tr>
<tr style="height: 30px;">
<td rowspan="1" colspan="1" class="detail_3_1_1 etype_2">
<div data-cellmark="detail_-1_1_1" style="display: inline-block;">
<span><%=SystemEnv.getHtmlLabelName(15486, user.getLanguage())%></span></div>
</td>
<td rowspan="1" colspan="1" class="detail_3_1_1 etype_2">
<div data-cellmark="detail_-1_1_1" style="display: inline-block;">
<span><%=SystemEnv.getHtmlLabelName(15499, user.getLanguage())%></span></div>
</td>
<td rowspan="1" colspan="1" class="detail_3_1_2 etype_2">
<div data-cellmark="detail_-1_1_2" style="display: inline-block;">
<span><%=SystemEnv.getHtmlLabelName(15500, user.getLanguage())%></span></div>
</td>
<td rowspan="1" colspan="1" class="detail_3_1_3 etype_2">
<div data-cellmark="detail_-1_1_3" style="display: inline-block;">
<span><%=SystemEnv.getHtmlLabelName(15501, user.getLanguage())%></span></div>
</td>
</tr>
</tr>
</tbody>
</table>
</div>
<div class="excelDetailContent">
<table class="excelDetailTable" id="oTable-1" name="oTable-1" style="width: 100%;">
<tbody>
<tr class="detailControlWidth">
<td class="" style="width: 9%;"></td>
<td class="" style="width: 30%;"></td>
<td class="" style="width: 30%;"></td>
<td class="" style="width: 30%;"></td>
</tr>
<tr style="height: 30px;">
<td rowspan="1" colspan="1" class="detail_3_1_1 etype_2">
<%-- 序号--%>
<div data-cellmark="detail_-1_1_1" style="display: inline-block;">
<span><%=SystemEnv.getHtmlLabelName(15486, user.getLanguage())%></span></div>
</td>
<td rowspan="1" colspan="1" class="detail_3_1_1 etype_2">
<%-- 主要计划事项--%>
<div data-cellmark="detail_-1_1_1" style="display: inline-block;">
<span><%=SystemEnv.getHtmlLabelName(15499, user.getLanguage())%></span></div>
</td>
<td rowspan="1" colspan="1" class="detail_3_1_2 etype_2">
<%-- 预计完成时间 --%>
<div data-cellmark="detail_-1_1_2" style="display: inline-block;">
<span><%=SystemEnv.getHtmlLabelName(15500, user.getLanguage())%></span></div>
</td>
<td rowspan="1" colspan="1" class="detail_3_1_3 etype_2">
<%-- 关键因素--%>
<div data-cellmark="detail_-1_1_3" style="display: inline-block;">
<span><%=SystemEnv.getHtmlLabelName(15501, user.getLanguage())%></span></div>
</td>
</tr>
<%
int userid = user.getUID();
int requestid = Util.getIntValue(request.getParameter("requestid"), 0);
int iscreate = Util.getIntValue(request.getParameter("iscreate"), 0);
String sql = "";
//查主表数据最新的requestid对应的id,用这个id关联查出明细表3的所有数据
if ("mysql".equals(rs.getDBType())) {
if (iscreate == 1) {
sql = "select * from bill_workinfoWeekDt3 where infoid=(select b.id from bill_workinfoWeekDt3 a,bill_workinfo b where a.infoid=b.id and b.resourceid=" + userid + " order by requestid desc limit 1) order by id";
}else {
rs.executeSql("select resourceid from bill_workinfo where requestid="+requestid);
rs.next();
userid= Util.getIntValue(rs.getString("resourceid"));
sql = "select * from bill_workinfoWeekDt3 where infoid=(select b.id from bill_workinfoWeekDt3 a,bill_workinfo b where a.infoid=b.id and b.resourceid=" + userid + " and requestid < " + requestid + " order by requestid desc limit 1) order by id";
}
System.out.println("执行的sql:" + sql);
rs.execute(sql);
} else if("sqlserver".equals(rs.getDBType())){
if (iscreate == 1) {
sql = "select * from bill_workinfoWeekDt3 where infoid=(select top 1 b.id from bill_workinfoWeekDt3 a,bill_workinfo b where a.infoid=b.id and b.resourceid=" + userid + " order by requestid desc) order by id";
}else {
rs.executeSql("select resourceid from bill_workinfo where requestid="+requestid);
rs.next();
userid= Util.getIntValue(rs.getString("resourceid"));
sql = "select * from bill_workinfoWeekDt3 where infoid=(select top 1 b.id from bill_workinfoWeekDt3 a,bill_workinfo b where a.infoid=b.id and b.resourceid=" + userid + " and requestid < " + requestid + " order by requestid desc) order by id";
}
System.out.println("执行的sql:" + sql);
rs.execute(sql);
}else {
//创建节点则不加条件requestid条件.并且创建人就是当前操作者,userid可以直接取
if (iscreate == 1) {
sql = "select * from bill_workinfoWeekDt3 where infoid=(select id from (select b.* from bill_workinfo b,bill_workinfoWeekDt3 a where a.infoid=b.id and b.resourceid=" + userid + " order by requestid desc) where rownum=1 ) order by id";
}else {
//userid查主表数据获得,保证是创建人的上周计划
rs.executeSql("select resourceid from bill_workinfo where requestid="+requestid);
rs.next();
userid= Util.getIntValue(rs.getString("resourceid"));
//编辑、查看等非创建节点要加requestid条件,保证显示的是上次的周计划。
sql="select * from bill_workinfoWeekDt3 where infoid=(select id from (select b.* from bill_workinfo b,bill_workinfoWeekDt3 a where a.infoid=b.id and b.resourceid=" + userid + " and requestid < " + requestid + " order by requestid desc) where rownum=1 ) order by id";
}
System.out.println("执行的sql:" + sql);
rs.execute(sql);
}
int index = 1;
while (rs.next()) {
String curworknameold = rs.getString("workname");
String curdateold = rs.getString("forecastdate");
String curworkdescold = rs.getString("workdesc");
%>
<tr class="" style="height: 30px;">
<td align="center" class="mainTd_1_1 etype_3 " style="font-size: 9pt;font-family: Microsoft YaHei; text-align: center;"><%=index%></td>
<td align="center" class="mainTd_1_1 etype_3" style="font-size: 9pt;font-family: Microsoft YaHei;"><%=Util.toScreenToEdit(curworknameold, user.getLanguage())%></td>
<td align="center" class="mainTd_1_1 etype_3" style="font-size: 9pt;font-family: Microsoft YaHei;"><%=Util.toScreenToEdit(curdateold, user.getLanguage())%></td>
<td align="center" class="mainTd_1_1 etype_3" style="font-size: 9pt;font-family: Microsoft YaHei;"><%=Util.toScreenToEdit(curworkdescold, user.getLanguage())%></td>
</tr>
<%
index = index + 1;
}
%>
</tbody>
</table>
</div>
</div>
</div>
</div>
<table id="table2">
<tbody id="title2">
<tr id="" name="" class="" style="height: 30px;"><td></td></tr>
<tr id="" name="" class="" style="height: 30px;">
<td rowspan="1" colspan="2" >
<%-- 本周工作小结--%>
<div data-cellmark="main_-2_1" align="center"><span style="font-size: 9pt;font-family: Verdana;font-weight: bold;"><%=SystemEnv.getHtmlLabelName(15493, user.getLanguage())%></span></div>
</td>
</tr>
</tbody>
</table>
<table id="table3">
<tbody id="title3">
<tr id="" name="" class="" style="height: 30px;">
<td rowspan="1" colspan="2" >
<%-- 下周工作计划--%>
<div data-cellmark="main_-3_1" align="center"><span style="font-size: 9pt;font-family: Verdana;font-weight: bold;"><%=SystemEnv.getHtmlLabelName(15498, user.getLanguage())%></span></div>
</td>
</tr>
</tbody>
</table>
</body>
<script language="JavaScript">
$(document).ready(function () {
var table0 = $("#div-1").html();
var title1 = $("#title1").html();
var title2 = $("#title2").html();
var title3 = $("#title3").html();
var tr = "<tr id=\"\" name=\"\" class=\"\" style=\"height: 30px;\"><td rowspan=\"1\" colspan=\"2\" class=\"\">" + table0 + "</td></tr>";
$("#oTable0").closest("tr").before(title1,tr,title2);
$("#oTable2").closest("tr").before(title3);
$("#div-1").remove();
$("#table1").remove();
$("#table2").remove();
$("#table3").remove();
});
</script>
</html>