master:代发认证,根据userId查询代发情况;

pull/1121/head
liujiang 2025-10-22 12:11:32 +08:00
parent a01de03f3a
commit f5fc3ff13c
3 changed files with 34 additions and 2 deletions

View File

@ -67,6 +67,14 @@ public class UserAuthenticationController extends XktBaseController {
return R.ok(BeanUtil.toBean(userAuthService.getInfo(userAuthId), UserAuthResVO.class));
}
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,agent')")
@ApiOperation(value = "根据userId查询代发详情", httpMethod = "GET", response = R.class)
@GetMapping(value = "/userid/{userId}")
public R<UserAuthResVO> getInfoByUserId(@PathVariable("userId") Long userId) {
return R.ok(BeanUtil.toBean(userAuthService.getInfoByUserId(userId), UserAuthResVO.class));
}
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin')")
@ApiOperation(value = "代发启用/停用", httpMethod = "PUT", response = R.class)
@Log(title = "代发启用/停用", businessType = BusinessType.UPDATE)

View File

@ -66,4 +66,12 @@ public interface IUserAuthenticationService {
* @return Integer
*/
Integer update(UserAuthUpdateDTO updateDTO);
/**
* userId
*
* @param userId ID
* @return
*/
UserAuthResDTO getInfoByUserId(Long userId);
}

View File

@ -91,6 +91,24 @@ public class UserAuthenticationServiceImpl implements IUserAuthenticationService
return userAuthMapper.updateById(userAuth);
}
/**
* userId
*
* @param userId ID
* @return
*/
@Override
@Transactional(readOnly = true)
public UserAuthResDTO getInfoByUserId(Long userId) {
UserAuthentication userAuth = Optional.ofNullable(this.userAuthMapper.selectOne(new LambdaQueryWrapper<UserAuthentication>()
.eq(UserAuthentication::getUserId, userId)))
.orElseThrow(() -> new ServiceException("代发不存在!", HttpStatus.ERROR));
SysFile faceFile = this.fileMapper.selectById(userAuth.getIdCardFaceFileId());
SysFile emblemFile = this.fileMapper.selectById(userAuth.getIdCardEmblemFileId());
return BeanUtil.toBean(userAuth, UserAuthResDTO.class).setUserAuthId(userAuth.getId())
.setFaceUrl(faceFile.getFileUrl()).setEmblemUrl(emblemFile.getFileUrl());
}
/**
* APP
*
@ -106,8 +124,6 @@ public class UserAuthenticationServiceImpl implements IUserAuthenticationService
}
/**
*
*