fix:如果新买一个套餐,原有套餐的直接通过,不需要消耗额度
This commit is contained in:
parent
4ce735d4de
commit
7564af8220
@ -660,6 +660,32 @@ func autoConfirmAnalysis(ctx context.Context, analysisUuid string) (err error) {
|
||||
}
|
||||
return
|
||||
}
|
||||
// 判断数据分析的提交时间是否在现在的套餐期间范围之内
|
||||
submitTime, err := time.Parse("2006-01-02 15:04:05", infoResp.SubmitTime)
|
||||
if err != nil {
|
||||
zap.L().Error("autoConfirmAnalysis ParseSubmitTime", zap.Any("err", err))
|
||||
return
|
||||
}
|
||||
if submitTime.Before(time.Unix(balanceInfoRes.PayTime, 0)) {
|
||||
// todo 暂时先这样
|
||||
// confirmRemark = "该报告提交时间不在该套餐期间范围之内"
|
||||
// 直接提交
|
||||
confirmRemark = "系统自动确认"
|
||||
usedType = 0
|
||||
_, err = service.CastProvider.UpdateWorkAnalysisStatus(context.Background(), &cast.UpdateWorkAnalysisStatusReq{
|
||||
WorkAction: cast.WorkActionENUM_CONFIRM,
|
||||
Uuid: analysisUuid,
|
||||
ConfirmRemark: confirmRemark,
|
||||
CostType: usedType,
|
||||
ConfirmStatus: 1,
|
||||
ConfirmType: 2,
|
||||
})
|
||||
if err != nil {
|
||||
zap.L().Error("autoConfirmAnalysis UpdateWorkAnalysisStatus", zap.Any("err", err))
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
var addBalanceReq bundle.AddBundleBalanceReq
|
||||
addBalanceReq.UserId = int32(userID)
|
||||
|
||||
@ -1014,6 +1014,31 @@ func autoConfirmReport(ctx context.Context, reportUuid string) (err error) {
|
||||
}
|
||||
return
|
||||
}
|
||||
// 判断竞品报告的提交时间是否在现在的套餐期间范围之内
|
||||
submitTime, err := time.Parse("2006-01-02 15:04:05", infoResp.SubmitTime)
|
||||
if err != nil {
|
||||
zap.L().Error("autoConfirmReport ParseSubmitTime", zap.Any("err", err))
|
||||
return
|
||||
}
|
||||
if submitTime.Before(time.Unix(balanceInfoRes.PayTime, 0)) {
|
||||
// confirmRemark = "该报告提交时间不在该套餐期间范围之内"
|
||||
confirmRemark = "系统自动确认"
|
||||
usedType = 0
|
||||
// 直接提交
|
||||
_, err = service.CastProvider.UpdateCompetitiveReportStatus(context.Background(), &cast.UpdateCompetitiveReportStatusReq{
|
||||
WorkAction: cast.WorkActionENUM_CONFIRM,
|
||||
Uuid: reportUuid,
|
||||
ConfirmRemark: confirmRemark,
|
||||
CostType: usedType,
|
||||
ConfirmStatus: 1,
|
||||
ConfirmType: 2,
|
||||
})
|
||||
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