源码获取:博客首页 "资源" 里下载!项目介绍
本项目为后管系统,分为管理员、业主两种角色;
管理员主要功能为:
社区核心业务处理:车位收费管理、物业收费管理、投诉信息管理、报修信息管理
基础信息管理:楼宇管理、房屋管理、业主管理、车位管理、抄表管理、登录信息管理、修改密码
基础类型管理:投诉类型管理、收费类型管理、报修类型管理
数据统计:报修统计
业主主要功能为:
车位费查询、物业费查询、我的投诉列表、我的报修列表、修改密码等;
环境需要
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 8.0版本;
6.是否Maven项目:是;
技术栈
1. 后端:SpringBoot+Mybatis
2. 前端:HTML+CSS+JavaScript+LayUI
使用说明
1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean; maven install命令,然后运行;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,访问地址:http://localhost:8888
管理员账号/密码:admin/123456
业主账号/密码:kappy/123456
业主账号可通过管理员在业主管理模块进行添加,默认密码为123456
文章图片
文章图片
文章图片
文章图片
文章图片
【Java毕业设计项目实战篇|Java项目:物业管理系统(java+SpringBoot+LayUI+HTML+maven+mysql)】
文章图片
用户管理控制层:
@Controller
public class UserController {
@Autowired
@Qualifier("pmsService")
private PmsService pmsService;
@RequestMapping(value="https://www.it610.com/login")
public String login(@ModelAttribute("user") User user1, String userId,String password,Model model,HttpSession session) {
User user =pmsService.login(userId, password);
if(user!=null) {
session.setAttribute("user",user);
if(user.getRoleType()==0) {return "manager/userMg";
}
else return "user/user_login";
}
else {
model.addAttribute("errorMessage", "登录失败,请重新登录");
return "user/user_login";
}
}
@RequestMapping(value="https://www.it610.com/change")
public String change(@RequestParam("password")String password,@RequestParam("phone")String phone,Model model,HttpSession session) {
User user=(User)(session.getAttribute("user"));
String userId=user.getUserId();
System.out.println(userId);
System.out.println(password);
System.out.println(phone);
pmsService.change(password,phone,userId);
model.addAttribute("errorMessage", "修改成功,请重新登录");
user=null;
session.setAttribute("user", user);
return "user/user_login";
}
@RequestMapping(value= https://www.it610.com/article/{"/","/index"})
public String fist(Model model) {return "user/user_login";
}
@RequestMapping(value="https://www.it610.com/signout")
public String logout(HttpSession session,Model model) {
User user=null;
session.setAttribute("user", user);
return "user/user_login";
}@RequestMapping(value="https://www.it610.com/user/user-list")
public void selectUser(
HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException{
request.setCharacterEncoding("UTF-8");
String key = request.getParameter("key");
String pageNoStr = request.getParameter("pageNo");
String rowMaxStr = request.getParameter("rowMax");
String roleTypeStr = request.getParameter("roleType");
int pageNo = Integer.valueOf(pageNoStr);
int rowMax = Integer.valueOf(rowMaxStr);
int roleType = Integer.valueOf(roleTypeStr);
User user = new User();
user.setUserName(key);
user.setRoleType(roleType);
PageVOpage = pmsService.listUser(user, pageNo, rowMax);
response.reset();
response.setContentType("text/plain;
charset=UTF-8");
response.getWriter().print(JSON.toJSONString(page));
response.flushBuffer();
}@RequestMapping(value="https://www.it610.com/user/addUser")
public void addUser(@ModelAttribute("user") User user){
if(user.getSexId() == 0) {
user.setSex("男");
}
else {
user.setSex("女");
}
user.setRoleType(user.getTypeId());
pmsService.addUser(user);
System.out.println("add user :"+ user.getUserId());
user = null;
}@RequestMapping(value="https://www.it610.com/user/updateUser")
public void updateUser(@ModelAttribute("user") User user){
//User user = new User();
if(user.getSexId() == 0) {
user.setSex("男");
}
else {
user.setSex("女");
}
user.setRoleType(user.getTypeId());
pmsService.modifyUser(user);
System.out.println("modify user :"+ user.getUserName());
System.out.println("modify user :"+ user.getUserId());
System.out.println("modify user :"+ user.getPassword());
}@RequestMapping(value="https://www.it610.com/user/deleteUser")
public void deleteUser(@RequestBody User user, HttpServletResponse response){String userId = user.getUserId();
pmsService.removeUserById(userId);
System.out.println("delete user :"+ userId);
}@RequestMapping(value="https://www.it610.com/user/loadEditUser")
@ResponseBody
publicObject loadEditUser(@RequestParam(value="https://www.it610.com/article/name",required=false) String name){User user = new User();
user = pmsService.findUserById(name);
System.out.println("load user :"+ user.getUserName());
return user;
}@RequestMapping(value= https://www.it610.com/article/{"/userMg"})
public String userMg(@ModelAttribute("user") User user) {
return "manager/userMg";
}//关于我们
@RequestMapping(value="https://www.it610.com/info")
public String about() {
return "user/about";
}}
报修控制管理层:
@Controller
public class RepairController {
@Autowired
@Qualifier("pmsService")
private PmsService pmsService;
@RequestMapping(value= https://www.it610.com/article/{"/repairMg"})
public String repairMg(@ModelAttribute("repair") Repair repair) {
return "manager/repairMg";
} @RequestMapping(value="https://www.it610.com/manager/repair-list")
public void selectRepair(
HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException{
request.setCharacterEncoding("UTF-8");
String key = request.getParameter("key");
String pageNoStr = request.getParameter("pageNo");
String rowMaxStr = request.getParameter("rowMax");
String repairState1 = request.getParameter("repairState");
int pageNo = Integer.valueOf(pageNoStr);
int rowMax = Integer.valueOf(rowMaxStr);
int repairState = Integer.valueOf(repairState1);
Repair repair = new Repair();
repair.setUserId(key);
repair.setRepairState(repairState);
PageVOpage = pmsService.listRepair(repair, pageNo, rowMax);
response.reset();
response.setContentType("text/plain;
charset=UTF-8");
response.getWriter().print(JSON.toJSONString(page));
response.flushBuffer();
}
@RequestMapping(value="https://www.it610.com/manager/updateRepair")
public void updateRepair(@ModelAttribute("repair") Repair repair){
repair.setRepairState(repair.getTypeId());
pmsService.modifyRepair(repair);
System.out.println("modify Repair :"+ repair.getRepairId());
}@RequestMapping(value="https://www.it610.com/manager/deleteRepair")
public void deleteRepair(@RequestBody Repair repair, HttpServletResponse response){
int repairId = repair.getRepairId();
pmsService.removeRepair(repairId);
System.out.println("delete Repair :"+ repairId);
}@RequestMapping(value="https://www.it610.com/manager/loadEditRepair")
@ResponseBody
publicObject loadEditRepair(@RequestParam(value="https://www.it610.com/article/repairId",required=false) String repairId){
int repairId1 = Integer.valueOf(repairId);
Repair repair = new Repair();
repair = pmsService.findRepair(repairId1);
System.out.println("load Repair :"+ repairId);
return repair;
}@RequestMapping(value="https://www.it610.com/article/repair")
public String repair(Model model) {
return "user/repair";
}
@RequestMapping(value="https://www.it610.com/article/user/repair-list")
public void selectAdvice(HttpServletRequest request, HttpServletResponse response, HttpSession session)
throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
User user = (User) session.getAttribute("user");
String pageNoStr = request.getParameter("pageNo");
String rowMaxStr = request.getParameter("rowMax");
String repairState = request.getParameter("repairState");
String beginDate = request.getParameter("beginDate");
String endDate = request.getParameter("endDate");
System.out.println(beginDate);
System.out.println(endDate);
int pageNo = Integer.valueOf(pageNoStr);
int rowMax = Integer.valueOf(rowMaxStr);
int reState = Integer.valueOf(repairState);
Repair repair =new Repair();
repair.setUserId(user.getUserId());
repair.setRepairState(reState);
PageVOpage = pmsService.listRepair(repair, pageNo, rowMax);
response.reset();
response.setContentType("text/plain;
charset=UTF-8");
response.getWriter().print(JSON.toJSONString(page));
response.flushBuffer();
}
@RequestMapping(value="https://www.it610.com/user/addRepair")
public void addRepair(HttpServletRequest request, HttpServletResponse response, HttpSession session,
@ModelAttribute("repair") Repair repair) throws ServletException, IOException{
request.setCharacterEncoding("UTF-8");
String buildingNum = request.getParameter("buildingNum");
String roomNum = request.getParameter("roomNum");
Date date = (Date) new Timestamp(System.currentTimeMillis());
User user = (User) session.getAttribute("user");
String userId = user.getUserId();
int bdNum = Integer.valueOf(buildingNum);
int rmNum = Integer.valueOf(roomNum);
repair.setUserId(userId);
repair.setRepairDate(date);
repair.setBuildingNum(bdNum);
repair.setRoomNum(rmNum);
repair.setRepairState(0);
pmsService.addRepair(repair);
}@RequestMapping(value="https://www.it610.com/user/loadRepair")
@ResponseBody
public Object loadAdvice(@RequestParam(value="https://www.it610.com/article/repairId",required=false) String repairId){
int id = Integer.valueOf(repairId);
Repair repair = new Repair();
repair = pmsService.selectRepairByIdUser(id);
return repair;
}
}
耗材管理控制层:
@Controller
public class ConsumeController {
@Autowired
@Qualifier("pmsService")
private PmsService pmsService;
@RequestMapping(value= https://www.it610.com/article/{"/consumeMg"})
public String consumeMg(@ModelAttribute("consume") Consume consume) {return "manager/consumeMg";
}
@RequestMapping(value="https://www.it610.com/manager/consume-list")
public void selectConsume(
HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException{
request.setCharacterEncoding("UTF-8");
String key = request.getParameter("key");
String pageNoStr = request.getParameter("pageNo");
String rowMaxStr = request.getParameter("rowMax");
String consumeType1 = request.getParameter("consumeType");
String consumeState1 = request.getParameter("consumeState");
int pageNo = Integer.valueOf(pageNoStr);
int rowMax = Integer.valueOf(rowMaxStr);
int consumeType = Integer.valueOf(consumeType1);
int consumeState = Integer.valueOf(consumeState1);
Consume consume = new Consume();
consume.setUserId(key);
consume.setConsumeState(consumeState);
consume.setConsumeType(consumeType);
System.out.println(consume.getConsumeState());
PageVOpage = pmsService.listConsume(consume, pageNo, rowMax);
response.reset();
response.setContentType("text/plain;
charset=UTF-8");
response.getWriter().print(JSON.toJSONString(page));
response.flushBuffer();
}@RequestMapping(value="https://www.it610.com/manager/addConsume")
public void addConsume(@ModelAttribute("consume") Consume consume){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateStr = consume.getDate()+ " 00:00:00";
Date date = Timestamp.valueOf(dateStr);
consume.setConsumeDate(date);
System.out.println("add consume :"+ consume.getUserId());
consume.setConsumeType(consume.getTypeId());
consume.setCreateDate(new Timestamp(System.currentTimeMillis()));
consume.setPrice(consume.getCount() * consume.getUnitPrice());
consume.setConsumeState(0);
pmsService.addConsume(consume);
}@RequestMapping(value="https://www.it610.com/pay")
public String pay() {
return "user/pay";
}@RequestMapping(value="https://www.it610.com/list_consume")
public void selectConsume(
HttpServletRequest request, HttpServletResponse response,HttpSession session)throws ServletException, IOException{
request.setCharacterEncoding("UTF-8");
String pageNoStr = request.getParameter("pageNo");
String rowMaxStr = request.getParameter("rowMax");
String consumeType = request.getParameter("consumeType");
int pageNo = Integer.valueOf(pageNoStr);
int rowMax = Integer.valueOf(rowMaxStr);
String select=request.getParameter("select");
User user=(User)session.getAttribute("user");
Map map=new HashMap<>();
String calendar=request.getParameter("calendar");
String calendar1=request.getParameter("calendar1");
map.put("calendar", calendar);
map.put("calendar1", calendar1);
System.out.println(calendar+"9");
System.out.println(calendar1+"10");
map.put("consumeType", consumeType);
map.put("user", user);
map.put("select", select);
PageVOpage = pmsService.listConsumeUser(map, pageNo, rowMax);
response.reset();
response.setContentType("text/plain;
charset=UTF-8");
response.getWriter().print(JSON.toJSONString(page));
response.flushBuffer();
}@RequestMapping(value="https://www.it610.com/payconsume")
public void payconsume(HttpServletRequest request, HttpServletResponse response) {
String[] list = request.getParameterValues("list");
for (String item : list) {
int consumeId=Integer.valueOf(item);
pmsService.payOneItem(consumeId);
}}
}
源码获取:博客首页 "资源" 里下载!
推荐阅读
- Java毕业设计项目实战篇|Java项目:博客论坛管理系统(java+SpringBoot+JSP+LayUI+maven+mysql)
- Java毕业设计项目实战篇|Java项目:教材管理系统(java+SSM+jsp+mysql+maven)
- 蓝桥杯|2022 第十三届 蓝桥杯 省赛 Java B组 真题 详细解析 答案
- 计算机基础|初识java虚拟机(JVM)运行时数据区结构
- JVM|JVM系列之运行时数据区与内存异常演示
- 学习笔记|JVM学习笔记(二)运行时数据区
- 笔记|设计模式之一——单例模式
- Java|(JUC 下典型的类)Java 并发包中线程同步器
- 笔记|并发编程中常见的锁策略<包含详细介绍CAS机制和ABA问题>