Java项目:springboot学生会管理系统

作者主页:源码空间站2022

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

学生会管理系统.主要功能包括:

后台首页:最新活动展示、最新公告、学生会部门职能介绍;
财务管理:资金报销登记、赞助商管理;
物资管理:物资借还管理、全部物资;添加、编辑、删除;
日常事务管理:工作计划管理、活动管理、文件管理;
申请请假:添加、修改、删除、查看;

我的待办;

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 

6.数据库:MySql 5.7版本;

技术栈

1. 后端:SpringBoot

2. 前端:Thymeleaf+html+layui+jQuery+bootstrap

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 将项目中application.yml及activiti.cfg.xml配置文件中的数据库配置改为自己的配置;

3. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;

若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行;

4. 运行项目,输入localhost:8085 登录

运行截图

 Java项目:springboot学生会管理系统_第1张图片

Java项目:springboot学生会管理系统_第2张图片

Java项目:springboot学生会管理系统_第3张图片

Java项目:springboot学生会管理系统_第4张图片

Java项目:springboot学生会管理系统_第5张图片

Java项目:springboot学生会管理系统_第6张图片

Java项目:springboot学生会管理系统_第7张图片

Java项目:springboot学生会管理系统_第8张图片

代码相关

物资管理控制器

@RestController
@RequestMapping("/goods")
public class GoodsController {

    @Autowired
    private GoodsService goodsService;

    @Autowired
    private GoodsService1 AllgoodsService;


    /**
     * 查询物资
     * @param
     * @return
     */
    @RequestMapping("loadAllGoods")
    public Dataobj loadAllGoods(GoodsVo goodsVo){

        IPage page = new Page<>(goodsVo.getPage(),goodsVo.getLimit());
        QueryWrapper q = new QueryWrapper<>();
        q.like(StringUtils.isNotBlank(goodsVo.getGname()),"gname",goodsVo.getGname());
        q.like(StringUtils.isNotBlank(goodsVo.getRetunname()),"retunname",goodsVo.getRetunname());
        q.like(StringUtils.isNotBlank(goodsVo.getOperatorname()),"operatorname",goodsVo.getOperatorname());
        q.like(StringUtils.isNotBlank(goodsVo.getBorrowname()),"borrowname",goodsVo.getBorrowname());
        q.orderByAsc("id");
        goodsService.page(page,q);
        List list =goodsService.list(q);
        long num=list.size();
        if(list.isEmpty()){
            return new Dataobj(null,num);
        }else {
            //返回DataGridView
            return new Dataobj(page.getRecords(), page.getTotal());
        }
    }

    /**
     * 添加物资
     * @param goodsVo
     * @return
     */

    @RequestMapping("addGoods")
    public Resultreturn addGoods(GoodsVo goodsVo){
        try {
            Integer gid=goodsVo.getGid();
            Allgoods allgoods=AllgoodsService.getById(gid);
            Integer goodssum=allgoods.getGoodsnum();
            Integer brrownum=allgoods.getBorrownum();
            Integer num=goodsVo.getGoodsnum();
            if (allgoods.getGoodsnum() > 0 && num < allgoods.getGoodsnum()) {
                if (brrownum>=0) {
                    brrownum += num;
                    allgoods.setBorrownum(brrownum);
                    allgoods.setGoodsnum(goodssum - num);
                    AllgoodsService.updateById(allgoods);goodsService.save(goodsVo);
                }else {
                    goodsService.save(goodsVo);
                }
                return Resultreturn.ADD_SUCCESS;
            }else { return Resultreturn.ADD_ERRORs; }
        } catch (Exception e) {
            e.printStackTrace();
            return Resultreturn.ADD_ERROR;
        }
    }

