From 9f98a6bda0ed40f00e3098c74bab685d8283a9df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 13 Apr 2021 11:30:24 +0800 Subject: [PATCH] aa --- business/jxutils/jxutils.go | 5 +++-- business/partner/purchase/jd/order.go | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/business/jxutils/jxutils.go b/business/jxutils/jxutils.go index febc01951..153f8abb0 100644 --- a/business/jxutils/jxutils.go +++ b/business/jxutils/jxutils.go @@ -71,7 +71,7 @@ func (l OrderSkuList) Swap(i, j int) { func init() { rand.Seed(time.Now().Unix()) - routinePool = routinepool.New(1000, 1000) + routinePool = routinepool.New(2000, 2000) // Go regex does not support lookarounds. // https://stackoverflow.com/questions/38933898/error-parsing-regexp-invalid-or-unsupported-perl-syntax @@ -217,8 +217,9 @@ func GetPossibleVendorIDFromAfsOrderID(afsOrderID string) (vendorID int) { } func ComposeUniversalOrderID(orderID string, vendorID int) string { - return fmt.Sprintf("%s|%d", orderID, vendorID) + // return fmt.Sprintf("%s|%d", orderID, vendorID) // return orderID // 当前用长度就能区分,先不加上vendorID + return orderID + utils.Int64ToStr(time.Now().Unix()) } func GetUniversalOrderIDFromWaybill(bill *model.Waybill) string { diff --git a/business/partner/purchase/jd/order.go b/business/partner/purchase/jd/order.go index 021e25c4f..c90bf7b10 100644 --- a/business/partner/purchase/jd/order.go +++ b/business/partner/purchase/jd/order.go @@ -60,15 +60,15 @@ var ( ) func (c *PurchaseHandler) OnOrderMsg(a *jdapi.API, msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) { - primaryID := msg.BillID - if code, err := dao.GetVendorOrgCodeByKey(dao.GetDB(), model.VendorIDJD, a.GetAppKey()); err == nil && code != nil { - primaryID += code.VendorOrgCode - } + // primaryID := msg.BillID + // if code, err := dao.GetVendorOrgCodeByKey(dao.GetDB(), model.VendorIDJD, a.GetAppKey()); err == nil && code != nil { + // primaryID += code.VendorOrgCode + // } // primaryID += msg.BillID jxutils.CallMsgHandler(func() { globals.SugarLogger.Debugf("jd deliverOrder 3.7 ") retVal = c.onOrderMsg(a, msg) - }, primaryID) + }, jxutils.ComposeUniversalOrderID(msg.BillID, model.VendorIDJD)) return retVal }