|
|
@ -3,11 +3,15 @@ package com.luoo.user.service;
|
|
|
|
import com.luoo.user.dao.BandInfoDao;
|
|
|
|
import com.luoo.user.dao.BandInfoDao;
|
|
|
|
import com.luoo.user.dao.BandOperatorDao;
|
|
|
|
import com.luoo.user.dao.BandOperatorDao;
|
|
|
|
import com.luoo.user.dao.UserInfoDao;
|
|
|
|
import com.luoo.user.dao.UserInfoDao;
|
|
|
|
|
|
|
|
import com.luoo.user.dao.UserProcessDao;
|
|
|
|
import com.luoo.user.dto.band.BandRegisterDto;
|
|
|
|
import com.luoo.user.dto.band.BandRegisterDto;
|
|
|
|
import com.luoo.user.pojo.BandInfo;
|
|
|
|
import com.luoo.user.pojo.BandInfo;
|
|
|
|
import com.luoo.user.pojo.BandOperator;
|
|
|
|
import com.luoo.user.pojo.BandOperator;
|
|
|
|
import com.luoo.user.pojo.UserInfo;
|
|
|
|
import com.luoo.user.pojo.UserInfo;
|
|
|
|
|
|
|
|
import com.luoo.user.pojo.UserProcess;
|
|
|
|
import constants.Constants;
|
|
|
|
import constants.Constants;
|
|
|
|
|
|
|
|
import enums.UserProcessStatusEnum;
|
|
|
|
|
|
|
|
import enums.UserProcessTypeEnum;
|
|
|
|
import enums.UserStatusEnum;
|
|
|
|
import enums.UserStatusEnum;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@ -17,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import util.IdWorker;
|
|
|
|
import util.IdWorker;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @Author: yawei.huang
|
|
|
|
* @Author: yawei.huang
|
|
|
@ -44,6 +49,9 @@ public class BandService {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private BCryptPasswordEncoder encoder;
|
|
|
|
private BCryptPasswordEncoder encoder;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private UserProcessDao userProcessDao;
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public void bandRegister(BandRegisterDto bandRegisterDto) {
|
|
|
|
public void bandRegister(BandRegisterDto bandRegisterDto) {
|
|
|
|
UserInfo userInfoByUserName = userInfoDao.findUserInfoByUserName(bandRegisterDto.getUserName());
|
|
|
|
UserInfo userInfoByUserName = userInfoDao.findUserInfoByUserName(bandRegisterDto.getUserName());
|
|
|
@ -78,6 +86,23 @@ public class BandService {
|
|
|
|
|
|
|
|
|
|
|
|
bandOperatorDao.save(bandOperator);
|
|
|
|
bandOperatorDao.save(bandOperator);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<UserProcessDao> successList = userProcessDao.findUserProcessByUserIdAndTypeAndStatus(userInfo.getId(), UserProcessTypeEnum.BAND.getCode(), UserProcessStatusEnum.SUCCESS.getCode());
|
|
|
|
|
|
|
|
if(!successList.isEmpty()) {
|
|
|
|
|
|
|
|
throw new RuntimeException("该账号已审核通过,请勿重复申请");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
List<UserProcessDao> upApprovedList = userProcessDao.findUserProcessByUserIdAndTypeAndStatus(userInfo.getId(), UserProcessTypeEnum.BAND.getCode(), UserProcessStatusEnum.UNAPPROVED.getCode());
|
|
|
|
|
|
|
|
if(!upApprovedList.isEmpty()) {
|
|
|
|
|
|
|
|
throw new RuntimeException("该账号正在审核中,请勿重复申请");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UserProcess userProcess = UserProcess.builder()
|
|
|
|
|
|
|
|
.id(String.valueOf(idWorker.nextId()))
|
|
|
|
|
|
|
|
.userId(userInfo.getId())
|
|
|
|
|
|
|
|
.type(UserProcessTypeEnum.BAND.getCode())
|
|
|
|
|
|
|
|
.status(UserProcessStatusEnum.UNAPPROVED.getCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
userProcessDao.save(userProcess);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|