This commit is contained in:
苏尹岚
2021-04-13 11:30:24 +08:00
parent c07095187b
commit 9f98a6bda0
2 changed files with 8 additions and 7 deletions

View File

@@ -71,7 +71,7 @@ func (l OrderSkuList) Swap(i, j int) {
func init() { func init() {
rand.Seed(time.Now().Unix()) rand.Seed(time.Now().Unix())
routinePool = routinepool.New(1000, 1000) routinePool = routinepool.New(2000, 2000)
// Go regex does not support lookarounds. // Go regex does not support lookarounds.
// https://stackoverflow.com/questions/38933898/error-parsing-regexp-invalid-or-unsupported-perl-syntax // 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 { 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 // 当前用长度就能区分先不加上vendorID
return orderID + utils.Int64ToStr(time.Now().Unix())
} }
func GetUniversalOrderIDFromWaybill(bill *model.Waybill) string { func GetUniversalOrderIDFromWaybill(bill *model.Waybill) string {

View File

@@ -60,15 +60,15 @@ var (
) )
func (c *PurchaseHandler) OnOrderMsg(a *jdapi.API, msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) { func (c *PurchaseHandler) OnOrderMsg(a *jdapi.API, msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
primaryID := msg.BillID // primaryID := msg.BillID
if code, err := dao.GetVendorOrgCodeByKey(dao.GetDB(), model.VendorIDJD, a.GetAppKey()); err == nil && code != nil { // if code, err := dao.GetVendorOrgCodeByKey(dao.GetDB(), model.VendorIDJD, a.GetAppKey()); err == nil && code != nil {
primaryID += code.VendorOrgCode // primaryID += code.VendorOrgCode
} // }
// primaryID += msg.BillID // primaryID += msg.BillID
jxutils.CallMsgHandler(func() { jxutils.CallMsgHandler(func() {
globals.SugarLogger.Debugf("jd deliverOrder 3.7 ") globals.SugarLogger.Debugf("jd deliverOrder 3.7 ")
retVal = c.onOrderMsg(a, msg) retVal = c.onOrderMsg(a, msg)
}, primaryID) }, jxutils.ComposeUniversalOrderID(msg.BillID, model.VendorIDJD))
return retVal return retVal
} }