springboot校园社团信息管理系统源码和论文

校园社团信息管理系统

摘要

随着信息技术在管理上越来越深入而广泛的应用,管理信息系统的实施在技术上已逐步成熟。本文介绍了校园社团信息管理系统的开发全过程。通过分析校园社团信息管理系统管理的不足,创建了一个计算机管理校园社团信息管理系统的方案。文章介绍了校园社团信息管理系统的系统分析部分,包括可行性分析等,系统设计部分主要介绍了系统功能设计和数据库设计。

本校园社团信息管理系统管理员功能有个人中心,学生管理,社长管理,社团分类管理,社团信息管理,加入社团管理,社团成员管理,社团活动管理,活动报名管理,系统管理等。社长添加社团,管理员审核社团,学生加入社团,社长审核社团。因而具有一定的实用性。

本站是一个B/S模式系统,采用Spring Boot框架,MYSQL数据库设计开发,充分保证系统的稳定性。系统具有界面清晰、操作简单,功能齐全的特点,使得校园社团信息管理系统管理工作系统化、规范化。本系统的使用使管理人员从繁重的工作中解脱出来,实现无纸化办公,能够有效的提高校园社团信息管理系统管理效率。

关键词:校园社团信息管理系统;Spring Boot框架;MYSQL数据库

springboot校园社团信息管理系统源码和论文101

演示视频:

springboot校园社团信息管理系统源码和论文101

Abstract

With the deepening and extensive application of information technology in management, the implementation of management information systems has gradually matured in technology. This article introduces the whole process of the development of the campus community information management system. By analyzing the deficiencies of the campus community information management system management, a computer-based solution for the campus community information management system was created. The article introduces the system analysis part of the campus community information management system, including feasibility analysis, etc. The system design part mainly introduces the system function design and database design.

The administrator functions of the campus club information management system include personal center, student management, president management, club classification management, club information management, joining club management, club member management, club activity management, event registration management, system management, etc. The president adds a club, the administrator reviews the club, students join the club, and the president reviews the club. So it has a certain practicability.

This site is a B/S model system, using Spring Boot framework, MYSQL database design and development, fully guarantee the stability of the system. The system has the characteristics of clear interface, simple operation and complete functions, which makes the management of campus community information management system systematized and standardized. The use of this system frees managers from heavy work, realizes paperless office, and can effectively improve the management efficiency of the campus community information management system.

Keywords: Campus community information management system; Spring Boot framework; MYSQL database

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.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.annotation.IgnoreAuth;

import com.entity.ShetuanxinxiEntity;
import com.entity.view.ShetuanxinxiView;

import com.service.ShetuanxinxiService;
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 2021-05-08 09:49:51
 */
