基于web的实验教学管理系统源码和论文

        504基于web的实验教学管理系统java ssm教学视频平台源码和论文

摘要: 随着计算机技术和多媒体技术的不断发展与成熟,越来越多的学习者选择网络平台这一既先进又普遍的学习方式。互联网具有双向交换这一特点,信息交互非常便利,因此使用网络平台这种学习方式和线下实际学习上课相比有着独特的优势,更适合学习者进行更方便的自主学习。实验教学实验教学系统开发目的是使学校的教学模式模式从线下时时教学方式转变成线上随时管理,为教师和学生提供方便条件。在经过学校提供的数据进行实际调研分析后,了解学校各方面需求情况,对学校已有的教育教学管理模式进行修改完善,在这个基础上修改出—套符合学校需求的实验教学系统,借此机会熟悉系统开发的流程。随着后期工作对信息管理系统的功能进行不断调整和完善,学校方面的信息管理将越来越依赖于通过系统来处理。所以系统开发也要根据学校教学工作的实际情况来进行调整,使其更加符合学校教师及学生的需求。

本系统所使用的数据库为Mysql,在此基础上使用JSP技术开发,以Tomcat服务器配置运行环境,并使用idea作为开发平台。在设计时,尽量保证系统代码的整洁性、实用性、可读性、通用性、便于后期进行维护。

关键词:实验教学,网络教学平台,Mysql,信息管理系统,数据库,管理系统

演示视频:

Development and design of micro lesson learning system in primary and secondary schools

                        

Abstract:With the continuous development and maturity of computer technology and multimedia technology, more and more learners choose the network platform, which is an advanced and common way of learning. The Internet has the characteristics of two-way exchange, and information exchange is very convenient. Therefore, compared with offline learning, using the network platform has unique advantages, which is more suitable for learners to carry out more convenient autonomous learning. The purpose of the development of micro lesson learning system in primary and secondary schools is to change the teaching mode from offline teaching mode to online management mode, so as to provide convenient conditions for teachers and students. After the actual investigation and analysis of the data provided by the school, understand the needs of all aspects of the school, modify and improve the existing education and teaching management mode of the school, on this basis, modify a set of online course system that meets the needs of the school, and take this opportunity to be familiar with the development process of the system. With the continuous adjustment and improvement of the function of the information management system in the later work, the information management of the school will more and more rely on the system to deal with. Therefore, the system development should be adjusted according to the actual situation of school teaching, so as to make it more in line with the needs of school teachers and students.

The database used in this system is mysql. On this basis, JSP technology is used to develop. Tomcat server is used to configure the running environment, and idea is used as the development platform. In the design, try to ensure that the system code is clean, practical, readable, universal, easy to maintain later.

Keywords: Micro class, network teaching platform, mysql, information management system, database, management system

 

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;
    }

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序猿毕业分享网

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值