From c6b9c367835ebda628b14ff23e4f9f3407bef547 Mon Sep 17 00:00:00 2001 From: heminjian502 Date: Wed, 10 Aug 2022 10:19:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E8=B4=A6=E5=8F=B7=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/domain/entity/SysUser.java | 20 +++++++++++++++++++ .../web/service/SysLoginService.java | 2 ++ 2 files changed, 22 insertions(+) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index 432ea56..32749d7 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -94,6 +94,10 @@ public class SysUser extends BaseEntity /** 角色ID */ private Long roleId; + private Long doctorId; + + private Long hospitalId; + public SysUser() { @@ -314,6 +318,22 @@ public class SysUser extends BaseEntity this.roleId = roleId; } + public Long getDoctorId() { + return doctorId; + } + + public void setDoctorId(Long doctorId) { + this.doctorId = doctorId; + } + + public Long getHospitalId() { + return hospitalId; + } + + public void setHospitalId(Long hospitalId) { + this.hospitalId = hospitalId; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index bde8e44..e78d851 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -187,6 +187,8 @@ public class SysLoginService tDoctorMapper.insertTDoctor(tDoctor); } LoginUser loginUser = new LoginUser(); + sysUser.setDoctorId(tDoctor.getId()); + sysUser.setHospitalId(tDoctor.getHospitalId()); loginUser.setUserId(sysUser.getUserId()); loginUser.setUser(sysUser); String token = userTokenService.createToken(loginUser);