PieceRateMaintenance.jsp
4.72 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
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.Util" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page" />
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page"/>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="CheckSubCompanyRight" class="weaver.systeminfo.systemright.CheckSubCompanyRight" scope="page" />
<HTML><HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
</head>
<%
boolean hasright=true;
if(!HrmUserVarify.checkUserRight("PieceRate:maintenance", user)){
response.sendRedirect("/notice/noright.jsp");
return;
}
int subcompanyid=Util.getIntValue(request.getParameter("subCompanyId"));
int departmentid=Util.getIntValue(request.getParameter("departmentid"));
String title="";
String sqlwhere=" where 1=2" ;
if(subcompanyid>0){
title=SubCompanyComInfo.getSubCompanyname(""+subcompanyid);
sqlwhere=" where subcompanyid="+subcompanyid;
}
if(departmentid>0){
title=DepartmentComInfo.getDepartmentname(""+departmentid);
subcompanyid=Util.getIntValue(DepartmentComInfo.getSubcompanyid1(""+departmentid));
sqlwhere=" where departmentid="+departmentid;
}
//是否分权系统,如不是,则不显示框架,直接转向到列表页面
int detachable=Util.getIntValue((String)session.getAttribute("detachable"));
if(detachable==1){
if(subcompanyid>0){
int operatelevel= CheckSubCompanyRight.ChkComRightByUserRightCompanyId(user.getUID(),"PieceRate:maintenance",subcompanyid);
if(operatelevel==-1){
response.sendRedirect("/notice/noright.jsp");
return;
}
if(operatelevel<1){
hasright=false;
}
}else{
hasright=false;
}
}
String imagefilename = "/images/hdHRM_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(19377,user.getLanguage())+":"+title;
String needfav ="1";
String needhelp ="";
ArrayList yearslist=new ArrayList();
ArrayList [] monthlist=null;
rs.executeSql("select PieceYear from HRM_PieceRateInfo "+sqlwhere+" group by PieceYear");
if(rs.next()){
if(rs.getCounts()>0){
monthlist=new ArrayList[rs.getCounts()];
}
}
if(monthlist!=null){
for(int i=0;i<monthlist.length;i++){
monthlist[i]=new ArrayList();
}
}
rs.executeSql("select PieceYear,PieceMonth from HRM_PieceRateInfo "+sqlwhere+" group by PieceYear,PieceMonth order by PieceYear desc,PieceMonth desc");
while(rs.next()){
String tempyear=Util.add0(rs.getInt("PieceYear"),4);
String tempmonth=Util.add0(rs.getInt("PieceMonth"),2);
if(yearslist.indexOf(tempyear)==-1) {
yearslist.add(tempyear);
}
monthlist[yearslist.size()-1].add(tempmonth);
}
int rownum=(yearslist.size()+2)/3;
//System.out.println("rownum:"+rownum);
%>
<body>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
if(hasright){
RCMenu += "{"+SystemEnv.getHtmlLabelName(82,user.getLanguage())+",PieceRateMaintenanceEdit.jsp?subCompanyId="+subcompanyid+"&departmentid="+departmentid+",_self} " ;
RCMenuHeight += RCMenuHeightStep ;
}
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<table width=100% height=100% border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="10">
<col width="">
<col width="10">
<tr>
<td height="10" colspan="3"></td>
</tr>
<tr>
<td ></td>
<td valign="top">
<TABLE class=Shadow>
<tr>
<td valign="top">
<table class="ViewForm">
<tr class=field>
<td width="30%" align=left valign=top>
<%
int index=0;
for(int i=0;i<3;i++){
%>
<table class="ViewForm">
<tr>
<td>
<%
for(int k=1;k<=rownum;k++){
if(yearslist.size()>((k-1)*3+i)){
%>
<ul><li><b><%=yearslist.get(index)%><%=SystemEnv.getHtmlLabelName(17138,user.getLanguage())%></b>
<%
if(monthlist.length>index){
for(int m=0;m<monthlist[index].size();m++){
%>
<ul><li><a href="javascript:onlinks('<%=yearslist.get(index)%>','<%=monthlist[index].get(m)%>');">
<%=monthlist[index].get(m)%><%=SystemEnv.getHtmlLabelName(19398,user.getLanguage())%></a></ul></li>
<%
}
}
%>
</ul></li>
<%
if(k<rownum-1){
%>
</td></tr><tr><td>
<%
}
index++;
}
}
%>
</td></tr>
</table>
</td><td width="30%" align=left valign=top>
<%
}
%>
</td>
</tr>
</table>
</td>
</tr>
</TABLE>
</td>
<td></td>
</tr>
<tr>
<td height="10" colspan="3"></td>
</tr>
</table>
</body>
<script language="javascript">
function onlinks(years,months){
location="PieceRateMaintenanceView.jsp?subCompanyId=<%=subcompanyid%>&departmentid=<%=departmentid%>&PieceYear="+years+"&PieceMonth="+months;
}
</script>
</html>