基于javaweb的疫情物业系统(java+ssm+vue+elementui+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8、Node.js≥10
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的疫情物业系统(java+SSM+VUE+ElementUI+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项目:是;
技术栈
使用说明
用户管理控制层:
@Controller
public class UserController {
@Autowired
@Qualifier(“pmsService”)
private PmsService pmsService;
@RequestMapping(value=“/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=“/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= {“/”,“/index”})
public String fist(Model model) {
return “user/user_login”;
@RequestMapping(value=“/signout”)
public String logout(HttpSession session,Model model) {
User user=null;
session.setAttribute(“user”, user);
return “user/user_login”;
@RequestMapping(value=“/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);
PageVO page = pmsService.listUser(user, pageNo, rowMax);
response.reset();
response.setContentType(“text/plain;charset=UTF-8”);
response.getWriter().print(JSON.toJSONString(page));
response.flushBuffer();
@RequestMapping(value=“/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=“/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=“/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=“/user/loadEditUser”)
@ResponseBody
public Object loadEditUser(@RequestParam(value=“name”,required=false) String name){
User user = new User();
user = pmsService.findUserById(name);
System.out.println(“load user :”+ user.getUserName());
return user;
@RequestMapping(value= {“/userMg”})
public String userMg(@ModelAttribute(“user”) User user) {
return “manager/userMg”;
//关于我们
@RequestMapping(value=“/info”)
public String about() {
return “user/about”;
业主管理控制层:
@Controller
public class ConsumeController {
@Autowired
@Qualifier(“pmsService”)
private PmsService pmsService;
@RequestMapping(value= {“/consumeMg”})
public String consumeMg(@ModelAttribute(“consume”) Consume consume) {
return “manager/consumeMg”;
@RequestMapping(value=“/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());
PageVO page = pmsService.listConsume(consume, pageNo, rowMax);
response.reset();
response.setContentType(“text/plain;charset=UTF-8”);
response.getWriter().print(JSON.toJSONString(page));
response.flushBuffer();
@RequestMapping(value=“/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=“/pay”)
public String pay() {
return “user/pay”;
@RequestMapping(value=“/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
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);
PageVO page = pmsService.listConsumeUser(map, pageNo, rowMax);
response.reset();
response.setContentType(“text/plain;charset=UTF-8”);
response.getWriter().print(JSON.toJSONString(page));
response.flushBuffer();
@RequestMapping(value=“/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);
停车位管理控制层:
@Controller
public class CarportController {
@Autowired
CarportService carportService;
@RequestMapping(“/allcar”)
public String allcar(Model model,@RequestParam(value=“num”,defaultValue=“1”)int num) {
int pageNum1 = (num-1)*5;
System.out.println(“jinru”+num);
System.out.println(“jinru”+pageNum1);
List list = carportService.findAll(1,pageNum1);
List list1 = carportService.findAll(-1,pageNum1);
int pageNum =(int) Math.ceil(list1.size()/5);
model.addAttribute(“carportlist”, list);
model.addAttribute(“pageNum”, pageNum);
return “carport”;
@RequestMapping(“/findcarbyarea”)
public String findCarByArea(Model model,String area) {
List list = carportService.findCarByArea(area);
model.addAttribute(“carportlist”, list);
return “carport”;
@RequestMapping(value=“/page1”,method=RequestMethod.POST)
public @ResponseBody List page1(int page) {
int pageNum1 = (page-1)*5;
System.out.println(“jinru:”+page);
System.out.println(“jinru:”+pageNum1);
List list = carportService.findAll(1,pageNum1);
return list;
@RequestMapping(“/findcarbystate”)
public String findCarByState(Model model,String state) {
List list = carportService.findCarByState(state);
model.addAttribute(“carportlist”, list);
return “carport”;
@RequestMapping(“/updatetime”)
public void updatetime() {
boolean flag = carportService.updatetime();
System.out.println(“flag:”+flag);
/**
*/
@RequestMapping(“/suresellcar”)
public @ResponseBody boolean suresellcar(int uid,HttpSession session) {
int owneruid = (int) session.getAttribute(“owneruid”);
System.out.println(“suresellcar:”+uid);
Carport carport = new Carport();
SimpleDateFormat format = new SimpleDateFormat(“yyyy-MM-dd HH-mm-ss”);
Date date = new Date();
String d = format.format(date);
String state = “占用”;
carport.setDate(d);
carport.setUid(owneruid);
carport.setCid(uid);
carport.setState(state);
boolean flag = carportService.suresellcar(carport);
return flag;
@RequestMapping(value=“/startsellcar”,method=RequestMethod.POST)
public @ResponseBody boolean startsellcar(String time) {
boolean flag =false;
List list = carportService.findAll(-1, 0);
for (Carport c : list) {
if(c.getDuration().equals(time)) {
flag = false;
return flag;
}else {
flag = true;
if(flag) {
flag = carportService.sellCar(time);
return flag;
@RequestMapping(“/sellcar”)
public String sellcar(Model model) {
List list = carportService.findCarByState(“未使用”);
int count = list.size();
List list1 = new ArrayList();
list1 = carportService.findCarByArea(“A”);
model.addAttribute(“A”, list1);
list1 = carportService.findCarByArea(“B”);
model.addAttribute(“B”, list1);
list1 = carportService.findCarByArea(“C”);
model.addAttribute(“C”, list1);
list1 = carportService.findCarByArea(“D”);
model.addAttribute(“D”, list1);
model.addAttribute(“count”, count);
return “sellcar”;