ssm大学生创新创业平台项目管理子系统设计与实现

ssm大学生创新创业平台项目管理子系统设计与实现179


 开发工具:idea 或eclipse
 数据库mysql5.7+
 数据库链接工具:navcat,小海豚等
  技术:ssm

摘  要

互联网发展至今,无论是其理论还是技术都已经成熟,而且它广泛参与在社会中的方方面面。它让信息都可以通过网络传播,搭配信息管理工具可以很好地为人们提供服务。针对大学生创新创业项目信息管理混乱,出错率高,信息安全性差,劳动强度大,费时费力等问题,采用大学生创新创业平台项目管理子系统可以有效管理,使信息管理能够更加科学和规范。

大学生创新创业平台项目管理子系统在Eclipse环境中,使用Java语言进行编码,使用Mysql创建数据表保存本系统产生的数据。系统可以提供信息显示和相应服务,其管理员管理学生发布的项目,管理项目类型,管理学生,专家和教师。专家审批学生申报的项目,查询项目,查看公告。教师查询学生申报项目,查看公告。学生添加项目,申报项目,查看项目申报是否通过审批。

总之,大学生创新创业平台项目管理子系统集中管理信息,有着保密性强,效率高,存储空间大,成本低等诸多优点。它可以降低信息管理成本,实现信息管理计算机化。

关键词:大学生创新创业平台项目管理子系统;Java语言;Mysql


Abstract

Since the development of the Internet, both its theory and technology have matured, and it has been widely involved in all aspects of society. It allows information to be disseminated through the Internet, and it can serve people well with information management tools. In view of the chaotic information management of college students’ innovation and entrepreneurship projects, high error rates, poor information security, high labor intensity, and time-consuming and labor-intensive issues, the use of the project management subsystem of the college students’ innovation and entrepreneurship platform can effectively manage and make information management more scientific and standardized.

The project management subsystem of the college student innovation and entrepreneurship platform is coded in the Eclipse environment using the Java language, and MySQL is used to create a data table to save the data generated by the system. The system can provide information display and corresponding services. Its administrators manage the projects released by students, manage project types, manage students, experts and teachers. Experts approve the projects declared by the students, inquire about the projects, and check the announcements. Teachers inquire about the items declared by students and check the announcements. Students add items, declare items, and check whether the item declaration is approved.

In short, the project management subsystem of the university student innovation and entrepreneurship platform centralized management information, has many advantages such as strong confidentiality, high efficiency, large storage space, and low cost. It can reduce the cost of information management and realize the computerization of information management.

Key WordsProject Management Subsystem of College Student Innovation and Entrepreneurship Platform; Java Language; Mysql

 

package com.controller;


import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;

import com.entity.ShenbaoEntity;
import com.service.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;

import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;

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.XiangmuEntity;

import com.entity.view.XiangmuView;
import com.entity.JiaoshiEntity;
import com.entity.YonghuEntity;
import com.utils.PageUtils;
import com.utils.R;

/**
 * 项目
 * 后端接口
 * @author
 * @email
 * @date 2021-04-06
*/
@RestController
@Controller
@RequestMapping("/xiangmu")
public class XiangmuController {
    private static final Logger logger = LoggerFactory.getLogger(XiangmuController.class);

    @Autowired
    private XiangmuService xiangmuService;

    @Autowired
    private ShenbaoService shenbaoService;

    @Autowired
    private TokenService tokenService;
    @Autowired
    private DictionaryService dictionaryService;


    //级联表service
    @Autowired
    private JiaoshiService jiaoshiService;
    @Autowired
    private YonghuService yonghuService;


    /**
    * 后端列表
    */
    @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(StringUtil.isNotEmpty(role) && "用户".equals(role)){
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        }
        if(StringUtil.isNotEmpty(role) && "教师".equals(role)){
            params.put("jiaoshiId",request.getSession().getAttribute("userId"));
        }
        if(StringUtil.isNotEmpty(role) && "专家".equals(role)){
            params.put("zhuanjiId",request.getSession().getAttribute("userId"));
        }
        params.put("orderBy","id");
        PageUtils page = xiangmuService.queryPage(params);

