随着高校每年的扩大招生,学校人数越来越多,学校后勤报修管理的工作量也越来越繁重。使用传统的管理手段和方法,很难完成大量的信息分析和处理。因此,充分利用网络资源和信息化技术,建设一套基于校园网的学校后勤报修管理系统,提高后勤管理水平、效率和质量,使学校后勤管理科学化、信息化、现代化,是新时期学校后勤管理工作面临的一个新的课题。设计开发学校后勤报修管理系统,主要有一下几方面的原因:1、传统的报修、维修环节,存在着方法落后、手续烦琐、工作量大的缺点,以不能适应新形势的要求;2、高校不断扩招,学校的设备也不断增多,需利用现代化手段进行管理;3、赶上新时代的步伐,实现后勤报修管理的规化、信息化,提高后勤报修管理的服务质量和服务效率。基于以上的原因,原有的后勤报修维修手段,以不能适应新情况要求,为提高后勤管理效率和质量,降低后勤管理的人力、物力和财力,方便广大师生生活和学习,开发一个学校后勤报修管理系统十分重要。
开发工具:idea ,微信开发者工具
数据库mysql5.7+
数据库链接工具:navcat,小海豚等
演示视频:
基于微信小程序的java高校学生电器报修系统ssm高校后勤报修系统小程序
在信息化社会迎来知识经济的时代,校园的信息化和数字化建设成为国外高校建设的热点。它的基本特征体现为高起点、高投资和快速,相对于国高校而言,还存在起步早的特点。在一个多世纪以前,美国的一所大学就提出了数字化校园的概念,随后美国的麻省理工学院对这个概念,经过多年的努力研究,设计、构建出一个比较成熟的数字化校园的模型。调查显示,在西方的发达国家中一些著名的世界大学,已经于上世纪末成功地建设好了数字化校园。此外,我国在现阶段的信息数字化方面的工作,也开始进入一个全新的发展时期。尤其是在信息化高校的建设方面,已经步入了全面的发展阶段。许多高校都意识到信息化建设,是提高管理手段和水平,保证管理效率和质量的重要渠道。
项目截图:
小程序登录注册关键代码如下:
<van-dialog id="van-dialog" />
<view class='root_view'>
<image class='background' src="../../images/bg2.jpeg" mode="aspectFill"></image>
<view class="content_view">
<view style="text-align: center;padding-top: 100rpx;">
<image class='iv_logo' mode='widthFix' src='../../images/sq-logo.png'></image>
</view>
<form bindsubmit="onLogin">
<view class='iput_pan'>
<!-- 密码登录 -->
<view class='iput_pss_pan'>
<input name="tel" class='iput_telphone' placeholder-class='ipt_placeholder_style' placeholder='请输入电话'>
</input>
<input name="upwd" class='iput_password_login' type="password" placeholder-class='ipt_placeholder_style'
placeholder='请输入密码'>
</input>
</view>
</view>
<button formType="submit" class='btn_login'>登录</button>
</form>
<view class='tv_click'>
<!-- <text class='tv_vcode' bindtap='vcodelogin'></text> -->
<view class='tv_forget_psswd'>
<view bindtap='onJzRegister'>学生注册</view>
</view>
</view>
</view>
</view>
package com.controller;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
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.ResponseBody;
import com.model.Tadmin;
import com.service.TadminService;
/**
* 登录Controller控制类
*/
@Controller
public class LoginController {
/**
* 注入Service
*/
@Autowired
private TadminService tadminService;
/**
* 用户登录
*
* @param request
* @return
* @throws Exception
*/
@ResponseBody
@RequestMapping(value = "/tadmin_login")
public String login(HttpServletRequest request) throws Exception {
String flag = "false";
String uname = request.getParameter("uname");
String upwd = request.getParameter("upwd");
Tadmin tadmin = new Tadmin();
tadmin.setUname(uname);
tadmin.setUpwd(upwd);
List<Tadmin> tadminList = tadminService.queryTadminList(tadmin, null);
if (tadminList != null && tadminList.size() > 0) {
Tadmin admin = tadminList.get(0);
request.getSession().setAttribute("cuser", admin);
flag = "true";
}
return flag;
}
@RequestMapping(value = "/tadmin_loginout")
public String loginout(HttpServletRequest request) throws Exception {
request.getSession().setAttribute("cuser", null);
request.getSession().invalidate();
return "/admin/login.jsp";
}
}
发布维修单关键代码:
<wux-toast id="wux-toast" />
<view class="page">
<view>
<van-cell-group>
<van-field value="{{fxsq}}" label="" type="textarea" placeholder="请输入详情" autosize border="{{ false }}" bind:change="onChange" />
</van-cell-group>
</view>
<view class="imgs">
<van-uploader file-list="{{ fileList }}" bind:after-read="afterRead" preview-size="160rpx" max-count="1"/>
</view>
<van-divider />
<view class="foot" style="">
<van-button bind:click="saveSQ" size="small" type="warning">提交</van-button>
</view>
</view>
package com.controller;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
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.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.model.Userinfo;
import com.model.Wxuser;
import com.model.Xminfo;
import com.model.Zhaopin;
import com.response.LoginResponse;
import com.response.Response;
import com.response.UinfoResponse;
import com.response.WxuserListResponse;
import com.response.WxuserResponse;
import com.response.XminfoListResponse;
import com.response.ZhaopinListResponse;
import com.response.ZhaopinResponse;
import com.service.UserinfoService;
import com.service.WxuserService;
import com.service.XminfoService;
import com.service.ZhaopinService;
@Controller
@RequestMapping(value = "/rest")
public class RestApiController {
@Autowired
private UserinfoService userinfoService;
@Autowired
private WxuserService wxuserService;
@Autowired
private ZhaopinService zhaopinService;
@Autowired
private XminfoService xminfoService;
/**
* 用户注册
*
* @param user
* @return
*/
@RequestMapping(value = "/register", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
@ResponseBody
public Response register(HttpServletRequest req, Userinfo user) {
Response sres = new Response();
try {
Userinfo uinfo = new Userinfo();
uinfo.setTel(user.getTel());
List<Userinfo> ulist = userinfoService.queryUserinfoList(uinfo,
null);
if (ulist == null || ulist.size() == 0) {
userinfoService.insertUserinfo(user);
sres.setCode(200);
} else {
sres.setCode(201); // 手机号已存在
}
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 用户登录
*
* @param user
* @return
*/
@RequestMapping(value = "/ulogin")
@ResponseBody
public LoginResponse ulogin(HttpServletRequest req, Userinfo user) {
LoginResponse sres = new LoginResponse();
try {
int uid = 0;
List<Userinfo> ulist = userinfoService
.queryUserinfoList(user, null);
if (ulist != null && ulist.size() > 0) {
uid = ulist.get(0).getId();
sres.setCode(200);
sres.setOpenid(uid + "");
sres.setName(ulist.get(0).getName());
sres.setTel(ulist.get(0).getTel());
sres.setUtype(ulist.get(0).getUtype());
sres.setAddress(ulist.get(0).getAddress());
} else {
sres.setCode(201);
}
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 用户资料
*
* @param user
* @return
*/
@RequestMapping(value = "/uinfo")
@ResponseBody
public UinfoResponse uinfo(HttpServletRequest req) {
UinfoResponse sres = new UinfoResponse();
int uid = Integer.parseInt(req.getParameter("uid"));
try {
Userinfo uinfo = userinfoService.queryUserinfoById(uid);
sres.setUinfo(uinfo);
sres.setCode(200);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 修改个人资料
*
* @param user
* @return
*/
@RequestMapping(value = "/updateuser")
@ResponseBody
public Response updateuser(HttpServletRequest req, Userinfo userinfo) {
Response sres = new Response();
try {
userinfoService.updateUserinfo(userinfo);
sres.setCode(200);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 维修人员信息列表
*
* @param req
* @return
*/
@RequestMapping(value = "/tlist")
@ResponseBody
public WxuserListResponse tlist(HttpServletRequest req) {
WxuserListResponse sres = new WxuserListResponse();
try {
String keywords = req.getParameter("keywords");
Wxuser teainfo = new Wxuser();
teainfo.setState("通过");
teainfo.setKeywords(keywords);
List<Wxuser> dlist = wxuserService.queryWxuserList(teainfo, null);
sres.setCode(200);
sres.setDlist(dlist);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 维修项目列表
*
* @param req
* @return
*/
@RequestMapping(value = "/xmlist")
@ResponseBody
public XminfoListResponse xmlist(HttpServletRequest req) {
XminfoListResponse sres = new XminfoListResponse();
try {
List<Xminfo> dlist = xminfoService.queryXminfoList(new Xminfo(), null);
sres.setCode(200);
sres.setDlist(dlist);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 自己查看维修人员信息详情
*
* @param req
* @return
*/
@RequestMapping(value = "/tinfoView")
@ResponseBody
public WxuserResponse tinfoView(HttpServletRequest req) {
WxuserResponse sres = new WxuserResponse();
try {
Wxuser teainfo = null;
int uid = Integer.parseInt(req.getParameter("uid") == null ? "0"
: req.getParameter("uid"));
Wxuser tinfo = new Wxuser();
tinfo.setUid(uid);
List<Wxuser> tlist = wxuserService.queryWxuserList(tinfo, null);
if (tlist != null && tlist.size() > 0) {
teainfo = tlist.get(0);
}
sres.setCode(200);
sres.setDinfo(teainfo);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 修改维修人员信息
*
* @param req
* @return
*/
@RequestMapping(value = "/updateTinfo")
@ResponseBody
public Response updateTinfo(HttpServletRequest req, Wxuser wxuser) {
Response sres = new Response();
try {
if (wxuser.getId() != null) {
wxuserService.updateWxuser(wxuser);
} else {
wxuser.setState("待审核");
wxuserService.insertWxuser(wxuser);
}
sres.setCode(200);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 报修单列表 任务大厅
*
* @param req
* @return
*/
@RequestMapping(value = "/zplist")
@ResponseBody
public ZhaopinListResponse zplist(HttpServletRequest req) {
ZhaopinListResponse sres = new ZhaopinListResponse();
try {
Zhaopin zinfo = new Zhaopin();
zinfo.setState("待接单");
String keywords = req.getParameter("keywords");
zinfo.setKeywords(keywords);
List<Zhaopin> dlist = zhaopinService.queryZhaopinList(zinfo, null);
sres.setCode(200);
sres.setDlist(dlist);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 报修单详情
*
* @param req
* @return
*/
@RequestMapping(value = "/zpinfo")
@ResponseBody
public ZhaopinResponse zpinfo(HttpServletRequest req) {
ZhaopinResponse sres = new ZhaopinResponse();
try {
int id = Integer.parseInt(req.getParameter("id"));
Zhaopin zinfo = zhaopinService.queryZhaopinById(id);
if (zinfo.getWuid() != null && zinfo.getWuid() != 0) {
Wxuser wxuser = new Wxuser();
wxuser.setUid(zinfo.getWuid());
List<Wxuser> wxlist = wxuserService.queryWxuserList(wxuser,
null);
if (wxlist != null && wxlist.size() > 0) {
zinfo.setWxuserVO(wxlist.get(0));
}
}
sres.setCode(200);
sres.setDinfo(zinfo);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 发布报修单
*
* @param req
* @return
*/
@RequestMapping(value = "/addZhaopin")
@ResponseBody
public Response addZhaopin(HttpServletRequest req, Zhaopin zhaopin) {
Response sres = new Response();
try {
int xmid = Integer.parseInt(req.getParameter("xmid"));
Xminfo xminfo = xminfoService.queryXminfoById(xmid);
zhaopin.setTitle(xminfo.getName());
zhaopin.setGj(xminfo.getBj());
zhaopin.setState("待接单");
zhaopin.setFbsj(new SimpleDateFormat("yyyy-MM-dd")
.format(new Date()));
zhaopinService.insertZhaopin(zhaopin);
sres.setCode(200);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 修改报修单
*
* @param req
* @return
*/
@RequestMapping(value = "/updateZhaopin")
@ResponseBody
public Response updateZhaopin(HttpServletRequest req, Zhaopin zhaopin) {
Response sres = new Response();
try {
zhaopin.setFbsj(new SimpleDateFormat("yyyy-MM-dd")
.format(new Date()));
zhaopinService.updateZhaopin(zhaopin);
sres.setCode(200);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 删除报修单
*
* @param req
* @return
*/
@RequestMapping(value = "/delZhaopin")
@ResponseBody
public Response delZhaopin(HttpServletRequest req) {
Response sres = new Response();
try {
int id = Integer.parseInt(req.getParameter("id"));
zhaopinService.deleteZhaopin(id);
sres.setCode(200);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 我发布的报修单
*
* @param req
* @return
*/
@RequestMapping(value = "/myzplist")
@ResponseBody
public ZhaopinListResponse myzplist(HttpServletRequest req) {
ZhaopinListResponse sres = new ZhaopinListResponse();
try {
int uid = Integer.parseInt(req.getParameter("uid"));
Zhaopin zinfo = new Zhaopin();
zinfo.setUid(uid);
List<Zhaopin> dlist = zhaopinService.queryZhaopinList(zinfo, null);
sres.setCode(200);
sres.setDlist(dlist);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 维修人员接单
*
* @param req
* @return
*/
@RequestMapping(value = "/jiedan")
@ResponseBody
public Response jiedan(HttpServletRequest req) {
Response sres = new Response();
try {
int id = Integer.parseInt(req.getParameter("id"));
int uid = Integer.parseInt(req.getParameter("uid"));
Wxuser wxuser = new Wxuser();
wxuser.setUid(uid);
List<Wxuser> wlist = wxuserService.queryWxuserList(wxuser, null);
if (wlist != null && wlist.size() > 0) {
wxuser = wlist.get(0);
if (wxuser.getState().equals("通过")) {
Zhaopin zinfo = zhaopinService.queryZhaopinById(id);
zinfo.setWuid(uid);
zinfo.setState("已接单");
zhaopinService.updateZhaopin(zinfo);
sres.setCode(200);
} else {
sres.setCode(202);
}
} else {
sres.setCode(201);
}
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 我接的维修单 维修人员
*
* @param req
* @return
*/
@RequestMapping(value = "/mjdlist")
@ResponseBody
public ZhaopinListResponse mjdlist(HttpServletRequest req) {
ZhaopinListResponse sres = new ZhaopinListResponse();
try {
int uid = Integer.parseInt(req.getParameter("uid"));
Zhaopin zinfo = new Zhaopin();
zinfo.setWuid(uid);
List<Zhaopin> dlist = zhaopinService.queryZhaopinList(zinfo, null);
sres.setCode(200);
sres.setDlist(dlist);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 维修工报价
*
* @param req
* @return
*/
@RequestMapping(value = "/baojia")
@ResponseBody
public Response baojia(HttpServletRequest req) {
Response sres = new Response();
try {
int id = Integer.parseInt(req.getParameter("id"));
String baojia = req.getParameter("baojia");
Zhaopin zinfo = zhaopinService.queryZhaopinById(id);
zinfo.setBaojia(baojia);
zinfo.setState("已维修");
zhaopinService.updateZhaopin(zinfo);
sres.setCode(200);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 用户确认完成
*
* @param req
* @return
*/
@RequestMapping(value = "/wancheng")
@ResponseBody
public Response wancheng(HttpServletRequest req) {
Response sres = new Response();
try {
int id = Integer.parseInt(req.getParameter("id"));
Zhaopin zinfo = zhaopinService.queryZhaopinById(id);
zinfo.setState("已完成");
zhaopinService.updateZhaopin(zinfo);
sres.setCode(200);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 返修申请
*
* @param req
* @return
*/
@RequestMapping(value = "/fxsqInfo")
@ResponseBody
public Response fxsqInfo(HttpServletRequest req) {
Response sres = new Response();
try {
int id = Integer.parseInt(req.getParameter("id"));
String fxsq = req.getParameter("fxsq");
String fujian = req.getParameter("fujian");
Zhaopin zinfo = zhaopinService.queryZhaopinById(id);
zinfo.setFxsq(fxsq);
zinfo.setFujian(fujian);
zinfo.setState("申请返修");
zhaopinService.updateZhaopin(zinfo);
sres.setCode(200);
} catch (Exception e) {
sres.setCode(500);
e.printStackTrace();
}
return sres;
}
/**
* 上传文件
*
* @param user
* @return
*/
@RequestMapping(value = "/uploadFile")
@ResponseBody
public String uploadFile(HttpServletRequest req, HttpServletResponse res,
Userinfo user) {
String url = "";
try {
FileItemFactory factory = new DiskFileItemFactory();
// 创建文件上传处理器
ServletFileUpload upload = new ServletFileUpload(factory);
// 开始解析请求信息
List items = null;
try {
items = upload.parseRequest(req);
} catch (FileUploadException e) {
e.printStackTrace();
}
// 对所有请求信息进行判断
Iterator iter = items.iterator();
while (iter.hasNext()) {
FileItem item = (FileItem) iter.next();
// 信息为普通的格式
if (item.isFormField()) {
String fieldName = item.getFieldName();
String value = item.getString();
}
// 信息为文件格式
else {
String fileName = item.getName();
int index = fileName.lastIndexOf(".");
fileName = fileName.substring(index);
String fname = new SimpleDateFormat("yyyyMMddHHmmss")
.format(new Date())
+ fileName;
String basePath = req.getRealPath("/upload");
String furl = "/upload/" + fname;
File file = new File(basePath, fname);
try {
item.write(file);
url = furl;
} catch (Exception e) {
e.printStackTrace();
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return url;
}
}
系统需求分析
系统开发的第一步,就是要对系统进行需求分析,这是开发应用系统中最举足轻重且不可缺少的一项工作[1]。需求分析的好坏程度,决定着系统开发的速度。系统需求分析工作做得越精细,开发系统的过程就越快。做需求分析的时候,一般需要了解本系统开发的背景,在信息收集的基础上,决定系统开发的技术、经济和操作可行性,进行业务调查和分析,了解用户的功能需求和工作流程,确定开发系统的总体方案,明确系统开发的总体思路和系统要达到的目标,以及系统开发所需要的时间和资金等问题。通过对问题的理解和分析,将需求整理成规格说明书,为问题涉及的信息建立模型,描述如何实现系统。
经过多次测试,可以确定本系统的基本功能已经实现了,基本符合要求。本次测试主要利用黑盒测试的方法对系统的功能进行测试,从测试的结果上看,总体上来说还是蛮好的,没有太多的bug和严重的错误。测试出来的都是一些模块上,设计不够完善的一些错误。测试的结果证明,本系统所实现的功能,与需求分析上所要求的功能基本符合,系统的运行速度和稳定性也比较好。