基于javaweb的SpringBoot校园运动会管理系统(java+springboot+vue+elementui+mysql+maven)

运行环境

Java≥8、MySQL≥5.7、Node.js≥14

开发工具

后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可

❗没学过node.js的不要搞前后端分离项目

适用

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

功能说明

372323411807

382323411807

392323411807

402323411807

412323411807

432323411807

基于javaweb的SpringBoot校园运动会管理系统(java+springboot+vue+elementui+mysql+maven)

1
2
3
4
5
6
7
管理员
admin 123456


学生
201234567892 123456

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 4.数据库:MySql 5.7/8.0版本均可; 5.是否Maven项目:是;

技术栈

1.后端:SpringBoot+Mybaits 2.前端:Vue +ElementUI +HTML+CSS+JS

使用说明

项目运行: 1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;

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
        LambdaQueryWrapper<Competition> wrapper = Wrappers.<Competition>lambdaQuery();
if (StrUtil.isNotBlank(search)) {
wrapper.like(Competition::getCompetitionNb, search);
}
Page<Competition> competitionPage = competitionMapper.selectPage(new Page<>(PageNum, PageSize), wrapper);
return Result.success(competitionPage);
}

/**
* 根据时间段,名字模糊查询
*
* @param PageNum
* @param PageSize
* @param competitionNe
* @param competitionStart
* @param competitionEnd
* @return
*/
@GetMapping("/selectByNb")
public Result<?> selectByNb(@RequestParam(defaultValue = "1") Integer PageNum,
@RequestParam(defaultValue = "20") Integer PageSize,
String competitionNe, String competitionStart, String competitionEnd) {
// Page<Competition> competitionPage = competitionMapper.selectByNb(new Page<>(PageNum, PageSize), competitionNe,competitionStart,competitionEnd);
Page<Competition> competitionPage = competitionService.selectByNb(new Page<>(PageNum, PageSize), competitionNe, competitionStart, competitionEnd);
return Result.success(competitionPage);
// return Result.success(competitionService.selectByNb(PageNum, PageSize, competitionNe,competitionStart,competitionEnd));

}

