基于ssm高校普法系统源码和论文

随着信息化时代的到来,管理系统都趋向于智能化、系统化,高校普法系统也不例外,但目前国内的市场仍都使用人工管理,市场规模越来越大,同时信息量也越来越庞大,人工管理显然已无法应对时代的变化,而高校普法系统能很好地解决这一问题,轻松应对高校普法平时的工作,既能提高人力物力财力,又能加快工作的效率,取代人工管理是必然趋势。

本高校普法系统以ssm作为框架,b/s模式以及MySql作为后台运行的数据库,同时使用Tomcat用为系统的服务器。本系统主要包括以下功能模块:首页,个人中心,律师推荐管理,咨询问题管理,问题回复管理,学生管理,律师管理,类型管理,法律知识管理,新闻类型管理,法律新闻管理,律师推荐管理,咨询问题管理,问题回复管理,管理员管理,普法论坛,系统管理等模块,通过这些模块的实现能够基本满足日常高校普法管理的操作。

本文着重阐述了高校普法系统的分析、设计与实现,首先介绍开发系统和环境配置、数据库的设计,接着说明功能模块的详细实现,最后进行了总结。

关键词:高校普法系统;ssm;MySql数据库;Tomcat

基于ssm高校普法系统源码和论文765

演示视频:

基于ssm高校普法系统源码和论文


Abstract

With the advent of the information age, management systems tend to be intelligent and systematic, and the law popularization system in colleges and universities is no exception. However, at present, the domestic market still uses manual management, the market scale is getting bigger and bigger, and the amount of information is also increasing. The larger the scale, the more human management can obviously not cope with the changes of the times, and the legal popularization system in colleges and universities can solve this problem well and easily cope with the usual work of legal popularization in colleges and universities. Management is an inevitable trend.

The legal popularization system of this university uses ssm as the framework, b/s mode and MySql as the database running in the background, and uses Tomcat as the system server. This system mainly includes the following functional modules: Homepage, Personal Center, Lawyer Recommendation Management, Consulting Question Management, Question Reply Management, Student Management, Lawyer Management, Type Management, Legal Knowledge Management, News Type Management, Legal News Management, Lawyer Recommendation Management, Consulting question management, question reply management, administrator management, legal popularization forum, system management and other modules, the realization of these modules can basically meet the daily operation of legal popularization management in colleges and universities.

This paper focuses on the analysis, design and implementation of the legal popularization system in colleges and universities. First, it introduces the development system, environment configuration, and database design. Then, it explains the detailed implementation of the functional modules. Finally, it summarizes.

Key words:University law popularization system; ssm; MySql database; Tomcat

基于ssm高校普法系统源码和论文_第1张图片基于ssm高校普法系统源码和论文_第2张图片基于ssm高校普法系统源码和论文_第3张图片基于ssm高校普法系统源码和论文_第4张图片基于ssm高校普法系统源码和论文_第5张图片基于ssm高校普法系统源码和论文_第6张图片基于ssm高校普法系统源码和论文_第7张图片基于ssm高校普法系统源码和论文_第8张图片基于ssm高校普法系统源码和论文_第9张图片基于ssm高校普法系统源码和论文_第10张图片基于ssm高校普法系统源码和论文_第11张图片基于ssm高校普法系统源码和论文_第12张图片基于ssm高校普法系统源码和论文_第13张图片基于ssm高校普法系统源码和论文_第14张图片基于ssm高校普法系统源码和论文_第15张图片基于ssm高校普法系统源码和论文_第16张图片基于ssm高校普法系统源码和论文_第17张图片基于ssm高校普法系统源码和论文_第18张图片基于ssm高校普法系统源码和论文_第19张图片基于ssm高校普法系统源码和论文_第20张图片基于ssm高校普法系统源码和论文_第21张图片基于ssm高校普法系统源码和论文_第22张图片基于ssm高校普法系统源码和论文_第23张图片基于ssm高校普法系统源码和论文_第24张图片基于ssm高校普法系统源码和论文_第25张图片基于ssm高校普法系统源码和论文_第26张图片

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 java.io.IOException;

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.LvshiEntity;
import com.entity.view.LvshiView;

import com.service.LvshiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import com.service.StoreupService;
import com.entity.StoreupEntity;

/**
 * 律师
 * 后端接口
 * @author 
 * @email 
 * @date 2022-02-18 19:49:37
 */
@RestController
@RequestMapping("/lvshi")
public class LvshiController {
    @Autowired
    private LvshiService lvshiService;


    @Autowired
    private StoreupService storeupService;

    
	@Autowired
	private TokenService tokenService;
	
