Java项目:27 基于SSM+JSP实现的大学校园兼职平台

news/2024/11/28 22:46:24/
作者主页:源码空间codegym

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

文中获取源码

项目介绍

系统介绍

基于SSM+JSP实现的大学校园兼职平台分为前台与管理员两块

管理端分为8大模块,分别是用户管理、兼职管理、帖子管理、聊天管理、广告管理、信箱管理、收藏管理、系统管理等模块

前台有兼职查看、论坛交流、平台公告等主要菜单项

用户登陆后可查看兼职详情、与发布者交流、选择喜欢的兼职

点击查看演示视频

环境要求

1.运行环境:最好是java jdk1.8,我们在这个平台上运行的。其他版本理论上也可以。

2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;

3.tomcat环境:Tomcat7.x,8.X,9.x版本均可

4.硬件环境:windows7/8/10 4G内存以上;或者Mac OS;

5.是否Maven项目:是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven.项目

6.数据库:MySql5.7/8.0等版本均可;

技术栈

运行环境:jdk8 + tomcat9 + mysql5.7 + windows10

服务端技术:Spring + SpringMvc + Mybatis + jsp + Jquery + Layui

使用说明

1.使用Navicati或者其它工具,在mysql中创建对应sq文件名称的数据库,并导入项目的sql文件;

2.使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;

3.将项目中config-propertiesi配置文件中的数据库配置改为自己的配置,然后运行;

运行指导

idea导入源码空间站顶目教程说明(Vindows版)-ssm篇:

http://mtw.so/5MHvZq

源码地址:http://codegym.top

运行截图

前端界面

微信截图_20240223190322

微信截图_20240223190349

微信截图_20240223190356

微信截图_20240223190403

微信截图_20240223190408

微信截图_20240223190414

微信截图_20240223190422

微信截图_20240223190438

后台界面

微信截图_20240223190524

微信截图_20240223190529

微信截图_20240223190535

微信截图_20240223190544

微信截图_20240223190557

微信截图_20240223190603

代码

PcIndexController

