文末获取源码
开发环境
项目编号:Java+spring ssm279高校生活服务平台#毕业设计
开发语言:Java
开发工具:IDEA /Eclipse
数据库:MYSQL5.7
应用服务:Tomcat7/Tomcat8
使用框架:ssm+vue
项目介绍
社会的发展和科学技术的进步,互联网技术越来越受欢迎。网络计算机的生活方式逐渐受到广大人民群众的喜爱,也逐渐进入了每个学生的使用。互联网具有便利性,速度快,效率高,成本低等优点。 因此,构建符合自己要求的操作系统是非常有意义的。
本文从学生的功能要求出发,建立了高校生活服务平台 ,系统中的功能模块主要是实现管理员;首页、个人中心、学生管理、维修师傅管理、宿舍公告管理、自习室管理、预约信息管理、设备报修管理、维修信息管理、维修评价管理、试卷管理、试题管理、论坛管理、系统管理、考试管理,学生;首页、个人中心、预约信息管理、设备报修管理、维修信息管理、维修评价管理,维修师傅;首页、个人中心、设备报修管理、维修信息管理、维修评价管理系统管理,前台首页;首页、宿舍公告、自习室、论坛、试卷列表、校园公告、个人中心、后台管理、在线沟通等功能部分;经过认真细致的研究,精心准备和规划,最后测试成功,系统可以正常使用。分析功能调整与高校生活服务平台实现的实际需求相结合,讨论了java开发的高校生活服务平台的使用。
系统截图
关键代码
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.WeixiupingjiaEntity;
import com.entity.view.WeixiupingjiaView;
import com.service.WeixiupingjiaService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 维修评价
* 后端接口
* @author
* @email
* @date 2021-01-25 17:37:50
*/
@RestController
@RequestMapping("/weixiupingjia")
public class WeixiupingjiaController {
@Autowired
private WeixiupingjiaService weixiupingjiaService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,WeixiupingjiaEntity weixiupingjia, HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("weixiushifu")) {
weixiupingjia.setGonghao((String)request.getSession().getAttribute("username"));
}
if(tableName.equals("xuesheng")) {
weixiupingjia.setXuehao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<WeixiupingjiaEntity> ew = new EntityWrapper<WeixiupingjiaEntity>();
PageUtils page = weixiupingjiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, weixiupingjia), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,WeixiupingjiaEntity weixiupingjia, HttpServletRequest request){
EntityWrapper<WeixiupingjiaEntity> ew = new EntityWrapper<WeixiupingjiaEntity>();
PageUtils page = weixiupingjiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, weixiupingjia), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( WeixiupingjiaEntity weixiupingjia){
EntityWrapper<WeixiupingjiaEntity> ew = new EntityWrapper<WeixiupingjiaEntity>();
ew.allEq(MPUtil.allEQMapPre( weixiupingjia, "weixiupingjia"));
return R.ok().put("data", weixiupingjiaService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(WeixiupingjiaEntity weixiupingjia){
EntityWrapper< WeixiupingjiaEntity> ew = new EntityWrapper< WeixiupingjiaEntity>();
ew.allEq(MPUtil.allEQMapPre( weixiupingjia, "weixiupingjia"));
WeixiupingjiaView weixiupingjiaView = weixiupingjiaService.selectView(ew);
return R.ok("查询维修评价成功").put("data", weixiupingjiaView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
WeixiupingjiaEntity weixiupingjia = weixiupingjiaService.selectById(id);
return R.ok().put("data", weixiupingjia);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
WeixiupingjiaEntity weixiupingjia = weixiupingjiaService.selectById(id);
return R.ok().put("data", weixiupingjia);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody WeixiupingjiaEntity weixiupingjia, HttpServletRequest request){
weixiupingjia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(weixiupingjia);
weixiupingjiaService.insert(weixiupingjia);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody WeixiupingjiaEntity weixiupingjia, HttpServletRequest request){
weixiupingjia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(weixiupingjia);
weixiupingjiaService.insert(weixiupingjia);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody WeixiupingjiaEntity weixiupingjia, HttpServletRequest request){
//ValidatorUtils.validateEntity(weixiupingjia);
weixiupingjiaService.updateById(weixiupingjia);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
weixiupingjiaService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<WeixiupingjiaEntity> wrapper = new EntityWrapper<WeixiupingjiaEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("weixiushifu")) {
wrapper.eq("gonghao", (String)request.getSession().getAttribute("username"));
}
if(tableName.equals("xuesheng")) {
wrapper.eq("xuehao", (String)request.getSession().getAttribute("username"));
}
int count = weixiupingjiaService.selectCount(wrapper);
return R.ok().put("count", count);
}
}