@RestController
@RequestMapping("/shetuanxinxi")
public class ShetuanxinxiController {
    @Autowired
    private ShetuanxinxiService shetuanxinxiService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,ShetuanxinxiEntity shetuanxinxi,
		HttpServletRequest request){
		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("shezhang")) {
			shetuanxinxi.setZhanghao((String)request.getSession().getAttribute("username"));
		}
        EntityWrapper<ShetuanxinxiEntity> ew = new EntityWrapper<ShetuanxinxiEntity>();
		PageUtils page = shetuanxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shetuanxinxi), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,ShetuanxinxiEntity shetuanxinxi, 
		HttpServletRequest request){
        EntityWrapper<ShetuanxinxiEntity> ew = new EntityWrapper<ShetuanxinxiEntity>();
		PageUtils page = shetuanxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shetuanxinxi), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( ShetuanxinxiEntity shetuanxinxi){
       	EntityWrapper<ShetuanxinxiEntity> ew = new EntityWrapper<ShetuanxinxiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( shetuanxinxi, "shetuanxinxi")); 
        return R.ok().put("data", shetuanxinxiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(ShetuanxinxiEntity shetuanxinxi){
        EntityWrapper< ShetuanxinxiEntity> ew = new EntityWrapper< ShetuanxinxiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( shetuanxinxi, "shetuanxinxi")); 
		ShetuanxinxiView shetuanxinxiView =  shetuanxinxiService.selectView(ew);
		return R.ok("查询社团信息成功").put("data", shetuanxinxiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        ShetuanxinxiEntity shetuanxinxi = shetuanxinxiService.selectById(id);
		shetuanxinxi.setClicknum(shetuanxinxi.getClicknum()+1);
		shetuanxinxi.setClicktime(new Date());
		shetuanxinxiService.updateById(shetuanxinxi);
        return R.ok().put("data", shetuanxinxi);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        ShetuanxinxiEntity shetuanxinxi = shetuanxinxiService.selectById(id);
		shetuanxinxi.setClicknum(shetuanxinxi.getClicknum()+1);
		shetuanxinxi.setClicktime(new Date());
		shetuanxinxiService.updateById(shetuanxinxi);
        return R.ok().put("data", shetuanxinxi);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody ShetuanxinxiEntity shetuanxinxi, HttpServletRequest request){
    	shetuanxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(shetuanxinxi);
        shetuanxinxiService.insert(shetuanxinxi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody ShetuanxinxiEntity shetuanxinxi, HttpServletRequest request){
    	shetuanxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(shetuanxinxi);
        shetuanxinxiService.insert(shetuanxinxi);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ShetuanxinxiEntity shetuanxinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(shetuanxinxi);
        shetuanxinxiService.updateById(shetuanxinxi);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        shetuanxinxiService.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<ShetuanxinxiEntity> wrapper = new EntityWrapper<ShetuanxinxiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}

		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("shezhang")) {
			wrapper.eq("zhanghao", (String)request.getSession().getAttribute("username"));
		}

		int count = shetuanxinxiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	
	/**
     * 前端智能排序
     */
	@IgnoreAuth
    @RequestMapping("/autoSort")
    public R autoSort(@RequestParam Map<String, Object> params,ShetuanxinxiEntity shetuanxinxi, HttpServletRequest request,String pre){
        EntityWrapper<ShetuanxinxiEntity> ew = new EntityWrapper<ShetuanxinxiEntity>();
        Map<String, Object> newMap = new HashMap<String, Object>();
        Map<String, Object> param = new HashMap<String, Object>();
		Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
		while (it.hasNext()) {
			Map.Entry<String, Object> entry = it.next();
			String key = entry.getKey();
			String newKey = entry.getKey();
			if (pre.endsWith(".")) {
				newMap.put(pre + newKey, entry.getValue());
			} else if (StringUtils.isEmpty(pre)) {
				newMap.put(newKey, entry.getValue());
			} else {
				newMap.put(pre + "." + newKey, entry.getValue());
			}
		}
		params.put("sort", "clicknum");
        params.put("order", "desc");
		PageUtils page = shetuanxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shetuanxinxi), params), params));
        return R.ok().put("data", page);
    }


}

 


package com.controller;

import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;

import com.service.DictionaryService;
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.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;

/**
 * 菜单
 * 后端接口
 * @author
 * @email
*/
@RestController
@Controller
@RequestMapping("/menu")
public class MenuController {
    private static final Logger logger = LoggerFactory.getLogger(MenuController.class);

    private static final String TABLE_NAME = "menu";

    @Autowired
    private MenuService menuService;


    @Autowired
    private TokenService tokenService;

    @Autowired
    private DanganService danganService;//档案
    @Autowired
    private DictionaryService dictionaryService;//字典
    @Autowired
    private GonggaoService gonggaoService;//公告
    @Autowired
    private QiandaoService qiandaoService;//员工签到
    @Autowired
    private XinziService xinziService;//薪资
    @Autowired
    private YuangongService yuangongService;//员工
    @Autowired
    private YuangongchuchaiService yuangongchuchaiService;//员工出差
    @Autowired
    private YuangongqingjiaService yuangongqingjiaService;//员工请假
    @Autowired
    private UsersService usersService;//管理员


