上传代码

hehai
zhiyong.ning 4 years ago
parent d52514e993
commit 0bbfb24c85
  1. 1
      src/main/java/com/msdw/tms/api/ProjectControllerApi.java
  2. 9
      src/main/java/com/msdw/tms/controller/StudentController.java
  3. 2
      src/main/java/com/msdw/tms/entity/UserInfoEntity.java
  4. 65
      src/main/java/com/msdw/tms/service/impl/StudentServiceImpl.java
  5. 2
      src/main/resources/application.yml
  6. 4
      src/main/resources/mapper/tms/UserInfoDao.xml

@ -6,7 +6,6 @@ import io.swagger.annotations.ApiOperation;
@Api(value = "用户_实验学习",tags = "用户_实验学习")
public interface ProjectControllerApi {
@ApiOperation(value = "用户_实验学习实验项目",notes = "用户_实验学习实验项目")
R list(Integer userid);
}

@ -13,6 +13,7 @@ import com.msdw.tms.service.StudentService;
import com.msdw.tms.service.UserInfoService;
import com.sun.xml.bind.v2.model.core.ID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -22,6 +23,8 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
* 学生管理
@ -64,11 +67,13 @@ public class StudentController implements StudentControllerApi{
}
else{
UserInfoEntity userInfoList = new UserInfoEntity();
String token ="UT_"+ UUID.randomUUID().toString().replace("-", "");
userInfoList.setAccount(account)
.setPhone(phone)
.setEmail(studentVo.getEmail())
.setSchoolId(studentVo.getSchoolAppellationId())
.setUserName(studentVo.getUserName());
.setUserName(studentVo.getUserName())
.setToken(token);
userInfoService.saveUserInfo(userInfoList);
studentVo.setUserId(userInfoList.getUserId()).setPlatformId(ConstantUtils.PLATFORMID);//暂时写死平台id(PlatformId)
@ -211,7 +216,7 @@ public class StudentController implements StudentControllerApi{
}
@Override
@GetMapping("/export_failure")
@GetMapping("/exportFailure")
public void exportFailureRecord(HttpServletResponse response, String token) throws Exception{
studentService.exportFailureRecord(response,token);

@ -58,4 +58,6 @@ public class UserInfoEntity {
private Integer disableAccount;
//所属院校id
private Integer schoolAppellationId;
//token
private String token;
}

@ -145,7 +145,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao,StudentEntity> im
Map<String, String> map = new HashMap<>();
Long ii = 1L;//用于记录序列号
try {
for (int i = 0;i<students.size();i++){
for (int i = 0;i<size;i++){
StudentVo student = students.get(i);
String phone = student.getPhone();
String workNumber = student.getWorkNumber();
@ -283,67 +283,4 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao,StudentEntity> im
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;
// }
}

@ -5,7 +5,7 @@ spring:
# url: jdbc:mysql://www.liuwanr.cn:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
# username: super
# password: huoran888
url: jdbc:mysql://rm-wz9y13wf7u8q8610fwo.mysql.rds.aliyuncs.com:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
url: jdbc:mysql://rm-wz9y13wf7u8q8610-fwo.mysql.rds.aliyuncs.com:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: super
password: huoran888
# url: jdbc:mysql://localhost:3306/msdw_tms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai

@ -121,9 +121,9 @@
</select>
<insert id="saveUserInfo" useGeneratedKeys="true" keyProperty="userId" keyColumn="userId">
INSERT INTO hr_user_info ( userName,email,phone,uniqueIdentificationAccount, schoolId, account,password, roleId,isdel,creationTime)
INSERT INTO hr_user_info ( userName,email,phone,uniqueIdentificationAccount, schoolId, account,password, roleId,isdel,creationTime,token)
VALUES
( #{userName},#{email},#{phone},#{uniqueIdentificationAccount}, #{schoolId}, #{account}, #{password}, 4 ,0,now())
( #{userName},#{email},#{phone},#{uniqueIdentificationAccount}, #{schoolId}, #{account}, #{password}, 4 ,0,now(),#{token})
</insert>
<!-- <insert id="bacthAddStudents">-->
<!-- insert into hr_user_info(-->

Loading…
Cancel
Save