基于javaweb的SSM宿舍公共财产管理系统(java+ssm+jsp+easyui+h-ui+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

340023562402

350023562402

360023562402

370023562402

390023562402

400023562402

410023562402

420023562402

基于javaweb的SSM宿舍公共财产管理系统(java+ssm+jsp+easyui+h-ui+mysql)

1
2
3
4
5
6
7
8
9
10
11
管理员
admin 123456

宿管老师
1902 123456
1903 123456

学生
192300422 123456
192300423 123456
192300424 123456

项目介绍

本系统采用java作为前台开发工具、MySQL作为后台数据库平台的管理系统。系统通过实现公寓管理人员的信息输入与维护、公寓入住人员的信息修改与维护、宿舍用品配置登记与维护、公寓信息查询、来访人员登记等功能,使大学生公寓管理变得系统化、规范化、自动化,从而达到掌握宿舍成员的情况、提高管理效率的目的。

该项目主要包括管理员、宿管老师、学生三种角色。 管理员主要功能包括: 系统设置:菜单管理、角色管理、修改密码; 用户管理:老师管理、学生管理、管理员管理; 系统日志:日志列表; 宿舍楼管理; 财产管理; 财产盘点管理; 同产报修管理; 报废管理; 宿管老师主要功能包括: 财产管理、财产盘点管理、财产报修管理、报废处理;

学生主要功能包括: 财产管理、财产报修管理;

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;  5.数据库:MySql 5.7版本; 6.是否Maven项目:否;

技术栈

  1. 后端:spring+springMVC+mybaits 2. 前端:JSP+EasyUI+H-ui+jQuery+Ajax

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中db.properties配置文件中的数据库配置改为自己的配置; 4. 前台访问路径:http://localhost:8080/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
	queryMap.put("name", name);
queryMap.put("offset", page.getOffset());
queryMap.put("pageSize", page.getRows());
ret.put("rows", registrationService.findList(queryMap));
ret.put("total", registrationService.getTotal(queryMap));
return ret;
}

