切换主体

This commit is contained in:
ziming 2026-03-27 16:10:29 +08:00
parent ae09a7509b
commit 2ceb9ed9d0
2 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,9 @@ func (e *BusinessErr) Error() string {
}
var (
BatchNotSetStartedError = &BusinessErr{Code: ErrCode("400"), Message: "批次开始时间未设置"}
BatchSetEndedError = &BusinessErr{Code: ErrCode("400"), Message: "批次已结束时间未设置"}
BatchNotStartedError = &BusinessErr{Code: ErrCode("400"), Message: "批次未开始"}
BatchEndedError = &BusinessErr{Code: ErrCode("400"), Message: "批次已结束"}
)

View File

@ -34,6 +34,13 @@ func (this *VoucherBiz) CmbOrder(ctx context.Context, req *bo.OrderCreateReqBo)
return nil, product, err3
}
if product.StartTime == nil {
return nil, product, businesserr.BatchNotSetStartedError
}
if product.EndTime == nil {
return nil, product, businesserr.BatchSetEndedError
}
nowTime := time.Now()
if nowTime.Before(*product.StartTime) {
return nil, product, businesserr.BatchNotStartedError