From 69c617e87aec3350a712e1103543187b2ea7248a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 14 Sep 2020 15:30:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=8512=E5=B0=8F=E6=97=B6=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=94=AE=E5=90=8E=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/misc/misc.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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) {