InputReportMutiUploadOperation.jsp
3.04 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
<%@ page buffer="4kb" autoFlush="true"%>
<%@ page import="weaver.general.Util,weaver.file.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*,java.math.*" %>
<%@ page language="java" contentType="text/html; charset=GBK" %>
<%@ include file="/systeminfo/init.jsp" %>
<%!
/** 由于这里的参数是用上传组件解析的,所以中文字符的默认编码是ISO-8859-1,需要转换编码至GBK */
private static String toGBK(String str){
String s=str;
try{
s=new String(str.getBytes("ISO-8859-1"),"GBK");
}catch(UnsupportedEncodingException uee){ }
return s;
}
%>
<jsp:useBean id="ExcelParse" class="weaver.file.ExcelParse" scope="page" />
<jsp:useBean id="FileManage" class="weaver.file.FileManage" scope="page" />
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="CustomerInfoComInfo" class="weaver.crm.Maint.CustomerInfoComInfo" scope="page" />
<jsp:useBean id="moduleFile" class="weaver.datacenter.InputReportModuleFile" scope="page"/>
<%
FileUploadToPath fu = new FileUploadToPath(request) ;
Hashtable ht = new Hashtable() ;
ArrayList crmids = new ArrayList() ;
ArrayList crmnames = new ArrayList() ;
while(CustomerInfoComInfo.next()) {
crmids.add(CustomerInfoComInfo.getCustomerInfoid()) ;
crmnames.add(CustomerInfoComInfo.getCustomerInfoname()) ;
}
String filename = fu.uploadFiles("file1") ;
String inprepid = Util.null2String(fu.getParameter("inprepid"));
String filetype = Util.null2String(fu.getParameter("filetype"));
String fromcheck = Util.null2String(fu.getParameter("fromcheck"));
String reportDates=Util.null2String(fu.getParameter("reportDates"));
String overWriter=Util.null2String(fu.getParameter("isOverWriter"));
boolean isOverWriter=overWriter.equalsIgnoreCase("true")?true:false;
String crmid = ""+user.getUID() ;
String reportuserid = "" + Util.getIntValue(user.getTitle(), 0) ;
String actionpage = "" ;
if(fromcheck.equals("1")) actionpage = "/datacenter/maintenance/reportstatus/ReportDetailStatus.jsp" ;
else actionpage = "InputReportDate.jsp";
int iFileType=Util.getIntValue(filetype,1);
if(!filename.equalsIgnoreCase("")){
if(iFileType<4 && iFileType>0){
int iInprepId=Integer.parseInt(inprepid);
int iCrmid =Integer.parseInt(fu.getParameter("crmid"));
int reprotHrmId = Integer.parseInt(fu.getParameter("reprotHrmId"));
/** 将指定文件名的$fname文件导入inprepId的报表数据库中 */
moduleFile.importData(filename,iFileType,iInprepId,reprotHrmId,iCrmid,user.getUID(),reportDates,isOverWriter);
}
FileManage.DeleteFile(filename);
}
/*
actionpage="";
String url=actionpage+"?action=redirect&inprepid="+inprepid;
response.sendRedirect(url);
*/
String returnUrl=Util.null2String(fu.getParameter("returnUrl"));
//param:redirectFormString 获取的是转向页面传递所需要的参数。
%>
<form id="frmMain" name="frmMain" action="<%=returnUrl%>" method="post">
<%=toGBK(Util.null2String(fu.getParameter("redirectFormString")))%>
</form>
<script language=javascript>
function doSubmit(){
document.frmMain.submit();
}
doSubmit();
</script>
<input type="hidden" name="redirect" id="redirect" value="redirect" onclick="doSubmit()" />