使用SSM為學(xué)校開發(fā)后勤報(bào)修系統(tǒng)
?項(xiàng)目編號:BS-XX-006
本系統(tǒng)基于SSM實(shí)現(xiàn)后勤報(bào)修管理功能,前端采用DIV+CSS布局處理,采用異步請求AJAX發(fā)送請求和接受消息,數(shù)據(jù)庫采用MYSQL,開發(fā)工具使用IDEA或ECLIPSE,提供基于MAVEN和非MAVEN兩種版本供使用。
主要包含三個(gè)角色:
管理員角色:admin /? 123456? 主要可以管理用戶信息,報(bào)修分配維修人員,發(fā)布公告,維修類型管理,個(gè)人資料修改等功能
普通用戶:loguser / 123456? 主要可以進(jìn)行宿舍問題報(bào)修,查詢報(bào)修記錄,對報(bào)修結(jié)果進(jìn)行評價(jià),查看公告,修改個(gè)人資料等功能
維護(hù)人員:repair / 123456? 主要可以查看分配的維護(hù)記錄,對維護(hù)的結(jié)果進(jìn)行處理,維護(hù)個(gè)人記錄等相關(guān)功能
部分功能展示如下:
一,管理員登陸
報(bào)修系統(tǒng)首頁:可以根據(jù)時(shí)間和狀態(tài)進(jìn)行搜索報(bào)修記錄

2.? 用戶登陸注冊


3.維護(hù)分類管理

4.發(fā)布公告

5.用戶管理

6,管理分配報(bào)修單

7,個(gè)人資料修改

二,普通用戶登陸
新增報(bào)修

查看自己報(bào)修歷史并修改報(bào)修單

3.查看報(bào)修信息和公告信息等操作

4,對維護(hù)結(jié)果進(jìn)行評分操作

三,維護(hù)人員登陸
查看維修記錄并修改報(bào)修狀態(tài)

2.修改個(gè)人資料