package com.work.controller.pc;import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.work.common.utils.BaseUtil;
import com.work.common.utils.JsonUtil;
import com.work.common.utils.Page;
import com.work.pojo.Adver;
import com.work.pojo.Banner;
import com.work.pojo.Chat;
import com.work.pojo.Forum;
import com.work.pojo.ForumReply;
import com.work.pojo.Notice;
import com.work.pojo.QueryVo;
import com.work.pojo.SystemUpset;
import com.work.pojo.User;
import com.work.pojo.Work;
import com.work.service.AdverService;
import com.work.service.BannerService;
import com.work.service.ChatService;
import com.work.service.ForumReplyService;
import com.work.service.ForumService;
import com.work.service.NoticeService;
import com.work.service.SystemUpsetService;
import com.work.service.UserService;
import com.work.service.WorkService;@Controller
@RequestMapping("/pc/index")
public class PcIndexController extends BaseUtil{@Autowiredprivate AdverService adverService;@Autowiredprivate NoticeService noticeService;@Autowiredprivate WorkService workService;@Autowiredprivate UserService userService;@Autowiredprivate ForumService forumService;@Autowiredprivate ChatService chatService;@Autowiredprivate BannerService bannerService;@Autowiredprivate SystemUpsetService systemUpsetService;@Autowiredprivate ForumReplyService forumReplyService;//公共头部@RequestMapping(value="/goHeader.action")public ModelAndView goHeader(HttpServletRequest request,ModelAndView mv,SystemUpset systemUpset){List<SystemUpset> systemUpsets = systemUpsetService.getSystemUpsetList(systemUpset, null, null);if(systemUpsets.size() > 0){mv.addObject("systemUpset", systemUpsets.get(0));}mv.setViewName("pc/header");return mv;}//公共尾部@RequestMapping(value="/goFooter.action")public ModelAndView goFooter(ModelAndView mv,SystemUpset systemUpset){List<SystemUpset> systemUpsets = systemUpsetService.getSystemUpsetList(systemUpset, null, null);if(systemUpsets.size() > 0){mv.addObject("systemUpset", systemUpsets.get(0));}mv.setViewName("pc/footer");return mv;}//去首页面@RequestMapping(value="/goIndex.action")public ModelAndView goLogin(HttpServletRequest request,ModelAndView mv, Work work, QueryVo vo){//判断滚动条String isScroll = "f";//获取兼职Page<Work> page=new Page<Work>();if(work.getWorkCategory() != null && !work.getWorkCategory().equals("")){isScroll = "t";
//			try {
//				work.setWorkCategory(new String(work.getWorkCategory().getBytes("ISO8859-1"),"UTF-8"));
//			} catch (UnsupportedEncodingException e) {
//				e.printStackTrace();
//			}}System.out.println(work.getWorkCategory());work.setIsEffect(1);work.setIsAuditing(1);if(vo.getSize()!=8){ vo.setSize(8);}if(vo.getPage()==null){vo.setPage(1);}//每页数page.setSize(vo.getSize());if (vo != null){//判断当前页if(vo.getPage() != null) {page.setPage(vo.getPage());vo.setStartRow((vo.getPage() -1)*vo.getSize());}page.setTotal(workService.getWorkListCount(work));page.setRows(workService.getWorkList(work, (vo.getPage()-1) * vo.getSize(), vo.getSize()));}mv.addObject("page", page);//系统配置SystemUpset systemUpset = new SystemUpset();List<SystemUpset> systemUpsets = systemUpsetService.getSystemUpsetList(systemUpset, null, null);if(systemUpsets.size() > 0){mv.addObject("systemUpset", systemUpsets.get(0));}//轮播图Banner banner = new Banner();banner.setIsEffect(1);List<Banner> banners = bannerService.getBannerList(banner, null, null);mv.addObject("banners", banners);User pcUser = (User) request.getSession().getAttribute("pcUser");mv.addObject("pcUser", pcUser);if(vo.getPage() != 1){isScroll = "t";}mv.addObject("isScroll", isScroll);mv.setViewName("pc/index");return mv;}//首页获取分类兼职@RequestMapping("/getWorkByWorkCate")public void getWorkByWorkCate(HttpServletResponse response,Work work){work.setIsEffect(1);work.setIsAuditing(1);Integer count = workService.getWorkListCount(work);List<Work> works = workService.getWorkList(work, 0, 8);SimpleDateFormat cTime = new SimpleDateFormat("yyyy-MM-dd");if(works.size() > 0){for(int i = 0; i<works.size(); i++){works.get(i).setCreateTimes(cTime.format(works.get(i).getCreateTime()));}}output(response,JsonUtil.buildJsonByTotalCount(works, count));}//查看兼职@RequestMapping(value="/goFindWork.action")public ModelAndView goFindWork(ModelAndView mv,Work work){SystemUpset systemUpset = new SystemUpset();List<SystemUpset> systemUpsets = systemUpsetService.getSystemUpsetList(systemUpset, null, null);if(systemUpsets.size() > 0){mv.addObject("systemUpset", systemUpsets.get(0));}work = workService.getWorkById(work.getId());mv.addObject("work", work);mv.setViewName("pc/find_work");return mv;}//查看用户资料@RequestMapping(value="/goFindUser.action")public ModelAndView goFindUser(HttpServletRequest request,ModelAndView mv,SystemUpset systemUpset,User user){List<SystemUpset> systemUpsets = systemUpsetService.getSystemUpsetList(systemUpset, null, null);if(systemUpsets.size() > 0){mv.addObject("systemUpset", systemUpsets.get(0));}user = userService.getUserById(user.getUserId());mv.addObject("user", user);User pcUser = (User) request.getSession().getAttribute("pcUser");mv.addObject("pcUser", pcUser);mv.setViewName("pc/user_info");return mv;}//去聊天页面@RequestMapping(value="/goChat.action")public ModelAndView goChat(HttpServletRequest request,ModelAndView mv,SystemUpset systemUpset,User user){List<SystemUpset> systemUpsets = systemUpsetService.getSystemUpsetList(systemUpset, null, null);if(systemUpsets.size() > 0){mv.addObject("systemUpset", systemUpsets.get(0));}user = userService.getUserById(user.getUserId());int userId = user.getUserId();mv.addObject("user", user);//Session信息User pcUser = (User) request.getSession().getAttribute("pcUser");mv.addObject("pcUser", pcUser);if(pcUser == null){mv.setViewName("pc/login");}else if(pcUser.getUserId() == userId){mv.addObject("updatePage", "y");mv.setViewName("pc/index");}else{//更新isLookChat chat = new Chat();chat.setUserIdFa(user.getUserId());chat.setUserIdJie(pcUser.getUserId());chat.setIsLook(1);chatService.updateChat(chat);mv.setViewName("pc/chat");}return mv;}//去论坛页面@RequestMapping(value="/goForum.action")public ModelAndView goForum(HttpServletRequest request,ModelAndView mv, QueryVo vo){User pcUser = (User) request.getSession().getAttribute("pcUser");mv.addObject("pcUser", pcUser);//获取广告Adver adver = new Adver();List<Adver> advers = adverService.getAdverList(adver, null, null);mv.addObject("advers", advers);//获取帖子Page<Forum> page=new Page<Forum>();Forum forum = new Forum();forum.setIsEffect(1);if(vo.getSize()!=10){ vo.setSize(10);}if(vo.getPage()==null){vo.setPage(1);}//每页数page.setSize(vo.getSize());if (vo != null){//判断当前页if(vo.getPage() != null) {page.setPage(vo.getPage());vo.setStartRow((vo.getPage() -1)*vo.getSize());}page.setTotal(forumService.getForumListCount(forum));page.setRows(forumService.getForumList(forum, (vo.getPage()-1) * vo.getSize(), vo.getSize()));}//获取评论ForumReply forumReply = new ForumReply();for(int i=0; i<page.getRows().size(); i++){forumReply.setForumId(page.getRows().get(i).getForumId());page.getRows().get(i).setForumReplys(forumReplyService.getForumReplyList(forumReply, null, null));}mv.addObject("page", page);mv.setViewName("pc/forum");return mv;}//去信箱页面@RequestMapping(value="/goMailbox.action")public ModelAndView goMailbox(HttpServletRequest request,ModelAndView mv,SystemUpset systemUpset){List<SystemUpset> systemUpsets = systemUpsetService.getSystemUpsetList(systemUpset, null, null);if(systemUpsets.size() > 0){mv.addObject("systemUpset", systemUpsets.get(0));}User pcUser = (User) request.getSession().getAttribute("pcUser");mv.addObject("pcUser", pcUser);if(pcUser == null){mv.setViewName("pc/login");}else{mv.setViewName("pc/mailbox");}return mv;}//去发布兼职@RequestMapping(value="/goPublishWork.action")public ModelAndView goPublishWork(HttpServletRequest request,ModelAndView mv,SystemUpset systemUpset){List<SystemUpset> systemUpsets = systemUpsetService.getSystemUpsetList(systemUpset, null, null);if(systemUpsets.size() > 0){mv.addObject("systemUpset", systemUpsets.get(0));}User pcUser = (User) request.getSession().getAttribute("pcUser");mv.addObject("pcUser", pcUser);if(pcUser == null){mv.setViewName("pc/login");}else{mv.setViewName("pc/publish_work");}return mv;}//去公告页面@RequestMapping(value="/goNotice.action")public ModelAndView goNotice(HttpServletRequest request, ModelAndView mv, QueryVo vo){//获取个公告Page<Notice> page=new Page<Notice>();Notice notice = new Notice();if(vo.getSize()!=12){ vo.setSize(12);}if(vo.getPage()==null){vo.setPage(1);}//每页数page.setSize(vo.getSize());if (vo != null){//判断当前页if(vo.getPage() != null) {page.setPage(vo.getPage());vo.setStartRow((vo.getPage() -1)*vo.getSize());}page.setTotal(noticeService.getNoticeListCount(notice));page.setRows(noticeService.getNoticeList(notice, (vo.getPage()-1) * vo.getSize(), vo.getSize()));}mv.addObject("page", page);mv.setViewName("pc/notice");return mv;}//获取公告@RequestMapping(value="/getNotice.action")public void getNotice(Notice notice,HttpServletRequest request,HttpServletResponse response){notice = noticeService.getNoticeById(notice.getId());SimpleDateFormat cTime = new SimpleDateFormat("yyyy-MM-dd");notice.setCreateTimes(cTime.format(notice.getCreateTime()));output(response,JsonUtil.objectToJson(notice));}
}

