Java项目:学生考勤管理系统(java+Springboot+Mybaits+ElementUI+Vue+Mysql)
项目介绍基于SpringBoot Vue的学生考勤管理系统角色:管理员、教师、学生管理员:管理员登录进入系统可以查看首页,个人中心,学生管理,教师管理,班级信息管理,课程信息管理,签到信息管理,考勤信息管理,请假信息管理,考勤统计管理等功能教师:教师登录进入系统可以查看首页,个人中心,学生管理,班级信息管理,课程信息管理,签到信息管理,考勤信息管理,请假信息管理,考勤统计管理等功能学生: 学生登录
源码获取:俺的博客首页 "资源" 里下载!
项目介绍
基于SpringBoot Vue的学生考勤管理系统
角色:管理员、教师、学生
管理员:管理员登录进入系统可以查看首页,个人中心,学生管理,教师管理,班级信息管理,课程信息管理,签到信息管理,考勤信息管理,请假信息管理,考勤统计管理等功能
教师:教师登录进入系统可以查看首页,个人中心,学生管理,班级信息管理,课程信息管理,签到信息管理,考勤信息管理,请假信息管理,考勤统计管理等功能
学生: 学生登录进入系统可以查看首页,个人中心,班级信息管理,课程信息管理,签到信息管理,考勤信息管理,请假信息管理,考勤统计管理等功能
环境需要
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项目:是;
技术栈
后端: SpringBoot+Mybaits
前端:Vue +ElementUI
使用说明
项目运行:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,控制台提示运行成功后再去运行前端项目;
5. 管理员用户名密码:admin/admin
普通用户名密码:user/123456
用户管理控制层:
@RestController
@RequestMapping("/user")
public class AccountController {
@Autowired
private UserService userService;
@Autowired
private DataService dataService;
/**
* 注册
* @param user
* @return
*/
@PostMapping("/register")
public String register(@RequestBody User user) {
String username = user.getUsername();
String choice = user.getChoice();
String checkChoice = dataService.getChoice(username);
if(checkChoice.equals("empty")) {
// 学生信息不存在,请核对信息或者先进行录入
return "empty";
}else {
if(choice.equals(checkChoice)) {
// 学生姓名和学号与真实对应,可进行注册
return userService.insertUser(user);
}else {
// 选择用户错误
return "error";
}
}
}
/**
* 登录
* @param user
* @return
*/
@PostMapping("/login")
public String login(@RequestBody User user) {
String username = user.getUsername();
String password = user.getPassword();
String check = user.getChoice();
User test = userService.findAllByUsername(username);
if(test != null){
String choice = test.getChoice();
String encrypassword = test.getPassword();
if (check.equals(choice)) {
String matches = userService.matchesEncoder(password, encrypassword);
return matches;
}else {
return "check";
}
}else {
if(username.equals("admin")||username.equals("Admin")){
return userService.loginAdmin(user);
} else {
return "empty";
}
}
}
/**
* 通过旧密码或者验证码修改密码
* @param user
* @return
*/
@PostMapping("/updatePassword")
public String updatePassword(@RequestBody User user) {
String username = user.getUsername();
String check = user.getChoice();//前端输入的密码或验证码
String newpassword = user.getPassword();
User test = userService.findAllByUsername(username);
if(test != null){
String oldpassword = test.getPassword();
String oldverifyCode = test.getVerifyCode();
String passwordMatches =userService.matchesEncoder(check, oldpassword);
String verifyCodeMatches =userService.matchesEncoder(check, oldverifyCode);
if(passwordMatches.equals("success")||verifyCodeMatches.equals("success")) {
userService.updatePassword(username,newpassword);
return "success";
}
else {
return "error";
}
}else {
return "empty";
}
}
/**
* 通过验证码修改邮箱
* @param user
* @return
*/
@PostMapping("/changeEmial")
public String changeEmial(@RequestBody User user){
String username = user.getUsername();
String email = user.getEmail();
String verifyCode = user.getVerifyCode();
User test = userService.findAllByUsername(username);
if(test != null){
String oldverifyCode = test.getVerifyCode();
String matches =userService.matchesEncoder(verifyCode, oldverifyCode);
if(matches.equals("success")) {
userService.updateEmail(username, email);
return "success";
}else {
return "error";
}
}else {
return "empty";
}
}
/**
* 发送邮箱并获取验证码
* @param user
* @return
*/
@PostMapping("/getCheckemail")
public String sendCodeToMail(@RequestBody User user){
String username = user.getUsername();
String email = user.getEmail();
String choice = user.getChoice();
User test = userService.findAllByUsername(username);
if(test != null){ //判断用户是否存在
String mailAddress = test.getEmail();
String checkchoice = test.getChoice();
String checkusername = test.getUsername();
if (checkusername.equals(username)&&choice.equals(checkchoice)) {
//根据username获取保存的邮箱
if(email.equals(mailAddress)){ //用户输入邮箱与绑定邮箱一致→发送验证码
try{
//生成验证码
String verifyCode = RandomUtil.getCode();
//邮件主题
String emailTitle = "邮箱验证";
//邮件内容
String emailContent = "您正在进行邮箱验证,您的验证码为:" + verifyCode
+"\n\n 验证码将于5分钟后失效!";
//发送邮件
SendMailUtil.sendEmail(mailAddress, emailTitle, emailContent);
/* 将验证码注入数据库 */
userService.updateCode(username, verifyCode);
/* 验证码在指定时间内失效 */
Timer timer = new Timer();
timer.schedule(new TimerTask() {
public void run() {
String RandomCode = RandomUtil.getCode();
userService.updateCode(username, RandomCode);
}
},300000);//300000ms(300s)即5分钟
return "success";
}catch(Exception e){
return "error";
}
}else{
//邮箱地址错误
return "addressError";
}
}else {
//用户或选择用户错误
return "userError";
}
}else{
//用户不存在
return "empty";
}
}
/**
* 按用户名查找单个账号信息
* @param username
* @return
*/
@GetMapping("/findAllByUsername/{username}")
public User findAllByUsername(@PathVariable("username") String username) {
return userService.findAllByUsername(username);
}
/**
* 分页查询所有账号信息
* @param currentPage
* @param pageSize
* @return
*/
@GetMapping("findAll/{currentPage}/{pageSize}")
public Map<String,Object> findAll(@PathVariable("currentPage") Integer currentPage, @PathVariable("pageSize") Integer pageSize){
PageHelper.startPage(currentPage, pageSize);
Map<String,Object> returnMap=new HashMap<String,Object>();
List<User> list=null;
returnMap.put("content", list);
list= userService.findAll();
returnMap.put("content", list);
return returnMap;
}
/**
* 按用户类型查询账号所有信息
* @param currentPage
* @param pageSize
* @param choice
* @return
*/
@GetMapping("findAllByChoice/{currentPage}/{pageSize}/{choice}")
public Map<String,Object> findAllByChoice(@PathVariable("currentPage") Integer currentPage, @PathVariable("pageSize") Integer pageSize
, @PathVariable("choice") String choice){
PageHelper.startPage(currentPage, pageSize);
Map<String,Object> returnMap=new HashMap<String,Object>();
List<User> list=null;
returnMap.put("content", list);
list= userService.findAllByChoice(choice);
returnMap.put("content", list);
return returnMap;
}
/**
* 删除用户信息
* @param username
*/
@DeleteMapping("deleteByUsername/{username}")
public void deleteByUsername(@PathVariable("username") String username) {
userService.deleteByUsername(username);
}
/**
* 删除用户信息
* @param username
*/
@DeleteMapping("deleteAll")
public void deleteByUsername() {
userService.deleteAll();
}
/**
* 通过验证码注销账号
* @param user
* @return
*/
@SuppressWarnings("unused")
@PostMapping("/delUser")
public String delUserByCode(@RequestBody User user){
String username = user.getUsername();
String email = user.getEmail();
String verifyCode = user.getVerifyCode();
User test = userService.findAllByUsername(username);
if(test != null){
String oldverifyCode = test.getVerifyCode();
String matches =userService.matchesEncoder(verifyCode, oldverifyCode);
if(matches.equals("success")) {
userService.deleteByUsername(username);
return "success";
}else {
return "error";
}
}else {
return "empty";
}
}
/**
* 按姓名模糊查询全部
* @param currentPage
* @param pageSize
* @param realname
* @return
*/
@GetMapping("FuzzyQuery/{currentPage}/{pageSize}/{realname}")
public Map<String, Object> FuzzyQuery(@PathVariable("currentPage") Integer currentPage,
@PathVariable("pageSize") Integer pageSize, @PathVariable("realname") String realname) {
PageHelper.startPage(currentPage, pageSize);
Map<String, Object> returnMap = new HashMap<String, Object>();
List<User> list = null;
returnMap.put("content", list);
list = userService.FuzzyQueryByRealname(realname);
returnMap.put("content", list);
return returnMap;
}
/**
*
* 按用户类型通过姓名模糊查询
* @param currentPage
* @param pageSize
* @param realname
* @param choice
* @return
*/
@GetMapping("FuzzyQuery/{currentPage}/{pageSize}/{realname}/{choice}")
public Map<String, Object> FuzzyQueryByChoice(@PathVariable("currentPage") Integer currentPage,
@PathVariable("pageSize") Integer pageSize, @PathVariable("realname") String realname,
@PathVariable("choice") String choice) {
PageHelper.startPage(currentPage, pageSize);
Map<String, Object> returnMap = new HashMap<String, Object>();
List<User> list = null;
returnMap.put("content", list);
list = userService.FuzzyQueryByChioce(realname, choice);
returnMap.put("content", list);
return returnMap;
}
}
申请管理控制层:
@RestController
@RequestMapping("/leave")
public class LeaveController {
@Autowired
private LeaveService leaveService;
/**
* 发送申请表
* @param leave
* @return
*/
@PostMapping("/sendLeave")
public String sendLeave(@RequestBody Leave leave) {
return leaveService.InsertLeave(leave);
}
/**
* 修改申请表
* @param leave
* @return
*/
@PostMapping("/updateLeave")
public String updateLeave(@RequestBody Leave leave) {
return leaveService.UpdateLeave(leave);
}
/**
*查找单个申请表
* @param id
* @return
*/
@GetMapping("/findAllById/{id}")
public Leave findAllByUsername(@PathVariable("id") Integer id) {
return leaveService.findAllById(id);
}
/**
* 学生查询申请表当前状态
* @param username
* @return
*/
@GetMapping("/ShowOwnLeave/{username}")
public Map<String, Object> ShowOwnLeave(@PathVariable("username") String username) {
Map<String, Object> returnMap = new HashMap<String, Object>();
List<Leave> list = new ArrayList<Leave>();
Leave ownleave = leaveService.ShowOwnLeave(username);
if(ownleave == null) {
return returnMap;
}else {
returnMap.put("content", list);
list.add(ownleave);
returnMap.put("content", list);
return returnMap;
}
}
/**
* 查询以往申请记录
* @param currentPage
* @param pageSize
* @param username
* @return
*/
@GetMapping("/ShowOldLeave/{currentPage}/{pageSize}/{username}")
public Map<String, Object> ShowOldLeave(@PathVariable("currentPage") Integer currentPage,
@PathVariable("pageSize") Integer pageSize,
@PathVariable("username") String username) {
List<Leave> test = leaveService.findAll(username);
Integer size = test.size();//数据库中所有请假信息的总数
PageHelper.startPage(currentPage, pageSize);
Integer total = currentPage * pageSize; //分页可展示的总数
Map<String, Object> returnMap = new HashMap<String, Object>();
List<Leave> list = null;
returnMap.put("content", list);
list = leaveService.showAOldLeave(username,total,size);
returnMap.put("content", list);
return returnMap;
}
/**
* 按审核状态查询以往审核记录
* @param currentPage
* @param pageSize
* @param username
* @return
*/
@GetMapping("/ShowLeave/{currentPage}/{pageSize}/{username}/{state}")
public Map<String, Object> ShowLeave(@PathVariable("currentPage") Integer currentPage,
@PathVariable("pageSize") Integer pageSize,
@PathVariable("username") String username,
@PathVariable("state") String state){
Map<String, Object> returnMap = new HashMap<String, Object>();
List<Leave> list = null;
List<Leave> pagelist = null;
returnMap.put("content", list);
list = leaveService.showLeave(username, state);
pagelist = leaveService.startPage(list, currentPage, pageSize);
returnMap.put("content", pagelist);
return returnMap;
}
/**
* 删除申请表
* @param id
*/
@DeleteMapping("deleteLeave/{id}")
public void deleteData(@PathVariable("id") Integer id) {
leaveService.deleteLeave(id);
}
/**
* 查找辅导员管理的班级
* @param checkname
* @return
*/
@GetMapping("/findClass/{checkname}")
public List<String> findClass(@PathVariable("checkname") String checkname) {
List<Audit> audit = leaveService.FindClass(checkname);
List<String> list = new ArrayList<String>();
for(int i = 0 ; i < audit.size(); i++) {
String classes = audit.get(i).getClasses();
list.add(classes);
}
return list;
}
/**
* 删除辅导员管理的班级
* @param classes
*/
@DeleteMapping("delClass/{classes}")
public void delClass(@PathVariable("classes") String classes) {
leaveService.delClass(classes);
}
/**
* 添加辅导员要管理的班级
* @param classes
* @param realname
* @return
*/
@PostMapping("/insertClass")
public String insertClass(@RequestBody Audit aidit) {
return leaveService.insertAudit(aidit);
}
/**
* 按班级查找对应的辅导员
* @param classes
* @return
*/
@GetMapping("/findCheckname/{classes}")
public String findCheckname(@PathVariable("classes") String classes) {
String checkname = leaveService.FindCheckname(classes);
if(checkname == null) {
return "error";
} else {
return checkname;
}
}
/**
* 查询需要审核的请假表
* @param currentPage
* @param pageSize
* @param username
* @return
*/
@GetMapping("/showExamLeave/{currentPage}/{pageSize}/{username}")
public Map<String, Object> showExamLeave(@PathVariable("currentPage") Integer currentPage,
@PathVariable("pageSize") Integer pageSize,
@PathVariable("username") String username) {
PageHelper.startPage(currentPage, pageSize);
Map<String, Object> returnMap = new HashMap<String, Object>();
List<Leave> list = leaveService.showExamLeave(username);
if(list == null) {
return returnMap;
}else {
returnMap.put("content", list);
return returnMap;
}
}
/**
* 审核请假表
* @param username
* @param leave
* @return
*/
@PostMapping("/examLeave/{username}")
public String examLeave(@PathVariable("username") String username,@RequestBody Leave leave) {
String StuUsername = leave.getUsername();
Leave ownleave = leaveService.ShowOwnLeave(StuUsername);
Integer oldId = ownleave.getId();
Integer id = leave.getId();
if(oldId == id) {
return leaveService.examLeave(leave, username);
}else {
return "repeat";
}
}
}
考勤管理控制层:
@RestController
@RequestMapping("/attend")
public class AttendController {
@Autowired
private AttendService attendService;
@Autowired
private DataService dataService;
/**
* 添加学生考勤信息
* @param attend
* @return
*/
@PostMapping("/insertAttend")
public String insertAttend(@RequestBody Attend attend) {
String username = attend.getUsername();
Attend test = attendService.findAllByUsername(username);
if (test == null) {
return attendService.insertAttend(attend);
} else {
return "repeat";
}
}
/**
* 按用户类型显示学生考勤信息
* @param currentPage
* @param pageSize
* @param username
* @return
*/
@GetMapping("findAll/{currentPage}/{pageSize}/{username}")
public Map<String,Object> findAll(@PathVariable("currentPage") Integer currentPage,
@PathVariable("pageSize") Integer pageSize,
@PathVariable("username") String username){
Map<String,Object> returnMap=new HashMap<String,Object>();
Data data = dataService.findAllByUsername(username);
if(data == null) {
return returnMap;
}else {
String choice = data.getChoice();
if(choice.equals("辅导员")) {
String realname = data.getRealname();
List<Attend> list=null;
returnMap.put("content", list);
list = attendService.findAll(realname);
List<Attend> pageList = attendService.startPage(list, currentPage, pageSize);
returnMap.put("content", pageList);
return returnMap;
}else if(choice.equals("院领导")) {
String dept = data.getDept();
List<Attend> list=null;
returnMap.put("content", list);
list = attendService.findByDept(dept);
List<Attend> pageList = attendService.startPage(list, currentPage, pageSize);
returnMap.put("content", pageList);
return returnMap;
}else {
List<Attend> list=null;
returnMap.put("content", list);
list = attendService.findAll();
List<Attend> pageList = attendService.startPage(list, currentPage, pageSize);
returnMap.put("content", pageList);
return returnMap;
}
}
}
/**
* 按班级查询
* @param currentPage
* @param pageSize
* @param classes
* @return
*/
@GetMapping("findByClass/{currentPage}/{pageSize}/{classes}/{username}")
public Map<String,Object> findByClass(@PathVariable("currentPage") Integer currentPage,
@PathVariable("pageSize") Integer pageSize,
@PathVariable("classes") String classes,
@PathVariable("username") String username
){
Map<String,Object> returnMap = new HashMap<String,Object>();
Data data = dataService.findAllByUsername(username);
List<Attend> attend = attendService.findAll();
int[] arr = {0};
if(data !=null || attend.isEmpty() == false) {
String choice =data.getChoice();
String dept = data.getDept();
if(choice.equals("院领导")) {
for(int i = 0; i<attend.size();i++) {
String checkdept = attend.get(i).getDept();
String checkclasses = attend.get(i).getClasses();
if(checkdept.equals(dept)&&checkclasses.equals(classes)) {
arr[0] = 1;
}
}
if(arr[0] == 1) {
PageHelper.startPage(currentPage, pageSize);
List<Attend> list=null;
returnMap.put("content", list);
list = attendService.findByClass(classes);
returnMap.put("content", list);
return returnMap;
}else {
return returnMap;
}
}
PageHelper.startPage(currentPage, pageSize);
List<Attend> list=null;
returnMap.put("content", list);
list = attendService.findByClass(classes);
returnMap.put("content", list);
return returnMap;
}
return returnMap;
}
/**
* 将考勤信息单独传给后端做个人考勤信息柱状图
* @param username
* @return
*/
@GetMapping("showChatrStudent/{username}")
public Integer[] showChatrStudent(@PathVariable("username") String username){
return attendService.showChartStudent(username);
}
/**
* 将考勤信息单独传给后端做考勤信息饼图图
* @param classes
* @return
*/
@GetMapping("showChatrAttend/{classes}")
public List<Census> showChatrAttend(@PathVariable("classes") String classes){
return attendService.showChatrAttend(classes);
}
@GetMapping("showChatrScore/{classes}")
public Integer[] showChatrScore(@PathVariable("classes") String classes){
return attendService.showChatrScore(classes);
}
/**
* 查找单个考勤信息
* @param username
* @return
*/
@GetMapping("findAllByUsername/{username}")
public Attend findAllByUsername(@PathVariable("username") String username){
return attendService.findAllByUsername(username);
}
/**
* 查找单个考勤信息(表格)
* @param username
* @return
*/
@GetMapping("findAllOwn/{username}")
public Map<String,Object> findAllOwn(@PathVariable("username") String username){
Map<String,Object> returnMap = new HashMap<String,Object>();
Attend attend = attendService.findAllByUsername(username);
List<Attend> list = new ArrayList<Attend>();
returnMap.put("content", list);
if(attend == null) {
return returnMap;
}else {
list.add(attend);
returnMap.put("content", list);
return returnMap;
}
}
/**
* 修改考勤信息
* @param attend
* @return
*/
@PostMapping("/updateAttend")
public String updateAttend(@RequestBody Attend attend) {
String username = attend.getUsername();
Attend test = attendService.findAllByUsername(username);
if (test != null) {
attendService.saveAttend(attend);
return "success";
} else {
return "empty";
}
}
/**
* 删除考勤信息
* @param username
*/
@DeleteMapping("deleteAttend/{username}")
public void deleteData(@PathVariable("username") String username) {
attendService.delAttend(username);
}
/**
* 删除全部的考勤信息
*/
@DeleteMapping("deleteAttend")
public void deleteData() {
attendService.delAttend();
}
/**
* 按姓名模糊查询某一种用户
*
* @param currentPage
* @param pageSize
* @param realname
* @return
*/
@GetMapping("FuzzyQuery/{currentPage}/{pageSize}/{realname}")
public Map<String, Object> FuzzyQuery(@PathVariable("currentPage") Integer currentPage,
@PathVariable("pageSize") Integer pageSize, @PathVariable("realname") String realname) {
PageHelper.startPage(currentPage, pageSize);
Map<String, Object> returnMap = new HashMap<String, Object>();
List<Attend> list = null;
returnMap.put("content", list);
list = attendService.FuzzyQueryByRealname(realname);
returnMap.put("content", list);
return returnMap;
}
/**
*
* 按用户类型通过姓名模糊查询
* @param currentPage
* @param pageSize
* @param realname
* @param choice
* @return
*/
@GetMapping("FuzzyQuery/{currentPage}/{pageSize}/{realname}/{classes}")
public Map<String, Object> FuzzyQueryByChoice(@PathVariable("currentPage") Integer currentPage,
@PathVariable("pageSize") Integer pageSize, @PathVariable("realname") String realname,
@PathVariable("classes") String classes) {
PageHelper.startPage(currentPage, pageSize);
Map<String, Object> returnMap = new HashMap<String, Object>();
List<Attend> list = null;
returnMap.put("content", list);
list = attendService.FuzzyQueryByChioce(realname, classes);
returnMap.put("content", list);
return returnMap;
}
/**
* 批量上传excel文件导入用户信息
* @param multipartFile
* @param request
* @return
* @throws IOException
*/
@SuppressWarnings("unused")
@ResponseBody
@RequestMapping(value = "/fileUpload")
public String handlerForUpload(@RequestParam("fileList") MultipartFile multipartFile, HttpServletRequest request)
throws IOException {
// 判断所上传文件是否存在
List<String> test = new ArrayList<String>();
if (multipartFile.isEmpty()) {
return "error";
} else {
InputStream in = null;
try {
// 将file转InputStream
in = multipartFile.getInputStream();
} catch (IOException e) {
e.printStackTrace();
}
// 将InputStream转XLSX对象(即表格对象)
@SuppressWarnings("resource")
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(in);
// 获取表格的第一页
XSSFSheet xssfSheet = xssfWorkbook.getSheetAt(0);
// 获取该页有多少数据
int rowNum = xssfSheet.getLastRowNum();
for (int i = 1; i <= rowNum; i++) {
// 获取当前行
XSSFRow xssfRow = xssfSheet.getRow(i);
if(xssfRow == null) {
return "error";
}
// 默认纯数字是以double传的,写进据库会变成科学计数法格式的,需要改为以string传进来
xssfRow.getCell(1).setCellType(CellType.STRING);
xssfRow.getCell(2).setCellType(CellType.STRING);
xssfRow.getCell(4).setCellType(CellType.STRING);
xssfRow.getCell(5).setCellType(CellType.STRING);
xssfRow.getCell(6).setCellType(CellType.STRING);
xssfRow.getCell(7).setCellType(CellType.STRING);
// xssfRow.getCell(8).setCellType(CellType.STRING);
// 以此获得该行的所有单元格
// String realname = xssfRow.getCell(0).getStringCellValue();
// String username = xssfRow.getCell(1).getStringCellValue();
// String classes = xssfRow.getCell(2).getStringCellValue();
// String dept = xssfRow.getCell(3).getStringCellValue();
//
//
// String earlyString = xssfRow.getCell(4).getStringCellValue();
// String lateString = xssfRow.getCell(5).getStringCellValue();
// String vacationString = xssfRow.getCell(6).getStringCellValue();
// String truancyString = xssfRow.getCell(7).getStringCellValue();
String realname = xssfRow.getCell(0).toString();
String username = xssfRow.getCell(1).toString();
String classes = xssfRow.getCell(2).toString();
String dept = xssfRow.getCell(3).toString();
String earlyString = xssfRow.getCell(4).toString();
String lateString = xssfRow.getCell(5).toString();
String vacationString = xssfRow.getCell(6).toString();
String truancyString = xssfRow.getCell(7).toString();
// String scoreString = xssfRow.getCell(8).toString();
Integer early = Integer.valueOf(earlyString);
Integer late = Integer.valueOf(lateString);
Integer vacation = Integer.valueOf(vacationString);
Integer truancy = Integer.valueOf(truancyString);
// Integer score = Integer.valueOf(scoreString);
// 将数据写入实体类
// data = new Data();
Attend attend = new Attend();
attend.setRealname(realname);
attend.setUsername(username);
attend.setClasses(classes);
attend.setDept(dept);
attend.setEarly(early);
attend.setLate(late);
attend.setVacation(vacation);
attend.setTruancy(truancy);
// attend.setScore(score);
// 将实体类插入数据库
// dataService.InsertData(data);
String isRepeat = attendService.insertAttend(attend);
test.add(isRepeat);
// System.out.println("循环监视");
}
for(int j = 0;j <test.size();j++ ) {
if(test.get(j).equals("success")) {
// System.out.println(test.get(j));
return "success";
}else {
// System.out.println(test.get(j));
return "repeat";
}
}
return "repeat";
}
}
}
源码获取:俺的博客首页 "资源" 里下载!
更多推荐
所有评论(0)