Java程序员用下班时间给学弟做了一个在线考试系统_使用schema搭建考试后台管理系统(1)

Vue 编码基础

2.1.1. 组件规范

2.1.2. 模板中使用简单的表达式

2.1.3 指令都使用缩写形式

2.1.4 标签顺序保持一致

2.1.5 必须为 v-for 设置键值 key

2.1.6 v-show 与 v-if 选择

2.1.7 script 标签内部结构顺序

2.1.8 Vue Router 规范

Vue 项目目录规范

2.2.1 基础

2.2.2 使用 Vue-cli 脚手架

2.2.3 目录说明

2.2.4注释说明

2.2.5 其他

开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】

这次整合我分了2个配置文件,分别是spring-mybatis.xml,
包含spring和mybatis的配置文件,还有个是spring-mvc的配置文件,
此外有2个资源文件:jdbc.propertis和log4j.properties。

完整目录结构如下:
在这里插入图片描述

二、开发环境

开发语言:Java
技术:JavaWeb【Servlet】
数据库:MySQL
架构:B/S
源码类型: Web
编译工具:Idea、Eclipse、MyEclipse (选其一)
其他:jdk1.8、Tomcat5.7 、Navicat

使用框架的版本:
Spring 3.2.12 RELEASE
Spring MVC 4.0.2 RELEASE
MyBatis 3.2.6

三、系统功能

3.1 考试界面登陆

在这里插入图片描述
在这里插入图片描述

3.2 选择试题

在这里插入图片描述
在这里插入图片描述

3.3 试卷界面

在这里插入图片描述在这里插入图片描述

3.3 后台管理员主界面

在这里插入图片描述

3.4 管理菜单

在这里插入图片描述

3.4.1 学员管理

在这里插入图片描述

3.4.2 套题管理

在这里插入图片描述

3.4.3 试题结构维护

在这里插入图片描述

3.4.3 题库管理

在这里插入图片描述

3.4.5 成绩查询

在这里插入图片描述

3.4.6 考试报告

在这里插入图片描述

四、部分代码展示

4.1.login.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="/base.jsp"%>
<!DOCTYPE html>
<html>
<head>
<!-- Meta -->
<meta charset="utf-8" http-equiv="Content-Type" />
<!-- End of Meta -->
<!-- Page title -->
<title>登录 -${websitemap.web.company}-${websitemap.web.title}</title>
<!-- End of Page title -->
<meta name="author" content="${websitemap.web.author}" />
<meta name="keywords" content="${websitemap.web.keywords}" />
<meta name="description" content="${websitemap.web.description}" />
<link rel="shortcut icon" href="${ctx}/favicon.ico" type="image/x-icon">
<!-- Libraries -->
<link type="text/css" href="${ctx}/static/admin/css/login.css" rel="stylesheet" />
<script type="text/javascript">
	function enterSubmit(event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			$("#loginForm").submit();
			return false;
		}
	}
</script>
</head>
<body>
	<div id="container">
		<div class="logo">
			<a href="javascript:void(0);" onclick="return false;" target="_blank" title="Elearning">
			</a>
		</div>
	</div>

	<div class="b-box">
		<div id="container">
			<div id="box">
				<h2>在线考试后台管理系统</h2>
				<form action="${ctx}/admin/main/login" method="POST" id="loginForm">
					<p class="main">
						<label>用户名: </label>
						<input name="sysUser.loginName" onkeyup="enterSubmit(event)" value="${sysUser.loginName}" placeholder="输入用户名" />
						<label>密码: </label>
						<input type="password" onkeyup="enterSubmit(event)" name="sysUser.loginPwd" value="${sysUser.loginPwd}" placeholder="输入密码">
					</p>
					<p class="main">
						<label>验证码: </label>
						<input name="randomCode" onkeyup="enterSubmit(event)" placeholder="验证码" style="width: 105px;"  maxlength="4"/>
						<span class="yzm-pic">
							<img src="${ctx}/ran/random" alt="验证码,点击图片更换" onclick="this.src='${ctx}/ran/random?random='+Math.random();" />
						</span>
					</p>
					<p class="space">
						<input type="submit" value="登录" class="login" />
						<span>${message}</span>
					</p>
				</form>
			</div>
			<div class="login-foot">
				<span>
					Powered By <a target="_blank" href="#" style="color: #666;">IT邦德</a>
				</span>
			</div>
		</div>
	</div>