http://www.ppmy.cn/news/1360289.html

相关文章

探索水下低光照图像检测性能,基于YOLOv3全系列【yolov3tiny/yolov3/yolov3spp】参数模型开发构建海底生物检测识别分析系统

海底这类特殊数据场景下的检测模型开发相对来说比较少&#xff0c;在前面的博文中也有一些涉及&#xff0c;感兴趣的话可以自行移步阅读即可&#xff1a; 《尝试探索水下目标检测&#xff0c;基于yolov5轻量级系列模型n/s/m开发构建海底生物检测系统》 《基于YOLOv5C3CBAMCBA…

PostgreSQL 实体化视图的使用

上周的教程中&#xff0c;通过 DVD Rental Database 示例&#xff0c;让我们了解了在 PostgreSQL 中创建实体化视图的过程。正如我们所了解的&#xff0c;PostgreSQL 实体化视图提供了一种强大的机制&#xff0c;通过预计算和存储查询结果集为物理表来提高查询性能。接下来的内…

音频的“隐形保镖”——音频数字水印

在互联网时代&#xff0c;多媒体数字资源可以快捷地传播和获取&#xff0c;但同时也导致了数字音频产品的非法扩散、非法拷贝和非法篡改猖獗&#xff0c;数字音频产品的完整性和版权保护问题越来越凸显。文档和图像可以添加水印&#xff0c;音频同样可以添加水印&#xff0c;让…

