/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.oa.struts.action;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;
import org.apache.struts.actions.DispatchAction;
import com.oa.data.FileInfo;
import com.oa.data.FileType;
import com.oa.data.UserInfo;
import com.oa.helper.DateHelper;
import com.oa.helper.PageSplit;
import com.oa.helper.UpFile;
import com.oa.helper.UpdownloadFile;
import com.oa.wendang.bll.FileInfoService;
/**
* MyEclipse Struts Creation date: 03-10-2010
*
* XDoclet definition:
*
* @struts.action path="/fileinfo" name="fileinfoForm" parameter="op"
* scope="request"
*/
public class FileinfoAction extends DispatchAction {
/*
* Generated Methods
*/
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
private FileInfoService fileInfoService;
public FileInfoService getFileInfoService() {
return fileInfoService;
}
public void setFileInfoService(FileInfoService fileInfoService) {
this.fileInfoService = fileInfoService;
}
public ActionForward toFileList(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
DynaActionForm fileinfoForm = (DynaActionForm) form;// TODO
// Auto-generated
// method stub
List<FileInfo> filelist= this.fileInfoService
.findAllByParentAndState(0, (byte) 0);
PageSplit.doSplit("filelist", filelist, request, 5,"fileinfo.do?op=toFileList",null);
return mapping.findForward("filelist");
}
public ActionForward doFileFind(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws UnsupportedEncodingException {
DynaActionForm fileinfoForm = (DynaActionForm) form;// TODO
// Auto-generated
// method stub
Integer fid = Integer.parseInt(request.getParameter("fileId"));
request.setAttribute("fileinfo", this.fileInfoService.findById(fid));
String name = this.fileInfoService.findById(fid).getFileName();
request.setAttribute("parentName", name);
request.setAttribute("filelist", this.fileInfoService
.findAllByParentAndState(fid, (byte) 0));
return mapping.findForward("filelist");
}
public ActionForward doFileUpload(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
DynaActionForm fileinfoForm = (DynaActionForm) form;// TODO
// Auto-generated
// method stub
FileInfo fileinfo = (FileInfo) fileinfoForm.get("fileinfo");
UpFile uf = UpdownloadFile.uploadfile(request, fileinfoForm,
"/upfile", "fname");
String filename=uf.getFileName();
String fname = uf.getFileName();
String oldfname = fileinfo.getFileName();
if(uf.getFileSize()==0){
request.setAttribute("error","error");
}else{
if (!oldfname.equals("")) {
filename = fileinfo.getFileName();
} else {
filename = filename.substring(0, filename.lastIndexOf("."));
}
fileinfo.setCreateDate(DateHelper.getCurrentDate());
fileinfo.setFileName(filename);
fileinfo.setFileParentId((Integer) fileinfoForm.get("pfid"));
fileinfo.setFileShare(Byte.parseByte((String) fileinfoForm
.get("ifShare")));
fileinfo.setFileState((byte) 0);
FileType ft = new FileType();
ft.setFtId((Integer) fileinfoForm.get("ftId"));
fileinfo.setFileType(ft);
if (!fileinfo.getFilePath().equals("\\")) {
fileinfo.setFilePath(fileinfo.getFilePath() + "\\"
+ fileinfo.getFileName());
} else {
fileinfo.setFilePath(fileinfo.getFilePath()
+ fileinfo.getFileName());
}
fileinfo.setUserInfo((UserInfo) request.getSession().getAttribute(
"userinfo"));
String suffix = this.fileInfoService.findTypeById(ft.getFtId())
.getFtSuffix();
File f = new File(request.getSession().getServletContext().getRealPath(
"/upfile")
+ "/" + fname);
f.renameTo(new File(request.getSession().getServletContext()
.getRealPath("/upfile")
+ "/" + fileinfo.getFileName() + "." + suffix));
this.fileInfoService.addFile(fileinfo);
}
request.setAttribute("filelist", this.fileInfoService
.findAllByParentId((Integer) fileinfoForm.get("pfid")));
return mapping.findForward("filelist");
}
public ActionForward toFileUpload(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
DynaActionForm fileinfoForm = (DynaActionForm) form;// TODO
// Auto-generated
// method stub
String spid = request.getParameter("fileId");
Integer fid = 0;
if (spid.length() != 0) {
fid = Integer.parseInt(spid);
request.setAttribute("parentFile", this.fileInfoService
.findById(fid));
}
List<FileType> ft = this.fileInfoService.findAllType();
List<FileType> ft2 = ft.subList(1, ft.size());
request.setAttribute("filetype", ft2);
fileinfoForm.set("ifShare", "0");
return mapping.findForward("fileadd");
}
public ActionForward dofindTypeImage(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException {
DynaActionForm fileinfoForm = (DynaActionForm) form;// TODO
// Auto-generated
// method stub
Integer ftId = Integer.parseInt(request.getParameter("ftId"));
response.setCharacterEncoding("UTF-8");
FileType ft = this.fileInfoService.findTypeById(ftId);
if(ft!=null){
if (ft.getFtSuffix().equals("noname")) {
response.getWriter().print(ft.getFtImage() + "|" + " ");
} else {
response.getWriter().print(
ft.getFtImage() + "|" + "(*." + ft.getFtSuffix() + ")");
}
}
return null;
}
public ActionForward dofileDownload(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws IOException {
Integer fid = Integer.parseInt(request.getParameter("fileId"));
FileInfo fileInfo = this.fileInfoService.findById(fid);// 获取文件信息
String contextPath = request.getSession().getServletContext()
.getRealPath("//");// 获取项目路径
String filePath = contextPath + "\\upfile\\" + fileInfo.getFileName()
+ "." + fileInfo.getFileType().getFtSuffix(); // 获取项目真实路径
// 执行下载
UpdownloadFile.download(request, response, filePath);
return null;
}
public ActionForward toRecycleList(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws IOException {
List<FileInfo> recycleList= this.fileInfoService
.findByState((byte) 1);
PageSplit.doSplit("recycleList", recycleList, request, 5,"fileinfo.do?op=toRecycleList",null);
return mapping.findForward("recyclelist");
}
public ActionForward doReturnFile(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws IOException {
String fileId = request.getParameter("fileId");
if (fileId != null) {
Integer fid = Integer.parseInt(fileId);
FileInfo f = this.fileInfoService.findById(fid);
this.fileInfoService.updateFileState(f, (byte) 0);
} else {
this.fileInfoService.updateFileState(this.fileInfoService
.findByState((byte) 1), (byte) 0);
}
response.getWriter().print(1);
return null;
}
public ActionForward doReturnAllFile(Act
没有合适的资源?快使用搜索试试~ 我知道了~
OA.rar_ajax oa
共1288个文件
gif:598个
scc:133个
java:87个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 190 浏览量
2022-09-19
16:38:44
上传
评论
收藏 3.65MB RAR 举报
温馨提示
一个简单的网络自动化办公软件OA 主要用到struts hibernate spring ajax JQ等技术 数据库是sql2005
资源推荐
资源详情
资源评论
收起资源包目录
OA.rar_ajax oa (1288个子文件)
fckeditor.afp 4KB
class_upload.asp 6KB
class_upload.asp 6KB
commands.asp 5KB
fckeditor.asp 5KB
connector.asp 3KB
upload.asp 3KB
io.asp 2KB
basexml.asp 2KB
config.asp 1KB
config.asp 1KB
util.asp 1KB
io.asp 697B
connector.aspx 959B
upload.aspx 930B
calendar.js.bak 18KB
oa系统数据库关系表.bmp 5.2MB
fckeditor.cfc 7KB
connector.cfm 11KB
fckeditor.cfm 6KB
upload.cfm 6KB
spellchecker.cfm 5KB
config.cfm 3KB
config.cfm 3KB
connector.cgi 3KB
UserinfoAction.class 13KB
FileinfoAction.class 13KB
WorkInfoAction.class 12KB
WorkInfoDAO.class 11KB
MessageAction.class 10KB
ScheduleAction.class 10KB
MessageServiceImpl.class 9KB
ScheduleInfoDAO.class 9KB
FileInfoDAO.class 9KB
DepartmentDAO.class 8KB
MessageDAO.class 8KB
PageSplit.class 8KB
FileInfoServiceImpl.class 7KB
UserInfoDAO.class 7KB
DepartmentAction.class 7KB
OperateDAO.class 7KB
LoginLogDAO.class 7KB
MessageToUserDAO.class 6KB
UserInfo.class 6KB
OrganDAO.class 6KB
MyNoteDAO.class 5KB
DtreeDAO.class 5KB
MyNoteAction.class 5KB
FileTypeDAO.class 5KB
UpdownloadFile.class 5KB
RoleTreeDAO.class 5KB
WorkTimeDAO.class 5KB
MessageTypeDAO.class 5KB
MeetingTypeDAO.class 5KB
RolesDAO.class 5KB
ScheduleInfoServiceImpl.class 5KB
WorkInfoServiceImpl.class 5KB
RolesAction.class 4KB
OrganAction.class 4KB
WorkTimeAction.class 4KB
ScheduleInfo.class 4KB
Message.class 4KB
DepartmentServiceImpl.class 3KB
RolesServiceImpl.class 3KB
FileInfo.class 3KB
UserInfoServiceImpl.class 3KB
OperateFilter.class 3KB
OperateAction.class 3KB
LoginLogAction.class 3KB
HibernateSessionFactory.class 2KB
Department.class 2KB
WorkInfo.class 2KB
TreeTag.class 2KB
LoginLog.class 2KB
Dtree.class 2KB
Organ.class 2KB
LoginLogServiceImpl.class 2KB
OperateServiceImpl.class 2KB
FileType.class 2KB
Roles.class 2KB
WorkInfoTotal.class 2KB
MessageToUser.class 2KB
ScheduleInfoService.class 2KB
FileInfoService.class 2KB
MyNote.class 2KB
Operate.class 2KB
WorkTime.class 2KB
OrganServiceImpl.class 2KB
DateHelper.class 2KB
MyNoteServiceImpl.class 1KB
MeetingType.class 1KB
MessageType.class 1KB
WorkInfoService.class 1KB
NavigateAction.class 1KB
RoleTree.class 1KB
MessageService.class 1KB
UserInfoService.class 1KB
WorkTimeServiceImpl.class 1KB
SessionClearAdvice.class 1KB
LoginAdvice.class 1KB
共 1288 条
- 1
- 2
- 3
- 4
- 5
- 6
- 13
资源评论
weixin_42651887
- 粉丝: 80
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 2023-04-06-项目笔记 - 第一百五十四阶段 - 4.4.2.152全局变量的作用域-152 -2024.06.04
- 松哥解协议松哥解协议松哥解协议松哥解协议松哥解协议
- 618节日618节日618节日
- tensorflow-gpu-2.9.1-cp37-cp37m-win-amd64.whl
- tensorflow-gpu-2.9.0-cp37-cp37m-win-amd64.whl
- tensorflow-gpu-2.9.0-cp39-cp39-win-amd64.whl
- lcd daimalcd daima
- 电影领域-推荐算法-个性化内容-观影决策-电影推荐小程序.zip
- 电气控制PLC考试题库
- 如何使用MATLAB简介
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功