資源簡介
使用SpringMVC,spring,hibernate框架,分為前臺和后臺的請假流管理系統。前臺使用bootstrap,后臺使用easyUI。主要實現學生請假的審批。
代碼片段和文件信息
package?net.dfrz.action;
import?java.util.ArrayList;
import?java.util.HashMap;
import?java.util.List;
import?java.util.Map;
import?javax.servlet.http.HttpServletRequest;
import?javax.servlet.http.HttpServletResponse;
import?javax.sql.DataSource;
import?org.springframework.beans.factory.annotation.Autowired;
import?org.springframework.jdbc.core.BeanPropertyRowMapper;
import?org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import?org.springframework.stereotype.Controller;
import?org.springframework.web.bind.annotation.RequestMapping;
import?org.springframework.web.bind.annotation.ResponseBody;
import?net.dfrz.bean.po.ClassPO;
import?net.dfrz.bean.po.DepPO;
import?net.dfrz.bean.po.UserPO;
import?net.dfrz.service.ClassServiceI;
@Controller
@RequestMapping(value?=?“/class/“)
public?class?ClassListAction?extends?CommonAction?{
private?static?final?long?serialVersionUID?=?1L;
@Autowired
private?ClassServiceI?classServiceI;
@Autowired
private?DataSource?dataSource;
private?Mapject>?getClassDataList(int?currentPage?int?pageSize
Mapject>?paramMap)?{
Mapject>?dataMap?=?new?HashMapject>();
List?classList?=?new?ArrayList();
NamedParameterJdbcTemplate?template?=?new?NamedParameterJdbcTemplate(
this.dataSource);
String?sql?=?“select?*?from?f_class“;
//?1:取總記錄數
int?total?=?classServiceI.getClasses().size();
//?2:記錄集分頁
int?startIndex?=?(currentPage?-?1)?*?pageSize;
String?pageSQL?=?sql?+?“?limit?“?+?startIndex?+?““?+?pageSize?+?““;
try?{
BeanPropertyRowMapper?rowMapper?=?new?BeanPropertyRowMapper(
ClassPO.class);
classList?=?template.query(pageSQL?rowMapper);
dataMap.put(“total“?total);
dataMap.put(“rows“?classList);
}?catch?(Exception?e)?{
e.printStackTrace();
throw?new?RuntimeException(e);
}
return?dataMap;
}
@RequestMapping(value?=?“classList“)
@ResponseBody()
public?Mapject>?classList(HttpServletRequest?request?HttpServletResponse?response)?{
String?page?=?request.getParameter(“page“);
String?rows?=?request.getParameter(“rows“);
if?(page?==?null?||?page.equals(““))?{
page?=?“1“;
}
if?(rows?==?null?||?rows.equals(““))?{
rows?=?“10“;
}
int?pageNo?=?Integer.parseInt(page);
int?pageSize?=?Integer.parseInt(rows);
//?獲取查詢信息
?Mapject>?classPOs?=?getClassDataList(pageNo?pageSize?null);
?return?classPOs;
}
@RequestMapping(value?=?“classList2“)
@ResponseBody()
public?List?classList2()?{
List?classPOs?=?classServiceI.getClasses();
return?classPOs;
}
@RequestMapping(value?=?“classSearch“)
@ResponseBody()
public?List?userSerarch(String?class_id?String?class_name)?{
StringBuilder?hql?=?new?StringBuilder(“from?f_class?where?1=1“);
if?(class_id?!=?null?&&?!““.equals(class_id))
hql.append(“?and?classid?like?“?+?“‘%“?+?class_id?+?“%‘“);
if?(class_name?!=?null?&&?!““.equals(class_name))
h
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-07-27?17:00??flow-main\
?????文件????????1129??2018-05-15?20:21??flow-main\.classpath
?????目錄???????????0??2018-07-27?17:00??flow-main\.git\
?????文件??????????36??2018-05-26?20:30??flow-main\.git\COMMIT_EDITMSG
?????文件?????????117??2018-05-26?20:57??flow-main\.git\FETCH_HEAD
?????文件??????????23??2018-05-15?20:21??flow-main\.git\HEAD
?????目錄???????????0??2018-07-27?17:10??flow-main\.git\branches\
?????文件?????????272??2018-05-20?22:13??flow-main\.git\config
?????目錄???????????0??2018-07-27?17:10??flow-main\.git\hooks\
?????文件??????157856??2018-05-26?20:57??flow-main\.git\index
?????目錄???????????0??2018-07-27?17:00??flow-main\.git\logs\
?????文件????????3914??2018-05-26?20:57??flow-main\.git\logs\HEAD
?????目錄???????????0??2018-07-27?17:00??flow-main\.git\logs\refs\
?????目錄???????????0??2018-07-27?17:00??flow-main\.git\logs\refs\heads\
?????文件????????3914??2018-05-26?20:57??flow-main\.git\logs\refs\heads\master
?????目錄???????????0??2018-07-27?17:00??flow-main\.git\logs\refs\remotes\
?????目錄???????????0??2018-07-27?17:00??flow-main\.git\logs\refs\remotes\origin\
?????文件????????3103??2018-05-26?20:57??flow-main\.git\logs\refs\remotes\origin\master
?????目錄???????????0??2018-07-27?17:00??flow-main\.git\ob
?????目錄???????????0??2018-07-27?17:00??flow-main\.git\ob
?????文件??????????55??2018-05-20?22:10??flow-main\.git\ob
?????目錄???????????0??2018-07-27?17:00??flow-main\.git\ob
?????文件??????????57??2018-05-25?21:09??flow-main\.git\ob
?????目錄???????????0??2018-07-27?17:00??flow-main\.git\ob
?????文件????????2291??2018-05-26?20:30??flow-main\.git\ob
?????文件?????????193??2018-05-20?15:40??flow-main\.git\ob
?????文件????????2728??2018-05-21?21:40??flow-main\.git\ob
?????文件?????????334??2018-05-21?21:40??flow-main\.git\ob
?????目錄???????????0??2018-07-27?17:00??flow-main\.git\ob
?????文件??????????46??2018-05-20?22:10??flow-main\.git\ob
?????文件?????????369??2018-05-25?21:17??flow-main\.git\ob
............此處省略1799個文件信息
評論
共有 條評論