Postgresql源码(123)事务提交时三段资源释放分析ResourceOwnerRelease

0 总结 三段释放原因&#xff1a;因为如果先释放锁&#xff0c;没有释放一些共享资源&#xff08;比如pin住的buffer&#xff09;&#xff0c;别人拿到锁后发现我们仍然持有一些资源&#xff0c;就会有问题。所以三阶段释放主要是以锁为分界线&#xff0c;先释放锁保护的资源&…

idea在工具栏中显示快速创建包和类的图标

一、效果图 点击需要创建包或者类的位置&#xff0c;在点击对用的图标就可以快速创建类或者包了。 二、设置 步骤一 View-->Appearance-->Toolbar 步骤二 File-->Settings-->Appearance & Behavior-->Menus and Toolbars-->Main Toolbar-->----…

【xss跨站漏洞】xss漏洞利用工具beef的安装

安装环境 阿里云服务器&#xff0c;centos8.2系统&#xff0c;docker docker安装 前提用root用户 安装docker yum install docker 重启docker systemctl restart docker beef安装 安装beef docker pull janes/beef 绑定到3000端口 docker run --rm -p 3000:3000 janes/beef …

芯科科技与Arduino携手推动Matter普及化

双方的合作可助力开发人员在两分钟内将新开发板配置入网 致力于以安全、智能无线连接技术&#xff0c;建立更互联世界的全球领导厂商Silicon Labs&#xff08;亦称“芯科科技”&#xff0c;NASDAQ&#xff1a;SLAB&#xff09;日前宣布&#xff0c;公司与开源硬件和软件领域的…

JAVAEE初阶 JVM(一)

JVM的热门话题 一. JVM中的内存区域划分1.经典笔试题. 二. JVM的类加载机制 一. JVM中的内存区域划分 1.经典笔试题. 二. JVM的类加载机制