</body>
</html>

4.2 修改学员信息

4.2 .1 Controller
/**
	 * 修改学员信息
	 */
	@RequestMapping("/updateUserInfo")
	@ResponseBody
	public Map<String, Object> updateUserInfo(HttpServletRequest request,
			@ModelAttribute("user") User user) {
		Map<String, Object> json = new HashMap<String, Object>();
		try {
			if (user.getUserId() > 0) {
				if (user.getShowName() == null || user.getShowName() == "") {
					json = this.setJson(false, "姓名不能为空!", null);
					return json;
				}
				if (user.getEmail() != null
						&& user.getEmail().trim().length() > 0
						&& !WebUtils.checkEmail(user.getEmail(), 50)) {
					json = this.setJson(false, "请输入正确的邮箱号", null);
					return json;
				}
				if (user.getMobile() != null
						&& user.getMobile().trim().length() > 0
						&& !WebUtils.checkMobile(user.getMobile())) {
					json = this.setJson(false, "请输入正确的电话号", null);
					return json;
				}
				SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
				String startDate=user.getStartDate();
				user.setShiftTime(sdf.parse(startDate));
				userService.updateUser(user);
				json = this.setJson(true, "学员修改成功", null);
			} else {
				json = this.setJson(false, "修改失败", null);
			}
		} catch (Exception e) {
			this.setAjaxException(json);
			logger.error("udpateUser()--error", e);
		}
		return json;
	}

4.2.2 Service
public interface UserService {
	/**
	 * 创建用户
	 * @param user
	 * @return 返回用户ID
	 */
	public int createUser(User user);
	
	/**
	 * 通过用户ID查询用户
	 * @param userId 用户不D
	 * @return User
	 */
	public User queryUserById(int userId);
	
	
	/**
	 * 检测用户工号是否存在 
	 * @param username 工号
	 * @return  true存在 false不存在 
	 */
	public boolean checkuserName(String username);
	
	/**
	 * 检测手机是否存在 
	 * @param mobile 手机号
	 * @return true存在 false不存在 
	 */
	public boolean checkMobile(String mobile);

4.2.3 ServiceImpl
@Service("userService")
public class UserServiceImpl implements UserService{

	@Autowired
	private UserDao userDao;
	
	@Autowired
	private SysDictService sysDictService;
	
	@Autowired
	private UserGroupService userGroupService;

	public int createUser(User user) {
		return userDao.createUser(user);
	}

	
	public User queryUserById(int userId) {
		return userDao.queryUserById(userId);
	}

	
	public boolean checkMobile(String mobile) {
		int count = userDao.checkMobile(mobile);
		if(count>0){
			return true;
		}
		return false;
	}
	
	public boolean checkuserName(String username) {
		int count = userDao.checkuserName(username);
		if(count>0){
			return true;
		}
		return false;
	}

4.2.4 dao
public interface UserDao {
	/**
	 * 创建用户
	 * @param user
	 * @return 返回用户ID
	 */
	public int createUser(User user);
	
	/**
	 * 通过用户ID查询用户
	 * @param userId 用户不D
	 * @return User
	 */
	public User queryUserById(int userId);
	
