package com.cl.controller;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.text.ParseException;
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.cl.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.format.annotation.DateTimeFormat;
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.cl.annotation.IgnoreAuth;
import com.cl.entity.XueshengchengjiEntity;
import com.cl.entity.view.XueshengchengjiView;
import com.cl.service.XueshengchengjiService;
import com.cl.service.TokenService;
import com.cl.utils.PageUtils;
import com.cl.utils.R;
import com.cl.utils.MPUtil;
import com.cl.utils.CommonUtil;
import java.io.IOException;
/**
* 学生成绩
* 后端接口
* @author
* @email
* @date 2024-03-05 21:53:17
*/
@RestController
@RequestMapping("/xueshengchengji")
public class XueshengchengjiController {
@Autowired
private XueshengchengjiService xueshengchengjiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,XueshengchengjiEntity xueshengchengji,
@RequestParam(required = false) Double kaoshichengjistart,
@RequestParam(required = false) Double kaoshichengjiend,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("xuesheng")) {
xueshengchengji.setXuehao((String)request.getSession().getAttribute("username"));
}
if(tableName.equals("jiaoshi")) {
xueshengchengji.setJiaoshigonghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<XueshengchengjiEntity> ew = new EntityWrapper<XueshengchengjiEntity>();
if(kaoshichengjistart!=null) ew.ge("kaoshichengji", kaoshichengjistart);
if(kaoshichengjiend!=null) ew.le("kaoshichengji", kaoshichengjiend);
PageUtils page = xueshengchengjiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xueshengchengji), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,XueshengchengjiEntity xueshengchengji,
@RequestParam(required = false) Double kaoshichengjistart,
@RequestParam(required = false) Double kaoshichengjiend,
HttpServletRequest request){
EntityWrapper<XueshengchengjiEntity> ew = new EntityWrapper<XueshengchengjiEntity>();
if(kaoshichengjistart!=null) ew.ge("kaoshichengji", kaoshichengjistart);
if(kaoshichengjiend!=null) ew.le("kaoshichengji", kaoshichengjiend);
PageUtils page = xueshengchengjiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xueshengchengji), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( XueshengchengjiEntity xueshengchengji){
EntityWrapper<XueshengchengjiEntity> ew = new EntityWrapper<XueshengchengjiEntity>();
ew.allEq(MPUtil.allEQMapPre( xueshengchengji, "xueshengchengji"));
return R.ok().put("data", xueshengchengjiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(XueshengchengjiEntity xueshengchengji){
EntityWrapper< XueshengchengjiEntity> ew = new EntityWrapper< XueshengchengjiEntity>();
ew.allEq(MPUtil.allEQMapPre( xueshengchengji, "xueshengchengji"));
XueshengchengjiView xueshengchengjiView = xueshengchengjiService.selectView(ew);
return R.ok("查询学生成绩成功").put("data", xueshengchengjiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
XueshengchengjiEntity xueshengchengji = xueshengchengjiService.selectById(id);
xueshengchengji = xueshengchengjiService.selectView(new EntityWrapper<XueshengchengjiEntity>().eq("id", id));
return R.ok().put("data", xueshengchengji);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
XueshengchengjiEntity xueshengchengji = xueshengchengjiService.selectById(id);
xueshengchengji = xueshengchengjiService.selectView(new EntityWrapper<XueshengchengjiEntity>().eq("id", id));
return R.ok().put("data", xueshengchengji);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody XueshengchengjiEntity xueshengchengji, HttpServletRequest request){
xueshengchengji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xueshengchengji);
xueshengchengjiService.insert(xueshengchengji);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody XueshengchengjiEntity xueshengchengji, HttpServletRequest request){
xueshengchengji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xueshengchengji);
xueshengchengjiService.insert(xueshengchengji);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody XueshengchengjiEntity xueshengchengji, HttpServletRequest request){
//ValidatorUtils.validateEntity(xueshengchengji);
xueshengchengjiService.updateById(xueshengchengji);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
xueshengchengjiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* (按值统计)
*/
@RequestMapping("/value/{xColumnName}/{yColumnName}")
public R value(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName,HttpServletRequest request) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
EntityWrapper<XueshengchengjiEntity> ew = new EntityWrapper<XueshengchengjiEntity>();
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("xuesheng")) {
ew.eq("xuehao", (String)request.getSession().getAttribute("username"));
}
if(tableName.equals("jiaoshi")) {
ew.eq("jiaoshigonghao", (String)request.getSession().getAttribute("username"));
}
List<Map<String, Object>> result = xueshengchengjiService.selectValue(params, ew);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k,
没有合适的资源?快使用搜索试试~ 我知道了~
家校合作平台&java&基于springboot家校合作平台设计与实现
共375个文件
java:94个
vue:85个
png:46个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 3 浏览量
2024-11-09
17:33:24
上传
评论
收藏 12.09MB ZIP 举报
温馨提示
家校合作平台&java&基于springboot家校合作平台设计与实现
资源推荐
资源详情
资源评论
收起资源包目录
家校合作平台&java&基于springboot家校合作平台设计与实现 (375个子文件)
chunk-vendors.83167ee3.css 339KB
chunk-vendors.9650af1e.css 319KB
app.6cf57a8d.css 160KB
app.456aa9d0.css 146KB
271.71333387.css 11KB
650.46dd1782.css 10KB
951.663ec587.css 3KB
723.615dd096.css 3KB
84.cb283eb7.css 1KB
iconfont.css 622B
canvas-bg-1.css 391B
canvas-bg-1.css 391B
canvas-bg-2.css 83B
canvas-bg-2.css 83B
canvas-bg-4.css 61B
canvas-bg-5.css 61B
canvas-bg-3.css 61B
canvas-bg-4.css 61B
canvas-bg-5.css 61B
canvas-bg-3.css 61B
.env.development 195B
.env.development 195B
数据库表结构文档.doc 931KB
.gitignore 231B
index.html 771B
index.html 768B
index.html 686B
index.html 683B
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
XueshengchengjiController.java 16KB
BaiduUtil.java 8KB
EncryptUtil.java 8KB
JiazhangController.java 8KB
XueshengController.java 8KB
JiaoshiController.java 8KB
CommonController.java 7KB
ExamrecordController.java 7KB
MenuController.java 6KB
ExamquestionController.java 6KB
ExampaperController.java 5KB
UsersController.java 5KB
MPUtil.java 5KB
ExamrecordEntity.java 5KB
NewsController.java 5KB
FileController.java 4KB
ExamquestionEntity.java 4KB
CommonUtil.java 4KB
XueshengEntity.java 4KB
JiazhangEntity.java 4KB
XueshengchengjiEntity.java 4KB
JiaoshiEntity.java 3KB
AuthorizationInterceptor.java 3KB
ConfigController.java 3KB
XueshengchengjiServiceImpl.java 3KB
HttpClientUtils.java 3KB
NewsEntity.java 3KB
Query.java 3KB
ExampaperEntity.java 2KB
TokenServiceImpl.java 2KB
TokenEntity.java 2KB
ExamquestionServiceImpl.java 2KB
ExamrecordServiceImpl.java 2KB
MenuEntity.java 2KB
PageUtils.java 2KB
ExampaperServiceImpl.java 2KB
XueshengServiceImpl.java 2KB
JiazhangServiceImpl.java 2KB
JiaoshiServiceImpl.java 2KB
NewsServiceImpl.java 2KB
MenuServiceImpl.java 2KB
XueshengchengjiDao.java 2KB
InterceptorConfig.java 1KB
CommonServiceImpl.java 1KB
XueshengchengjiService.java 1KB
UsersServiceImpl.java 1KB
UsersEntity.java 1KB
ExamrecordView.java 1KB
SpringContextUtils.java 1KB
ValidatorUtils.java 1KB
SQLFilter.java 1KB
XueshengchengjiView.java 1KB
ExamquestionView.java 1020B
ExampaperView.java 993B
XueshengView.java 978B
JiazhangView.java 978B
JiaoshiView.java 969B
NewsView.java 945B
ExamquestionService.java 944B
MenuView.java 942B
ExamquestionDao.java 936B
ConfigServiceImpl.java 934B
ExamrecordService.java 924B
ExampaperService.java 914B
ExamrecordDao.java 912B
ExampaperDao.java 900B
XueshengService.java 898B
JiazhangService.java 898B
共 375 条
- 1
- 2
- 3
- 4
资源评论
code.song
- 粉丝: 981
- 资源: 1043
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 5G建设和AI技术推动下,中证5G通信ETF的投资价值探讨
- Python项目之淘宝模拟登录.zip
- 课程设计项目:python+QT实现的小型编译器.zip
- (源码)基于AVR ATmega644的智能卡AES解密系统.zip
- (源码)基于C++插件框架的计算与打印系统.zip
- (源码)基于Spring Boot和Vue的苍穹外卖管理系统.zip
- (源码)基于wxWidgets库的QMiniIDE游戏开发环境管理系统.zip
- 通过C++实现原型模式(Prototype Pattern).rar
- 学习记录111111111111111111111111
- 通过java实现原型模式(Prototype Pattern).rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功