package com.action;
/**
*
*
*/
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.bean.ComBean;
import com.bean.SystemBean;
import com.util.Constant;
import com.util.Filter;
import com.util.SmartFile;
import com.util.SmartUpload;
public class NewsAction extends HttpServlet {
private ServletConfig config;
/**
* Constructor of the object.
*/
public NewsAction() {
super();
}
final public void init(ServletConfig config) throws ServletException
{
this.config = config;
}
final public ServletConfig getServletConfig()
{
return config;
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request,response);
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding(Constant.CHARACTERENCODING);
response.setContentType(Constant.CONTENTTYPE);
String sysdir = new SystemBean().getDir();
HttpSession session = request.getSession();
String method = null;
SmartUpload mySmartUpload = new SmartUpload();//init
int count = 0;
try{String date=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());
mySmartUpload.initialize(config,request,response);
mySmartUpload.upload();
ComBean cb=new ComBean();
method = mySmartUpload.getRequest().getParameter("method").trim();
if(method.equals("addgd")){
// String bh = "";String wz=""; String hm=""; String xm=""; String pp=""; String ys=""; String pic=""; String dz=""; String fs="";
String bh=mySmartUpload.getRequest().getParameter("bh");
String wz=mySmartUpload.getRequest().getParameter("wz");
String hm=mySmartUpload.getRequest().getParameter("hm");
String xm=mySmartUpload.getRequest().getParameter("xm");
String pp=mySmartUpload.getRequest().getParameter("pp");
String ys=mySmartUpload.getRequest().getParameter("ys");
String dz=mySmartUpload.getRequest().getParameter("dz");
String fs=mySmartUpload.getRequest().getParameter("fs");
String jg=mySmartUpload.getRequest().getParameter("jg");
SmartFile file = mySmartUpload.getFiles().getFile(0);
String fileExt=file.getFileExt();
String path="/pic";
count = mySmartUpload.save(path);
String str=cb.getString("select fs from gd where bh='"+bh+"'");
if(str==null){
int flag=cb.comUp("insert into gd(bh,wz,hm, xm, pp, ys, pic, dz, fs,jg) " +
"values('"+bh+"','"+wz+"','"+hm+"','"+xm+"','"+pp+"','"+ys+"','"+path+"/"+file.getFileName()+"','"+dz+"','"+fs+"','"+jg+"' )");
if(flag==Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("gd/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中!");
request.getRequestDispatcher("gd/index.jsp").forward(request, response);
}
}
else{
request.setAttribute("message", "编号重复!");
request.getRequestDispatcher("gd/index.jsp").forward(request, response);
}
}
else if(method.equals("upgd")){
//String id=mySmartUpload.getRequest().getParameter("id");
String bh=mySmartUpload.getRequest().getParameter("bh");
String wz=mySmartUpload.getRequest().getParameter("wz");
String hm=mySmartUpload.getRequest().getParameter("hm");
String xm=mySmartUpload.getRequest().getParameter("xm");
String pp=mySmartUpload.getRequest().getParameter("pp");
String ys=mySmartUpload.getRequest().getParameter("ys");
String dz=mySmartUpload.getRequest().getParameter("dz");
String fs=mySmartUpload.getRequest().getParameter("fs");
String jg=mySmartUpload.getRequest().getParameter("jg");
SmartFile file = mySmartUpload.getFiles().getFile(0);
String fileExt=file.getFileExt();
String path="/pic";
count = mySmartUpload.save(path);
int flag=cb.comUp("update gd set bh='"+bh+"',wz='"+wz+"',hm='"+hm+"',xm='"+xm+"'," +
"pp='"+pp+"',ys='"+ys+"',pic='"+path+"/"+file.getFileName()+"',dz='"+dz+"',fs='"+fs+"',jg='"+jg+"' where bh='"+bh+"'");
if(flag==Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("gd/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中!");
request.getRequestDispatcher("gd/index.jsp").forward(request, response);
}
}
////////////////////////////////////////////////////////////////////////////
else if(method.equals("addzytc")){
// String bh = "";String wz=""; String hm=""; String xm=""; String pp=""; String ys=""; String pic=""; String dz=""; String fs="";
String hm=mySmartUpload.getRequest().getParameter("hm");
String wz=mySmartUpload.getRequest().getParameter("wz");
String xm=mySmartUpload.getRequest().getParameter("xm");
String pp=mySmartUpload.getRequest().getParameter("pp");
String ys=mySmartUpload.getRequest().getParameter("ys");
String dz=mySmartUpload.getRequest().getParameter("dz");
String fs=mySmartUpload.getRequest().getParameter("fs");
SmartFile file = mySmartUpload.getFiles().getFile(0);
String fileExt=file.getFileExt();
String path="/pic";
count = mySmartUpload.save(path);
String ss=cb.getString("select id from zytc where hm='"+hm+"' and lksj='未离开'");
if(ss==null){
int flag=cb.comUp("insert into zytc(hm,wz,xm, pp, ys, pic, dz, fs,jrsj,lksj) " +
"values('"+hm+"','"+wz+"','"+xm+"','"+pp+"','"+ys+"','"+path+"/"+file.getFileName()+"','"+dz+"','"+fs+"','"+date+"','未离开')");
if(flag==Constant.SUCCESS){
cb.comUp("update zy set zt='有车' where bh='"+wz+"'");
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("tc/zytc.jsp").forward(request, response);
}
else{
request.setAttr
没有合适的资源?快使用搜索试试~ 我知道了~
基于Java+JSP +MYSQL教师工作量考核系统毕业设计实现+源码.rar
共132个文件
gif:32个
jpg:19个
class:18个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 137 浏览量
2022-04-20
21:28:13
上传
评论 2
收藏 3.3MB RAR 举报
温馨提示
基于Java+JSP +MYSQL教师工作量考核系统毕业设计实现+源码.rar
资源详情
资源评论
资源推荐
收起资源包目录
基于Java+JSP +MYSQL教师工作量考核系统毕业设计实现+源码.rar (132个子文件)
SmartUpload.class 17KB
AdminBean.class 8KB
NewsAction.class 7KB
ComAction.class 7KB
AdminAction.class 6KB
SmartFile.class 6KB
ComBean.class 5KB
DBO.class 3KB
SystemBean.class 3KB
Common.class 2KB
SmartRequest.class 2KB
SmartFiles.class 2KB
Log.class 1KB
MD5.class 1KB
Filter.class 975B
CheckCode.class 922B
Constant.class 674B
SmartUploadException.class 364B
.classpath 872B
Admin_Style.css 6KB
base.css 5KB
skin.css 4KB
skin.css 4KB
style.css 4KB
main.css 1KB
menu.css 1005B
Thumbs.db 22KB
Thumbs.db 15KB
1336375725125test.doc 11KB
1336368698421test.doc 11KB
JSP教师工作量考核系统演示录像.exe 1.73MB
MainBg.gif 25KB
login_09.gif 21KB
login_09.gif 21KB
login_04.gif 20KB
login_04.gif 20KB
login_06.gif 14KB
login_06.gif 14KB
login_03.gif 5KB
login_03.gif 5KB
login_08.gif 5KB
login_08.gif 5KB
login_07.gif 2KB
login_07.gif 2KB
Title.gif 2KB
menubg.gif 2KB
qq_22.gif 2KB
menu.gif 1KB
sys.gif 1KB
last.gif 899B
first.gif 897B
jump.gif 883B
pre.gif 861B
next.gif 861B
out.gif 859B
out.gif 859B
bt_login.gif 315B
bullet.gif 179B
HardWare.gif 168B
arr4.gif 153B
img_u.gif 85B
linkbg2.gif 63B
linkbg1.gif 57B
selcolor.htm 4KB
sqljdbc.jar 570KB
mysql-connector-java-5.0.8-bin.jar 528KB
msbase.jar 280KB
mssqlserver.jar 65KB
msutil.jar 58KB
commons-fileupload.jar 22KB
FCKeditor-2.3.jar 18KB
NewsAction.java 10KB
ComBean.java 4KB
DBO.java 3KB
Log.java 836B
Filter.java 650B
Constant.java 533B
1336117352437R61i.jpg 98KB
1336117447656R61i.jpg 98KB
1336117532000R61i.jpg 98KB
1336117523109R61i.jpg 98KB
topnav_bg.jpg 13KB
1336129585734111.jpg 8KB
1336125742703111.jpg 8KB
1336125762312111.jpg 8KB
1336129715421111.jpg 8KB
1336117974171111.jpg 8KB
1336126534078111.jpg 8KB
1336128118453111.jpg 8KB
1336125999859111.jpg 8KB
1336128085500111.jpg 8KB
1336129787093111.jpg 8KB
1336125100421111.jpg 8KB
1336125215250111.jpg 8KB
1336127515359111.jpg 8KB
bg.jpg 876B
Common.js 26KB
calendar.js 20KB
SearchFluctuation.js 18KB
menu.js 3KB
共 132 条
- 1
- 2
yyyyyyhhh222
- 粉丝: 412
- 资源: 6万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1