/**
* 比赛增加
*
* @param competition
* @return
*/
@PostMapping("/insertCompetition")
public Result<?> insert(@RequestBody Competition competition) {
Competition competitionN = competitionMapper.selectOne(Wrappers.<Competition>lambdaQuery().eq(Competition::getCompetitionNb, competition.getCompetitionNb()));
if (competitionN != null) {
return Result.error("-1", "比赛编号已存在");
} else {
Competition icompetition = new Competition();
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
44


@Api
@RestController
@RequestMapping("/role")
public class RoleController {

@Autowired
RoleService roleService;

@Resource
RoleMapper roleMapper;

/**
* 查询角色权限表
*
* @param PageNum
* @param PageSize
// * @param search
* @return
*/
@GetMapping("/search")
public Result<?> selectEnroll(@RequestParam(defaultValue = "1") Integer PageNum,
@RequestParam(defaultValue = "100") Integer PageSize,
String usersStnumber, String usersName) {
// LambdaQueryWrapper<Role> wrapper = Wrappers.<Role>lambdaQuery();
Page<Role> rolePage = roleService.selectEnroll(new Page<>(PageNum, PageSize),usersStnumber,usersName);
return Result.success(rolePage);
}


/**
* 角色权限表新增
*
* @param role
* @return
*/
@PostMapping("/addR")
public Result<?> addR(Role role) {
roleService.addR(role);
return Result.success("成功");
}

/**
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
44
45
46
47
48
@Autowired
CompetitionService competitionService;

@Autowired
EnrollService enrollService;

@Autowired
ApplicationformService applicationformService;

@Autowired
UsersService usersService;

@Resource
CompetitionMapper competitionMapper;

/**
* 比赛信息分页查询
*
* @param PageNum
* @param PageSize
* @param search
* @return
*/
@GetMapping("/search")
public Result<?> findPage(@RequestParam(defaultValue = "1") Integer PageNum,
@RequestParam(defaultValue = "100") Integer PageSize,
@RequestParam(defaultValue = "") String search) {
LambdaQueryWrapper<Competition> wrapper = Wrappers.<Competition>lambdaQuery();
if (StrUtil.isNotBlank(search)) {
wrapper.like(Competition::getCompetitionNb, search);
}
Page<Competition> competitionPage = competitionMapper.selectPage(new Page<>(PageNum, PageSize), wrapper);
return Result.success(competitionPage);
}

/**
* 根据时间段,名字模糊查询
*
* @param PageNum
* @param PageSize
* @param competitionNe
* @param competitionStart
* @param competitionEnd
* @return
*/
@GetMapping("/selectByNb")
public Result<?> selectByNb(@RequestParam(defaultValue = "1") Integer PageNum,
@RequestParam(defaultValue = "20") Integer PageSize,
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
        draft.setDraftState(draftState);
draftService.updateState(draft);
return Result.success();
}

/**
* 根据id删除
*
* @param draftId
* @return
*/
@DeleteMapping("/delete")
public Result<?> delete(Integer draftId) {
draftMapper.deleteById(draftId);
return Result.success();
}

/**
* 增加
* @param draft
* @return
*/
@PostMapping("/insertDraft")
public Result<?> insert(@RequestBody Draft draft) {
draftMapper.insert(draft);
return Result.success();
}

}



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
44
45
46
47
48
49
50
    @GetMapping("/search")
public Result<?> findPage(@RequestParam(defaultValue = "1") Integer PageNum,
@RequestParam(defaultValue = "100") Integer PageSize,
@RequestParam(defaultValue = "") String search) {
LambdaQueryWrapper<College> wrapper = Wrappers.<College>lambdaQuery();
if (StrUtil.isNotBlank(search)) {
wrapper.like(College::getCollegeNumber, search);
// wrapper.like(Student::getStuGrade,search);
}
// Wrappers.<Book> lambdaQuery().like(Book::getNickName,search)
Page<College> collegePage = collegeMapper.selectPage(new Page<>(PageNum, PageSize), wrapper);
return Result.success(collegePage);
}

/**
* 学院增加
*
* @param college
* @return
*/
@PostMapping("/insertCollege")
public Result<?> insert(College college) { //加@RequestBody会不兼容
College collegeNb = collegeMapper.selectOne(Wrappers.<College>lambdaQuery().eq(College::getCollegeNumber, college.getCollegeNumber()));
College collegeNe = collegeMapper.selectOne(Wrappers.<College>lambdaQuery().eq(College::getCollegeName, college.getCollegeName()));
if (collegeNb != null) {
return Result.error("-1", "学院编号已存在");
}
if (collegeNe != null) {
return Result.error("-2", "学院名称已存在");
}
collegeMapper.insert(college);
System.out.println("222");
return Result.success();
}

/**
* 学院删除
*
* @param collegeName
* @return
*/
@GetMapping("/deleteCollege")
public Result<?> delete(String collegeName) {
// List map = collegeService.selectUsersCollegeName(collegeName); //查询用户列表
List<Users> iusers = usersService.selectUsersCollege(collegeName);
collegeService.deleteCollege(collegeName); //删除学院
for (int i=0;i<iusers.size();i++){
System.out.println(i+" "+iusers.get(i).getUsersStnumber());
usersService.delete(iusers.get(i).getUsersStnumber()); //删除用户
roleService.deleteByUsersStnumber(iusers.get(i).getUsersStnumber()); //删除角色
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
     */
@PostMapping("/insertCompetition")
public Result<?> insert(@RequestBody Competition competition) {
Competition competitionN = competitionMapper.selectOne(Wrappers.<Competition>lambdaQuery().eq(Competition::getCompetitionNb, competition.getCompetitionNb()));
if (competitionN != null) {
return Result.error("-1", "比赛编号已存在");
} else {
Competition icompetition = new Competition();
icompetition.setCompetitionNb(competition.getCompetitionNb());
icompetition.setCompetitionNe(competition.getCompetitionNe());
icompetition.setCompetitionSite(competition.getCompetitionSite());
icompetition.setCompetitionPe(competition.getCompetitionPe());
icompetition.setCompetitionTnor(competition.getCompetitionPe());
icompetition.setCompetitionStart(competition.getCompetitionStart());
icompetition.setCompetitionEnd(competition.getCompetitionEnd());
icompetition.setApplyStart(competition.getApplyStart());
icompetition.setApplyEnd(competition.getApplyEnd());
competitionService.addCompetition(icompetition);
// competitionMapper.insert(competition);
System.out.println("222");
return Result.success();
}
}

/**
* 比赛编号修改
*
* @param cn
* @return
*/
@PutMapping("/updateScore")
public Result<?> update(Competition cn) {
competitionMapper.updateById(cn);
return Result.success();
}

/**
* 比赛编号删除
*
* @param competitionNb


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