release-音乐人审核

release-2024-08-08
pikaqiudeshujia 7 months ago
parent 9c81dcc153
commit 1257b77eb1

@ -1,6 +1,7 @@
package com.luoo.user.controller; package com.luoo.user.controller;
import api.Result; import api.Result;
import com.luoo.user.dto.UserProcessApproveDto;
import com.luoo.user.dto.artist.ArtistRegisterDto; import com.luoo.user.dto.artist.ArtistRegisterDto;
import com.luoo.user.dto.artist.ArtistUserBindDto; import com.luoo.user.dto.artist.ArtistUserBindDto;
import com.luoo.user.service.ArtistService; import com.luoo.user.service.ArtistService;
@ -38,7 +39,12 @@ public class ArtistController {
return Result.success(); return Result.success();
} }
@ApiOperation(value = "音乐人审核",notes = "音乐人审核")
@PostMapping("/approve")
public Result<Void> approve(@ApiParam(value = "音乐人审核对象", required = true) @Valid @RequestBody UserProcessApproveDto userProcessApproveDto) {
artistService.approve(userProcessApproveDto);
return Result.success();
}
@ApiOperation(value = "音乐人-成员绑定", notes = "音乐人-成员绑定") @ApiOperation(value = "音乐人-成员绑定", notes = "音乐人-成员绑定")
@PostMapping("/bind") @PostMapping("/bind")

@ -18,4 +18,5 @@ public interface UserProcessDao extends JpaRepository<UserProcess,String>, JpaSp
public List<UserProcess> findUserProcessByUserIdAndTypeAndStatus(String userId, Integer type, Integer status); public List<UserProcess> findUserProcessByUserIdAndTypeAndStatus(String userId, Integer type, Integer status);
public UserProcess findUserProcessById(String id);
} }

@ -0,0 +1,30 @@
package com.luoo.user.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author: yawei.huang
* @Package: com.luoo.user.dto
* @Project: luoo_parent
* @Date: 2024/4/28 8:53
* @Filename: UserProcessDto
* @Describe:
*/
@Data
public class UserProcessApproveDto implements Serializable {
@ApiModelProperty(name = "id")
@NotBlank(message = "id必填")
private String id;
@ApiModelProperty(name = "审核结果")
@NotBlank(message = "审核结果必填")
private Integer status;
@ApiModelProperty(name = "拒绝理由")
private String content;
}

@ -44,17 +44,17 @@ public class ArtistRegisterDto implements Serializable {
@ApiModelProperty(name = "所属公司/厂牌") @ApiModelProperty(name = "所属公司/厂牌")
private String bandUserId; private String bandUserId;
@ApiModelProperty(name = "负责人名称") // @ApiModelProperty(name = "负责人名称")
@NotBlank(message = "负责人名称必填") // @NotBlank(message = "负责人名称必填")
private String responsibleName; // private String responsibleName;
//
@ApiModelProperty(name = "性别") // @ApiModelProperty(name = "性别")
@NotNull(message = "负责人性别必填") // @NotNull(message = "负责人性别必填")
private Integer sex; // private Integer sex;
//
@ApiModelProperty(name = "负责人手机") // @ApiModelProperty(name = "负责人手机")
@NotBlank(message = "负责人手机必填") // @NotBlank(message = "负责人手机必填")
private String mobile; // private String mobile;
@ApiModelProperty(name = "登录用户名") @ApiModelProperty(name = "登录用户名")
@NotBlank(message = "用户名必填") @NotBlank(message = "用户名必填")

@ -1,6 +1,7 @@
package com.luoo.user.service; package com.luoo.user.service;
import com.luoo.user.dao.*; import com.luoo.user.dao.*;
import com.luoo.user.dto.UserProcessApproveDto;
import com.luoo.user.dto.artist.ArtistRegisterDto; import com.luoo.user.dto.artist.ArtistRegisterDto;
import com.luoo.user.dto.artist.ArtistUserBindDto; import com.luoo.user.dto.artist.ArtistUserBindDto;
import com.luoo.user.pojo.*; import com.luoo.user.pojo.*;
@ -9,6 +10,8 @@ import enums.UserProcessStatusEnum;
import enums.UserProcessTypeEnum; import enums.UserProcessTypeEnum;
import enums.UserStatusEnum; import enums.UserStatusEnum;
import lombok.extern.slf4j.Slf4j; 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.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -92,14 +95,14 @@ public class ArtistService {
artistInfoDao.save(artistInfo); artistInfoDao.save(artistInfo);
// 新增音乐人负责人信息 // 新增音乐人负责人信息
ArtistResponsible artistResponsible = ArtistResponsible.builder() // ArtistResponsible artistResponsible = ArtistResponsible.builder()
.id(String.valueOf(idWorker.nextId())) // .id(String.valueOf(idWorker.nextId()))
.userId(userInfo.getId()) // .userId(userInfo.getId())
.sex(artistRegisterDto.getSex()) // .sex(artistRegisterDto.getSex())
.name(artistRegisterDto.getNickName()) // .name(artistRegisterDto.getNickName())
.mobile(artistRegisterDto.getMobile()) // .mobile(artistRegisterDto.getMobile())
.build(); // .build();
artistResponsibleDao.save(artistResponsible); // artistResponsibleDao.save(artistResponsible);
// 审核记录 // 审核记录
List<UserProcess> successList = userProcessDao.findUserProcessByUserIdAndTypeAndStatus(userInfo.getId(), UserProcessTypeEnum.ARTIST.getCode(), UserProcessStatusEnum.SUCCESS.getCode()); List<UserProcess> successList = userProcessDao.findUserProcessByUserIdAndTypeAndStatus(userInfo.getId(), UserProcessTypeEnum.ARTIST.getCode(), UserProcessStatusEnum.SUCCESS.getCode());
@ -121,6 +124,32 @@ public class ArtistService {
userProcessDao.save(userProcess); 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);
}
/** /**
* - * -
* *

Loading…
Cancel
Save