——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明






基于javaweb的SSM+Maven社区居民户籍管理系统(java+ssm+jsp+js+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版本;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录
——————————CodeStart——————————
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
| System.out.println(dataMap.get("title").toString()); if(temp.get("title").toString().contains(dataMap.get("title").toString())) { returnList.add(temp); total = 1L; break; }
} }else if(request.getSession().getAttribute("admin")!=null&&table.equals("user")&&dataMap.get("name")!= null&&!"".equals(dataMap.get("name"))){ for (Map<String, Object> temp:list) { System.out.println(temp.get("user_name").toString()); System.out.println(dataMap.get("name").toString()); if(temp.get("user_name").toString().contains(dataMap.get("name").toString())) { returnList.add(temp); total = 1L; break; }
} }else { returnList = list; } JSONObject result = new JSONObject(); JSONArray jsonArray = JSONArray.fromObject(returnList); result.put("rows", jsonArray); result.put("total", total); ResponseUtil.write(response, result); } } package com.wq.controller;
|
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
|
@Controller @RequestMapping("/policy") public class PolicyController {
@Resource private PolicyService policyService; @Autowired private static final Logger log = Logger.getLogger(PolicyController.class);
@RequestMapping(value = "addSave", method = RequestMethod.POST) @ResponseBody public Result save(@RequestBody Policy policy) throws Exception { int resultTotal; resultTotal = policyService.addSave(policy); if (resultTotal > 0) { return ResultGenerator.genSuccessResult(); } else { return ResultGenerator.genFailResult("FAIL"); } }
@RequestMapping(value = "updateSave", method = RequestMethod.POST) @ResponseBody public Result updateSave(@RequestBody Policy policy) throws Exception { int resultTotal; resultTotal = policyService.update(policy); if (resultTotal > 0) { return ResultGenerator.genSuccessResult();
|
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
| package com.wq.controller;
@Controller @RequestMapping("/users") public class UserController {
@Resource private UserService userService; private static final Logger log = Logger.getLogger(UserController.class);
@RequestMapping(value = "/cookie", method = RequestMethod.POST) @ResponseBody public Result login(User user,HttpServletRequest request) { request.getSession().invalidate();
try { String MD5pwd = MD5Util.MD5Encode(user.getPassword(), "UTF-8"); user.setPassword(MD5pwd); } catch (Exception e) { user.setPassword("");
|
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
| }else if(request.getSession().getAttribute("admin")!=null&&table.equals("v_person")&&dataMap.get("name")!= null){
for (Map<String, Object> temp:list) { System.out.println(temp.get("name").toString()); System.out.println(dataMap.get("name").toString()); if(temp.get("name").toString().contains(dataMap.get("name").toString())) { returnList.add(temp); total = 1L; break; }
} }else if(request.getSession().getAttribute("admin")!=null&&table.equals("policy")&&dataMap.get("title")!= null&&!"".equals(dataMap.get("title"))){
for (Map<String, Object> temp:list) { System.out.println(temp.get("title").toString()); System.out.println(dataMap.get("title").toString()); if(temp.get("title").toString().contains(dataMap.get("title").toString())) { returnList.add(temp); total = 1L; break; }
} }else if(request.getSession().getAttribute("admin")!=null&&table.equals("user")&&dataMap.get("name")!= null&&!"".equals(dataMap.get("name"))){ for (Map<String, Object> temp:list) { System.out.println(temp.get("user_name").toString()); System.out.println(dataMap.get("name").toString()); if(temp.get("user_name").toString().contains(dataMap.get("name").toString())) { returnList.add(temp); total = 1L; break; }
} }else { returnList = list; } JSONObject result = new JSONObject(); JSONArray jsonArray = JSONArray.fromObject(returnList); result.put("rows", jsonArray); result.put("total", total); ResponseUtil.write(response, result); } } package com.wq.controller;
|
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
| */ @RequestMapping(value = "updateSave", method = RequestMethod.POST) @ResponseBody public Result updateSave(@RequestBody Policy policy) throws Exception { int resultTotal; resultTotal = policyService.update(policy); if (resultTotal > 0) { return ResultGenerator.genSuccessResult(); } else { return ResultGenerator.genFailResult("FAIL"); } }
@RequestMapping(value = "/delete/{pkids}", method = RequestMethod.DELETE) @ResponseBody public Result delete(@PathVariable(value = "pkids") String pkids) throws Exception { String[] pkidArr = pkids.split(","); policyService.delete(pkidArr); return ResultGenerator.genSuccessResult(); }
@RequestMapping(value = "/getPolicyList", method = RequestMethod.POST) @ResponseBody public JSONArray getPolicyList() { List<Map<String, Object>> list = policyService.getPolicyList(); if (list.size() > 0) { JSONArray jsonArray = JSONArray.fromObject(list); return jsonArray; } return null; } } package com.wq.controller;
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=551122532008200rm
https://javayms.pages.dev?id=551122532008200rm