研究背景
近几年来,随着地方高等院校办学规模的不断扩大,为了适用社会发展需要,地方高校将应用
型人才培养作为学校的人才培养目标。为了适应学校应用型人才培养目标,各专业尤其是理工科专
业人才培养方案中加强了实践教学环节,因此,实践教学管理成为高等院校教学管理的重要内容之
一。
目前高校教学管理都采用了基于网络的信息化管理系统,但是由于实践教学在课程教学时间安
排、课程教学内容、周数等方面不同于传统的课程教学,通用的教学管理系统不能很好地适应实践
教学管理。根据我系实践教学的需求,基于
java web
设计与实现了一个实践教学管理系统,满足实
践教学管理的需求要求,更好地实现实践课程教学管理。
演示视频:
【java毕业设计】基于web的实验教学管理系统java ssm教学视频平台源码和论文
研究目标
调研我系的实际情况,根据软件工程的思想,设计并开发了一个适合我系实践教学管理的系统,
该系统包括学生和教师信息的管理、实践教学管理、学生成绩管理等功能,基本上满足了实践教学
的需求。
pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jlwl</groupId>
<artifactId>jspmx120k</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>5.0.0.RELEASE</spring.version>
<junit.version>4.12</junit.version>
<druid.version>1.1.0</druid.version>
<fastjson.version>1.2.8</fastjson.version>
<mybaitsplus.version>2.3</mybaitsplus.version>
<mysql.version>5.1.38</mysql.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.19</slf4j.version>
<aspectjweaver.version>1.8.8</aspectjweaver.version>
<fileupload.version>1.3.1</fileupload.version>
<jstl.version>1.2</jstl.version>
</properties>
<dependencies>
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- Spring MVC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- AOP -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectjweaver.version}</version>
</dependency>
<!-- FileUpload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${fileupload.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency>
<!-- Mybatis-Plus -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>${mybaitsplus.version}</version>
</dependency>
<!-- Mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- FastJson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- Log -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.0.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-core -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.29</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet.jsp/jsp-api -->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<!-- 百度人工智能 -->
<dependency>
<groupId>com.baidu.aip</groupId>
<artifactId>java-sdk</artifactId>
<version>4.4.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-jasper -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>9.0.27</version>
<scope>provided</scope>
</dependency>
<!-- pdf start -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.3.2</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-asian</artifactId>
<version>5.2.0</version>
</dependency>
<!-- pdf end -->
</dependencies>
<build>
<!-- 项目访问名称 -->
<finalName>jspmx120k</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
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.XueshengEntity;
import com.entity.view.XueshengView;
import com.service.XueshengService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 学生
* 后端接口
* @author
* @email
* @date 2022-02-12 18:33:18
*/
@RestController
@RequestMapping("/xuesheng")
public class XueshengController {
@Autowired
private XueshengService xueshengService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
XueshengEntity user = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("xueshengzhanghao", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(), username,"xuesheng", "学生" );
request.getSession().setAttribute("xuesheng",user);
request.getSession().removeAttribute("user");
request.getSession().removeAttribute("jiaoshi");
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody XueshengEntity xuesheng){
//ValidatorUtils.validateEntity(xuesheng);
XueshengEntity user = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("xueshengzhanghao", xuesheng.getXueshengzhanghao()));
if(user!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
xuesheng.setId(uId);
xueshengService.insert(xuesheng);
return R.ok();
}
/**
* 退出
*/
@RequestMapping("/logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
XueshengEntity user = xueshengService.selectById(id);
return R.ok().put("data", user);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
XueshengEntity user = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("xueshengzhanghao", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
xueshengService.updateById(user);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,XueshengEntity xuesheng, HttpServletRequest request){
EntityWrapper<XueshengEntity> ew = new EntityWrapper<XueshengEntity>();
PageUtils page = xueshengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xuesheng), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,XueshengEntity xuesheng, HttpServletRequest request){
EntityWrapper<XueshengEntity> ew = new EntityWrapper<XueshengEntity>();
PageUtils page = xueshengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xuesheng), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( XueshengEntity xuesheng){
EntityWrapper<XueshengEntity> ew = new EntityWrapper<XueshengEntity>();
ew.allEq(MPUtil.allEQMapPre( xuesheng, "xuesheng"));
return R.ok().put("data", xueshengService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(XueshengEntity xuesheng){
EntityWrapper< XueshengEntity> ew = new EntityWrapper< XueshengEntity>();
ew.allEq(MPUtil.allEQMapPre( xuesheng, "xuesheng"));
XueshengView xueshengView = xueshengService.selectView(ew);
return R.ok("查询学生成功").put("data", xueshengView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
XueshengEntity xuesheng = xueshengService.selectById(id);
return R.ok().put("data", xuesheng);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
XueshengEntity xuesheng = xueshengService.selectById(id);
return R.ok().put("data", xuesheng);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody XueshengEntity xuesheng, HttpServletRequest request){
xuesheng.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xuesheng);
XueshengEntity user = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("xueshengzhanghao", xuesheng.getXueshengzhanghao()));
if(user!=null) {
return R.error("用户已存在");
}
xuesheng.setId(new Date().getTime());
xueshengService.insert(xuesheng);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody XueshengEntity xuesheng, HttpServletRequest request){
xuesheng.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xuesheng);
XueshengEntity user = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("xueshengzhanghao", xuesheng.getXueshengzhanghao()));
if(user!=null) {
return R.error("用户已存在");
}
xuesheng.setId(new Date().getTime());
xueshengService.insert(xuesheng);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody XueshengEntity xuesheng, HttpServletRequest request){
//ValidatorUtils.validateEntity(xuesheng);
xueshengService.updateById(xuesheng);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
xueshengService.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<XueshengEntity> wrapper = new EntityWrapper<XueshengEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = xueshengService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
package com.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.JiaoshiEntity;
import com.entity.NewsEntity;
import com.entity.ShiyanbaogaoEntity;
import com.entity.XueshengEntity;
import com.itextpdf.text.Document;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.Rectangle;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import com.service.JiaoshiService;
import com.service.ShiyanbaogaoService;
import com.service.UserService;
import com.utils.PDFBuilder;
import com.utils.PDFReport;
import com.utils.PdfUtil;
import com.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpSession;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* @author
* @date 2022-02-11 11:56
*/
@Controller
@RequestMapping("/shiyanbaogao")
public class ShiyanbaogaoController {
@Autowired
private JiaoshiService jiaoshiService;
@Autowired
private ShiyanbaogaoService shiyanbaogaoService;
@Autowired
private UserService userService;
Document document = new Document();// 建立一个Document对象
@RequestMapping("toTijiaoPage")
public String toTijiaoPage(Model model,HttpSession session){
XueshengEntity xueshengEntity = (XueshengEntity) session.getAttribute("xuesheng");
if(xueshengEntity!=null){
EntityWrapper<JiaoshiEntity> ew = new EntityWrapper<JiaoshiEntity>();
List<JiaoshiEntity> jiaoshiEntityList = jiaoshiService.selectList(ew);
model.addAttribute("jiaoshiEntityList",jiaoshiEntityList);
return "baogao/index";
}
JiaoshiEntity jiaoshiEntity = (JiaoshiEntity) session.getAttribute("jiaoshi");
if(jiaoshiEntity!=null){
return "redirect:../shiyanbaogao/tea_list";
}
return "index";
}
@RequestMapping("add")
public String add(ShiyanbaogaoEntity shiyanbaogaoEntity, HttpSession session){
XueshengEntity xueshengEntity = (XueshengEntity) session.getAttribute("xuesheng");
if(xueshengEntity==null){
//return R.error("请先登录");
}
shiyanbaogaoEntity.setCreatetime(new Date());
//shiyanbaogaoEntity.setJiaoshigonghao();
shiyanbaogaoEntity.setNianji(xueshengEntity.getNianji());
shiyanbaogaoEntity.setXueshengzhanghao(xueshengEntity.getXueshengzhanghao());
shiyanbaogaoEntity.setXueshengxingming(xueshengEntity.getXueshengxingming());
shiyanbaogaoEntity.setXueshengId(xueshengEntity.getId().intValue());
JiaoshiEntity jiaoshiEntity = jiaoshiService.selectById(shiyanbaogaoEntity.getJiaoshiId());
if(jiaoshiEntity!=null){
shiyanbaogaoEntity.setJiaoshigonghao(jiaoshiEntity.getJiaoshixingming());
}else{
shiyanbaogaoEntity.setJiaoshigonghao("程序猿");
}
shiyanbaogaoService.insert(shiyanbaogaoEntity);
return "redirect:../shiyanbaogao/list";
}
@RequestMapping("tea_list")
public String tea_list(HttpSession session,Model model){
JiaoshiEntity jiaoshiEntity = (JiaoshiEntity) session.getAttribute("jiaoshi");
EntityWrapper<ShiyanbaogaoEntity> ew = new EntityWrapper<ShiyanbaogaoEntity>();
ew.eq("jiaoshi_id",jiaoshiEntity.getId());
List<ShiyanbaogaoEntity> shiyanbaogaoEntityList = shiyanbaogaoService.selectList(ew);
model.addAttribute("shiyanbaogaoEntityList",shiyanbaogaoEntityList);
String[] data1 =new String[10];
String[] data2 =new String[10];
Integer[] score1 =new Integer[10];
Integer[] score2 =new Integer[10];
List<ShiyanbaogaoEntity> list1 = shiyanbaogaoService.selectNum1();
List<ShiyanbaogaoEntity> list2 = shiyanbaogaoService.selectpinjun();
int i=0;
for (ShiyanbaogaoEntity shiyanbaogaoEntity:list1) {
data1[i] = shiyanbaogaoEntity.getXueshengxingming();
score1[i] = shiyanbaogaoEntity.getScore();
i++;
}
int j=0;
for (ShiyanbaogaoEntity shiyanbaogaoEntity:list2) {
data2[j] = shiyanbaogaoEntity.getNianji();
score2[j] = shiyanbaogaoEntity.getScore();
j++;
}
model.addAttribute("data1",data1);
model.addAttribute("data2",data2);
model.addAttribute("score1",score1);
model.addAttribute("score2",score2);
return "baogao/tea_list";
}
@RequestMapping("list")
public String list(HttpSession session,Model model){
EntityWrapper<ShiyanbaogaoEntity> ew = new EntityWrapper<ShiyanbaogaoEntity>();
XueshengEntity xueshengEntity = (XueshengEntity) session.getAttribute("xuesheng");
ew.eq("xuesheng_id",xueshengEntity.getId());
List<ShiyanbaogaoEntity> shiyanbaogaoEntityList = shiyanbaogaoService.selectList(ew);
model.addAttribute("shiyanbaogaoEntityList",shiyanbaogaoEntityList);
return "baogao/list";
}
@RequestMapping("detail")
public String detail(Integer id,Model model){
ShiyanbaogaoEntity shiyanbaogaoEntity = shiyanbaogaoService.selectById(id);
model.addAttribute("shiyanbaogaoEntity",shiyanbaogaoEntity);
return "baogao/pingfen";
}
@RequestMapping("delete")
public String delete(Integer id,HttpSession session){
shiyanbaogaoService.deleteById(id);
XueshengEntity xueshengEntity = (XueshengEntity) session.getAttribute("xuesheng");
if(xueshengEntity!=null){
return "redirect:../shiyanbaogao/list";
}
JiaoshiEntity jiaoshiEntity = (JiaoshiEntity) session.getAttribute("jiaoshi");
if(jiaoshiEntity!=null){
return "redirect:../shiyanbaogao/tea_list";
}
return "index";
}
/**
* 评价实验报告 打分
* @param shiyanbaogaoEntity
* @param session
* @return
*/
@RequestMapping("pingjia")
public String pingjia(ShiyanbaogaoEntity shiyanbaogaoEntity, HttpSession session){
ShiyanbaogaoEntity baogao = shiyanbaogaoService.selectById(shiyanbaogaoEntity.getId());
baogao.setPingyu(shiyanbaogaoEntity.getPingyu());
baogao.setScore(shiyanbaogaoEntity.getScore());
baogao.setPtime(new Date());
shiyanbaogaoService.updateById(baogao);
return "redirect:../shiyanbaogao/tea_list";
}
@RequestMapping("xiazai")
public String xiazai(Integer id,HttpSession session) throws Exception {
ShiyanbaogaoEntity baogao =shiyanbaogaoService.selectById(id);
//设置单元格为5列
PdfPTable table = PdfUtil.createTable(4);
table.addCell(PdfUtil.createHeadCell(baogao.getXueshengxingming()+"实验成绩报告单"));
table.addCell(PdfUtil.createTitleCell_1("学生姓名"));
table.addCell(PdfUtil.createCell_1(baogao.getXueshengxingming()));
table.addCell(PdfUtil.createTitleCell_1("指导老师"));
table.addCell(PdfUtil.createCell_1(baogao.getJiaoshigonghao()));
//table.addCell(PdfUtil.createCell_2("Logo"));
table.addCell(PdfUtil.createTitleCell_1("报告内容"));
table.addCell(PdfUtil.createCell_4(baogao.getContent()));
table.addCell(PdfUtil.createTitleCell_1("教师评语"));
table.addCell(PdfUtil.createCell_4(baogao.getPingyu()));
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
table.addCell(PdfUtil.createTitleCell_1("教师评分"));
table.addCell(PdfUtil.createCell_1(baogao.getScore().toString()));
table.addCell(PdfUtil.createTitleCell_1("生成时间"));
table.addCell(PdfUtil.createCell_1(df.format(new Date())));
File file1=new File("D:\\file");
if(!file1.exists()) {//如果文件夹不存在
file1.mkdir();//创建文件夹
}
String UUID = java.util.UUID.randomUUID().toString();
String path = "D:/file/"+UUID+".pdf";
try {
File file = new File(path);
file.createNewFile();
Rectangle pageSize = new Rectangle(PageSize.A4);
document.setPageSize(pageSize);
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(file));
PDFBuilder builder = new PDFBuilder();
writer.setPageEvent(builder);
document.open();
//PdfPTable table = generatePDF();
document.add(table);
document.close();
} catch (Exception e) {
e.printStackTrace();
}
String test="d:/file/"+baogao.getXueshengxingming()+"实验报告"+UUID+".pdf";
PdfUtil.addImage(path,test ,baogao.getPingyu(),null);
XueshengEntity xueshengEntity = (XueshengEntity) session.getAttribute("xuesheng");
if(xueshengEntity!=null){
return "redirect:../shiyanbaogao/list";
}
JiaoshiEntity jiaoshiEntity = (JiaoshiEntity) session.getAttribute("jiaoshi");
if(jiaoshiEntity!=null){
return "redirect:../shiyanbaogao/tea_list";
}
return "index";
}
@RequestMapping("data1")
@ResponseBody
public List<ShiyanbaogaoEntity> list(){
List<ShiyanbaogaoEntity> list2 = shiyanbaogaoService.selectpinjun();
return list2;
}
@RequestMapping("data2")
@ResponseBody
public List<ShiyanbaogaoEntity> data2(){
List<ShiyanbaogaoEntity> list1 = shiyanbaogaoService.selectNum1();
return list1;
}
}
随着科技发展,现代的计算机信息技术不断进步,在学校系统管理方面逐步开始普遍借助计算机处理数据来完成对数据的操作,对于实验教学实验教学系统所设计的管理及数据保存而言极为常见,例如主页、个人中心、学生管理、教师管理、班级管理、实验教学信息管理、系统管理等,这给管理者的工作带来了巨大的挑战,用传统方式处理归类大量的信息,都是通过笔记的方式进行详细信息的统计,计算机普及之后,逐渐开始使用电脑软件将信息输入到电脑内进行统计,但想要统计数据信息仍然比较繁琐和困难,而通过计算机对数据进行处理排版相对人工而言更为简单省力,因此实验教学实验教学系统顺应需求产生;该系统可以为用户提供了上传信息的便利,同时方便了管理员查看、维护系统,还可以通过客户需求对系统进行相应的调整和维护等;同时对于用户而言,可以随时查看网站内的各种信息,管理员可以非常轻松地获取到相应的数据信息并进行分类处理等,节省了用户和管理员在各个方面需要的时间。
本论文实验教学实验教学系统主要牵扯到的程序基础理论等。如果加以改造使用,普及范围会更为广泛,可以提高工作人员的工作效率。