企业任务流程管理系统,采用springMVC全注解开发,带流程功能。开发工具:myeclipse10,数据库:mysql,数据库导入工具:navicat,增删改查,分页,图片上传,附件上传,流程审批,权限控制,三个角色员工,领导,超级管理员。提供java毕业设计源码下载
java毕业设计源码部分功能截图
java毕业设计部分代码Controller讲解:
package com.sxl.controller.admin;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.sxl.controller.MyController;
@Controller("deptController")
@RequestMapping(value = "/admin/dept")
public class DeptController extends MyController {
@RequestMapping(value = "/frame")
public String frame(Model model, HttpServletRequest request,String flag)throws Exception {
return "/admin/dept/frame";
}
@RequestMapping(value = "/list")
public String list(Model model, HttpServletRequest request,String flag,String deptName)throws Exception {
String sql="select a.* from t_dept a where 1=1";
if(deptName!=null&&!"".equals(deptName)){
sql+=" and deptName like '%"+deptName+"%'";
}
sql+=" order by id desc";
List list = db.queryForList(sql);
request.setAttribute("list", list);
return "/admin/dept/list";
}
@RequestMapping(value = "/editSave")
public ResponseEntity editSave(Model model,HttpServletRequest request,Long id,String flag
,String deptName) throws Exception{
int result = 0;
if(id!=null){
String sql="update t_dept set deptName=? where id=?";
result = db.update(sql, new Object[]{deptName,id});
}else{
String sql="insert into t_dept(deptName) values(?)";
result = db.update(sql, new Object[]{deptName});
}
if(result==1){
return renderData(true,"操作成功",null);
}else{
return renderData(false,"操作失败",null);
}
}
@RequestMapping(value = "/editDelete")
public ResponseEntity editDelete(Model model,HttpServletRequest request,Long id,String flag) throws Exception {
String sql="delete from t_dept where id=?";
int result = db.update(sql, new Object[]{id});
if(result==1){
return renderData(true,"操作成功",null);
}else{
return renderData(false,"操作失败",null);
}
}
@RequestMapping(value = "/edit")
public String edit(Model model, HttpServletRequest request,Long id,String flag)throws Exception {
if(id!=null){
//修改
String sql="select * from t_dept where id=?";
Map map = db.queryForMap(sql,new Object[]{id});
model.addAttribute("map", map);
}String sql="";
return "/admin/dept/edit";
}
}