基于javaweb的SSM考试在线报名管理系统(java+ssm+js+jsp+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

090023172402

100023172402

110023172402

120023172402

140023172402

160023172402

基于javaweb的SSM考试在线报名管理系统(java+ssm+js+jsp+mysql)

项目介绍

考务管理员角色包含以下功能: 考务管理员登录,教务办公室管理,考场管理,考试管理,考场分配管理,报名管理等功能。

管理员角色包含以下功能: 管理员登录,学院管理,班级管理,学生管理,考务管理员管理,管理员管理等功能。

学生角色包含以下功能: 学生登录,查看我的报名,报名考试,密码修改,缴费等功能。

环境需要

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

技术栈

  1. 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp

使用说明

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

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
/**
* @MethodName : fillSheet
* @Description : 向工作表中填充数据
* @param sheet
* 工作表
* @param list
* 数据源
* @param fieldMap
* 中英文字段对应关系的Map
* @param firstIndex
* 开始索引
* @param lastIndex
* 结束索引
*/
private static <T> void fillSheet(WritableSheet sheet, List<T> list, LinkedHashMap<String, String> fieldMap, int firstIndex, int lastIndex)
throws Exception {

// 定义存放英文字段名和中文字段名的数组
String[] enFields = new String[fieldMap.size()];
String[] cnFields = new String[fieldMap.size()];

// 填充数组
int count = 0;
for (Entry<String, String> entry : fieldMap.entrySet()) {
enFields[count] = entry.getKey();
cnFields[count] = entry.getValue();
count++;
}
// 填充表头
for (int i = 0; i < cnFields.length; i++) {
Label label = new Label(i, 0, cnFields[i]);
sheet.addCell(label);
}

// 填充内容
int rowNo = 1;
for (int index = firstIndex; index <= lastIndex; index++) {
// 获取单个对象
T item = list.get(index);
for (int i = 0; i < enFields.length; i++) {
Object objValue = getFieldValueByNameSequence(enFields[i], item);
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
}

@RequestMapping(value = "/feeExamStudent.do")
public String feeExamStudent(int uid) {
try {
ExamStudent bean = service.get(uid);
bean.setStatus("已缴费");
bean.setZunid(new Date().getTime() + "");

ExamRoom t = new ExamRoom();
t.setExamId(bean.getExamId());
List<ExamRoom> list = examRoomService.selectAll(t);

if (list.size() == 0) {
MessageUtil.addMessage(request, "操作失败.当前没有考场分配,请联系考务管理员");
return ERROR;
}

Collections.shuffle(list);

Room room = null;
for (int i = 0; i < list.size(); i++) {
ExamRoom er = list.get(i);

ExamStudent tt = new ExamStudent();
tt.setExamId(bean.getExamId());
tt.setRoomId(er.getRoomId());
List<ExamStudent> eslist = service.selectAll(tt);
if (eslist.size() < er.getRoom().getMaxSite()) {
room = er.getRoom();
break;
}
}
if (room == null) {
MessageUtil.addMessage(request, "操作失败.考场已满,请联系考务管理员");
return ERROR;
}
bean.setRoomId(room.getId());

service.update(bean);
MessageUtil.addRelMessage(request, "操作成功.", "mainquery");
return SUCCESS;
} catch (Exception e) {
e.printStackTrace();
MessageUtil.addMessage(request, "操作失败.");
return ERROR;
}
}

@RequestMapping(value = "/deleteExamStudent.do")
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

public class FileUtil {
private static List<String> exts = new ArrayList<String>();
static {
exts.add("image/jpeg");
}

public static String readFile(String filepath, String encoding) {
String ret = "";

//File file = new File(filepath);
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(filepath), encoding));
String tempString = null;
while ((tempString = reader.readLine()) != null) {
ret += tempString;
}
reader.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (reader != null) {
try {
reader.close();
} catch (IOException e1) {
}
}
}

return ret;
}

public static boolean fileUploadAble(String ext) {
// return exts.contains(ext);
return true;
}

public static boolean isImage(String name) {
return name.endsWith(".jpg") || name.endsWith(".jpeg") || name.endsWith(".png");
}

public static boolean isVideo(String name) {
return name.endsWith(".mp4");
}

public static String getExt(String name) {
int index = name.lastIndexOf('.');
if (index > 0) {
return name.substring(index);
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
		scope.put(navTabId, "navTab");
} else {
scope.put(navTabId, rel);
}
}
public static void addRelMessage(HttpServletRequest scope, String message,
String rel) {
scope.setAttribute(messageKey, message);
if (StringUtil.isEmpty(rel)) {
scope.setAttribute(navTabId, "navTab");
} else {
scope.setAttribute(navTabId, rel);
}
}
/**
* unixbox 局部刷新中提交后刷新父页面
* @param scope
* @param message
* @param rel
*/
public static void addRelMessage(Map<String, Object> scope, String message,
String rel) {
scope.put(messageKey, message);
scope.put("rel", rel);
}

public static void addForwardUrl(Map<String, Object> scope, String url) {
if (StringUtil.notEmpty(url)) {
scope.put(forwardUrlKey, url);
scope.put(callbackType, "forward");
}
}

public static void addMessages(Map<String, Object> scope, String message,
String url) {
scope.put(messageKey, message);
addForwardUrl(scope, url);
}

/**
* 关闭当前标签
*
* @param scope
* @param message
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




@Controller
@RequestMapping("/sys")
public class ClazzAction extends BaseAction {
private String actionname = "班级";
private String actionclass = "Clazz";
@Autowired
private ClazzService service;

@RequestMapping(value = "/add2Clazz.do")
public String add2() {
request.setAttribute("actionname", actionname);
request.setAttribute("actionclass", actionclass);
return "addClazz";
}

@RequestMapping(value = "/getClazz.do")
public String get(int uid) {
try {
Clazz bean = service.get(uid);
request.setAttribute("modifybean", bean);

request.setAttribute("actionname", actionname);
request.setAttribute("actionclass", actionclass);
return "modifyClazz";
} catch (Exception e) {
e.printStackTrace();
MessageUtil.addMessage(request, "获取信息失败.");
return ERROR;
}
}

@RequestMapping(value = "/deleteClazz.do")
public String delete(String ids) {
try {
service.deleteAll(ids);
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
@RequestMapping(value = "/getExamStudent.do")
public String get(int uid) {
try {
putRequestValue("list1", examService.selectAll());
ExamStudent bean = service.get(uid);
request.setAttribute("modifybean", bean);

request.setAttribute("actionname", actionname);
request.setAttribute("actionclass", actionclass);
return "modifyExamStudent";
} catch (Exception e) {
e.printStackTrace();
MessageUtil.addMessage(request, "获取信息失败.");
return ERROR;
}
}

@RequestMapping(value = "/checkExamStudent.do")
public String checkExamStudent(String status, int uid) {
try {
ExamStudent bean = service.get(uid);
bean.setStatus(status.equals("1") ? "审核通过" : "审核失败");
service.update(bean);
MessageUtil.addRelMessage(request, "操作成功.", "mainquery");
return SUCCESS;
} catch (Exception e) {
e.printStackTrace();
MessageUtil.addMessage(request, "操作失败.");
return ERROR;
}
}

@RequestMapping(value = "/feeExamStudent.do")
public String feeExamStudent(int uid) {
try {
ExamStudent bean = service.get(uid);
bean.setStatus("已缴费");
bean.setZunid(new Date().getTime() + "");

ExamRoom t = new ExamRoom();
t.setExamId(bean.getExamId());


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