	/**
	 * 登录
	 */
	@IgnoreAuth
	@RequestMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		LvshiEntity user = lvshiService.selectOne(new EntityWrapper().eq("lvshizhanghao", username));
		if(user==null || !user.getMima().equals(password)) {
			return R.error("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(), username,"lvshi",  "律师" );
		return R.ok().put("token", token);
	}
	
	/**
     * 注册
     */
	@IgnoreAuth
    @RequestMapping("/register")
    public R register(@RequestBody LvshiEntity lvshi){
    	//ValidatorUtils.validateEntity(lvshi);
    	LvshiEntity user = lvshiService.selectOne(new EntityWrapper().eq("lvshizhanghao", lvshi.getLvshizhanghao()));
		if(user!=null) {
			return R.error("注册用户已存在");
		}
		Long uId = new Date().getTime();
		lvshi.setId(uId);
        lvshiService.insert(lvshi);
        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");
        LvshiEntity user = lvshiService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	LvshiEntity user = lvshiService.selectOne(new EntityWrapper().eq("lvshizhanghao", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
    	user.setMima("123456");
        lvshiService.updateById(user);
        return R.ok("密码已重置为:123456");
    }


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map params,LvshiEntity lvshi, 
		HttpServletRequest request){

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

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( LvshiEntity lvshi){
       	EntityWrapper ew = new EntityWrapper();
      	ew.allEq(MPUtil.allEQMapPre( lvshi, "lvshi")); 
        return R.ok().put("data", lvshiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(LvshiEntity lvshi){
        EntityWrapper< LvshiEntity> ew = new EntityWrapper< LvshiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( lvshi, "lvshi")); 
		LvshiView lvshiView =  lvshiService.selectView(ew);
		return R.ok("查询律师成功").put("data", lvshiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        LvshiEntity lvshi = lvshiService.selectById(id);
		lvshi.setClicktime(new Date());
		lvshiService.updateById(lvshi);
        return R.ok().put("data", lvshi);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        LvshiEntity lvshi = lvshiService.selectById(id);
		lvshi.setClicktime(new Date());
		lvshiService.updateById(lvshi);
        return R.ok().put("data", lvshi);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody LvshiEntity lvshi, HttpServletRequest request){
    	lvshi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(lvshi);
    	LvshiEntity user = lvshiService.selectOne(new EntityWrapper().eq("lvshizhanghao", lvshi.getLvshizhanghao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		lvshi.setId(new Date().getTime());
        lvshiService.insert(lvshi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody LvshiEntity lvshi, HttpServletRequest request){
    	lvshi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(lvshi);
    	LvshiEntity user = lvshiService.selectOne(new EntityWrapper().eq("lvshizhanghao", lvshi.getLvshizhanghao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		lvshi.setId(new Date().getTime());
        lvshiService.insert(lvshi);
        return R.ok();
    }

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

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


		int count = lvshiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	
	/**
     * 前端智能排序
     */
	@IgnoreAuth
    @RequestMapping("/autoSort")
    public R autoSort(@RequestParam Map params,LvshiEntity lvshi, HttpServletRequest request,String pre){
        EntityWrapper ew = new EntityWrapper();
        Map newMap = new HashMap();
        Map param = new HashMap();
		Iterator> it = param.entrySet().iterator();
		while (it.hasNext()) {
			Map.Entry 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", "clicktime");
        
        params.put("order", "desc");
		PageUtils page = lvshiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, lvshi), params), params));
        return R.ok().put("data", page);
    }







}

 

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 java.io.IOException;

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.FalvxinwenEntity;
import com.entity.view.FalvxinwenView;

import com.service.FalvxinwenService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import com.service.StoreupService;
import com.entity.StoreupEntity;

/**
 * 法律新闻
 * 后端接口
 * @author 
 * @email 
 * @date 2022-02-18 19:49:38
 */
@RestController
@RequestMapping("/falvxinwen")
public class FalvxinwenController {
    @Autowired
    private FalvxinwenService falvxinwenService;


    @Autowired
    private StoreupService storeupService;

    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map params,FalvxinwenEntity falvxinwen, 
		HttpServletRequest request){

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

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( FalvxinwenEntity falvxinwen){
       	EntityWrapper ew = new EntityWrapper();
      	ew.allEq(MPUtil.allEQMapPre( falvxinwen, "falvxinwen")); 
        return R.ok().put("data", falvxinwenService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(FalvxinwenEntity falvxinwen){
        EntityWrapper< FalvxinwenEntity> ew = new EntityWrapper< FalvxinwenEntity>();
 		ew.allEq(MPUtil.allEQMapPre( falvxinwen, "falvxinwen")); 
		FalvxinwenView falvxinwenView =  falvxinwenService.selectView(ew);
		return R.ok("查询法律新闻成功").put("data", falvxinwenView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        FalvxinwenEntity falvxinwen = falvxinwenService.selectById(id);
		falvxinwen.setClicknum(falvxinwen.getClicknum()+1);
		falvxinwen.setClicktime(new Date());
		falvxinwenService.updateById(falvxinwen);
        return R.ok().put("data", falvxinwen);
    }

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



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody FalvxinwenEntity falvxinwen, HttpServletRequest request){
    	falvxinwen.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(falvxinwen);

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

        falvxinwenService.insert(falvxinwen);
        return R.ok();
    }

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

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


		int count = falvxinwenService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	
	/**
     * 前端智能排序
     */
	@IgnoreAuth
    @RequestMapping("/autoSort")
    public R autoSort(@RequestParam Map params,FalvxinwenEntity falvxinwen, HttpServletRequest request,String pre){
        EntityWrapper ew = new EntityWrapper();
        Map newMap = new HashMap();
        Map param = new HashMap();
		Iterator> it = param.entrySet().iterator();
		while (it.hasNext()) {
			Map.Entry 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 = falvxinwenService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, falvxinwen), params), params));
        return R.ok().put("data", page);
    }







}

你可能感兴趣的:(mysql,java)