| | |
| | | package com.xiaopeng.account.controller; |
| | | |
| | | |
| | | import cn.hutool.core.util.DesensitizedUtil; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.xiaopeng.account.constant.I18nKeyConstant; |
| | | import com.xiaopeng.account.mapper.XpOperationsRoleMapper; |
| | | import com.xiaopeng.account.model.dto.EnableDisableDTO; |
| | | import com.xiaopeng.account.model.dto.RePasswordDTO; |
| | |
| | | import com.xiaopeng.account.model.dto.XpOperationsUserDTO; |
| | | import com.xiaopeng.account.model.query.XpOperationsUserPageQuery; |
| | | import com.xiaopeng.account.model.query.XpOperationsUserQuery; |
| | | import com.xiaopeng.account.service.ISysRoleService; |
| | | import com.xiaopeng.account.service.IXpOperationsUserService; |
| | | import com.xiaopeng.account.service.IXpQualificationAuditService; |
| | | import com.xiaopeng.api.dto.account.XpOperationsUserQueryDTO; |
| | | import com.xiaopeng.api.feignClient.account.SysGroupMenuClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetClient; |
| | | import com.xiaopeng.api.model.account.SysRole; |
| | | import com.xiaopeng.api.model.account.XpOperationsRole; |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import com.xiaopeng.api.model.account.XpQualificationAudit; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpFleet; |
| | | import com.xiaopeng.api.query.account.OptionalUsersPageListQuery; |
| | | import com.xiaopeng.api.vo.account.LoginUser; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserProfileVO; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserVO; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserWithRoleVO; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.utils.SensitiveDataCryptoUtil; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.log.annotation.AdminOperationLog; |
| | | import com.xiaopeng.common.log.enums.AdminBusinessType; |
| | | import com.xiaopeng.common.log.enums.AdminOperationType; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.account.constant.I18nKeyConstant; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import com.xiaopeng.common.log.annotation.AdminOperationLog; |
| | | import com.xiaopeng.common.log.enums.AdminBusinessType; |
| | | import com.xiaopeng.common.log.enums.AdminOperationType; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | private final AliOssService aliOssService; |
| | | |
| | | @Resource |
| | | private IXpQualificationAuditService xpQualificationAuditService; |
| | | |
| | | @Resource |
| | | private ISysRoleService sysRoleService; |
| | | @Resource |
| | | private SysGroupMenuClient groupMenuClient; |
| | | |
| | | @Autowired |
| | | public XpOperationsUserController(IXpOperationsUserService xpOperationsUserService, |
| | | XpOperationsRoleMapper xpOperationsRoleMapper, |
| | |
| | | * @param ids 用户ID列表 |
| | | * @return 用户列表 |
| | | */ |
| | | @PostMapping("/inner/xpOperationsUser/listByIds") |
| | | @PostMapping("/logan/inner/xpOperationsUser/listByIds") |
| | | public R<List<XpOperationsUser>> listByIds(@RequestBody List<Long> ids) { |
| | | return R.ok(xpOperationsUserService.listByIds(ids)); |
| | | List<XpOperationsUser> users = xpOperationsUserService.listByIds(ids); |
| | | users.forEach(user -> user.setPhoneNumber(SensitiveDataCryptoUtil.decryptIfPossible(user.getPhoneNumber()))); |
| | | return R.ok(users); |
| | | } |
| | | |
| | | @PostMapping("/logan/inner/xpOperationsUser/pageListByIds") |
| | | public R<PageInfo<XpOperationsUserWithRoleVO>> pageListByIds(@RequestBody OptionalUsersPageListQuery q) { |
| | | return R.ok(xpOperationsUserService.pageListByIds(q)); |
| | | } |
| | | |
| | | @PostMapping("/logan/inner/xpOperationsUser/findList") |
| | | public R<List<XpOperationsUserWithRoleVO>> findList(@RequestBody XpOperationsUserQueryDTO query) { |
| | | return R.ok(xpOperationsUserService.findList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 根据ID查询运维用户信息 |
| | | * |
| | | * @return 用户列表 |
| | | */ |
| | | @GetMapping("/inner/xpOperationsUser/queryById") |
| | | @GetMapping("/logan/inner/xpOperationsUser/queryById") |
| | | R<XpOperationsUser> queryById(@RequestParam Long id) { |
| | | return R.ok(xpOperationsUserService.getById(id)); |
| | | XpOperationsUser operationsUser = xpOperationsUserService.getById(id); |
| | | XpOperationsRole operationsUserId = xpOperationsRoleMapper.selectOne(new QueryWrapper<XpOperationsRole>().eq("operations_user_id", id)); |
| | | SysRole sysRole = sysRoleService.getById(operationsUserId.getRoleId()); |
| | | operationsUser.setRoleName(sysRole.getRoleName()); |
| | | operationsUser.setPhoneNumber(SensitiveDataCryptoUtil.decryptIfPossible(operationsUser.getPhoneNumber())); |
| | | return R.ok(operationsUser); |
| | | } |
| | | |
| | | /** |
| | | * 根据ID查询运维用户信息 |
| | | * @return 用户列表 |
| | | */ |
| | | @GetMapping("/logan/inner/xpOperationsUser/queryByIds") |
| | | R<List<XpOperationsUser>> queryByIds(@RequestParam String operationsUserId) { |
| | | List<Long> ids = Arrays.stream(operationsUserId.split(",")) |
| | | .map(Long::parseLong) |
| | | .collect(Collectors.toList()); |
| | | List<XpOperationsUser> operationsUser = xpOperationsUserService.listByIds(ids); |
| | | for (XpOperationsUser xpOperationsUser : operationsUser) { |
| | | XpOperationsRole role = xpOperationsRoleMapper.selectOne(new QueryWrapper<XpOperationsRole>().eq("operations_user_id", xpOperationsUser.getId())); |
| | | SysRole sysRole = sysRoleService.getById(role.getRoleId()); |
| | | xpOperationsUser.setRoleName(sysRole.getRoleName()); |
| | | xpOperationsUser.setPhoneNumber(SensitiveDataCryptoUtil.decryptIfPossible(xpOperationsUser.getPhoneNumber())); |
| | | } |
| | | |
| | | return R.ok(operationsUser); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param nickName 昵称 |
| | | * @return 运维用户列表 |
| | | */ |
| | | @PostMapping("/inner/xpOperationsUser/listByName") |
| | | @PostMapping("/logan/inner/xpOperationsUser/listByName") |
| | | public R<List<XpOperationsUser>> listByName(@RequestParam("nickName") String nickName) { |
| | | return R.ok(xpOperationsUserService.listByName(nickName)); |
| | | } |
| | | |
| | | @GetMapping("/logan/inner/xpOperationsUser/profile") |
| | | public R<XpOperationsUserProfileVO> profile(@RequestParam("id")Long id) { |
| | | |
| | | return R.ok(xpOperationsUserService.getUserProfile(id)); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 用户及角色信息列表 |
| | | */ |
| | | @ApiOperation(value = "批量查询用户及角色信息", tags = {"内部接口"}) |
| | | @PostMapping("/inner/xpOperationsUser/listByIdsWithRole") |
| | | @PostMapping("/logan/inner/xpOperationsUser/listByIdsWithRole") |
| | | public R<List<XpOperationsUserWithRoleVO>> listByIdsWithRole(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return R.ok(new ArrayList<>()); |
| | |
| | | * @return 用户及角色信息列表 |
| | | */ |
| | | @ApiOperation(value = "根据条件查询用户及角色信息", tags = {"内部接口"}) |
| | | @PostMapping("/inner/xpOperationsUser/queryByConditions") |
| | | @PostMapping("/logan/inner/xpOperationsUser/queryByConditions") |
| | | public R<List<XpOperationsUserWithRoleVO>> queryByConditions(@RequestBody XpOperationsUserQueryDTO dto) { |
| | | List<XpOperationsUserWithRoleVO> result = xpOperationsRoleMapper.selectUsersByConditions( |
| | | dto.getNickName(), |
| | | dto.getPhoneNumber(), |
| | | SensitiveDataCryptoUtil.queryValues(dto.getPhoneNumber()), |
| | | dto.getRoleId() |
| | | ); |
| | | result.forEach(user -> user.setPhoneNumber(SensitiveDataCryptoUtil.decryptIfPossible(user.getPhoneNumber()))); |
| | | return R.ok(result); |
| | | } |
| | | |
| | |
| | | * @return 个人中心首页信息 |
| | | */ |
| | | @ApiOperation(value = "获取个人中心首页信息", tags = {"运维APP-个人中心"}) |
| | | @GetMapping("/api/v1/userInfo") |
| | | @GetMapping("/maintenance-app/api/v1/userInfo") |
| | | public R<XpOperationsUserProfileVO> getProfile() { |
| | | // 通过TokenService获取当前登录用户ID |
| | | Long currentUserId = tokenService.getLoginOperationUser().getId(); |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "个人中心-证件上传", tags = {"运维APP-个人中心"}) |
| | | @PostMapping("/api/v1/saveCertificate") |
| | | @PostMapping("/maintenance-app/api/v1/saveCertificate") |
| | | public R<?> saveCertificate(@Valid @RequestBody XpOperationsUserDTO dto) { |
| | | xpOperationsUserService.saveCertificate(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "个人中心-查询证件上传详情", tags = {"运维APP-个人中心"}) |
| | | @PostMapping("/maintenance-app/api/v1/getCertificate") |
| | | public R<XpQualificationAudit> getCertificate() { |
| | | Long id = tokenService.getLoginOperationUser().getId(); |
| | | XpQualificationAudit xpQualificationAudit = xpQualificationAuditService.getOne(new QueryWrapper<XpQualificationAudit>().eq("operations_user_id", id) |
| | | .last(" order by create_time desc limit 1")); |
| | | return R.ok(xpQualificationAudit); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "运维人员管理分页列表", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/pageList") |
| | | public R<PageInfo<XpOperationsUserVO>> pageList(@RequestBody XpOperationsUserQuery query) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | PageInfo<XpOperationsUserVO> pageList = xpOperationsUserService.pageList(query); |
| | | if(!loginUser.getPhoneDesensitizationExempt()){ |
| | | for (XpOperationsUserVO record : pageList.getRecords()) { |
| | | record.setPhoneNumber(DesensitizedUtil.mobilePhone(record.getPhoneNumber())); |
| | | } |
| | | } |
| | | return R.ok(pageList); |
| | | } |
| | | |
| | |
| | | @PostMapping("/api/v1/operationsUser/listAll") |
| | | public R<List<XpOperationsUser>> listAll() { |
| | | List<XpOperationsUser> listAll = xpOperationsUserService.list(); |
| | | listAll.forEach(user -> user.setPhoneNumber(SensitiveDataCryptoUtil.decryptIfPossible(user.getPhoneNumber()))); |
| | | for (XpOperationsUser xpOperationsUser : listAll) { |
| | | // todo 需要上传工单id,根据距离进行排序 |
| | | } |
| | | return R.ok(listAll); |
| | | } |
| | | |
| | |
| | | * @return 启用状态的用户列表 |
| | | */ |
| | | @ApiOperation(value = "获取所有启用状态的运维用户", tags = {"内部接口"}) |
| | | @GetMapping("/inner/xpOperationsUser/listAllEnabled") |
| | | @GetMapping("/logan/inner/xpOperationsUser/listAllEnabled") |
| | | public R<List<XpOperationsUser>> listAllEnabled() { |
| | | List<XpOperationsUser> users = xpOperationsUserService.lambdaQuery() |
| | | .eq(XpOperationsUser::getStatus, true) |
| | | .list(); |
| | | users.forEach(user -> user.setPhoneNumber(SensitiveDataCryptoUtil.decryptIfPossible(user.getPhoneNumber()))); |
| | | return R.ok(users); |
| | | } |
| | | |
| | | @ApiOperation(value = "运维人员管理新增", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/add") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.OPERATIONS_USER_MANAGEMENT, |
| | | operationType = AdminOperationType.ADD, |
| | | content = "新增运维人员", |
| | | appendRequestData = true |
| | | ) |
| | | public R<String> add(@RequestBody XpOperationsUserAddDTO dto) { |
| | | return xpOperationsUserService.addOperationsUser(dto); |
| | | } |
| | | |
| | | @ApiOperation(value = "运维人员管理编辑", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/edit") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.OPERATIONS_USER_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "编辑运维人员", |
| | | appendRequestData = true |
| | | ) |
| | | public R<String> edit(@RequestBody XpOperationsUserAddDTO dto) { |
| | | return xpOperationsUserService.editOperationsUser(dto); |
| | | } |
| | | |
| | | @ApiOperation(value = "运维人员管理启用禁用", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/enableDisableById") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.OPERATIONS_USER_MANAGEMENT, |
| | | operationType = AdminOperationType.SWITCH_STATUS, |
| | | content = "运维人员管理启用禁用", |
| | | appendRequestData = true |
| | | ) |
| | | public R<String> enableDisableById(@RequestBody EnableDisableDTO dto) { |
| | | xpOperationsUserService.enableDisableById(dto); |
| | | return R.ok(); |
| | |
| | | |
| | | @ApiOperation(value = "运维人员管理删除", tags = {"管理后台-运维执行"}) |
| | | @DeleteMapping("/api/v1/operationsUser/deleteById") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.OPERATIONS_USER_MANAGEMENT, |
| | | operationType = AdminOperationType.DELETE, |
| | | content = "删除运维人员", |
| | | appendRequestData = true |
| | | ) |
| | | public R<String> deleteById(@RequestParam Long id) { |
| | | try { |
| | | R<XpFleet> fleetResult = xpFleetClient.getFleetByOperationsUserId(id); |
| | |
| | | |
| | | @ApiOperation(value = "运维人员管理重置密码", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/rePassword") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.OPERATIONS_USER_MANAGEMENT, |
| | | operationType = AdminOperationType.RESET_PASSWORD, |
| | | content = "重置运维人员密码", |
| | | appendRequestData = true |
| | | ) |
| | | public R<String> rePassword(@RequestBody RePasswordDTO dto) { |
| | | xpOperationsUserService.rePassword(dto); |
| | | return R.ok(); |
| | |
| | | @ApiOperation(value = "运维人员管理详情", tags = {"管理后台-运维执行"}) |
| | | @GetMapping("/api/v1/operationsUser/detailById") |
| | | public R<XpOperationsUserVO> detailById(@RequestParam Long id) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | XpOperationsUserVO xpOperationsUserVO = xpOperationsUserService.detailById(id); |
| | | if (xpOperationsUserVO.getAvatar() != null) { |
| | | JSONObject jsonObject = JSONObject.parseObject(xpOperationsUserVO.getAvatar()); |
| | | String downloadUrl = null; |
| | | try { |
| | | // 1 |
| | | String downloadUrl1 = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | downloadUrl = downloadUrl1; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | if(jsonObject!=null){ |
| | | String downloadUrl = null; |
| | | try { |
| | | // 1 |
| | | downloadUrl= aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpOperationsUserVO.setAvatar(jsonObject.toJSONString()); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpOperationsUserVO.setAvatar(jsonObject.toJSONString()); |
| | | } |
| | | |
| | | if (xpOperationsUserVO.getIdCardFront() != null) { |
| | | JSONObject jsonObject = JSONObject.parseObject(xpOperationsUserVO.getIdCardFront()); |
| | | if(jsonObject!=null){ |
| | | String downloadUrl = null; |
| | | try { |
| | | // 1 |
| | | downloadUrl= aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpOperationsUserVO.setIdCardFront(jsonObject.toJSONString()); |
| | | } |
| | | } |
| | | |
| | | if (xpOperationsUserVO.getIdCardBack() != null) { |
| | | JSONObject jsonObject = JSONObject.parseObject(xpOperationsUserVO.getIdCardBack()); |
| | | if(jsonObject!=null){ |
| | | String downloadUrl = null; |
| | | try { |
| | | // 1 |
| | | downloadUrl= aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpOperationsUserVO.setIdCardBack(jsonObject.toJSONString()); |
| | | } |
| | | } |
| | | if (xpOperationsUserVO.getDriverLicense() != null) { |
| | | JSONObject jsonObject = JSONObject.parseObject(xpOperationsUserVO.getDriverLicense()); |
| | | if(jsonObject!=null){ |
| | | String downloadUrl = null; |
| | | try { |
| | | // 1 |
| | | downloadUrl= aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpOperationsUserVO.setDriverLicense(jsonObject.toJSONString()); |
| | | } |
| | | } |
| | | |
| | | if (xpOperationsUserVO.getCertificateOfNoCriminalRecord() != null) { |
| | | JSONObject jsonObject = JSONObject.parseObject(xpOperationsUserVO.getCertificateOfNoCriminalRecord()); |
| | | if(jsonObject!=null){ |
| | | String downloadUrl = null; |
| | | try { |
| | | // 1 |
| | | downloadUrl= aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpOperationsUserVO.setCertificateOfNoCriminalRecord(jsonObject.toJSONString()); |
| | | } |
| | | } |
| | | if(!loginUser.getPhoneDesensitizationExempt()){ |
| | | xpOperationsUserVO.setPhoneNumber(DesensitizedUtil.mobilePhone(xpOperationsUserVO.getPhoneNumber())); |
| | | } |
| | | |
| | | return R.ok(xpOperationsUserVO); |
| | |
| | | |
| | | @ApiOperation(value = "运维人员管理导出列表", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/exportOperationsUser") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.OPERATIONS_USER_MANAGEMENT, |
| | | operationType = AdminOperationType.EXPORT, |
| | | content = "导出运维人员列表", |
| | | appendRequestData = true |
| | | ) |
| | | public void exportOperationsUser(@RequestBody XpOperationsUserQuery query, HttpServletResponse response) { |
| | | xpOperationsUserService.exportOperationsUser(query, response); |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "运维人员管理导出模板", tags = {"管理后台-运维执行"}) |
| | | @GetMapping("/api/v1/operationsUser/exportTemplate") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.OPERATIONS_USER_MANAGEMENT, |
| | | operationType = AdminOperationType.EXPORT, |
| | | content = "导出运维人员模板", |
| | | appendRequestData = false |
| | | ) |
| | | public void exportTemplate(HttpServletResponse response) { |
| | | xpOperationsUserService.exportTemplate(response); |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "运维人员管理导入数据", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/importOperationsUser") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.OPERATIONS_USER_MANAGEMENT, |
| | | operationType = AdminOperationType.IMPORT, |
| | | content = "导入运维人员数据", |
| | | appendRequestData = false |
| | | ) |
| | | public R<String> importOperationsUser(@RequestParam("file") MultipartFile file) { |
| | | xpOperationsUserService.importOperationsUser(file); |
| | | return R.ok(); |
| | |
| | | * @return 用户信息列表 |
| | | */ |
| | | @ApiOperation(value = "根据手机号模糊查询用户及角色信息", tags = {"内部接口"}) |
| | | @PostMapping("/inner/xpOperationsUser/getByPhoneNumber") |
| | | @PostMapping("/logan/inner/xpOperationsUser/getByPhoneNumber") |
| | | public R<List<XpOperationsUser>> getByPhoneNumber(@RequestParam String phoneNumber) { |
| | | List<XpOperationsUser> result = xpOperationsUserService.getByPhoneNumber(phoneNumber); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | /** |
| | | * 根据手机号精确查询运维用户(内部接口) |
| | | * |
| | | * @param phoneNumber 手机号 |
| | | * @return 运维用户信息,不存在返回null |
| | | */ |
| | | @ApiOperation(value = "根据手机号精确查询运维用户", tags = {"内部接口"}) |
| | | @GetMapping("/logan/inner/xpOperationsUser/getByExactPhone") |
| | | public R<XpOperationsUser> getByExactPhone(@RequestParam("phoneNumber") String phoneNumber) { |
| | | if (com.xiaopeng.common.core.utils.StringUtils.isBlank(phoneNumber)) { |
| | | return R.ok(); |
| | | } |
| | | XpOperationsUser user = xpOperationsUserService.lambdaQuery() |
| | | .in(XpOperationsUser::getPhoneNumber, SensitiveDataCryptoUtil.queryValues(phoneNumber)) |
| | | .last("LIMIT 1") |
| | | .one(); |
| | | if (user != null) { |
| | | user.setPhoneNumber(SensitiveDataCryptoUtil.decryptIfPossible(user.getPhoneNumber())); |
| | | } |
| | | return R.ok(user); |
| | | } |
| | | } |