|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.luoo.user.service;
|
|
|
|
|
|
|
|
|
|
import com.luoo.user.dao.*;
|
|
|
|
|
import com.luoo.user.dto.UserProcessApproveDto;
|
|
|
|
|
import com.luoo.user.dto.artist.ArtistRegisterDto;
|
|
|
|
|
import com.luoo.user.dto.artist.ArtistUserBindDto;
|
|
|
|
|
import com.luoo.user.pojo.*;
|
|
|
|
@ -9,6 +10,8 @@ import enums.UserProcessStatusEnum;
|
|
|
|
|
import enums.UserProcessTypeEnum;
|
|
|
|
|
import enums.UserStatusEnum;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang.ObjectUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -92,14 +95,14 @@ public class ArtistService {
|
|
|
|
|
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);
|
|
|
|
|
// 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());
|
|
|
|
@ -121,6 +124,32 @@ public class ArtistService {
|
|
|
|
|
userProcessDao.save(userProcess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 音乐人审核
|
|
|
|
|
*
|
|
|
|
|
* @param userProcessApproveDto 审核实体类
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public void approve(UserProcessApproveDto userProcessApproveDto) {
|
|
|
|
|
if(ObjectUtils.equals(UserProcessStatusEnum.FAIL.getCode(), userProcessApproveDto.getStatus())
|
|
|
|
|
&& StringUtils.isBlank(userProcessApproveDto.getContent())) {
|
|
|
|
|
throw new RuntimeException("请填写拒绝理由!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UserProcess userProcessById = userProcessDao.findUserProcessById(userProcessApproveDto.getId());
|
|
|
|
|
userProcessById.setContent(userProcessApproveDto.getContent());
|
|
|
|
|
userProcessById.setModifyTime(new Date());
|
|
|
|
|
userProcessById.setStatus(userProcessApproveDto.getStatus());
|
|
|
|
|
|
|
|
|
|
userProcessDao.save(userProcessById);
|
|
|
|
|
|
|
|
|
|
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());
|
|
|
|
|
userInfoDao.save(userInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 音乐人-成员绑定
|
|
|
|
|
*
|
|
|
|
|