|
|
|
@ -1,18 +1,12 @@
|
|
|
|
|
package com.luoo.user.service;
|
|
|
|
|
|
|
|
|
|
import api.PageResult;
|
|
|
|
|
import com.luoo.user.dao.ArtistInfoDao;
|
|
|
|
|
import com.luoo.user.dao.ArtistUserDao;
|
|
|
|
|
import com.luoo.user.dao.UserInfoDao;
|
|
|
|
|
import com.luoo.user.dao.UserProcessDao;
|
|
|
|
|
import com.luoo.user.dao.*;
|
|
|
|
|
import com.luoo.user.dto.UserProcessApproveDto;
|
|
|
|
|
import com.luoo.user.dto.artist.ArtistRegisterDto;
|
|
|
|
|
import com.luoo.user.dto.artist.ArtistSearchDto;
|
|
|
|
|
import com.luoo.user.dto.artist.ArtistUserBindDto;
|
|
|
|
|
import com.luoo.user.pojo.ArtistInfo;
|
|
|
|
|
import com.luoo.user.pojo.ArtistUser;
|
|
|
|
|
import com.luoo.user.pojo.UserInfo;
|
|
|
|
|
import com.luoo.user.pojo.UserProcess;
|
|
|
|
|
import com.luoo.user.pojo.*;
|
|
|
|
|
import constants.Constants;
|
|
|
|
|
import constants.ErrorConstants;
|
|
|
|
|
import dto.UserLoginDto;
|
|
|
|
@ -25,16 +19,24 @@ import exception.BizException;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang.ObjectUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
|
|
import org.springframework.data.domain.Sort;
|
|
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import util.IdWorker;
|
|
|
|
|
import util.JwtUtil;
|
|
|
|
|
|
|
|
|
|
import javax.persistence.criteria.CriteriaBuilder;
|
|
|
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
|
|
import javax.persistence.criteria.Root;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -65,136 +67,69 @@ public class ArtistService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private ArtistUserDao artistUserDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserProcessDao userProcessDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserMessageService userMessageService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private JwtUtil jwtUtil;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ArtistRegisterDao artistRegisterDao;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 音乐人注册
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public void artistRegister(String token, ArtistRegisterDto artistRegisterDto) {
|
|
|
|
|
|
|
|
|
|
UserLoginDto currentUser = jwtUtil.getUserLoginDto(token);
|
|
|
|
|
UserInfo userInfo;
|
|
|
|
|
if (currentUser == null) {
|
|
|
|
|
// 用户校验失败,请重新登录
|
|
|
|
|
throw new BizException(ErrorConstants.USER_VERIFICATION_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(artistRegisterDto.getUserId())) {
|
|
|
|
|
// 重新发起音乐人账号审批
|
|
|
|
|
UserInfo info = userInfoDao.findById(artistRegisterDto.getUserId()).get();
|
|
|
|
|
if(ObjectUtils.notEqual(artistRegisterDto.getUserName(), info.getUserName())) {
|
|
|
|
|
throw new BizException("用户名不允许修改");
|
|
|
|
|
}
|
|
|
|
|
Integer count = userInfoDao.countByUserNameAndUserNameNotNullAndIdNot(artistRegisterDto.getUserName(), artistRegisterDto.getUserId());
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
throw new BizException("该用户名已存在,请重新输入!");
|
|
|
|
|
}
|
|
|
|
|
userInfo = UserInfo.builder()
|
|
|
|
|
.id(info.getId())
|
|
|
|
|
.nickName(artistRegisterDto.getNickName())
|
|
|
|
|
.avatar(artistRegisterDto.getAvatar())
|
|
|
|
|
.joinTime(new Date())
|
|
|
|
|
.status(UserStatusEnum.UNAPPROVED.getStatus())
|
|
|
|
|
.thumbnail(Constants.DEFAULT_USER_THUMBNAIL)
|
|
|
|
|
.signature(Constants.DEFAULT_USER_SIGNATURE)
|
|
|
|
|
.userName(artistRegisterDto.getUserName())
|
|
|
|
|
.type(artistRegisterDto.getType())
|
|
|
|
|
.password(encoder.encode(artistRegisterDto.getPassword()))
|
|
|
|
|
.build();
|
|
|
|
|
userInfoDao.save(userInfo);
|
|
|
|
|
|
|
|
|
|
ArtistInfo artistInfoByUserId = artistInfoDao.findArtistInfoByUserId(artistRegisterDto.getUserId());
|
|
|
|
|
|
|
|
|
|
// 新增音乐人基本信息
|
|
|
|
|
ArtistInfo artistInfo = ArtistInfo.builder()
|
|
|
|
|
.id(artistInfoByUserId != null ? artistInfoByUserId.getId() : String.valueOf(idWorker.nextId()))
|
|
|
|
|
.userId(userInfo.getId())
|
|
|
|
|
.backgroundImage(artistRegisterDto.getBackgroundImage())
|
|
|
|
|
.address(artistRegisterDto.getAddress())
|
|
|
|
|
.style(artistRegisterDto.getStyle())
|
|
|
|
|
.bandUserId(artistRegisterDto.getBandUserId())
|
|
|
|
|
.build();
|
|
|
|
|
artistInfoDao.save(artistInfo);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
String id = artistRegisterDto.getId();
|
|
|
|
|
if (StringUtils.isNotBlank(id)) {
|
|
|
|
|
// 新增音乐人账号
|
|
|
|
|
// 目前一个用户只能新增一个音乐人账号
|
|
|
|
|
UserProcess currentUserProcess = userProcessDao.findUserProcessByCreateUserAndTypeOrderByCreateTime(currentUser.getUserId(), UserProcessTypeEnum.ARTIST.getCode());
|
|
|
|
|
if(currentUserProcess != null) {
|
|
|
|
|
// 一个用户只能新增一个音乐人账号
|
|
|
|
|
List<ArtistRegister> list = artistRegisterDao.findAllByCreateUser(currentUser.getUserId());
|
|
|
|
|
if (!list.isEmpty()) {
|
|
|
|
|
// 用户已存在音乐人账号
|
|
|
|
|
throw new BizException(ErrorConstants.USER_ALREADY_EXISTS_ARTIST);
|
|
|
|
|
}
|
|
|
|
|
Integer count = userInfoDao.countByUserNameAndUserNameNotNull(artistRegisterDto.getUserName());
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
throw new BizException("该用户名已存在,请重新输入!");
|
|
|
|
|
}
|
|
|
|
|
// 新增用户基本信息
|
|
|
|
|
userInfo = UserInfo.builder()
|
|
|
|
|
.id(String.valueOf(idWorker.nextId()))
|
|
|
|
|
.nickName(artistRegisterDto.getNickName())
|
|
|
|
|
.avatar(artistRegisterDto.getAvatar())
|
|
|
|
|
.joinTime(new Date())
|
|
|
|
|
.status(UserStatusEnum.UNAPPROVED.getStatus())
|
|
|
|
|
.thumbnail(Constants.DEFAULT_USER_THUMBNAIL)
|
|
|
|
|
.signature(Constants.DEFAULT_USER_SIGNATURE)
|
|
|
|
|
.userName(artistRegisterDto.getUserName())
|
|
|
|
|
.type(artistRegisterDto.getType())
|
|
|
|
|
.password(encoder.encode(artistRegisterDto.getPassword()))
|
|
|
|
|
.build();
|
|
|
|
|
userInfoDao.save(userInfo);
|
|
|
|
|
|
|
|
|
|
// 新增音乐人基本信息
|
|
|
|
|
ArtistInfo artistInfo = ArtistInfo.builder()
|
|
|
|
|
.id(String.valueOf(idWorker.nextId()))
|
|
|
|
|
.userId(userInfo.getId())
|
|
|
|
|
.backgroundImage(artistRegisterDto.getBackgroundImage())
|
|
|
|
|
.address(artistRegisterDto.getAddress())
|
|
|
|
|
.style(artistRegisterDto.getStyle())
|
|
|
|
|
.bandUserId(artistRegisterDto.getBandUserId())
|
|
|
|
|
.build();
|
|
|
|
|
artistInfoDao.save(artistInfo);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 新增音乐人负责人信息
|
|
|
|
|
// ArtistResponsible artistResponsible = ArtistResponsible.builder()
|
|
|
|
|
// .id(String.valueOf(idWorker.nextId()))
|
|
|
|
|
// .userId(userInfo.getId())
|
|
|
|
|
// .sex(artistRegisterDto.getSex())
|
|
|
|
|
// .name(artistRegisterDto.getNickName())
|
|
|
|
|
// .mobile(artistRegisterDto.getMobile())
|
|
|
|
|
// .build();
|
|
|
|
|
// artistResponsibleDao.save(artistResponsible);
|
|
|
|
|
|
|
|
|
|
// 审核记录
|
|
|
|
|
List<UserProcess> successList = userProcessDao.findUserProcessByUserIdAndTypeAndStatus(userInfo.getId(), UserProcessTypeEnum.ARTIST.getCode(), UserProcessStatusEnum.SUCCESS.getCode());
|
|
|
|
|
if (!successList.isEmpty()) {
|
|
|
|
|
throw new BizException("该账号已审核通过,请勿重复申请");
|
|
|
|
|
List<ArtistRegister> allByUserName = artistRegisterDao.findAllByUserName(artistRegisterDto.getUserName());
|
|
|
|
|
if (!allByUserName.isEmpty()) {
|
|
|
|
|
// 用户名已存在
|
|
|
|
|
throw new BizException(ErrorConstants.USER_NAME_ALREADY_EXISTS);
|
|
|
|
|
}
|
|
|
|
|
List<UserProcess> upApprovedList = userProcessDao.findUserProcessByUserIdAndTypeAndStatus(userInfo.getId(), UserProcessTypeEnum.ARTIST.getCode(), UserProcessStatusEnum.UNAPPROVED.getCode());
|
|
|
|
|
if (!upApprovedList.isEmpty()) {
|
|
|
|
|
throw new BizException("该账号正在审核中,请勿重复申请");
|
|
|
|
|
ArtistRegister artistRegister = new ArtistRegister();
|
|
|
|
|
BeanUtils.copyProperties(artistRegisterDto, artistRegister);
|
|
|
|
|
// 未审核状态
|
|
|
|
|
artistRegister.setStatus(UserProcessStatusEnum.UNAPPROVED.getCode());
|
|
|
|
|
// 创建人
|
|
|
|
|
artistRegister.setCreateUser(currentUser.getUserId());
|
|
|
|
|
// 密码加密
|
|
|
|
|
artistRegister.setPassword(encoder.encode(artistRegisterDto.getPassword()));
|
|
|
|
|
artistRegisterDao.save(artistRegister);
|
|
|
|
|
} else {
|
|
|
|
|
// 拒绝后重新发起音乐人账号审批
|
|
|
|
|
// 判断当前是否是拒绝状态
|
|
|
|
|
ArtistRegister artistRegister = artistRegisterDao.findById(id).get();
|
|
|
|
|
if (ObjectUtils.notEqual(UserProcessStatusEnum.FAIL.getCode(), artistRegister.getStatus())) {
|
|
|
|
|
throw new BizException(ErrorConstants.STATE_ERROR);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UserProcess userProcess = UserProcess.builder()
|
|
|
|
|
.id(String.valueOf(idWorker.nextId()))
|
|
|
|
|
.userId(userInfo.getId())
|
|
|
|
|
.type(UserProcessTypeEnum.ARTIST.getCode())
|
|
|
|
|
.status(UserProcessStatusEnum.UNAPPROVED.getCode())
|
|
|
|
|
.createTime(new Date())
|
|
|
|
|
.createUser(currentUser.getUserId())
|
|
|
|
|
.build();
|
|
|
|
|
List<ArtistRegister> allByUserName = artistRegisterDao.findAllByUserNameAndIdNot(artistRegisterDto.getUserName(), id);
|
|
|
|
|
if (!allByUserName.isEmpty()) {
|
|
|
|
|
// 用户名已存在
|
|
|
|
|
throw new BizException(ErrorConstants.USER_NAME_ALREADY_EXISTS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
userProcessDao.save(userProcess);
|
|
|
|
|
BeanUtils.copyProperties(artistRegisterDto, artistRegister);
|
|
|
|
|
// 未审核状态
|
|
|
|
|
artistRegister.setStatus(UserProcessStatusEnum.UNAPPROVED.getCode());
|
|
|
|
|
// 创建人
|
|
|
|
|
artistRegister.setCreateUser(currentUser.getUserId());
|
|
|
|
|
// 密码加密
|
|
|
|
|
artistRegister.setPassword(encoder.encode(artistRegisterDto.getPassword()));
|
|
|
|
|
artistRegisterDao.save(artistRegister);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -227,27 +162,50 @@ public class ArtistService {
|
|
|
|
|
throw new BizException("请填写拒绝理由!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UserProcess userProcessById = userProcessDao.findUserProcessById(userProcessApproveDto.getId());
|
|
|
|
|
userProcessById.setContent(userProcessApproveDto.getContent());
|
|
|
|
|
userProcessById.setModifyTime(new Date());
|
|
|
|
|
userProcessById.setStatus(userProcessApproveDto.getStatus());
|
|
|
|
|
|
|
|
|
|
userProcessDao.save(userProcessById);
|
|
|
|
|
ArtistRegister artistRegister = artistRegisterDao.findById(userProcessApproveDto.getId()).get();
|
|
|
|
|
artistRegister.setStatus(userProcessApproveDto.getStatus());
|
|
|
|
|
artistRegister.setContent(userProcessApproveDto.getContent());
|
|
|
|
|
artistRegister.setModifyTime(new Date());
|
|
|
|
|
artistRegisterDao.save(artistRegister);
|
|
|
|
|
|
|
|
|
|
UserInfo userInfo = userInfoDao.findById(userProcessById.getUserId()).get();
|
|
|
|
|
userInfo.setStatus(ObjectUtils.equals(UserProcessStatusEnum.FAIL.getCode(), userProcessApproveDto.getStatus()) ?
|
|
|
|
|
UserStatusEnum.DISABLE.getStatus() : UserStatusEnum.ENABLE.getStatus());
|
|
|
|
|
userInfo.setModifyTime(new Date());
|
|
|
|
|
if (ObjectUtils.equals(UserProcessStatusEnum.SUCCESS.getCode(), userProcessApproveDto.getStatus())) {
|
|
|
|
|
// 审核通过
|
|
|
|
|
// 新增用户基本信息,直接是启用状态
|
|
|
|
|
UserInfo userInfo = UserInfo.builder()
|
|
|
|
|
.id(String.valueOf(idWorker.nextId()))
|
|
|
|
|
.nickName(artistRegister.getNickName())
|
|
|
|
|
.avatar(artistRegister.getAvatar())
|
|
|
|
|
.joinTime(new Date())
|
|
|
|
|
.status(UserStatusEnum.ENABLE.getStatus())
|
|
|
|
|
.thumbnail(Constants.DEFAULT_USER_THUMBNAIL)
|
|
|
|
|
.signature(Constants.DEFAULT_USER_SIGNATURE)
|
|
|
|
|
.userName(artistRegister.getUserName())
|
|
|
|
|
.type(artistRegister.getType())
|
|
|
|
|
.password(artistRegister.getPassword())
|
|
|
|
|
.build();
|
|
|
|
|
userInfoDao.save(userInfo);
|
|
|
|
|
|
|
|
|
|
// 新增音乐人基本信息
|
|
|
|
|
ArtistInfo artistInfo = ArtistInfo.builder()
|
|
|
|
|
.id(String.valueOf(idWorker.nextId()))
|
|
|
|
|
.userId(userInfo.getId())
|
|
|
|
|
.backgroundImage(artistRegister.getBackgroundImage())
|
|
|
|
|
.address(artistRegister.getAddress())
|
|
|
|
|
.style(artistRegister.getStyle())
|
|
|
|
|
.bandUserId(artistRegister.getBandUserId())
|
|
|
|
|
.build();
|
|
|
|
|
artistInfoDao.save(artistInfo);
|
|
|
|
|
}
|
|
|
|
|
UserInfo sendUser = userInfoDao.findById(artistRegister.getCreateUser()).get();
|
|
|
|
|
|
|
|
|
|
UserMessageDto userMessageDto = new UserMessageDto();
|
|
|
|
|
userMessageDto.setType(MessageTypeEnum.PRIVATE_MESSAGE.getType());
|
|
|
|
|
userMessageDto.setSendUserId(userInfo.getId());
|
|
|
|
|
userMessageDto.setSendUserId(sendUser.getId());
|
|
|
|
|
userMessageDto.setTitle(title);
|
|
|
|
|
userMessageDto.setContent(content);
|
|
|
|
|
userMessageDto.setUserId(userProcessById.getCreateUser());
|
|
|
|
|
userMessageDto.setSendUserAvatar(Constants.RESOURCE_PREFIX + userInfo.getAvatar());
|
|
|
|
|
userMessageDto.setSendUserNickName(userInfo.getNickName());
|
|
|
|
|
userMessageDto.setUserId(artistRegister.getCreateUser());
|
|
|
|
|
userMessageDto.setSendUserAvatar(Constants.RESOURCE_PREFIX + sendUser.getAvatar());
|
|
|
|
|
userMessageDto.setSendUserNickName(sendUser.getNickName());
|
|
|
|
|
userMessageService.sendUserMessage(userMessageDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -288,60 +246,72 @@ public class ArtistService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页显示音乐人列表
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public PageResult<ArtistInfo> getList(ArtistSearchDto artistSearchDto, Integer page, Integer size) {
|
|
|
|
|
Pageable pageable = PageRequest.of(page - 1, size);
|
|
|
|
|
Page<ArtistInfo> artistInfoPage;
|
|
|
|
|
if(artistSearchDto.getStatus() == null) {
|
|
|
|
|
artistInfoPage = artistInfoDao.findAllNoStatus(pageable);
|
|
|
|
|
} else {
|
|
|
|
|
artistInfoPage = artistInfoDao.findAllByStatus(artistSearchDto.getStatus(), pageable);
|
|
|
|
|
}
|
|
|
|
|
long totalElements = artistInfoPage.getTotalElements();
|
|
|
|
|
return new PageResult<>(totalElements, artistInfoPage.getContent());
|
|
|
|
|
public PageResult<ArtistRegister> getList(ArtistSearchDto artistSearchDto, Integer page, Integer size) {
|
|
|
|
|
Sort sort = new Sort(Sort.Direction.DESC, "createTime");
|
|
|
|
|
PageRequest pageRequest = PageRequest.of(page - 1, size, sort);
|
|
|
|
|
|
|
|
|
|
Specification<ArtistRegister> artistRegisterDtoSpecification = buildSearchSpecification(artistSearchDto);
|
|
|
|
|
Page<ArtistRegister> artistRegisterPage = artistRegisterDao.findAll(artistRegisterDtoSpecification, pageRequest);
|
|
|
|
|
|
|
|
|
|
long totalElements = artistRegisterPage.getTotalElements();
|
|
|
|
|
return new PageResult<>(totalElements, artistRegisterPage.getContent());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取上一次申请的审批状态
|
|
|
|
|
* 检索条件
|
|
|
|
|
*
|
|
|
|
|
* @param param 查询对象
|
|
|
|
|
* @return 检索条件
|
|
|
|
|
*/
|
|
|
|
|
public UserProcess lastApplyResult(String token) {
|
|
|
|
|
UserLoginDto user = jwtUtil.getUserLoginDto(token);
|
|
|
|
|
if (user == null) {
|
|
|
|
|
throw new BizException(ErrorConstants.USER_VERIFICATION_FAILURE);
|
|
|
|
|
private Specification<ArtistRegister> buildSearchSpecification(ArtistSearchDto param) {
|
|
|
|
|
return (Root<ArtistRegister> root, CriteriaQuery<?> query, CriteriaBuilder builder) -> {
|
|
|
|
|
List<Predicate> predicateList = new ArrayList<Predicate>();
|
|
|
|
|
|
|
|
|
|
if (param.getType() != null) {
|
|
|
|
|
predicateList.add(builder.and(builder.equal(root.get("type"), param.getType())));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (param.getStatus() != null) {
|
|
|
|
|
predicateList.add(builder.and(builder.equal(root.get("status"), param.getStatus())));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(param.getSearchStr())) {
|
|
|
|
|
// 专辑名称
|
|
|
|
|
String likeExpression = "%" + param.getSearchStr() + "%";
|
|
|
|
|
predicateList.add(builder.and(builder.like(root.get("nickName"), likeExpression)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(param.getStyle())) {
|
|
|
|
|
// 专辑名称
|
|
|
|
|
String likeExpression = "%" + param.getStyle() + "%";
|
|
|
|
|
predicateList.add(builder.and(builder.like(root.get("style"), likeExpression)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (param.getStartTime() != null) {
|
|
|
|
|
predicateList.add(builder.greaterThanOrEqualTo(root.get("createTime"), param.getStartTime()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (param.getEndTime() != null) {
|
|
|
|
|
predicateList.add(builder.lessThanOrEqualTo(root.get("createTime"), param.getEndTime()));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return userProcessDao.findUserProcessByCreateUserAndTypeOrderByCreateTime(user.getUserId(), UserProcessTypeEnum.ARTIST.getCode());
|
|
|
|
|
return builder.and(predicateList.toArray(new Predicate[predicateList.size()]));
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 返回给前端上一次申请的对象
|
|
|
|
|
*
|
|
|
|
|
* 获取上一次申请的审批状态
|
|
|
|
|
*/
|
|
|
|
|
public ArtistRegisterDto lastApplyRecord(String token) {
|
|
|
|
|
public ArtistRegister lastApplyResult(String token) {
|
|
|
|
|
UserLoginDto user = jwtUtil.getUserLoginDto(token);
|
|
|
|
|
if (user == null) {
|
|
|
|
|
throw new BizException(ErrorConstants.USER_VERIFICATION_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
UserProcess userprocess = userProcessDao.findUserProcessByCreateUserAndTypeOrderByCreateTime(user.getUserId(), UserProcessTypeEnum.ARTIST.getCode());
|
|
|
|
|
String userId = userprocess.getUserId();
|
|
|
|
|
UserInfo userInfo = userInfoDao.findById(userId).get();
|
|
|
|
|
ArtistInfo artistInfoByUserId = artistInfoDao.findArtistInfoByUserId(userId);
|
|
|
|
|
|
|
|
|
|
return ArtistRegisterDto.builder()
|
|
|
|
|
.userId(userInfo.getId())
|
|
|
|
|
.nickName(userInfo.getNickName())
|
|
|
|
|
.avatar(userInfo.getAvatar())
|
|
|
|
|
.userName(userInfo.getUserName())
|
|
|
|
|
.type(userInfo.getType())
|
|
|
|
|
.password("")
|
|
|
|
|
.backgroundImage(artistInfoByUserId.getBackgroundImage())
|
|
|
|
|
.address(artistInfoByUserId.getAddress())
|
|
|
|
|
.style(artistInfoByUserId.getStyle())
|
|
|
|
|
.bandUserId(artistInfoByUserId.getBandUserId())
|
|
|
|
|
.screenshot(artistInfoByUserId.getScreenshot())
|
|
|
|
|
.build();
|
|
|
|
|
return artistRegisterDao.findArtistRegisterByCreateUserOrderByCreateTime(user.getUserId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|