/**
*
* @param dormitoryVO
* @return
*/
@RequestMapping(value = "/add", method = { RequestMethod.POST, RequestMethod.GET })
@ResponseBody
public AjaxJson add(RegistrationEntity registrationEntity, HttpServletRequest request) {
AjaxJson j = new AjaxJson();
if (registrationEntity == null) {
j.setMsg("请填写正确的盘点信息!");
j.setSuccess(false);
return j;
}
if (StringUtils.isEmpty(String.valueOf(registrationEntity.getAssetid()))) {
j.setMsg("请填写财产名");
j.setSuccess(false);
return j;
}
if (StringUtils.isEmpty(registrationEntity.getRcreatetime().toGMTString())) {
j.setMsg("请填写登记时间");
j.setSuccess(false);
return j;
}
Integer myrole = (Integer) request.getSession().getAttribute("myrole");
switch (myrole) {// 1管理员 2老师 4 学生
case 2: // 老师
TeacherEntity teacherEntity = (TeacherEntity) request.getSession().getAttribute("admin");// 获取老师
registrationEntity.setTeaid(teacherEntity.getId());
break;
case 1: // 管理员
/*
* User user = (User) request.getSession().getAttribute("admin");
* registrationEntity.setTeaid(user.getUsername()); break;
*/
j.setMsg("无权限");
j.setSuccess(false);
return j;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 * @return
*/
@RequestMapping(value="/logout",method=RequestMethod.GET)
public String logout(HttpServletRequest request){
HttpSession session = request.getSession();
session.setAttribute("admin", null);
session.setAttribute("role", null);
request.getSession().setAttribute("userMenus", null);
return "redirect:login";
}

/**
* 修改密码页面
* @param model
* @return
*/
@RequestMapping(value="/edit_password",method=RequestMethod.GET)
public ModelAndView editPassword(ModelAndView model){
model.setViewName("system/edit_password");
return model;
}
/**
* 修改密码
* @param newpassword
* @param oldpassword
* @param request
* @return
*/
@RequestMapping(value="/edit_password",method=RequestMethod.POST)
@ResponseBody
public Map<String, String> editPasswordAct(String newpassword,String oldpassword,HttpServletRequest request){
Map<String, String> ret = new HashMap<String, String>();
if(StringUtils.isEmpty(newpassword)){
ret.put("type", "error");
ret.put("msg", "请填写新密码!");
return ret;
}
User user = (User)request.getSession().getAttribute("admin");
if(!user.getPassword().equals(oldpassword)){
ret.put("type", "error");
ret.put("msg", "原密码错误!");
return ret;
}
user.setPassword(newpassword);
if(userService.editPassword(user) <= 0){
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
			 */
j.setMsg("无权限");
j.setSuccess(false);
return j;
}
j.setMsg("保存成功!");
j.setSuccess(true);
try {
registrationService.insertSelective(registrationEntity);
} catch (Exception e) {
j.setMsg("保存失败!");
j.setSuccess(false);
}
return j;
}
}




@RequestMapping("/admin/dormitory")
@Controller
public class DormitoryController {
@Autowired
DormitoryService dormitoryService;

/**admin/dormitory/getall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
public List<Map<String, Object>> loadCategory(HttpServletResponse response) {

List<AssetCategoryEntity> findAll = assetCategoryService.findAll();
System.out.println("查询到的类别:" + findAll);
// list存放map,map存放kv值(json),namelist取需要的字段
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
for (AssetCategoryEntity category : findAll) {
Map<String, Object> map = new HashMap<String, Object>();
// 只取classid、ClassName即可。
String canme = category.getCname();
String cid = String.valueOf(category.getId());
// map存放键值对
map.put("canme", canme);
map.put("cid", cid);
// list存放map
list.add(map);
System.out.println("json格式:" + list); // 打印出来就成为了json格式
}
return list;
}

@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public Map<String, String> add(AssetCategoryEntity assetCategoryEntity) {
Map<String, String> ret = new HashMap<String, String>();
if (assetCategoryEntity == null) {
ret.put("type", "error");
ret.put("msg", "请填写正确的财产分类信息!");
return ret;
}
if (StringUtils.isEmpty(assetCategoryEntity.getCname())) {
ret.put("type", "error");
ret.put("msg", "请填写财产分类名");
return ret;
}
if (StringUtils.isEmpty(String.valueOf(assetCategoryEntity.getCyear()))) {
ret.put("type", "error");
ret.put("msg", "请填写财产使用年限");
return ret;
}
if (assetCategoryService.insertSelective(assetCategoryEntity) <= 0) {
ret.put("type", "error");
ret.put("msg", "财产分类信息添加失败,请联系管理员!");
return ret;
}
ret.put("type", "success");
ret.put("msg", "财产分类信息添加成功!");
return ret;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
		return ret;
}

@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Map<String, String> delete(String ids) {
Map<String, String> ret = new HashMap<String, String>();
if (StringUtils.isEmpty(ids)) {
ret.put("type", "error");
ret.put("msg", "选择要删除的数据!");
return ret;
}
if (ids.contains(",")) {
ids = ids.substring(0, ids.length() - 1);
}
if (assetPropertyListService.delete(ids) <= 0) {
ret.put("type", "error");
ret.put("msg", "财产信息删除失败,请联系管理员!");
return ret;
}
ret.put("type", "success");
ret.put("msg", "财产信息删除成功!");
return ret;
}

@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public Map<String, String> add(AssetPropertyListEntity assetPropertyListEntity) {
Map<String, String> ret = new HashMap<String, String>();
if (assetPropertyListEntity == null) {
ret.put("type", "error");
ret.put("msg", "请填写正确的财产信息!");
return ret;
}
if (StringUtils.isEmpty(String.valueOf(assetPropertyListEntity.getCtegoryid()))) {
ret.put("type", "error");
ret.put("msg", "请填写财产分类名");
return ret;
}
if (StringUtils.isEmpty(String.valueOf(assetPropertyListEntity.getPname()))) {
ret.put("type", "error");
ret.put("msg", "请填写财产名");
return ret;
}
if (assetPropertyListService.insertSelective(assetPropertyListEntity) <= 0) {
ret.put("type", "error");
ret.put("msg", "财产信息添加失败,请联系管理员!");
return ret;
}
ret.put("type", "success");
ret.put("msg", "财产信息添加成功!");
return ret;
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
}

/**
* 获取指定目录下的系统icon集合
*
* @param request
* @return
*/
@RequestMapping(value = "/get_icons", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> getIconList(HttpServletRequest request) {
Map<String, Object> ret = new HashMap<String, Object>();
String realPath = request.getServletContext().getRealPath("/");
File file = new File(realPath + "\\resources\\admin\\easyui\\css\\icons");
List<String> icons = new ArrayList<String>();
if (!file.exists()) {
ret.put("type", "error");
ret.put("msg", "文件目录不存在!");
return ret;
}
File[] listFiles = file.listFiles();
for (File f : listFiles) {
if (f != null && f.getName().contains("png")) {
icons.add("icon-" + f.getName().substring(0, f.getName().indexOf(".")).replace("_", "-"));
}
}
ret.put("type", "success");
ret.put("content", icons);
return ret;
}

/**
* 菜单添加
*
* @param menu
* @return
*/
@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public Map<String, String> add(Menu menu) {
Map<String, String> ret = new HashMap<String, String>();


项目链接:
https://javayms.github.io?id=011122582008200un
https://javayms.pages.dev?id=011122582008200un