Merge branch 'feat-cjy-report' into dev
This commit is contained in:
commit
82fd06139a
@ -317,6 +317,11 @@ func WorkAnalysisConfirm(c *gin.Context) { // 确认数据分析并扣除余量
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if balanceInfoRes.BundleStatus == common.BundleExpired {
|
||||||
|
service.Error(c, errors.New("套餐已过期"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
analysisInfoRes, err := service.CastProvider.GetWorkAnalysis(c, &cast.GetWorkAnalysisDetailReq{
|
analysisInfoRes, err := service.CastProvider.GetWorkAnalysis(c, &cast.GetWorkAnalysisDetailReq{
|
||||||
Uuid: req.Uuid,
|
Uuid: req.Uuid,
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
package cast
|
package cast
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -13,6 +13,7 @@ import (
|
|||||||
modelCast "fonchain-fiee/pkg/model/cast"
|
modelCast "fonchain-fiee/pkg/model/cast"
|
||||||
"fonchain-fiee/pkg/model/login"
|
"fonchain-fiee/pkg/model/login"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
|
"fonchain-fiee/pkg/service/bundle/common"
|
||||||
"fonchain-fiee/pkg/utils"
|
"fonchain-fiee/pkg/utils"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
@ -609,6 +610,22 @@ func autoConfirmAnalysis(ctx context.Context, analysisUuid string) (err error) {
|
|||||||
isFailed = true
|
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
|
var addBalanceReq bundle.AddBundleBalanceReq
|
||||||
addBalanceReq.UserId = int32(userID)
|
addBalanceReq.UserId = int32(userID)
|
||||||
// 检查数据分析余量
|
// 检查数据分析余量
|
||||||
|
|||||||
@ -520,6 +520,11 @@ func UpdateCompetitiveReportStatus(ctx *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if balanceInfoRes.BundleStatus == common.BundleExpired {
|
||||||
|
service.Error(ctx, errors.New("套餐已过期"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if balanceInfoRes.CompetitiveConsumptionNumber >= balanceInfoRes.CompetitiveNumber {
|
if balanceInfoRes.CompetitiveConsumptionNumber >= balanceInfoRes.CompetitiveNumber {
|
||||||
service.Error(ctx, errors.New("竞品报告余额不足"))
|
service.Error(ctx, errors.New("竞品报告余额不足"))
|
||||||
return
|
return
|
||||||
@ -946,6 +951,22 @@ func autoConfirmReport(ctx context.Context, reportUuid string) (err error) {
|
|||||||
isFailed = true
|
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
|
var addBalanceReq bundle.AddBundleBalanceReq
|
||||||
addBalanceReq.UserId = int32(userID)
|
addBalanceReq.UserId = int32(userID)
|
||||||
// 检查竞品报告余量
|
// 检查竞品报告余量
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user