摘 要
高校后勤管理工作中,会涉及很多细节问题,比如一些设备、设施在高频率的使用中往往会出现故障,对师生的工作、学习、生活造成影响。校园报修APP就是针对城市学院后勤报修、维修工作而设计的。校园报修APP的实现将提升后勤响应速度和后勤管理工作的信息化程度。
首先对校园的后勤维修流程进行了分析和调研;然后设计出一套基于HTML5平台,采用SSM框架技术开发,通过Redis做为缓冲数据,同时数据库使用的是较流行的MySQL数据库,采用UML建模技术对系统进行需求分析、功能设计以及类的设计。最后实现了一个具有实现了具有发布维修、指派维修、支付维修订单、管理人员信息等功能的校园后勤报修系统。
系统的实现,能够对维修部门进行规范化管理,并能实现对维修人员的绩效考核,提高报修服务的质量和效果,从而提升师生对后勤服务的满意度。
关键词:维修管理 APP UML Redis MySQL
【584】基于ssm后端的后勤报修系统APP源码和论文演示和配置视频
Abstract
In the logistics management of colleges and universities, many details are involved.For example, some equipment and facilities often fail in high-frequency use, which affects the work, study, and life of teachers and students. Designed for maintenance work. The implementation of the city's repair application will improve the speed of logistics response and the informationization of logistics management.
First of all, the logistics maintenance process of the City College of Dongguan University of Technology was analyzed and investigated; then a set of HTML5 based platforms were developed using SSM framework technology, and Redis was used as the buffer data.At the same time, the database used the more popular MySQL database UML modeling technology is used for requirements analysis, functional design and class design of the system;In the end, a logistics and repair system for the city hospital has been implemented that has the functions of issuing maintenance, assigning maintenance, paying maintenance orders, and management personnel information.
The realization of the system can standardize the management of the maintenance department, and achieve the performance evaluation of the maintenance personnel, improve the quality and effect of the repair service, and thereby increase the satisfaction of the teachers and students on the logistics service.
Key words : Repair Management APP UML Redis MySQL
package com.smwb.controller;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.smwb.po.Area;
import com.smwb.po.Category;
import com.smwb.po.Lou;
import com.smwb.po.Progress;
import com.smwb.po.Repair;
import com.smwb.po.User;
import com.smwb.service.AreaService;
import com.smwb.service.CategoryService;
import com.smwb.service.ILouService;
import com.smwb.service.RepairService;
import com.smwb.service.UserService;
import com.smwb.vo.AreaCountVo;
import com.smwb.vo.CategoryCountVo;
import com.smwb.vo.DongLouVo;
import com.smwb.vo.MainCountVo;
import com.smwb.vo.RepairAllVo;
import com.smwb.vo.RepairCountVo;
import com.smwb.vo.RepairQueryVo;
import com.smwb.vo.RepairVo;
import com.zhenzi.sms.ZhenziSmsClient;
import sun.invoke.empty.Empty;
@Controller
@RequestMapping("/repair")
public class RepairController {
@Autowired
public CategoryService categoryService;
@Autowired
public AreaService areaService;
@Autowired
public RepairService repairService;
@Autowired
public UserService userService;
@Autowired
private ILouService louService;
//发送短信必须的变量
private String apiUrl = "http://sms_developer.zhenzikj.com";
private String appId = "100424";
private String appSecret = "0fbe1bb0-658d-4a66-b089-53906a3dcdf8";
//在执行此Controller层中每一个方法之前 执行此方法
@ModelAttribute("categorys")
public List<Category> loadCategorys(Model model,Area area){
//一进来默认查询学生的
if(area.getTemp()==null) {
area.setTemp("1");
}
List<Category> categorys = categoryService.findAll(area.getTemp());
model.addAttribute("categorys",JSON.toJSONString(categorys));
return categorys;
}
@ModelAttribute
public void loadAreas(Model model,Area area){
//一进来默认查询学生的
if(area.getTemp()==null) {
area.setTemp("1");
}
List<Area> areas = areaService.findAll(area.getTemp());
model.addAttribute("areas",JSON.toJSONString(areas));
}
//查询所有维修单
@RequestMapping("/findAll")
public String findAll(Integer pageNum,RepairQueryVo repairQueryVo,Model model) {
/*if(pageNum==null) {
pageNum=1;
}
PageHelper.startPage(pageNum,15);
List<RepairVo> repairVos = repairService.findAll(repairQueryVo);
PageInfo<RepairVo> pageInfo = new PageInfo<RepairVo>(repairVos);
model.addAttribute("pageInfo",pageInfo);
model.addAttribute("RepairQueryVo",repairQueryVo);*/
return "repair";
}
//查询所有维修单
@RequestMapping("/findAll2")
@ResponseBody
public Map<String,Object> findAll2(Integer pageNum,RepairQueryVo repairQueryVo,Model model,String temp) {
Map<String,Object> map = new HashMap<String,Object>();
if(pageNum==null) {
pageNum=1;
}
PageHelper.startPage(pageNum,15);
List<RepairVo> repairVos = repairService.findAll(repairQueryVo,temp);
PageInfo<RepairVo> pageInfo = new PageInfo<RepairVo>(repairVos);
map.put("pageInfo",pageInfo);
map.put("RepairQueryVo",repairQueryVo);
List<Area> areas = areaService.findAll(temp);
List<Category> categorys = categoryService.findAll(temp);
map.put("areas",areas);
map.put("categorys",categorys);
return map;
}
//模糊查询
@RequestMapping("/getChaXun")
@ResponseBody
public Map<String,Object> getChaXun(Integer pageNum,RepairQueryVo repairQueryVo,Model model,String temp) {
Map<String,Object> map = new HashMap<String,Object>();
if(pageNum==null) {
pageNum=1;
}
PageHelper.startPage(pageNum,15);
List<RepairVo> repairVos = repairService.getChaXun(repairQueryVo,temp);
PageInfo<RepairVo> pageInfo = new PageInfo<RepairVo>(repairVos);
map.put("pageInfo",pageInfo);
map.put("RepairQueryVo",repairQueryVo);
List<Area> areas = areaService.findAll(temp);
List<Category> categorys = categoryService.findAll(temp);
map.put("areas",areas);
map.put("categorys",categorys);
return map;
}
//修改维修单的回显 ,
@RequestMapping("/findById")
@ResponseBody
public Repair findById(String rid) {
Repair repair = repairService.findById(rid);
return repair;
}
//修改维修单
@RequestMapping("/update")
@ResponseBody
public String update(Repair repair,Model model) {
repairService.update(repair);
return "true";
}
//删除维修单
@RequestMapping("/deleteById")
@ResponseBody
public String deleteById(String rid) {
repairService.delete(rid);
return "true";
}
//指派维修员 发送短信在controller层 添加维修进度在service层
@RequestMapping("/appoint")
@ResponseBody
public String appoint(String rid,Integer uid){
boolean isUpdate = repairService.appoint(rid,uid);
if(isUpdate) {
try {
//rid 维修单号 uid 维修员号 telephone aid address
Repair repair = repairService.findById(rid);
Area area = areaService.findById(repair.getAid());
//查询该维修员信息
User user =userService.findByIdForUserId(uid);
String maintennance=user.getName()+"("+user.getUsername()+")";
String title=repair.getTitle();
Lou selectLouById = louService.selectLouById(Integer.parseInt(repair.getAddress().split(",")[0]));
String address=area.getAreaItem()+"--"+selectLouById.getlName()+"楼"+repair.getAddress().split(",")[1]+"号";
//发送短信通知维修员
ZhenziSmsClient client = new ZhenziSmsClient(apiUrl,appId,appSecret);
client.send(user.getTelephone(),maintennance+",后勤管理中心已为您派单。位置:"+address+",问题:"+title+"。请登录APP查看详情");
//发送短信通知用户
client.send(repair.getTelephone(),"您的报修已被受理,维修员:"+user.getName()+",联系电话:"+user.getTelephone()+"。48小时自动确认维修完成");
} catch (Exception e) {
e.printStackTrace();
}
return "true";
}else {
return "false";
}
}
//查询维修进度 &app端
@RequestMapping("/findProgressById")
@ResponseBody
public List<Progress> findProgressById(String rid){
List<Progress> progresses = repairService.findProgressById(rid);
return progresses;
}
//app查询所有维修单
@RequestMapping("/app/findAll")
@ResponseBody
public PageInfo<RepairVo> appfindAll(Integer pageNum,RepairQueryVo repairQueryVo,String temp){
if(pageNum==null) {
pageNum=1;
}
if(temp==null) {
temp="1";
}
PageHelper.startPage(pageNum,20);
List<RepairVo> lists = repairService.getChaXun(repairQueryVo,temp);
PageInfo<RepairVo> pageInfo = new PageInfo<RepairVo>(lists);
return pageInfo;
}
//app查询 我的维修单
@RequestMapping("/app/findAllByMy")
@ResponseBody
public PageInfo<RepairVo> appfindAllByMy(Integer pageNum,RepairQueryVo repairQueryVo,Integer uid,String temp){
if(pageNum==null) {
pageNum=1;
}
List<RepairVo> lists3 = new ArrayList<RepairVo>();
// PageHelper.startPage(pageNum,20);
if(temp.equals("0")) {
List<RepairVo> lists2 = repairService.findAllByMy2(repairQueryVo,uid);//这里查询的是所有的
lists3.addAll(lists2);
}else {
List<RepairVo> lists = repairService.findAllByMy(repairQueryVo,uid);//该业务是查询指定我的记录
lists3.addAll(lists);
}
PageInfo<RepairVo> pageInfo = new PageInfo<RepairVo>(lists3);
return pageInfo;
}
//app查询 我的订单
@RequestMapping("/app/findAllByMyOrder")
@ResponseBody
public PageInfo<RepairVo> findAllByMyOrder(Integer pageNum,RepairQueryVo repairQueryVo,Integer uid){
if(pageNum==null) {
pageNum=1;
}
// PageHelper.startPage(pageNum,20);
List<RepairVo> lists = repairService.findAllByMy4(repairQueryVo,uid);//这里查询的是我的订单
PageInfo<RepairVo> pageInfo = new PageInfo<RepairVo>(lists);
return pageInfo;
}
//app查询维修单详情
@RequestMapping("/app/findById")
@ResponseBody
public RepairAllVo appfindById(String rid) {
RepairAllVo repairAllVo = repairService.appfindById(rid);
return repairAllVo;
}
//app维修员接单
@RequestMapping("/app/accept")
@ResponseBody
public String appaccept(String rid,Integer uid,String telephone) {
boolean isUpdate = repairService.accept(rid,uid);
if(isUpdate) {
try {
//rid 维修单号 uid 维修员号 telephone 维修员电话 准备三个数据
Repair repair = repairService.findById(rid);
//查询该维修员信息
User user =userService.findById(uid);
ZhenziSmsClient client = new ZhenziSmsClient(apiUrl,appId,appSecret);
//发送短信通知用户
client.send(repair.getTelephone(),"您的报修已被受理,维修员:"+user.getName()+",联系电话:"+user.getTelephone()+"。48小时自动确认维修完成");
} catch (Exception e) {
e.printStackTrace();
}
return "true";
}else {
return "false";
}
}
//h5+ uplaoder多图上传 在APP端报修 若有图片上传 调用此
@RequestMapping("/app/webuploader")
public void upload(HttpServletRequest request, HttpServletResponse response,Repair repair) throws IOException{
boolean temp = false;
MultipartHttpServletRequest Murequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> files = Murequest.getFileMap();// 得到文件map对象
// 设置图片上传路径
String url = request.getSession().getServletContext().getRealPath("/upload");
for (MultipartFile file : files.values()) {
// 设置文件名
String imgName = UUID.randomUUID().toString().replace("-", "");
// 获取文件后缀 getOriginalFIlename()方法可以得到文件全名
String imgLastName = FilenameUtils.getExtension(file.getOriginalFilename());
try {
file.transferTo(new File(url + "/" + imgName + "." + imgLastName));
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
if(imgLastName.equals("flv")||imgLastName.equals("swf")||imgLastName.equals("mkv")||imgLastName.equals("avi")||imgLastName.equals("rm")||imgLastName.equals("rmvb")||imgLastName.equals("mpeg")||imgLastName.equals("mpg")||imgLastName.equals("ogg")||imgLastName.equals("ogv")||imgLastName.equals("mov")||imgLastName.equals("wnv")||imgLastName.equals("mp4")||imgLastName.equals("vebm")||imgLastName.equals("wav")||imgLastName.equals("mid")) {
temp = false;
repair.setVideo("upload/"+imgName+"."+imgLastName);
}else {
temp = true;
repair.setImg("upload/"+imgName+"."+imgLastName);
}
}
List<JSONObject> list = new ArrayList<>();
JSONObject json = new JSONObject();
//解决中文乱码
response.setCharacterEncoding("utf-8");
response.setContentType("text/html; charset=UTF-8");
PrintWriter writer = response.getWriter();
json.put("code", "200");
if(temp) {
json.put("url", repair.getImg());
}else {
json.put("url", repair.getVideo());
}
list.add(json);
writer.write(list.toString());
writer.flush();
writer.close();
}
@RequestMapping("/app/addRepair")
@ResponseBody
public Map<String,Object> addRepair(Repair repair){
Map<String,Object> map = new HashMap<>();
repairService.addRepair(repair);
map.put("code", "200");
map.put("msg", "提交成功");
return map;
}
//分组统计各种维修状态
@RequestMapping("/app/findCount")
@ResponseBody
public Map<String,Object> findCount(Integer uid) {
Map<String,Object> map = new HashMap<String,Object>();
List<RepairCountVo> list = repairService.findCount(uid);
String count = repairService.findAllByMy3();
map.put("list", list);
map.put("count", count);
return map;
}
//分组统计维修区域分布
@RequestMapping("/findAreaCount")
@ResponseBody
public Map<String,Object> findAreaCount(String temp) {
Map<String,Object> map = new HashMap<String,Object>();
List<AreaCountVo> list = new ArrayList<>();
List<AreaCountVo> list2 = new ArrayList<>();
if(temp!=null && "".equals("")) {
for(int i=0;i<temp.split(",").length;i++) {
list = repairService.findAreaCount(temp.split(",")[i]);
list2.addAll(list);
map.put("list"+i, list2);
list2 = new ArrayList<>();
}
}else {
temp="1";
list = repairService.findAreaCount(temp);
map.put("list", list);
}
return map;
}
//分组统计维修区域分布
@RequestMapping("/findCategoryCount")
@ResponseBody
public Map<String,Object> findCategoryCount(String temp) {
Map<String,Object> map = new HashMap<String,Object>();
List<CategoryCountVo> list = new ArrayList<>();
List<CategoryCountVo> list2 = new ArrayList<>();
if(temp!=null && "".equals("")) {
for(int i=0;i<temp.split(",").length;i++) {
list = repairService.findCategoryCount(temp.split(",")[i]);
list2.addAll(list);
map.put("list"+i, list2);
list2 = new ArrayList<>();
}
}else {
temp="1";
list = repairService.findCategoryCount(temp);
map.put("list", list);
}
return map;
}
//首页 所有项目的 总数 用户,维修, 失物招领, 二手市场
@RequestMapping("/findAllCount")
@ResponseBody
public MainCountVo findAllCount() {
MainCountVo mainCountVo = repairService.findAllCount();
return mainCountVo;
}
//首页 所有项目的 总数 用户,维修, 失物招领, 二手市场
@RequestMapping("/findAllCount2")
@ResponseBody
public Map<String,Object> findAllCount2() {
Map<String,Object> map = new HashMap<String,Object>();
List<RepairCountVo> list = repairService.findAllCount2();
map.put("list", list);
return map;
}
//app改变维修状态
@RequestMapping("/app/updateState")
@ResponseBody
public void updateState(String rid,Integer state,Integer uid) {
repairService.updateState(rid,state,uid);
}
//app改变维修状态
@RequestMapping("/app/updateMoney")
@ResponseBody
public Map<String,Object> updateMoney(String rid,String money) {
Map<String,Object> map = new HashMap<String,Object>();
int row = repairService.updateMoney(rid,money);
map.put("code", 200);
return map;
}
//app改变维修状态
@RequestMapping("/app/updateCaiLiao")
@ResponseBody
public Map<String,Object> updateCaiLiao(String rid,String caiLiao) {
Map<String,Object> map = new HashMap<String,Object>();
int row = repairService.updateCaiLiao(rid,caiLiao);
map.put("code", 200);
return map;
}
}