diff --git a/app/mix/service/apiservice_business_validation.go b/app/mix/service/apiservice_business_validation.go index 40bce516..bf47206e 100644 --- a/app/mix/service/apiservice_business_validation.go +++ b/app/mix/service/apiservice_business_validation.go @@ -487,7 +487,7 @@ func (s *Service) ApiCreateStreamerAuthApprovalBasicBusinessValidate(ctx *gin.Co result := businessvalidator.NewAuthBusinessValidator(ctx, req). QueryAccount(_DefaultAccount.OpListByMid). - EnsureIsThisRole(consts.Streamer). + EnsureIsNotThisRole(consts.Streamer). EnsureMediaIsSuccessfullyUploaded(req.StreamerAuthApprovalBasic.Avatar). EnsureMediaIsSuccessfullyUploaded(req.StreamerAuthApprovalBasic.AccountShot). Validate(). @@ -504,6 +504,8 @@ func (s *Service) ApiCreateStreamerAuthApprovalDetailsBusinessValidate(ctx *gin. ec = errcode.ErrCodeStreamerAuthApprovalSrvOk result := businessvalidator.NewAuthBusinessValidator(ctx, req). + QueryAccount(_DefaultAccount.OpListByMid). + EnsureIsNotThisRole(consts.Streamer). EnsureMediaIsSuccessfullyUploaded(req.StreamerAuthApprovalDetails.Cover). EnsureMediaIsSuccessfullyUploaded(req.StreamerAuthApprovalDetails.Shorts). EnsureMediaIsSuccessfullyUploaded(req.StreamerAuthApprovalDetails.Album). diff --git a/app/mix/service/logic/streamerauthapproval_basic.go b/app/mix/service/logic/streamerauthapproval_basic.go index 6147bf50..91c83a8d 100644 --- a/app/mix/service/logic/streamerauthapproval_basic.go +++ b/app/mix/service/logic/streamerauthapproval_basic.go @@ -102,7 +102,6 @@ func (p *StreamerAuthApprovalBasic) OpDeleteBatch(ctx *gin.Context, ids []int64) //2.原有审核申请标记删除后转存到历史表 for _, streamerauthapprovalbasic := range list { streamerauthapprovalbasic.DelFlag = goproto.Int64(consts.Deleted) - streamerauthapprovalbasic.ApproveStatus = goproto.Int64(consts.StreamerAuthApprovalBasicApprove_Rejected) } err = p.store.CreateBatchStreamerAuthApprovalBasicHis(ctx, list) if err != nil { diff --git a/app/mix/service/logic/streamerauthapproval_details.go b/app/mix/service/logic/streamerauthapproval_details.go index c83dc72c..024bd906 100644 --- a/app/mix/service/logic/streamerauthapproval_details.go +++ b/app/mix/service/logic/streamerauthapproval_details.go @@ -119,7 +119,7 @@ func (p *StreamerAuthApprovalDetails) OpDeleteBatch(ctx *gin.Context, ids []int6 return nil } -func (p *StreamerAuthApprovalDetails) OpDeleteBatchByMids(ctx *gin.Context, mids []int64) error { +func (p *StreamerAuthApprovalDetails) OpDeleteBatchByMids(ctx *gin.Context, mids []int64, status int64, approveStatus int64, remarks string) error { //1.查出原有审核申请 list, err := p.store.GetStreamerAuthApprovalDetailsListByMids(ctx, mids) @@ -134,8 +134,9 @@ func (p *StreamerAuthApprovalDetails) OpDeleteBatchByMids(ctx *gin.Context, mids //2.原有审核申请标记删除后转存到历史表 for _, streamerauthapprovaldetails := range list { streamerauthapprovaldetails.DelFlag = goproto.Int64(consts.Deleted) - streamerauthapprovaldetails.ApproveStatus = goproto.Int64(consts.StreamerAuthApprovalDetailsApprove_Rejected) - streamerauthapprovaldetails.Status = goproto.Int64(consts.StreamerAuthApprovalDetails_Rejected) + streamerauthapprovaldetails.Status = goproto.Int64(status) + streamerauthapprovaldetails.ApproveStatus = goproto.Int64(approveStatus) + streamerauthapprovaldetails.Remarks = goproto.String(remarks) } err = p.store.CreateBatchStreamerAuthApprovalDetailsHis(ctx, list) if err != nil { diff --git a/app/mix/service/service.go b/app/mix/service/service.go index e2c6b764..7ec431f2 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -1964,12 +1964,12 @@ func (s *Service) OpGetStreamerAuthApprovalBasicHisList(ctx *gin.Context, req *s func (s *Service) OpApproveStreamerAuthApprovalBasic(ctx *gin.Context, req *streamerauthapprovalbasicproto.OpApproveReq) (ec errcode.ErrCode) { ec = errcode.ErrCodeStreamerAuthApprovalBasicSrvOk - //状态流转:0-等待复审 → 3-跟进中,3-跟进中 → 1-通过/2-拒绝 + //状态流转:0-等待复审 → 3-跟进中/2-拒绝,3-跟进中 → 1-通过 destApproveStatus := util.DerefInt64(req.ApproveStatus) currentApproveStatus := int64(-1) - if destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Approving { + if destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Approving || destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Rejected { currentApproveStatus = consts.StreamerAuthApprovalBasicApprove_Waiting - } else if destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Passed || destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Rejected { + } else if destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Passed { currentApproveStatus = consts.StreamerAuthApprovalBasicApprove_Approving } @@ -2015,7 +2015,7 @@ func (s *Service) OpApproveStreamerAuthApprovalBasic(ctx *gin.Context, req *stre for _, basic := range list { mids = append(mids, basic.GetMid()) } - err = _DefaultStreamerAuthApprovalDetails.OpDeleteBatchByMids(ctx, mids) + err = _DefaultStreamerAuthApprovalDetails.OpDeleteBatchByMids(ctx, mids, consts.StreamerAuthApprovalDetails_Rejected, consts.StreamerAuthApprovalDetailsApprove_Rejected, util.DerefString(req.Remarks)) if err != nil { logger.Error("_DefaultStreamerAuthApprovalDetails OpDeleteBatchByMids fail, req: %v, err: %v", util.ToJson(req), err) ec = errcode.ErrCodeStreamerAuthApprovalDetailsSrvFail