fix: 修复套餐过期导致的错误
This commit is contained in:
parent
6c7e27ce78
commit
c0ea800511
@ -302,6 +302,11 @@ func WorkAnalysisConfirm(c *gin.Context) { // 确认数据分析并扣除余量
|
||||
return
|
||||
}
|
||||
|
||||
if balanceInfoRes.BundleStatus == common.BundleExpired {
|
||||
service.Error(c, errors.New("套餐已过期"))
|
||||
return
|
||||
}
|
||||
|
||||
analysisInfoRes, err := service.CastProvider.GetWorkAnalysis(c, &cast.GetWorkAnalysisDetailReq{
|
||||
Uuid: req.Uuid,
|
||||
})
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package cast
|
||||
package cast
|
||||
|
||||
import (
|
||||
"context"
|
||||
@ -13,6 +13,7 @@ import (
|
||||
modelCast "fonchain-fiee/pkg/model/cast"
|
||||
"fonchain-fiee/pkg/model/login"
|
||||
"fonchain-fiee/pkg/service"
|
||||
"fonchain-fiee/pkg/service/bundle/common"
|
||||
"fonchain-fiee/pkg/utils"
|
||||
"strconv"
|
||||
"sync"
|
||||
@ -609,6 +610,22 @@ func autoConfirmAnalysis(ctx context.Context, analysisUuid string) (err error) {
|
||||
isFailed = true
|
||||
}
|
||||
|
||||
if balanceInfoRes.BundleStatus == common.BundleExpired {
|
||||
confirmRemark = "套餐已过期"
|
||||
// 直接提交
|
||||
_, err = service.CastProvider.UpdateWorkAnalysisStatus(context.Background(), &cast.UpdateWorkAnalysisStatusReq{
|
||||
WorkAction: cast.WorkActionENUM_CONFIRM,
|
||||
Uuid: analysisUuid,
|
||||
ConfirmRemark: confirmRemark,
|
||||
ConfirmStatus: 3,
|
||||
})
|
||||
if err != nil {
|
||||
zap.L().Error("autoConfirmAnalysis UpdateWorkAnalysisStatus", zap.Any("err", err))
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
var addBalanceReq bundle.AddBundleBalanceReq
|
||||
addBalanceReq.UserId = int32(userID)
|
||||
// 检查数据分析余量
|
||||
|
||||
@ -520,6 +520,11 @@ func UpdateCompetitiveReportStatus(ctx *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if balanceInfoRes.BundleStatus == common.BundleExpired {
|
||||
service.Error(ctx, errors.New("套餐已过期"))
|
||||
return
|
||||
}
|
||||
|
||||
if balanceInfoRes.CompetitiveConsumptionNumber >= balanceInfoRes.CompetitiveNumber {
|
||||
service.Error(ctx, errors.New("竞品报告余额不足"))
|
||||
return
|
||||
@ -946,6 +951,22 @@ func autoConfirmReport(ctx context.Context, reportUuid string) (err error) {
|
||||
isFailed = true
|
||||
}
|
||||
|
||||
if balanceInfoRes.BundleStatus == common.BundleExpired {
|
||||
confirmRemark = "套餐已过期"
|
||||
// 直接提交
|
||||
_, err = service.CastProvider.UpdateCompetitiveReportStatus(context.Background(), &cast.UpdateCompetitiveReportStatusReq{
|
||||
WorkAction: cast.WorkActionENUM_CONFIRM,
|
||||
Uuid: reportUuid,
|
||||
ConfirmRemark: confirmRemark,
|
||||
ConfirmStatus: 3,
|
||||
})
|
||||
if err != nil {
|
||||
zap.L().Error("autoConfirmReport UpdateCompetitiveReportStatus", zap.Any("err", err))
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
var addBalanceReq bundle.AddBundleBalanceReq
|
||||
addBalanceReq.UserId = int32(userID)
|
||||
// 检查竞品报告余量
|
||||
|
||||
Loading…
Reference in New Issue
Block a user