    /**
    * 后端列表
    */
    @RequestMapping("/page")
    @IgnoreAuth
    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(false)
            return R.error(511,"永不会进入");
        else if("员工".equals(role))
            params.put("yuangongId",request.getSession().getAttribute("userId"));
        CommonUtil.checkMap(params);
        PageUtils page = menuService.queryPage(params);

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

    /**
    * 后端详情
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id, HttpServletRequest request){
        logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        MenuEntity menu = menuService.selectById(id);
        if(menu !=null){
            //entity转view
            MenuView view = new MenuView();
            BeanUtils.copyProperties( menu , view );//把实体数据重构到view中
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody MenuEntity menu, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,menu:{}",this.getClass().getName(),menu.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永远不会进入");

        Wrapper<MenuEntity> queryWrapper = new EntityWrapper<MenuEntity>()
            .eq("role_zh_name", menu.getRoleZhName())
            .eq("role_en_name", menu.getRoleEnName())
            .eq("direction", menu.getDirection())
            .eq("yiji_menu_name", menu.getYijiMenuName())
            .eq("yiji_menu_icon", menu.getYijiMenuIcon())
            .eq("erji_menu", menu.getErjiMenu())
            .eq("beizhu", menu.getBeizhu())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        MenuEntity menuEntity = menuService.selectOne(queryWrapper);
        if(menuEntity==null){
            menu.setInsertTime(new Date());
            menu.setCreateTime(new Date());
            menuService.insert(menu);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody MenuEntity menu, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
        logger.debug("update方法:,,Controller:{},,menu:{}",this.getClass().getName(),menu.toString());
        MenuEntity oldMenuEntity = menuService.selectById(menu.getId());//查询原先数据

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
        menu.setUpdateTime(new Date());

            menuService.updateById(menu);//根据id更新
            return R.ok();
    }



    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        List<MenuEntity> oldMenuList =menuService.selectBatchIds(Arrays.asList(ids));//要删除的数据
        menuService.deleteBatchIds(Arrays.asList(ids));

        return R.ok();
    }


    /**
     * 批量上传
     */
    @RequestMapping("/batchInsert")
    public R save( String fileName, HttpServletRequest request){
        logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
        Integer yuangongId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))
        try {
            List<MenuEntity> menuList = new ArrayList<>();//上传的东西
            Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
            Date date = new Date();
            int lastIndexOf = fileName.lastIndexOf(".");
            if(lastIndexOf == -1){
                return R.error(511,"该文件没有后缀");
            }else{
                String suffix = fileName.substring(lastIndexOf);
                if(!".xls".equals(suffix)){
                    return R.error(511,"只支持后缀为xls的excel文件");
                }else{
                    URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
                    File file = new File(resource.getFile());
                    if(!file.exists()){
                        return R.error(511,"找不到上传文件,请联系管理员");
                    }else{
                        List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
                        dataList.remove(0);//删除第一行,因为第一行是提示
                        for(List<String> data:dataList){
                            //循环
                            MenuEntity menuEntity = new MenuEntity();
//                            menuEntity.setRoleZhName(data.get(0));                    //角色汉字 要改的
//                            menuEntity.setRoleEnName(data.get(0));                    //角色表名 要改的
//                            menuEntity.setDirection(data.get(0));                    //使用方向 要改的
//                            menuEntity.setYijiMenuName(data.get(0));                    //一级菜单名称 要改的
//                            menuEntity.setYijiMenuIcon(data.get(0));                    //一级菜单图标 要改的
//                            menuEntity.setErjiMenu(data.get(0));                    //二级菜单 要改的
//                            menuEntity.setBeizhu(data.get(0));                    //备注 要改的
//                            menuEntity.setInsertTime(date);//时间
//                            menuEntity.setUpdateTime(sdf.parse(data.get(0)));          //更新时间 要改的
//                            menuEntity.setCreateTime(date);//时间
                            menuList.add(menuEntity);


                            //把要查询是否重复的字段放入map中
                        }

                        //查询是否重复
                        menuService.insertBatch(menuList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }




}

  • 9
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值