肖海南学生实体类型修改

master
总裁 3 months ago
parent 4e11d014e1
commit 55777b33a4
  1. 2
      src/main/java/com/teaching/backend/controller/umsAdmin/UmsStudentManageController.java
  2. 2
      src/main/java/com/teaching/backend/mapper/umsAdmin/UmsStudentMapper.java
  3. 2
      src/main/java/com/teaching/backend/model/entity/umsAdmin/UmsStudent.java
  4. 2
      src/main/java/com/teaching/backend/model/entity/umsAdmin/UmsStudentManage.java
  5. 2
      src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsStudentManageServiceImpl.java
  6. 6
      src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsUserServiceImpl.java

@ -1,6 +1,5 @@
package com.teaching.backend.controller.umsAdmin; package com.teaching.backend.controller.umsAdmin;
import com.teaching.backend.common.BaseResponse;
import com.teaching.backend.common.CommonResult; import com.teaching.backend.common.CommonResult;
import com.teaching.backend.model.dto.umsAdmin.UmsStudentPageQueryDTO; import com.teaching.backend.model.dto.umsAdmin.UmsStudentPageQueryDTO;
import com.teaching.backend.model.entity.umsAdmin.UmsStudentManage; import com.teaching.backend.model.entity.umsAdmin.UmsStudentManage;
@ -11,7 +10,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;

@ -14,6 +14,6 @@ import com.teaching.backend.model.entity.umsAdmin.UmsStudent;
public interface UmsStudentMapper extends BaseMapper<UmsStudent> { public interface UmsStudentMapper extends BaseMapper<UmsStudent> {
boolean updateStudentInfo(UmsStudent umsStudent); boolean updateStudentInfo(UmsStudent umsStudent);
UmsStudent selectByUserId(Integer userId); UmsStudent selectByUserId(Long userId);
} }

@ -60,7 +60,7 @@ public class UmsStudent implements Serializable {
private String className; private String className;
//user_id //user_id
private Integer userId; private Long userId;
} }

@ -78,7 +78,7 @@ public class UmsStudentManage implements Serializable {
private String className; private String className;
//user_id //user_id
private Integer userId; private Long userId;
} }

@ -91,7 +91,7 @@ public class UmsStudentManageServiceImpl extends ServiceImpl<UmsStudentManageMap
} }
UmsUser umsUser = new UmsUser(); UmsUser umsUser = new UmsUser();
BeanUtils.copyProperties(umsStudentManage, umsUser); BeanUtils.copyProperties(umsStudentManage, umsUser);
umsUser.setId(Long.valueOf(umsStudentManage.getUserId())); umsUser.setId(umsStudentManage.getUserId());
boolean userInformation = umsUserMapper.updateUserInformation(umsUser); boolean userInformation = umsUserMapper.updateUserInformation(umsUser);
if (userInformation == false){ if (userInformation == false){
throw new BusinessException(400,"修改失败"); throw new BusinessException(400,"修改失败");

@ -42,8 +42,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import static com.teaching.backend.constant.RoleConstants.TEACHER_ROLE;
@Service @Service
@Slf4j @Slf4j
public class UmsUserServiceImpl extends ServiceImpl<UmsUserMapper, UmsUser> implements UmsUserService { public class UmsUserServiceImpl extends ServiceImpl<UmsUserMapper, UmsUser> implements UmsUserService {
@ -90,7 +88,7 @@ public class UmsUserServiceImpl extends ServiceImpl<UmsUserMapper, UmsUser> impl
UmsUser byUsername = lambdaQuery().eq(UmsUser::getUsername, umsUser.getUsername()) UmsUser byUsername = lambdaQuery().eq(UmsUser::getUsername, umsUser.getUsername())
.one(); .one();
UmsStudent umsStudent = new UmsStudent(); UmsStudent umsStudent = new UmsStudent();
umsStudent.setUserId(Math.toIntExact(byUsername.getId())); umsStudent.setUserId(byUsername.getId());
umsStudentMapper.insert(umsStudent); umsStudentMapper.insert(umsStudent);
return umsUser; return umsUser;
@ -311,7 +309,7 @@ public class UmsUserServiceImpl extends ServiceImpl<UmsUserMapper, UmsUser> impl
UmsUser byUsername = lambdaQuery().eq(UmsUser::getPhone, umsUser.getPhone()) UmsUser byUsername = lambdaQuery().eq(UmsUser::getPhone, umsUser.getPhone())
.one(); .one();
UmsStudent umsStudent = new UmsStudent(); UmsStudent umsStudent = new UmsStudent();
umsStudent.setUserId(Math.toIntExact(byUsername.getId())); umsStudent.setUserId(byUsername.getId());
umsStudentMapper.insert(umsStudent); umsStudentMapper.insert(umsStudent);
return umsUser; return umsUser;

Loading…
Cancel
Save