package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
* 试卷选题
* 后端接口
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/exampapertopic")
public class ExampapertopicController {
private static final Logger logger = LoggerFactory.getLogger(ExampapertopicController.class);
private static final String TABLE_NAME = "exampapertopic";
@Autowired
private ExampapertopicService exampapertopicService;
@Autowired
private TokenService tokenService;
@Autowired
private BaoxiuService baoxiuService;//报修
@Autowired
private DictionaryService dictionaryService;//字典
@Autowired
private ExampaperService exampaperService;//试卷
@Autowired
private ExamquestionService examquestionService;//试题表
@Autowired
private ExamrecordService examrecordService;//考试记录表
@Autowired
private ExamredetailsService examredetailsService;//答题详情表
@Autowired
private ExamrewrongquestionService examrewrongquestionService;//错题表
@Autowired
private FangkeService fangkeService;//访客
@Autowired
private FangwuService fangwuService;//公寓
@Autowired
private FangwuCollectionService fangwuCollectionService;//公寓收藏
@Autowired
private FangwuRuzhuService fangwuRuzhuService;//公寓学生
@Autowired
private FangwuTuisuService fangwuTuisuService;//公寓退宿申请
@Autowired
private FangwuYuyueService fangwuYuyueService;//公寓入住申请
@Autowired
private JiaofeiService jiaofeiService;//缴费
@Autowired
private LiuyanService liuyanService;//留言
@Autowired
private SusheguanliyuanService susheguanliyuanService;//宿舍管理员
@Autowired
private TiaosushenqingService tiaosushenqingService;//调宿申请
@Autowired
private WeishengService weishengService;//卫生
@Autowired
private YonghuService yonghuService;//学生
@Autowired
private UsersService usersService;//管理员
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永不会进入");
else if("学生".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
else if("宿舍管理员".equals(role))
params.put("susheguanliyuanId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = exampapertopicService.queryPage(params);
//字典表数据转换
List<ExampapertopicView> list =(List<ExampapertopicView>)page.getList();
for(ExampapertopicView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
ExampapertopicEntity exampapertopic = exampapertopicService.selectById(id);
if(exampapertopic !=null){
//entity转view
ExampapertopicView view = new ExampapertopicView();
BeanUtils.copyProperties( exampapertopic , view );//把实体数据重构到view中
//级联表 试卷
//级联表
ExampaperEntity exampaper = exampaperService.selectById(exampapertopic.getExampaperId());
if(exampaper != null){
BeanUtils.copyProperties( exampaper , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setExampaperId(exampaper.getId());
}
//级联表 试题表
//级联表
ExamquestionEntity examquestion = examquestionService.selectById(exampapertopic.getExamquestionId());
if(examquestion != null){
BeanUtils.copyProperties( examquestion , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setExamquestionId(examquestion.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ExampapertopicEntity exampapertopic, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,exampapertopic:{}",this.getClass().getName(),exampapertopic.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<ExampapertopicEntity> queryWrapper = new EntityWrapper<ExampapertopicEntity>()
.eq("exampaper_id", exampapertopic.getExampaperId())
.eq("examquestion_id", exampapertopic.getExamquestionId())
.eq("exampapertopic_number", exampapertopic.getExampapertopicNumber())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExampapertopicEntity exampapertopicEntity = exampapertopicService.selectOne(queryWrapper);
if(exampapertopicEntity==null){
exampapertopic.setCreateTime(new Date());
exampapertopicService.insert(exampapertopic);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody ExampapertopicEntity exampapertopic, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,exampapertopic:{}",this.getClass().getName(),exampapertopic.toString());
ExampapertopicEntity oldExampapertopicEntity = exampapertopicService.selectById(exampapertopic.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// retu
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于Spring Boot框架的微信小程序高校宿舍信息管理系统是为了方便高校学生和宿舍管理员管理宿舍信息而设计的应用程序。该系统结合了微信小程序的便捷性和Spring Boot框架的高效性,为用户提供了一个方便、快捷的宿舍信息管理平台。 系统的主要功能包括宿舍信息查询、报修管理、报修处理、公告发布等,具体实现如下: 宿舍信息查询: 学生用户可以通过微信小程序查询宿舍相关信息,包括宿舍楼名称、房间号、床位分配情况等。 报修管理: 学生用户可以通过微信小程序提交宿舍报修申请,包括报修问题描述、照片上传等。 报修处理: 宿舍管理员可以通过微信小程序查看报修申请,并进行处理,包括分配维修人员、处理进度跟踪等。 公告发布: 宿舍管理员可以通过微信小程序发布宿舍相关公告,包括宿舍维修通知、宿舍活动通知等。 系统采用了Spring Boot框架提供的后端逻辑实现,并通过微信小程序提供的接口与用户进行交互。同时,系统还利用了数据库技术存储宿舍信息、报修记录、公告内容等,确保了数据的安全性和可靠性。 基于Spring Boot框架的微信小程序高校宿舍信息管理系统为学生和宿舍管理员提供了一个方便的宿舍信息管理平台,提高了宿舍管理效率,改善了学生的居住环境。
资源推荐
资源详情
资源评论
收起资源包目录
springboot框架基于微信小程序的高校宿舍信息管理系统小程序代码的实现.rar (2000个子文件)
main.css.bak 66KB
uni-fab.vue.bak 8KB
3-build.bat 16B
2-run.bat 14B
1-install.bat 12B
app.657841b4.css 309KB
icon.css 71KB
main.css 68KB
chunk-vendors.1f0a25b2.css 37KB
uniicons.css 8KB
global-restaurant.css 7KB
mescroll-uni.css 4KB
animation.css 3KB
style.css 2KB
theme.css 135B
1683697101643.doc 10KB
1683696770624.doc 10KB
1683696845794.doc 10KB
1683685068084.doc 10KB
1683684961437.doc 10KB
1683685001676.doc 10KB
1683690043288.doc 10KB
1683685022281.doc 10KB
1683697145965.doc 10KB
1683696812676.doc 10KB
微信小程序+springboot技术文档.docx 13KB
index.html 945B
index.html 597B
favicon.ico 4KB
favicon.ico 4KB
ExampapertopicController.java 33KB
CommonController.java 27KB
SusheguanliyuanController.java 25KB
YonghuController.java 24KB
TiaosushenqingController.java 23KB
FangwuYuyueController.java 21KB
FangwuController.java 21KB
FangwuTuisuController.java 20KB
JiaofeiController.java 19KB
FangkeController.java 18KB
WeishengController.java 18KB
ExamredetailsController.java 17KB
ExamrewrongquestionController.java 17KB
ExamrecordController.java 17KB
BaoxiuController.java 16KB
LiuyanController.java 16KB
FangwuCollectionController.java 15KB
TiaosushenqingView.java 15KB
FangwuRuzhuController.java 15KB
FangwuCollectionView.java 15KB
FangwuYuyueView.java 15KB
FangwuTuisuView.java 15KB
ExamrewrongquestionView.java 14KB
FangwuRuzhuView.java 14KB
FangkeView.java 14KB
ExampaperController.java 14KB
ExamquestionController.java 14KB
DictionaryController.java 12KB
WeishengView.java 12KB
JiaofeiView.java 12KB
ExamrecordView.java 11KB
ExamredetailsView.java 11KB
YonghuEntity.java 10KB
TiaosushenqingEntity.java 10KB
FangwuEntity.java 9KB
ClazzDiff.java 9KB
BaoxiuView.java 8KB
ExampapertopicView.java 8KB
LiuyanView.java 8KB
SusheguanliyuanEntity.java 8KB
BaoxiuEntity.java 7KB
YonghuVO.java 7KB
TiaosushenqingVO.java 7KB
FangwuVO.java 7KB
LiuyanEntity.java 7KB
JiaofeiEntity.java 7KB
FangwuTuisuEntity.java 7KB
FangwuYuyueEntity.java 7KB
FangkeEntity.java 7KB
YonghuModel.java 7KB
TiaosushenqingModel.java 7KB
WeishengEntity.java 6KB
FangwuView.java 6KB
FangwuModel.java 6KB
ExamquestionEntity.java 6KB
SusheguanliyuanVO.java 6KB
UsersController.java 6KB
ExampaperEntity.java 6KB
BaoxiuVO.java 5KB
MPUtil.java 5KB
DictionaryServiceImpl.java 5KB
SusheguanliyuanModel.java 5KB
ExamredetailsEntity.java 5KB
ExamrewrongquestionEntity.java 5KB
LiuyanVO.java 5KB
JiaofeiVO.java 5KB
ExamrecordEntity.java 5KB
BaoxiuModel.java 5KB
DictionaryEntity.java 5KB
FangwuTuisuVO.java 5KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
程序猿阿存
- 粉丝: 1238
- 资源: 1804
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功