|
|
|
@ -62,7 +62,6 @@ public class UserInfoController implements UserInfoControllerApi { |
|
|
|
|
public R save(@RequestBody UserInfoEntity userInfoEntity,@RequestParam String workNumber){ |
|
|
|
|
String token ="UT_"+ UUID.randomUUID().toString().replace("-", ""); |
|
|
|
|
userInfoEntity.setToken(token); |
|
|
|
|
userInfoEntity.setSchoolId(2105); |
|
|
|
|
Integer schoolId = userInfoEntity.getSchoolId(); |
|
|
|
|
Integer integer = userInfoService.queryStudentAccount(userInfoEntity.getAccount(),schoolId); |
|
|
|
|
Integer integer1 = userInfoService.queryStudentPhone(userInfoEntity.getPhone()); |
|
|
|
@ -96,6 +95,48 @@ public class UserInfoController implements UserInfoControllerApi { |
|
|
|
|
return studentService.addStudentInfo(studentVo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 职站注册 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
|
@PostMapping("/zzAdd") |
|
|
|
|
public R zzAdd(@RequestBody UserInfoEntity userInfoEntity,@RequestParam String workNumber){ |
|
|
|
|
String token ="UT_"+ UUID.randomUUID().toString().replace("-", ""); |
|
|
|
|
userInfoEntity.setToken(token); |
|
|
|
|
userInfoEntity.setSchoolId(2105); |
|
|
|
|
Integer schoolId = userInfoEntity.getSchoolId(); |
|
|
|
|
Integer integer = userInfoService.queryStudentAccount(userInfoEntity.getAccount(),schoolId); |
|
|
|
|
Integer integer1 = userInfoService.queryStudentPhone(userInfoEntity.getPhone()); |
|
|
|
|
|
|
|
|
|
//新增学生
|
|
|
|
|
StudentVo studentVo = new StudentVo(); |
|
|
|
|
|
|
|
|
|
studentVo.setRoleId(Integer.valueOf(userInfoEntity.getRoleId())); |
|
|
|
|
studentVo.setSchoolId(schoolId); |
|
|
|
|
studentVo.setIsdel(0); |
|
|
|
|
studentVo.setWorkNumber(workNumber); |
|
|
|
|
studentVo.setPlatformId(1); |
|
|
|
|
//为1 学号有重复
|
|
|
|
|
int num = studentService.queryStudentByWorkNumber(studentVo); |
|
|
|
|
if (integer==1){ |
|
|
|
|
return R.error(400,"账号已存在"); |
|
|
|
|
} |
|
|
|
|
if (integer1==1){ |
|
|
|
|
return R.error(400,"该手机号已被绑定"); |
|
|
|
|
} |
|
|
|
|
if (num == 1){ |
|
|
|
|
return R.error(400,"该学号重复!"); |
|
|
|
|
} |
|
|
|
|
int userId = userInfoService.add(userInfoEntity); |
|
|
|
|
if (userId==0){ |
|
|
|
|
return R.error(400,"添加用户信息失败"); |
|
|
|
|
} |
|
|
|
|
// userInfoEntity.setUserId(userId);
|
|
|
|
|
studentVo.setUserId(userInfoEntity.getUserId()); |
|
|
|
|
return studentService.addStudentInfo(studentVo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 修改 |
|
|
|
|
*/ |
|
|
|
@ -222,7 +263,7 @@ public class UserInfoController implements UserInfoControllerApi { |
|
|
|
|
@Override |
|
|
|
|
@GetMapping("/getUserId") |
|
|
|
|
public R getUserId(@RequestParam String token){ |
|
|
|
|
Integer userId = userInfoService.getUserId(token); |
|
|
|
|
return R.ok().put("userId", userId); |
|
|
|
|
R result = userInfoService.getUserId(token); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|