conn = DBConn.getConnection("PIP");
UploadFormModel uploadFormModel = uploadFileUtil.getUploadForm();
List<UploadFileModel> fileList = uploadFormModel.getFileList();
if (fileList.size() == 0)
{
return "";
}
for(int i=0;i<fileList.size();i++){
if(!fileList.get(i).equals(null)){
// 获取上传的文件
UploadFileModel uploadFileModel = fileList.get(i);
Ucm ucm = new Ucm(UcmContact.idcConnectionURL, UcmContact.userName, UcmContact.passWord);
String ucmDocId = ucm.uploadFile(uploadFileModel);
// 原文档的名称(名称+扩展名)
String fileFullName = uploadFileModel.getSaveFileName();
int index = fileFullName.indexOf(".");
// 文件扩展名
String fileExt = fileFullName.substring(index).toLowerCase();
// 临时文件存放目录
String tempFolderPath = request.getSession().getServletContext().getResource("/tempfile").getPath(); // 生成缩略图
if (fileExt.endsWith(".jpg") || fileExt.endsWith(".gif"))
{
ucm.createSmallPic(uploadFileModel.getFileData(), fileFullName, tempFolderPath);
}
String publicFileName = StringUtil.formatDbColumn(uploadFileModel.getSaveFileName());
String fileName = StringUtil.formatDbColumn(uploadFileModel.getFileName());
String toDay = DateUtil.getTodaydate();
// 增加附件记录
Map<String, Object> fileInfoMap = uploadFormModel.getFileInfo();
String subject = StringUtil.formatDbColumn(fileInfoMap.get("SUBJECT"));
String authorName = StringUtil.formatDbColumn(fileInfoMap.get("AUTHOR_NAME"));
String remark = StringUtil.formatDbColumn(fileInfoMap.get("AUTHOR_NAME"));
String flashFlag = StringUtil.formatDbColumn(fileInfoMap.get("FLASH_FLAG"));
KmAttchVo kmAttchVo = new KmAttchVo();
kmAttchVo.setDoc_id(docId);
kmAttchVo.setDate_linked(toDay);
kmAttchVo.setSubject(subject);
kmAttchVo.setPrivate_loc(fileName);
kmAttchVo.setPublic_loc(publicFileName);
kmAttchVo.setAuthor_name(authorName);
kmAttchVo.setRemark(remark);
kmAttchVo.setFlash_flag(flashFlag);
kmAttchVo.setUcmDocId(ucmDocId == "" ? 0 : Integer.valueOf(ucmDocId));
KmAttchBiz iKmAttchBiz = new KmAttchBiz();
iKmAttchBiz.addAttchInfo(conn, kmAttchVo);
flag = "1";
}
}
UploadFormModel uploadFormModel = uploadFileUtil.getUploadForm();
List<UploadFileModel> fileList = uploadFormModel.getFileList();
if (fileList.size() == 0)
{
return "";
}
for(int i=0;i<fileList.size();i++){
if(!fileList.get(i).equals(null)){
// 获取上传的文件
UploadFileModel uploadFileModel = fileList.get(i);
Ucm ucm = new Ucm(UcmContact.idcConnectionURL, UcmContact.userName, UcmContact.passWord);
String ucmDocId = ucm.uploadFile(uploadFileModel);
// 原文档的名称(名称+扩展名)
String fileFullName = uploadFileModel.getSaveFileName();
int index = fileFullName.indexOf(".");
// 文件扩展名
String fileExt = fileFullName.substring(index).toLowerCase();
// 临时文件存放目录
String tempFolderPath = request.getSession().getServletContext().getResource("/tempfile").getPath(); // 生成缩略图
if (fileExt.endsWith(".jpg") || fileExt.endsWith(".gif"))
{
ucm.createSmallPic(uploadFileModel.getFileData(), fileFullName, tempFolderPath);
}
String publicFileName = StringUtil.formatDbColumn(uploadFileModel.getSaveFileName());
String fileName = StringUtil.formatDbColumn(uploadFileModel.getFileName());
String toDay = DateUtil.getTodaydate();
// 增加附件记录
Map<String, Object> fileInfoMap = uploadFormModel.getFileInfo();
String subject = StringUtil.formatDbColumn(fileInfoMap.get("SUBJECT"));
String authorName = StringUtil.formatDbColumn(fileInfoMap.get("AUTHOR_NAME"));
String remark = StringUtil.formatDbColumn(fileInfoMap.get("AUTHOR_NAME"));
String flashFlag = StringUtil.formatDbColumn(fileInfoMap.get("FLASH_FLAG"));
KmAttchVo kmAttchVo = new KmAttchVo();
kmAttchVo.setDoc_id(docId);
kmAttchVo.setDate_linked(toDay);
kmAttchVo.setSubject(subject);
kmAttchVo.setPrivate_loc(fileName);
kmAttchVo.setPublic_loc(publicFileName);
kmAttchVo.setAuthor_name(authorName);
kmAttchVo.setRemark(remark);
kmAttchVo.setFlash_flag(flashFlag);
kmAttchVo.setUcmDocId(ucmDocId == "" ? 0 : Integer.valueOf(ucmDocId));
KmAttchBiz iKmAttchBiz = new KmAttchBiz();
iKmAttchBiz.addAttchInfo(conn, kmAttchVo);
flag = "1";
}
}