        //字典表数据转换
        List<XiangmuView> list =(List<XiangmuView>)page.getList();
        for(XiangmuView c:list){
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(c);
        }
        return R.ok().put("data", page);
    }

    /**
    * 后端详情
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        XiangmuEntity xiangmu = xiangmuService.selectById(id);
        if(xiangmu !=null){
            //entity转view
            XiangmuView view = new XiangmuView();
            BeanUtils.copyProperties( xiangmu , view );//把实体数据重构到view中

            //级联表
            JiaoshiEntity jiaoshi = jiaoshiService.selectById(xiangmu.getJiaoshiId());
            if(jiaoshi != null){
                BeanUtils.copyProperties( jiaoshi , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                view.setJiaoshiId(jiaoshi.getId());
            }
            //级联表
            YonghuEntity yonghu = yonghuService.selectById(xiangmu.getYonghuId());
            if(yonghu != null){
                BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                view.setYonghuId(yonghu.getId());
            }
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody XiangmuEntity xiangmu, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,xiangmu:{}",this.getClass().getName(),xiangmu.toString());
        Wrapper<XiangmuEntity> queryWrapper = new EntityWrapper<XiangmuEntity>()
            .eq("yonghu_id", xiangmu.getYonghuId())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        XiangmuEntity xiangmuEntity = xiangmuService.selectOne(queryWrapper);
        if(xiangmuEntity==null){
            xiangmu.setCreateTime(new Date());
            xiangmuService.insert(xiangmu);
            return R.ok();
        }else {
            return R.error(511,"每个学生只能上传一个项目信息哦");
        }
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody XiangmuEntity xiangmu, HttpServletRequest request){
        logger.debug("update方法:,,Controller:{},,xiangmu:{}",this.getClass().getName(),xiangmu.toString());
        //根据字段查询是否有相同数据
        Wrapper<XiangmuEntity> queryWrapper = new EntityWrapper<XiangmuEntity>()
            .notIn("id",xiangmu.getId())
            .andNew()
            .eq("xiangmu_name", xiangmu.getXiangmuName())
            .eq("leix_types", xiangmu.getLeixTypes())
            .eq("yonghu_id", xiangmu.getYonghuId())
            .eq("jiaoshi_id", xiangmu.getJiaoshiId())
            .eq("shifou_types", xiangmu.getShifouTypes())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        XiangmuEntity xiangmuEntity = xiangmuService.selectOne(queryWrapper);
        if("".equals(xiangmu.getXiangmuPhoto()) || "null".equals(xiangmu.getXiangmuPhoto())){
                xiangmu.setXiangmuPhoto(null);
        }
        if(xiangmuEntity==null){
            //  String role = String.valueOf(request.getSession().getAttribute("role"));
            //  if("".equals(role)){
            //      xiangmu.set
            //  }
            xiangmuService.updateById(xiangmu);//根据id更新
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }


    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        xiangmuService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }


    /**
    * 申报
    */
    @RequestMapping("/shenbao")
    public R shenbao(Integer ids){
        XiangmuEntity xiangmu = xiangmuService.selectById(ids);
        if(xiangmu==null){
            return R.error();
        }
        ShenbaoEntity shenbao = new ShenbaoEntity();
        shenbao.setCreateTime(new Date());
        shenbao.setInsertTime(new Date());
        shenbao.setXiangmuId(xiangmu.getId());
        shenbao.setYonghuId(xiangmu.getYonghuId());
        shenbao.setTongguoTypes(0);
        Wrapper<ShenbaoEntity> queryWrapper = new EntityWrapper<ShenbaoEntity>()
                .eq("yonghu_id", shenbao.getYonghuId())
                .eq("xiangmu_id", shenbao.getXiangmuId())
                ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        ShenbaoEntity shenbaoEntity = shenbaoService.selectOne(queryWrapper);
        if(shenbaoEntity != null){
            if(shenbaoEntity.getTongguoTypes() == 1){
                return R.error("你的申报已经通过请不要重复申请");
            }
        }
        boolean insert = shenbaoService.insert(shenbao);
        if(insert){
            xiangmu.setShifouTypes(1);
            boolean b = xiangmuService.updateById(xiangmu);
            if(b){
                return R.ok();
            }
        }
        return R.error();
    }
    /**
    * 同意
    */
    @RequestMapping("/shenpi")
    public R shenpi(Integer ids, HttpServletRequest request){
        ShenbaoEntity shenbao = shenbaoService.selectById(ids);
        if(shenbao==null){
            return R.error();
        }
        shenbao.setZhuanjiId((Integer)request.getSession().getAttribute("userId"));
        shenbao.setTongguoTypes(1);
        boolean b = shenbaoService.updateById(shenbao);
        if(b){
            return R.ok();
        }
        return R.error();
    }
    /**
    * 拒绝
    */
    @RequestMapping("/jujue")
    public R jujue(Integer ids, HttpServletRequest request){
        ShenbaoEntity shenbao = shenbaoService.selectById(ids);
        if(shenbao==null){
            return R.error();
        }
        shenbao.setZhuanjiId((Integer)request.getSession().getAttribute("userId"));
        shenbao.setTongguoTypes(2);
        boolean b = shenbaoService.updateById(shenbao);
        if(b){
            XiangmuEntity xiangmu = xiangmuService.selectById(shenbao.getXiangmuId());
            xiangmu.setShifouTypes(2);
            boolean b1 = xiangmuService.updateById(xiangmu);
            if(b1){
                return R.ok();
            }
        }
        return R.error();
    }



}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

程序猿毕业分享网

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

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

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

打赏作者

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

抵扣说明:

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

余额充值