本系統(tǒng)功能完整,運(yùn)行無誤,界面簡潔大方,適合做畢業(yè)設(shè)計(jì)或課程設(shè)計(jì)使用。
部分核心代碼:
package com.logistics.controller;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestParam;import org.springframework.web.bind.annotation.ResponseBody;import org.springframework.web.servlet.ModelAndView;import com.logistics.service.IndexService;import com.logistics.common.utils.exception.ServiceException;import com.logistics.common.utils.response.Res;public class IndexController {
private IndexService indexService;
public ModelAndView addPlacard( { String title, String status, String timeRange, Integer pageNo, Integer pageSize,
HttpServletRequest request, HttpServletResponse response)Res res = new Res(); try {
res = indexService.getIndexInfo();
} catch (ServiceException e) {
e.printStackTrace();
res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
}
}
package com.logistics.controller;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestParam;import org.springframework.web.bind.annotation.ResponseBody;import org.springframework.web.servlet.ModelAndView;import com.logistics.persistence.model.User;import com.logistics.service.UserService;import com.logistics.common.utils.exception.ServiceException;import com.logistics.common.utils.response.Res;public class UserController {
private UserService userService; /**
* 用戶登錄接口
*
* @param userName
* @param password
* @param request
* @param response
* @return
*/
public ModelAndView login( { String userName, String password, String rememberMe, String directPage,
HttpServletRequest request,HttpServletResponse response)Res res = new Res(); try {
res = userService.login(userName, password, rememberMe, request, response);
} catch (ServiceException e) {
? ?e.printStackTrace();
? ?res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
} /**
* 判斷是否登錄
* @param directPage
* @param request
* @param response
* @return
*/
public ModelAndView isLogin( { String directPage,
HttpServletRequest request,HttpServletResponse response)Res res = new Res(); try { User user = userService.getUser(request, response); if(user==null){ throw new ServiceException("未登錄");
}
res.addRespose("isLogin", 1);
res.addRespose("groupId", user.getGroupId());
} catch (ServiceException e) {
? ?e.printStackTrace();
? ?res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
}
public ModelAndView logout( { String directPage,
HttpServletRequest request,HttpServletResponse response)Res res = new Res(); try {
res = userService.logout(request, response);
} catch (ServiceException e) {
? ?e.printStackTrace();
? ?res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
} /**
* 用戶注冊接口
* @param userName
* @param password
* @param password2
* @param request
* @param response
* @return
*/
public ModelAndView singIn( { String userName, String password, String password2,
HttpServletRequest request,HttpServletResponse response)Res res = new Res(); try {
res = userService.singIn(userName,password,password2, request, response);
} catch (ServiceException e) {
? ?e.printStackTrace();
? ?res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
}
/**
* 修改密碼
* @param password
* @param password2
* @param request
* @param response
* @return
*/
public ModelAndView changePassword( { String password, String password2,
HttpServletRequest request,HttpServletResponse response)Res res = new Res(); try { Long userId = userService.getUser(request, response).getUsrId();
res = userService.changePassword(userId,password,password2);
} catch (ServiceException e) {
? ?e.printStackTrace();
? ?res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
} /**
* 獲取維修人員列表
* @param request
* @param response
* @return
*/
public ModelAndView getRepairManList(
HttpServletRequest request,HttpServletResponse response) { Res res = new Res(); try {
res = userService.getRepairManList();
} catch (ServiceException e) {
? ?e.printStackTrace();
? ?res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
} /**
*
* @param request
* @param response
* @return
*/
public ModelAndView getAllUserList(
HttpServletRequest request,HttpServletResponse response) { Res res = new Res(); try {
res = userService.getAllUserList();
} catch (ServiceException e) {
? ?e.printStackTrace();
? ?res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
}
public ModelAndView addUser( { String userName, String password, String usrMobile, String address, String groupId,
HttpServletRequest request,HttpServletResponse response)Res res = new Res(); try {
res = userService.addUser(userName,password, usrMobile, groupId,address);
} catch (ServiceException e) {
? ?e.printStackTrace();
? ?res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
}
public ModelAndView removeUser( { String userId,
HttpServletRequest request,HttpServletResponse response)Res res = new Res(); try {
res = userService.removeUser(userId);
} catch (ServiceException e) {
? ?e.printStackTrace();
? ?res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
}
}
package com.logistics.controller;import java.io.IOException;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.ui.Model;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestParam;import org.springframework.web.bind.annotation.ResponseBody;import org.springframework.web.servlet.ModelAndView;import com.logistics.persistence.model.User;import com.logistics.service.RepairOrderService;import com.logistics.service.UserService;import com.logistics.common.Page;import com.logistics.common.utils.exception.ServiceException;import com.logistics.common.utils.response.Res;public class RepairOrderController {
private RepairOrderService repairOrderService;
private UserService userService; /**
* 添加維修單
*
* @param title
* @param des
* @param phone
* @param address
* @param categoryId
* @param request
* @param response
* @return
*/
public ModelAndView addOrder( { String title, String des, String phone, String address, String categoryId,
HttpServletRequest request, HttpServletResponse response)Res res = new Res(); try { User user = userService.getUser(request, response);
res = repairOrderService.addOrder(title, des, phone, address, categoryId,user.getUsrId());
} catch (ServiceException e) {
e.printStackTrace();
res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
}
public ModelAndView getOrder( { String orderId,
HttpServletRequest request, HttpServletResponse response)Res res = new Res(); try {
res = repairOrderService.getOrder(orderId);
} catch (ServiceException e) {
e.printStackTrace();
res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
}
//確認(rèn)完成
public ModelAndView completeOrder( { String orderId,
HttpServletRequest request, HttpServletResponse response)Res res = new Res(); try { User user = userService.getUser(request, response);
res = repairOrderService.completeOrder(orderId,user.getUsrId());
} catch (ServiceException e) {
e.printStackTrace();
res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
} /**
* 修改維修單
*
* @param orderId
* @param title
* @param des
* @param phone
* @param address
* @param categoryId
* @param request
* @param response
* @return
*/
public ModelAndView updateOrder( { String orderId, String title, String des, String phone, String address, String categoryId,
HttpServletRequest request, HttpServletResponse response)Res res = new Res(); try {
res = repairOrderService.updateOrder(orderId, title, des, phone, address, categoryId);
} catch (ServiceException e) {
e.printStackTrace();
res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
} /**
* 查詢所有維修單
*
* @param name
* @param model
* @return
*/
public ModelAndView queryRepairOrderList( { String title, String status, String timeRange, Integer pageNo, Integer pageSize,
HttpServletRequest request, HttpServletResponse response)Res res = new Res(); try { Page page = new Page();
page.setPageNo(pageNo == null ? 0 : pageNo);
page.setPageSize(pageSize == null ? page.getPageSize() : pageSize);
res = repairOrderService.queryRepairOrderList(title, status, timeRange, page);
} catch (ServiceException e) {
e.printStackTrace();
res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
} /**
* 查詢個(gè)人維修單
*
* @param title
* @param status
* @param timeRange
* @param pageNo
* @param pageSize
* @param request
* @param response
* @return
*/
public ModelAndView getMyRepairOrderList(HttpServletRequest request, HttpServletResponse response) { Res res = new Res(); try { User user = userService.getUser(request, response);
res = repairOrderService.getMyRepairOrderList(user);
} catch (ServiceException e) {
e.printStackTrace();
res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
} /**
* 獲取我維修的訂單
* @param request
* @param response
* @return
*/
public ModelAndView getMyTaskOrder(HttpServletRequest request, HttpServletResponse response) { Res res = new Res(); try { User user = userService.getUser(request, response);
res = repairOrderService.getMyTaskOrder(user);
} catch (ServiceException e) {
e.printStackTrace();
res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
} /**
* 評價(jià)訂單
* @param orderId
* @param star
* @param comment
* @param request
* @param response
* @return
*/
public ModelAndView commentOrder( { String orderId, String star, String comment,
HttpServletRequest request, HttpServletResponse response)Res res = new Res(); try { User user = userService.getUser(request, response);
res = repairOrderService.commentOrder(orderId,star,comment,user);
} catch (ServiceException e) {
e.printStackTrace();
res.addError(Res.MESSAGE_NAME_ERROR, e.getMessage());
} return res.toView(response);
} /**
* 測試接口
*
* @param name
* @param model
* @param request
* @param response
* @return
*/
public ModelAndView hello( {
model.addAttribute( String name,
Model model, HttpServletRequest request, HttpServletResponse response)"name", name); try { if (name == null) {
name = "";
}
response.getWriter().write("<h1>Hello " + name + "</h1>");
} catch (IOException e) {
} return null;
}
}