    /*修改物资*/
    @RequestMapping("updateGoods")
    public Resultreturn updateGoods(GoodsVo goodsVo){
        try {

            Integer gid=goodsVo.getGid();
            Allgoods allgoods=AllgoodsService.getById(gid);
            Integer goodssum1=allgoods.getGoodsnum();
            Integer brrownum1=allgoods.getBorrownum();
            Integer num=goodsVo.getCountnum();
            Integer num1=goodsVo.getGoodsnum();
            if(goodsVo.getStatus()==1){
                allgoods.setGoodsnum(goodssum1+num1);
                allgoods.setBorrownum(brrownum1-num1);
                AllgoodsService.updateById(allgoods);
                goodsService.updateById(goodsVo);
                return Resultreturn.UPDATE_SUCCESS;
            }
            else {
                if (allgoods.getGoodsnum() > 0 && num < allgoods.getGoodsnum()) {
                    if (num>0) {
                        brrownum1 = num + brrownum1;
                        allgoods.setBorrownum(brrownum1);
                        allgoods.setGoodsnum(goodssum1 - num);
                        AllgoodsService.updateById(allgoods);
                        goodsService.updateById(goodsVo);
                    } else if (0 == num) {
                        goodsService.updateById(goodsVo);
                    } else {
                        brrownum1 = brrownum1 +num;
                        allgoods.setBorrownum(brrownum1);
                        allgoods.setGoodsnum(goodssum1-num);
                        AllgoodsService.updateById(allgoods);
                        goodsService.updateById(goodsVo);
                    }
                    return Resultreturn.UPDATE_SUCCESS;
                } else {
                    return Resultreturn.UPDATE_ERRORs;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            return Resultreturn.UPDATE_ERROR;
        }

    }


    /**
     * 批量删除
     * @param goodsVo 选中
     * @return
     */
    @RequestMapping("batchDeleteGoods")
    public Resultreturn batchDeletefiles(GoodsVo goodsVo){
        try {
            Collection idList = new ArrayList();
            for (Integer id : goodsVo.getIds()) {
                idList.add(id);
            }
            goodsService.removeByIds(idList);
            return Resultreturn.DELETE_SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            return Resultreturn.DELETE_ERROR;
        }
    }



    //删除物资
    @RequestMapping("deleteGoods")
    public Resultreturn deleteGoods(Integer id, Integer status){
        try {
            if (status==1)
            {
                goodsService.removeById(id);
                return Resultreturn.DELETE_SUCCESS;
            }
            else {
                return Resultreturn.DELETE_ERRORs;
            }



        } catch (Exception e) {
            e.printStackTrace();
            return Resultreturn.DELETE_ERROR;
        }
    }








    /**
     * 查询物资
     * @param
     * @return
     */
    @RequestMapping("loadAllGoods1")
    public Dataobj loadAllGoods1(GoodsVo1 goodsVo1){

        IPage page = new Page<>(goodsVo1.getPage(),goodsVo1.getLimit());
        QueryWrapper q = new QueryWrapper<>();
        q.like(StringUtils.isNotBlank(goodsVo1.getGname()),"gname",goodsVo1.getGname());
        q.like(StringUtils.isNotBlank(goodsVo1.getAdreess()),"adreess",goodsVo1.getAdreess());
        q.like(StringUtils.isNotBlank(goodsVo1.getDecript()),"decript",goodsVo1.getDecript());
        q.orderByAsc("id");
        AllgoodsService.page(page,q);
        return new Dataobj(page.getRecords(),page.getTotal());
    }

    @RequestMapping("loadAllgoodsForSelect")
    public Dataobj loadAllProviderForSelect(){
        QueryWrapper queryWrapper = new QueryWrapper();
        List list = AllgoodsService.list(queryWrapper);
        return new Dataobj(list);
    }

    /**
     * 添加物资
     * @param
     * @return
     */
    @RequestMapping("addGoods1")
    public Resultreturn addGoods1(GoodsVo1 goodsVo1){
        try {

            AllgoodsService.save(goodsVo1);
            return Resultreturn.ADD_SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            return Resultreturn.ADD_ERROR;
        }
    }

    /**
     * 修改物资
     * @param goodsVo
     * @return
     */
    @RequestMapping("updateGoods1")
    public Resultreturn updateGoods1(GoodsVo1 goodsVo){
        try {
            AllgoodsService.updateById(goodsVo);
            return Resultreturn.UPDATE_SUCCESS;

        } catch (Exception e) {
            e.printStackTrace();
            return Resultreturn.UPDATE_ERROR;
        }
    }

    //删除物资
    @RequestMapping("deleteGoods1")
    public Resultreturn deleteGoods1(Integer id){
        try {

            AllgoodsService.removeById(id);
            return Resultreturn.DELETE_SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            return Resultreturn.DELETE_ERROR;
        }
    }


    /**
     * 批量删除
     * @param goodsVo1 选中的
     * @return
     */
    @RequestMapping("batchDeleteGoods1")
    public Resultreturn batchDeletefiles(GoodsVo1 goodsVo1){
        try {
            Collection idList = new ArrayList();
            for (Integer id : goodsVo1.getIds()) {
                idList.add(id);
            }
            AllgoodsService.removeByIds(idList);
            return Resultreturn.DELETE_SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            return Resultreturn.DELETE_ERROR;
        }
    }

}

活动管理控制器

@RestController
@RequestMapping("/activitys")
public class HuodonController {

    @Autowired
    private ActivitysService activitysService;



    /**
     * 查询活动
     * @param
     * @return
     */
    @RequestMapping("loadAllactivitys")
    public Dataobj loadAllGoods1(huodonv huodonv){

        IPage page = new Page<>(huodonv.getPage(), huodonv.getLimit());
        QueryWrapper q = new QueryWrapper<>();
        q.like(StringUtils.isNotBlank(huodonv.getActivityname()),"activityname", huodonv.getActivityname());
        q.like(StringUtils.isNotBlank(huodonv.getUndertakedepart()),"undertakedepart", huodonv.getUndertakedepart());
        q.orderByAsc("aid");
        activitysService.page(page,q);
        List list =activitysService.list(q);
        long num=list.size();
        if(list.isEmpty()){
            return new Dataobj(null,num);
        }else {
            //返回DataGridView
            return new Dataobj(page.getRecords(), page.getTotal());
        }
    }



    /**
     * 新建活动
     */
    @RequestMapping("addactivitys")
    public Resultreturn addGoods1(huodonv huodonv){
        try {

            activitysService.save(huodonv);
            return Resultreturn.ADD_SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            return Resultreturn.ADD_ERROR;
        }
    }

    /**
     * 修改活动
     * @param huodonv
     * @return
     */
    @RequestMapping("updateactivitys")
    public Resultreturn updateGoods1(huodonv huodonv){
        try {
            activitysService.updateById(huodonv);
            return Resultreturn.UPDATE_SUCCESS;

        } catch (Exception e) {
            e.printStackTrace();
            return Resultreturn.UPDATE_ERROR;
        }
    }

    //删除活动
    @RequestMapping("deleteactivitys")
    public Resultreturn deleteGoods1(Integer id){
        try {

            activitysService.removeById(id);
            return Resultreturn.DELETE_SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            return Resultreturn.DELETE_ERROR;
        }
    }


    /**
     * 批量删除
     * @param huodonv 选中
     * @return
     */
    @RequestMapping("batchDeleteactivitys")
    public Resultreturn batchDeletefiles(huodonv huodonv){
        try {
            Collection idList = new ArrayList();
            for (Integer id : huodonv.getIds()) {
                idList.add(id);
            }
            activitysService.removeByIds(idList);
            return Resultreturn.DELETE_SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            return Resultreturn.DELETE_ERROR;
        }
    }

}

如果也想学习本系统,下面领取。回复:051springboot 

 

你可能感兴趣的:(springboot,java,java,spring,boot,spring)