|
|
@ -145,7 +145,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao,StudentEntity> im |
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
Long ii = 1L;//用于记录序列号
|
|
|
|
Long ii = 1L;//用于记录序列号
|
|
|
|
try { |
|
|
|
try { |
|
|
|
for (int i = 0;i<students.size();i++){ |
|
|
|
for (int i = 0;i<size;i++){ |
|
|
|
StudentVo student = students.get(i); |
|
|
|
StudentVo student = students.get(i); |
|
|
|
String phone = student.getPhone(); |
|
|
|
String phone = student.getPhone(); |
|
|
|
String workNumber = student.getWorkNumber(); |
|
|
|
String workNumber = student.getWorkNumber(); |
|
|
@ -283,67 +283,4 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao,StudentEntity> im |
|
|
|
export(response, inputStream, parse, "学生信息导入失败表.xlsx"); |
|
|
|
export(response, inputStream, parse, "学生信息导入失败表.xlsx"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
// public HashMap<String, Object> readStudent(Integer schoolId, MultipartFile file) {
|
|
|
|
|
|
|
|
// HashMap<String, Object> resp = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
// try {
|
|
|
|
|
|
|
|
// // 读取excel文件中的学生信息
|
|
|
|
|
|
|
|
// List<Student> students = ExcelImportHelper.readStudent(file);
|
|
|
|
|
|
|
|
// List<UserM> users = new ArrayList<UserM>();
|
|
|
|
|
|
|
|
// // 循环员工信息,将员工信息与用户信息进行对比
|
|
|
|
|
|
|
|
// for (int i = 0; i < students.size(); i++) {
|
|
|
|
|
|
|
|
// Student student = students.get(i);
|
|
|
|
|
|
|
|
// // 学校id
|
|
|
|
|
|
|
|
// student.setSchoolId(schoolId);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Student stu=studentMapper.getStudent(student);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// if(stu!=null) {
|
|
|
|
|
|
|
|
// // 专业id
|
|
|
|
|
|
|
|
// student.setProfessionalId(stu.getProfessionalId());
|
|
|
|
|
|
|
|
// // 年级
|
|
|
|
|
|
|
|
// student.setGradeId(stu.getGradeId());
|
|
|
|
|
|
|
|
// //班级
|
|
|
|
|
|
|
|
// student.setClassId(stu.getClassId());
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// UserM user = new UserM();
|
|
|
|
|
|
|
|
// // 用户名称
|
|
|
|
|
|
|
|
// user.setName(student.getStudentName());
|
|
|
|
|
|
|
|
// // 用户密码
|
|
|
|
|
|
|
|
// user.setPassword("huoran123");
|
|
|
|
|
|
|
|
// // 用户角色
|
|
|
|
|
|
|
|
// user.setAccountRole(student.getRoleId());
|
|
|
|
|
|
|
|
// // 工号
|
|
|
|
|
|
|
|
// user.setWorkNumber(student.getWorkNumber());
|
|
|
|
|
|
|
|
// // 手机号
|
|
|
|
|
|
|
|
// user.setPhone(student.getPhone());
|
|
|
|
|
|
|
|
// // 邮箱
|
|
|
|
|
|
|
|
// user.setEmail(student.getEmail());
|
|
|
|
|
|
|
|
// // 唯一标识性账号
|
|
|
|
|
|
|
|
// user.setUniqueIdentificationAccount(student.getUniqueIdentificationAccount());
|
|
|
|
|
|
|
|
// // 学校id
|
|
|
|
|
|
|
|
// user.setSchoolId(schoolId);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// users.add(user);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }else {
|
|
|
|
|
|
|
|
// students.remove(i);
|
|
|
|
|
|
|
|
// i--;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (!students.isEmpty() && students.size() > 0) {
|
|
|
|
|
|
|
|
// // 批量添加学生
|
|
|
|
|
|
|
|
// studentMapper.bacthAddStudent(students);
|
|
|
|
|
|
|
|
// // 批量添加用户
|
|
|
|
|
|
|
|
// userMapper.addUserM(users);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// resp.put("retcode", 200);
|
|
|
|
|
|
|
|
// } catch (RuntimeException e) {
|
|
|
|
|
|
|
|
// logger.error(e.getMessage());
|
|
|
|
|
|
|
|
// resp.put("retcode", 500);
|
|
|
|
|
|
|
|
// resp.put("retvalue", "Inquiry Failed");
|
|
|
|
|
|
|
|
// return resp;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return resp;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|