基于javaweb的SpringBoot高校学生社团活动管理系统(java+springboot+freemark+jpa+mysql+maven)

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

290023302402

300023302402

310023302402

320023302402

330023302402

基于javaweb的SpringBoot高校学生社团活动管理系统(java+springboot+freemark+jpa+mysql+maven)

前台:

1、社团信息浏览搜索、社团活动风采、新闻信息浏览搜索。

2、学生注册登录。

3、登录后可自己申请创建社团,也可申请加入其他社团活动。

4、管理自己社团的申请人员。

5个人信息修改及留言等。

后台:

后台管理员除了基本的系统管理功能(脚手架里的功能,这里不赘述)外,还有社团审核管理、活动新闻管理、学生管理、留言管理、活动申请审核、活动经费管理等等。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
}
package com.jinku.jsj.springboot.controller.admin;

/**
* 后台角色管理控制器
*/



@RequestMapping("/admin/role")
@Controller
public class RoleController {

@Autowired
private MenuService menuService;
private Logger log= LoggerFactory.getLogger(RoleController.class);
@Autowired
private OperaterLogService operaterLogService;
@Autowired
private RoleService roleService;

/**
* 分页搜索角色列表
* @param model
* @param role
* @param pageBean
* @return
*/
@RequestMapping(value = "/list")
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
      //查询风采
List<Style> style = styleService.findAllByTime();
model.addAttribute("StyleList",style.size()>6?style.subList(0,6):style);
//查询社团
List<Association> association = associationService.findAll();
model.addAttribute("associationList",association);
//查询推荐活动
List<Activities> activitiesRun = activitiesService.findByIsRun();
model.addAttribute("activitiesRunList",activitiesRun);
return "home/index/index";
}

/**
* 前台登录页面
* @param model
* @return
*/
@RequestMapping(value = "/login",method = RequestMethod.GET)
public String login(Model model){
return "home/index/login";
}


/**
* 前台登陆提交
* @param model
* @param loginName
* @param password
* @return
*/
@RequestMapping(value="/login",method=RequestMethod.POST)
@ResponseBody
public Result<Boolean> login(Model model, @RequestParam(name = "loginName")String loginName,
@RequestParam(name = "password")String password) {
Student byLoginName = studentService.findByLoginName(loginName);
//判断学生是否存在
if(byLoginName==null){
return Result.error(CodeMsg.HOME_STUDENT_ISEXIST_ERROR);
}
//判断学生密码是否正确
if(!byLoginName.getLoginPassword().equals(password)){
return Result.error(CodeMsg.HOME_STUDENT_PASSWORD_ERROR);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

@RequestMapping("/system")
@Controller
public class SystemController {
@Autowired
private SiteConfig siteConfig;
@Autowired
private OperaterLogService operaterLogService;
@Autowired
private UserService userService;
private Logger log= LoggerFactory.getLogger(SiteConfig.class);

@Autowired
private SmsService smsService;

@Autowired
private AssociationService associationService;

@Autowired
private ActivitiesService activitiesService;

@Autowired
private StyleService styleService;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

@Autowired
private MenuService menuService;

@Autowired
private OperaterLogService operaterLogService;

@RequestMapping(value = "/list")
public String list(Model model) {
List<Menu> all = menuService.findAll();
model.addAttribute("title","菜单列表");
model.addAttribute("topMenus", MenuUtil.getTopMenus(all));
model.addAttribute("secondMenus", MenuUtil.getSecondMenus(all));
model.addAttribute("thirdMenus", MenuUtil.getThirdMenus(all));
return "admin/menu/list";
}

/**
* 菜单添加页面
* @param model
* @return
*/
@RequestMapping(value = "/add",method = RequestMethod.GET)
public String add(Model model) {
List<Menu> all = menuService.findAll();
model.addAttribute("title","菜单列表");
model.addAttribute("topMenus", MenuUtil.getTopMenus(all));
model.addAttribute("secondMenus", MenuUtil.getSecondMenus(all));
model.addAttribute("menus",menuService.findAll());
return "admin/menu/add";
}

/**
* 菜单添加提交表单处理
* @param menu
* @return
*/
@ResponseBody
@RequestMapping(value = "/add",method = RequestMethod.POST)
public Result<Boolean> add(Menu menu) {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
        if (financialService.save(findbyId) == null) {
return Result.error(CodeMsg.ADMIN_FINANCIAL_EDIT_ERROR);
}
operaterLogService.add("编辑财务,财务活动编号:" + financial.getActId());
return Result.success(true);
}


/**
* 财务删除
* @param ids
* @return
*/
@ResponseBody
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public Result<Boolean> delete(@RequestParam(name = "ids", required = true) String ids) {
if (!StringUtils.isEmpty(ids)) {
String[] splitIds = ids.split(",");
for (String id : splitIds) {
Financial financial = financialService.find(Long.valueOf(id));
if (financial != null) {
try {
financialService.delete(Long.valueOf(id));
operaterLogService.add("删除财务,id为:" + id);
}catch (Exception e){
return Result.error(CodeMsg.ADMIN_FINANCIAL_DELETE_ERROR);
}
}

}

}
return Result.success(true);
}



}
package com.jinku.jsj.springboot.controller.admin;


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
}

@RequestMapping("/uploadJson")
@ResponseBody
public void uploadJson(HttpServletRequest request, HttpServletResponse response, String dir) throws Exception {
response.setContentType("application/json; charset=UTF-8");
PrintWriter out = response.getWriter();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
//文件保存的目录路径
String savePath = UploadPhotoPath + StringUtil.getFormatterDate(new Date(), "yyyy-MM-dd");
//文件保存目录url
HashMap<String, String> extMap = new HashMap<String, String>();
extMap.put("image", "gif,jpg,jpeg,png,bmp");
extMap.put("flash", "swf,flv");
extMap.put("media", "swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb,mp4");
extMap.put("file", "doc,docx,xls,xlsx,ppt,htm,html,txt,zip,rar,gz,bz2,pdf");
//最大的文件大小
long maxSize = 1000000;
response.setContentType("text/html; charset=UTF-8");
if (!ServletFileUpload.isMultipartContent(request)) {
out.println(getError("请选择文件。"));
return;
}
//检查目录
File uploadDir = new File(UploadPhotoPath);
if(!uploadDir.exists()){
//若不存在文件夹,则创建一个文件夹
uploadDir.mkdir();
}
File file = new File(savePath);
if(!file.exists()){
file.mkdir();
}
//检测目录写权限
if(!file.canWrite()){
out.println(getError("上传目录没有写权限。"));
return;
}
String dirName = request.getParameter("dir");
if(dirName==null){
dirName="image";
}


项目链接:
https://javayms.github.io?id=061422332105200lp
https://javayms.pages.dev?id=061422332105200lp