切换主体
This commit is contained in:
parent
ae09a7509b
commit
2ceb9ed9d0
|
|
@ -13,6 +13,9 @@ func (e *BusinessErr) Error() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
BatchNotSetStartedError = &BusinessErr{Code: ErrCode("400"), Message: "批次开始时间未设置"}
|
||||||
|
BatchSetEndedError = &BusinessErr{Code: ErrCode("400"), Message: "批次已结束时间未设置"}
|
||||||
|
|
||||||
BatchNotStartedError = &BusinessErr{Code: ErrCode("400"), Message: "批次未开始"}
|
BatchNotStartedError = &BusinessErr{Code: ErrCode("400"), Message: "批次未开始"}
|
||||||
BatchEndedError = &BusinessErr{Code: ErrCode("400"), Message: "批次已结束"}
|
BatchEndedError = &BusinessErr{Code: ErrCode("400"), Message: "批次已结束"}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,13 @@ func (this *VoucherBiz) CmbOrder(ctx context.Context, req *bo.OrderCreateReqBo)
|
||||||
return nil, product, err3
|
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()
|
nowTime := time.Now()
|
||||||
if nowTime.Before(*product.StartTime) {
|
if nowTime.Before(*product.StartTime) {
|
||||||
return nil, product, businesserr.BatchNotStartedError
|
return nil, product, businesserr.BatchNotStartedError
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue