From b03f5c4663ba0d217a0ae0c81c8d91fd363fe8a2 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Thu, 31 Oct 2024 18:49:54 +0800 Subject: [PATCH] 1 --- .../admin/CompanyStaffController.java | 32 +++++++ .../controller/app/ApiAppLoginController.java | 38 +------- .../service/impl/ApiAppLoginServiceImpl.java | 96 +++++++++---------- .../yudao/module/staff/vo/StaffLoginBody.java | 4 + .../admin/DlRepairTitemController.java | 17 ++++ .../tickets/service/DlRepairTitemService.java | 7 ++ .../impl/DlRepairTitemServiceImpl.java | 14 +++ .../dal/mysql/user/AdminUserMapper.java | 4 + .../system/service/auth/AdminAuthService.java | 15 +++ .../service/auth/AdminAuthServiceImpl.java | 34 +++++++ .../system/service/user/AdminUserService.java | 7 ++ .../service/user/AdminUserServiceImpl.java | 4 + .../src/main/resources/application.yaml | 1 + 13 files changed, 188 insertions(+), 85 deletions(-) diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/admin/CompanyStaffController.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/admin/CompanyStaffController.java index a0360000..ed96fabc 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/admin/CompanyStaffController.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/admin/CompanyStaffController.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.staff.controller.admin; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import cn.iocoder.yudao.common.CommonErrorCodeConstants; import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; @@ -9,10 +10,14 @@ import cn.iocoder.yudao.framework.security.config.SecurityProperties; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.label.entity.Label; import cn.iocoder.yudao.module.staff.entity.CompanyStaff; +import cn.iocoder.yudao.module.staff.service.ApiAppLoginService; import cn.iocoder.yudao.module.staff.service.CompanyStaffService; import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO; import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO; +import cn.iocoder.yudao.module.staff.vo.StaffLoginBody; import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO; +import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthLoginReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.auth.AdminAuthService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -21,6 +26,7 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.poi.ss.formula.functions.T; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -35,6 +41,7 @@ import java.util.List; import java.util.Map; import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; /** @@ -55,6 +62,8 @@ public class CompanyStaffController { private SecurityProperties securityProperties; @Resource private AdminAuthService loginService; + @Autowired + private ApiAppLoginService apiAppLoginService; /** * 分页查询 @@ -295,4 +304,27 @@ public class CompanyStaffController { } return success(true); } + + /** + * 员工登录方法 + * @author vinjor-M + * @date 15:17 2024/10/16 + * @param loginBody 登录请求体 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ + @PostMapping("/loginApp") + public CommonResult loginApp(@RequestBody StaffLoginBody loginBody) throws Exception { + try { + AdminUserDO user = apiAppLoginService.loginApp(loginBody); + AuthLoginReqVO authLoginReqVO = new AuthLoginReqVO(); + authLoginReqVO.setUsername(loginBody.getUsername()); + authLoginReqVO.setPassword(loginBody.getPassword()); + Map rtnMap = new HashMap<>(); + rtnMap.put("userinfo",user); + rtnMap.put("loginResult",loginService.loginApp(authLoginReqVO,loginBody.getTenantId())); + return success(rtnMap); + }catch (Exception e){ + return error(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST); + } + } } diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/app/ApiAppLoginController.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/app/ApiAppLoginController.java index 54aa1369..4ded4b19 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/app/ApiAppLoginController.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/app/ApiAppLoginController.java @@ -1,26 +1,13 @@ package cn.iocoder.yudao.module.staff.controller.app; -import cn.iocoder.yudao.common.CommonErrorCodeConstants; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.staff.service.ApiAppLoginService; -import cn.iocoder.yudao.module.staff.vo.StaffLoginBody; -import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthLoginReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; -import cn.iocoder.yudao.module.system.service.auth.AdminAuthService; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.Map; - -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error; -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; - /** * 员工APP端登录通用接口 * @author vinjor-M @@ -32,8 +19,6 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; public class ApiAppLoginController { @Autowired private ApiAppLoginService apiAppLoginService; - @Resource - private AdminAuthService loginService; /** * 登录获取验证码 @@ -48,26 +33,5 @@ public class ApiAppLoginController { return apiAppLoginService.loginSmsCode(phone,sysCode); } - /** - * 员工登录方法 - * @author vinjor-M - * @date 15:17 2024/10/16 - * @param loginBody 登录请求体 - * @return cn.iocoder.yudao.framework.common.pojo.CommonResult - **/ - @PostMapping("/loginApp") - public CommonResult loginApp(@RequestBody StaffLoginBody loginBody) throws Exception { - try { - AdminUserDO user = apiAppLoginService.loginApp(loginBody); - AuthLoginReqVO authLoginReqVO = new AuthLoginReqVO(); - authLoginReqVO.setUsername(loginBody.getUsername()); - authLoginReqVO.setPassword(loginBody.getPassword()); - Map rtnMap = new HashMap<>(); - rtnMap.put("userinfo",user); - rtnMap.put("loginResult",loginService.login(authLoginReqVO)); - return success(rtnMap); - }catch (Exception e){ - return error(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST); - } - } + } diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/service/impl/ApiAppLoginServiceImpl.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/service/impl/ApiAppLoginServiceImpl.java index fa419ba2..ecd2b078 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/service/impl/ApiAppLoginServiceImpl.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/service/impl/ApiAppLoginServiceImpl.java @@ -80,58 +80,58 @@ public class ApiAppLoginServiceImpl implements ApiAppLoginService { @SneakyThrows @Override public AdminUserDO loginApp(StaffLoginBody loginBody) { - String userName = loginBody.getUsername(); AdminUserDO user = new AdminUserDO(); - if(StringUtils.isNotEmpty(userName)){ + String userName = loginBody.getUsername(); + if (StringUtils.isNotEmpty(userName)) { //手机号密码登录 - user = userService.getUserByUsername(userName); - if (ObjectUtil.isEmpty(user)) { - throw new Exception(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST.getMsg()); - } - // 获取登录用户的角色信息 - List roleIdsByUserId = permissionApi.getRoleIdsByUserId(user.getId()); - if (ObjectUtil.isEmpty(roleIdsByUserId) || roleIdsByUserId.size() == 0) { - throw new Exception(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST.getMsg()); - } - List roleList = roleApi.getRoleList(); - //所拥有的角色code集和 - List roleCodeList = new ArrayList<>(); - //所拥有的角色名称集和 - List roleNames = new ArrayList<>(); - for (RoleReqDTO item:roleList){ - if(roleIdsByUserId.contains(item.getId())){ - roleCodeList.add(item.getCode()); - roleNames.add(item.getName()); - } - } - //默认无权限登录 - boolean flag = false; - if(SystemEnum.REPAIR.getCode().equals(loginBody.getSysCode())){ - //维修业务系统 - flag = this.checkRepairCanLogin(user,roleCodeList); - }else if(SystemEnum.INSPECTION.getCode().equals(loginBody.getSysCode())){ - //检测业务系统 - - }else if(SystemEnum.SCHOOL.getCode().equals(loginBody.getSysCode())){ - //驾校业务系统 - - }else if(SystemEnum.RESCUE.getCode().equals(loginBody.getSysCode())){ - //救援业务系统 - flag = (loginBody.getType().equals("0") && roleNames.contains("调度中心")) || (loginBody.getType().equals("0") && roleNames.contains("交警大队")); - }else if(SystemEnum.INSURE.getCode().equals(loginBody.getSysCode())){ - //保险业务系统 - - }else { - //错误的业务系统标识 - throw new Exception(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST.getMsg()); - } - // 角色是否可以登录 - if (!flag) { - throw new Exception(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST.getMsg()); - } - }else{ + user = userService.getUserByUsername(userName,loginBody.getTenantId()); + } else { //验证码登录--TODO 先不管 } + if (ObjectUtil.isEmpty(user)) { + throw new Exception(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST.getMsg()); + } + // 获取登录用户的角色信息 + List roleIdsByUserId = permissionApi.getRoleIdsByUserId(user.getId()); + if (ObjectUtil.isEmpty(roleIdsByUserId) || roleIdsByUserId.size() == 0) { + throw new Exception(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST.getMsg()); + } + List roleList = roleApi.getRoleList(); + //所拥有的角色code集和 + List roleCodeList = new ArrayList<>(); + //所拥有的角色名称集和 + List roleNames = new ArrayList<>(); + for (RoleReqDTO item : roleList) { + if (roleIdsByUserId.contains(item.getId())) { + roleCodeList.add(item.getCode()); + roleNames.add(item.getName()); + } + } + //默认无权限登录 + boolean flag = false; + if (SystemEnum.REPAIR.getCode().equals(loginBody.getSysCode())) { + //维修业务系统 + flag = this.checkRepairCanLogin(user, roleCodeList); + } else if (SystemEnum.INSPECTION.getCode().equals(loginBody.getSysCode())) { + //检测业务系统 + + } else if (SystemEnum.SCHOOL.getCode().equals(loginBody.getSysCode())) { + //驾校业务系统 + + } else if (SystemEnum.RESCUE.getCode().equals(loginBody.getSysCode())) { + //救援业务系统 + flag = (loginBody.getType().equals("0") && roleNames.contains("调度中心")) || (loginBody.getType().equals("0") && roleNames.contains("交警大队")); + } else if (SystemEnum.INSURE.getCode().equals(loginBody.getSysCode())) { + //保险业务系统 + + } else { + //错误的业务系统标识 + throw new Exception(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST.getMsg()); + } + // 角色是否可以登录 + if (!flag) { + throw new Exception(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST.getMsg()); + } return user; } diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/vo/StaffLoginBody.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/vo/StaffLoginBody.java index be629190..4d4b2bad 100644 --- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/vo/StaffLoginBody.java +++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/vo/StaffLoginBody.java @@ -38,4 +38,8 @@ public class StaffLoginBody { * 系统标识 */ private String sysCode; + /** + * 租户id + */ + private Long tenantId; } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java index 0848686e..7dcd45f3 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.tickets.controller.admin; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem; import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService; import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemReqVO; import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO; @@ -10,7 +11,9 @@ import io.swagger.v3.oas.annotations.Operation; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.List; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.ok; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; /** @@ -70,6 +73,20 @@ public class DlRepairTitemController { return success(dlRepairTitemService.updateRepairAndSale(dlRepairTitemReqVO)); } + /** + * 更新工单子表,维修项目配件的单价、数量、折扣、单项总价等 + * @author vinjor-M + * @date 16:10 2024/10/31 + * @param itemList 工单子表列表 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ + @PutMapping("/updateRepairItem") + @Operation(summary = "修改维修工单子表的维修人员和销售人员信息") + public CommonResult updateRepairItem(@RequestBody List itemList){ + dlRepairTitemService.updateRepairItem(itemList); + return ok(); + } + /** * 查看单个维修子表的数据 * diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTitemService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTitemService.java index a365d7ff..4f42d16b 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTitemService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTitemService.java @@ -67,4 +67,11 @@ public interface DlRepairTitemService extends IService { * @param id 工单子项ID **/ void removeItemById(String id); + + /** + * 更新工单子表,维修项目配件的单价、数量、折扣、单项总价等 + * @author vinjor-M + * @date 16:11 2024/10/31 + **/ + void updateRepairItem(List itemList); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTitemServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTitemServiceImpl.java index 487721de..cafcc927 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTitemServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTitemServiceImpl.java @@ -127,6 +127,20 @@ public class DlRepairTitemServiceImpl extends ServiceImpl itemList) { + this.updateBatchById(itemList); + //重新计划工单价格 + repairTicketsService.computeTicket(itemList.get(0).getTicketId()); + } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java index dada9a7c..15be2569 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.system.dal.mysql.user; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO; import cn.iocoder.yudao.module.system.controller.app.user.UserInfoVO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; @@ -20,6 +21,9 @@ public interface AdminUserMapper extends BaseMapperX { default AdminUserDO selectByUsername(String username) { return selectOne(AdminUserDO::getUsername, username); } + default AdminUserDO selectByUsername(String username,Long tenantId) { + return selectList(new LambdaQueryWrapperX().eq(AdminUserDO::getUsername, username).eq(TenantBaseDO::getTenantId,tenantId)).get(0); + } default AdminUserDO selectByEmail(String email) { return selectOne(AdminUserDO::getEmail, email); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthService.java index badc3a6a..7d653d15 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthService.java @@ -22,6 +22,14 @@ public interface AdminAuthService { * @return 用户 */ AdminUserDO authenticate(String username, String password); + /** + * 验证账号 + 密码。如果通过,则返回用户 + * + * @param username 账号 + * @param password 密码 + * @return 用户 + */ + AdminUserDO authenticateApp(String username, String password,Long tenantId); /** * 账号登录 @@ -30,6 +38,13 @@ public interface AdminAuthService { * @return 登录结果 */ AuthLoginRespVO login(@Valid AuthLoginReqVO reqVO); + /** + * 账号登录 + * + * @param reqVO 登录信息 + * @return 登录结果 + */ + AuthLoginRespVO loginApp(@Valid AuthLoginReqVO reqVO,Long tenantId); /** * 基于 token 退出登录 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java index 212c49ed..83a314bd 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java @@ -105,6 +105,26 @@ public class AdminAuthServiceImpl implements AdminAuthService { } return user; } + @Override + public AdminUserDO authenticateApp(String username, String password,Long tenantId) { + final LoginLogTypeEnum logTypeEnum = LoginLogTypeEnum.LOGIN_USERNAME; + // 校验账号是否存在 + AdminUserDO user = userService.getUserByUsername(username,tenantId); + if (user == null) { + createLoginLog(null, username, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS); + throw exception(AUTH_LOGIN_BAD_CREDENTIALS); + } + if (!userService.isPasswordMatch(password, user.getPassword())) { + createLoginLog(user.getId(), username, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS); + throw exception(AUTH_LOGIN_BAD_CREDENTIALS); + } + // 校验是否禁用 + if (CommonStatusEnum.isDisable(user.getStatus())) { + createLoginLog(user.getId(), username, logTypeEnum, LoginResultEnum.USER_DISABLED); + throw exception(AUTH_LOGIN_USER_DISABLED); + } + return user; + } @Override public AuthLoginRespVO login(AuthLoginReqVO reqVO) { @@ -122,6 +142,20 @@ public class AdminAuthServiceImpl implements AdminAuthService { // 创建 Token 令牌,记录登录日志 return createTokenAfterLoginSuccess(user.getId(), reqVO.getUsername(), LoginLogTypeEnum.LOGIN_USERNAME); } + @Override + public AuthLoginRespVO loginApp(AuthLoginReqVO reqVO,Long tenantId) { + // 校验验证码 + validateCaptcha(reqVO); + // 使用账号密码,进行登录 + AdminUserDO user = authenticateApp(reqVO.getUsername(), reqVO.getPassword(),tenantId); + // 如果 socialType 非空,说明需要绑定社交用户 + if (reqVO.getSocialType() != null) { + socialUserService.bindSocialUser(new SocialUserBindReqDTO(user.getId(), getUserType().getValue(), + reqVO.getSocialType(), reqVO.getSocialCode(), reqVO.getSocialState())); + } + // 创建 Token 令牌,记录登录日志 + return createTokenAfterLoginSuccess(user.getId(), reqVO.getUsername(), LoginLogTypeEnum.LOGIN_USERNAME); + } @Override public void sendSmsCode(AuthSmsSendReqVO reqVO) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java index 33e96340..f32ed626 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java @@ -123,6 +123,13 @@ public interface AdminUserService extends IService { * @return 用户对象信息 */ AdminUserDO getUserByUsername(String username); + /** + * 通过用户名查询用户 + * + * @param username 用户名 + * @return 用户对象信息 + */ + AdminUserDO getUserByUsername(String username,Long tenantId); /** * 通过用户名查询用户---不带租户ID * diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java index 61a64edf..e3c2878f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java @@ -282,6 +282,10 @@ public class AdminUserServiceImpl extends ServiceImpl