	/**
	 * 检测手机是否存在 
	 * @param mobile 手机号
	 * @return 返回记录数
	 */
	public int checkMobile(String mobile);
	
	
	/**
	 * 检测工号是否存在 
	 * @param username 工号
	 * @return 返回记录数
	 */
	public int checkuserName(String username);
	/**
	 * 检测邮箱号是否存在 
	 * @param email 邮箱号
	 * @return 返回记录数
	 */
	public int checkEmail(String email);

4.2.5 UserMapper
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="UserMapper">

	
	<!-- 分页查询用户列表,开始 -->
	<select id="queryUserListPage" parameterType="java.util.Map" resultMap="UserResult">
	SELECT <include refid="edu_user_column"/> FROM EDU_USER 
	<where>
		<if test="e.isavalible>0">
		EDU_USER.IS_AVALIBLE=#{e.isavalible}
		</if>
	    <if test="e.usergroup!=null and e.usergroup!=''">
		AND (EDU_USER.USERGROUP LIKE CONCAT('%',#{e.usergroup},'%'))
		</if>
		<if test="e.keyWord!=null and e.keyWord!=''">
		AND (EDU_USER.MOBILE LIKE CONCAT('%',#{e.keyWord},'%') OR EDU_USER.EMAIL LIKE CONCAT('%',#{e.keyWord},'%') OR EDU_USER.USER_NAME LIKE CONCAT('%',#{e.keyWord},'%') OR EDU_USER.SHOW_NAME LIKE CONCAT('%',#{e.keyWord},'%'))
		</if>
		<if test="e.beginCreateTime!=null and e.beginCreateTime!=''">
			AND EDU_USER.CREATE_TIME >= #{e.beginCreateTime}
		</if>
		<if test="e.endCreateTime!=null and e.endCreateTime!=''">
			AND <![CDATA[EDU_USER.CREATE_TIME <= #{e.endCreateTime}]]>
		</if>
	</where>
	<include refid="publicMapper.pageEnd"/>
	</select>
	<select id="queryUserListPageCount" parameterType="java.util.Map" resultType="int">
	SELECT COUNT(1) FROM EDU_USER 
	<where>
		<if test="e.isavalible>0">
		EDU_USER.IS_AVALIBLE=#{e.isavalible}
		</if>
	    <if test="e.usergroup!=null and e.usergroup!=''">
		AND (EDU_USER.USERGROUP LIKE CONCAT('%',#{e.usergroup},'%'))
		</if>
		<if test="e.keyWord!=null and e.keyWord!=''">
		AND (EDU_USER.MOBILE LIKE CONCAT('%',#{e.keyWord},'%') OR EDU_USER.EMAIL LIKE CONCAT('%',#{e.keyWord},'%') OR EDU_USER.USER_NAME LIKE CONCAT('%',#{e.keyWord},'%') OR EDU_USER.SHOW_NAME LIKE CONCAT('%',#{e.keyWord},'%'))
		</if>
		<if test="e.beginCreateTime!=null and e.beginCreateTime!=''">
			AND EDU_USER.CREATE_TIME >= #{e.beginCreateTime}
		</if>
		<if test="e.endCreateTime!=null and e.endCreateTime!=''">
			AND <![CDATA[EDU_USER.CREATE_TIME <= #{e.endCreateTime}]]>
		</if>
	</where>
	</select>
	<!-- 分页查询用户列表,结束-->	
	<select id="queryUserByUserName" parameterType="java.lang.String" resultMap="UserResult">
	SELECT <include refid="edu_user_column"/> FROM EDU_USER
	<where>
		EDU_USER.USER_NAME = #{value}
	</where>
	</select>
	
	<!-- 冻结或解冻用户 -->
	<update id="updateUserStates" parameterType="User">
	UPDATE EDU_USER SET EDU_USER.IS_AVALIBLE=#{isavalible} WHERE EDU_USER.USER_ID=#{userId}
	</update>
	
	<!-- 修改用户信息 -->
	<update id="updateUser" parameterType="User">
	UPDATE EDU_USER SET 
	EDU_USER.SHOW_NAME=#{showName},
	EDU_USER.USERGROUP=#{usergroup},
	EDU_USER.SECTION=#{section},
	EDU_USER.EMAIL=#{email},
	EDU_USER.MOBILE=#{mobile},
	EDU_USER.SEX=#{sex},
	EDU_USER.AGE=#{age},
	EDU_USER.SHIFT_DATE=#{shiftTime},
	EDU_USER.FREQUENCY=#{frequency}
	WHERE EDU_USER.USER_ID=#{userId}
	</update>
	
	<!-- 修改用户头像 -->
	<update id="updateImg" parameterType="User">
	UPDATE EDU_USER SET 
	EDU_USER.PIC_IMG=#{picImg}
	WHERE EDU_USER.USER_ID=#{userId}
	</update>
	
	<!-- 修改个中心个性化图片URL -->
	<update id="updateUserBannerUrl" parameterType="User">
	UPDATE EDU_USER SET BANNER_URL=#{bannerUrl} WHERE USER_ID=#{userId}
	</update>
	
	<!-- 查询所有学员记录数 -->
	<select id="queryAllUserCount" resultType="int">
	SELECT COUNT(1) FROM EDU_USER
	</select>
	
	<!-- 通过手机号或邮箱号查询用户信息 -->
	<select id="queryUserByEmailOrMobile" parameterType="java.lang.String" resultMap="UserResult">
	SELECT <include refid="edu_user_column"/> FROM EDU_USER WHERE EMAIL=#{value} OR MOBILE=#{value} LIMIT 1
	</select>
	
	<!-- 根据多个用户id获取用户信息 -->
	<select id="queryCustomerInCusIds" parameterType="java.util.HashMap" resultMap="UserResult">
		select
		<include refid="edu_user_column"/>
		from EDU_USER 
		where EDU_USER.USER_ID in
		<foreach collection="list" index="index" item="item" open="(" separator="," close=")">  
        	#{item}  
   		</foreach>  
	</select>
	<select id="getUserListPage" resultMap="UserResult" parameterType="java.util.HashMap">
		select
		<include refid="edu_user_column" />
		from edu_user
		<where>
			<if test="e.userId !=null and e.userId > 0 ">
				AND EDU_USER.USER_ID = #{e.userId}
			</if>
			<if test="e.email !=null and e.email !='' ">
				AND EDU_USER.EMAIL like CONCAT('%',#{e.email},'%')
			</if>
			<if test="e.mobile !=null and e.mobile !='' ">
				AND EDU_USER.MOBILE like CONCAT('%',#{e.mobile},'%')
			</if>
			<if test="e.userName !=null and e.userName !='' ">
				AND EDU_USER.USER_NAME like CONCAT('%',#{e.userName},'%')
			</if>
			<if test="e.showName !=null and e.showName !='' ">
				AND EDU_USER.SHOW_NAME like CONCAT('%',#{e.showName},'%')
			</if>
			<if test="e.sex !=null and e.sex > 0 ">
				AND EDU_USER.SEX=#{e.sex}
			</if>
		</where>
		order by EDU_USER.USER_ID desc
		<include refid="publicMapper.pageEnd" />
	</select>
	<select id="getUserListPageCount" resultType="int" parameterType="java.util.HashMap">
		select
		count(1)
		from edu_user
		<where>
			<if test="e.userId !=null and e.userId > 0 ">
				AND EDU_USER.USER_ID = #{e.userId}


### 总结

面试前要精心做好准备,简历上写的知识点和原理都需要准备好,项目上多想想难点和亮点,这是面试时能和别人不一样的地方。

还有就是表现出自己的谦虚好学,以及对于未来持续进阶的规划,企业招人更偏爱稳定的人。

万事开头难,但是程序员这一条路坚持几年后发展空间还是非常大的,一切重在坚持。



**[开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】](https://bbs.csdn.net/topics/618166371)**

**前端面试题汇总**

![](https://img-blog.csdnimg.cn/img_convert/42728594459506983a38ca2b86545fc6.png)

**JavaScript**

![](https://img-blog.csdnimg.cn/img_convert/7796de226b373d068d8f5bef31e668ce.png)

**前端资料汇总**

![](https://img-blog.csdnimg.cn/img_convert/6e0ba223f65e063db5b1b4b6aa26129a.png)

  • 3
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值