diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index 39f79a2af..f8a69a1e0 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -454,6 +454,25 @@ func doDailyWork() { cms.RefreshJdsSkusStatus(jxcontext.AdminCtx) //同步美团配送与否状态及美团门店是否存在 cms.SetMTPSStatus(jxcontext.AdminCtx, 0, 0) + //售后单如果超过12小时没有审核,就自动通过 + RefreshAfsOrderStatusAccess(jxcontext.AdminCtx) +} + +func RefreshAfsOrderStatusAccess(ctx *jxcontext.Context) { + var ( + offset = 0 + pageSize = 9999 + db = dao.GetDB() + ) + afsOrderList, _, err := dao.GetAfsOrdersByPage(db, "", "", "", time.Now().AddDate(0, 0, -7), time.Now(), offset, pageSize) + if err != nil { + return + } + for _, v := range afsOrderList { + if v.Status == model.AfsOrderStatusWait4Approve && time.Now().Sub(v.AfsCreatedAt).Hours() > 12 { + defsch.FixedScheduler.AgreeOrRefuseRefund(ctx, v.AfsOrderID, v.VendorID, model.AfsTypePartRefund, "超时系统同意") + } + } } func RefreshRealMobile(ctx *jxcontext.Context, vendorID int, fromTime, toTime time.Time, isAsync, isContinueWhenError bool) (hint string, err error) {