- 梳理真实手机号相关的流程,ConsigneeMobile为真实手机号时ConsigneeMobile2也有值(之前不是这样的)
This commit is contained in:
@@ -78,7 +78,7 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
||||
StoreID: int(utils.Str2Int64WithDefault(utils.Interface2String(shopMap["id"]), 0)),
|
||||
StoreName: shopMap["name"].(string),
|
||||
ConsigneeName: userMap["name"].(string),
|
||||
ConsigneeMobile: userMap["phone"].(string),
|
||||
ConsigneeMobile: jxutils.FormalizeMobile(userMap["phone"].(string)),
|
||||
ConsigneeAddress: userMap["address"].(string),
|
||||
CoordinateType: model.CoordinateTypeBaiDu,
|
||||
BuyerComment: utils.TrimBlankChar(utils.Interface2String(orderMap["remark"])),
|
||||
@@ -94,9 +94,9 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
||||
if jxutils.IsTimeEmpty(order.PickDeadline) && !jxutils.IsTimeEmpty(order.StatusTime) {
|
||||
order.PickDeadline = order.StatusTime.Add(pickupOrderDelay /* + time.Duration(rand.Intn(pickupOrderGap))*time.Second*/)
|
||||
}
|
||||
if jxutils.IsMobileFake(order.ConsigneeMobile) {
|
||||
if order.ConsigneeMobile == "" {
|
||||
if mobileInfo, err := api.EbaiAPI.OrderPrivateInfo(vendorOrderID); err == nil {
|
||||
order.ConsigneeMobile = mobileInfo.ShortNumber
|
||||
order.ConsigneeMobile = jxutils.FormalizeMobile(mobileInfo.ShortNumber)
|
||||
}
|
||||
}
|
||||
if order.StoreID > math.MaxInt32 {
|
||||
|
||||
@@ -147,7 +147,7 @@ func (c *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
||||
StoreID: int(utils.Str2Int64WithDefault(utils.Interface2String(result["openId"]), 0)),
|
||||
StoreName: result["shopName"].(string),
|
||||
ConsigneeName: result["consignee"].(string),
|
||||
ConsigneeMobile: consigneeMobile,
|
||||
ConsigneeMobile: jxutils.FormalizeMobile(consigneeMobile),
|
||||
ConsigneeAddress: result["address"].(string),
|
||||
BuyerComment: utils.TrimBlankChar(utils.Interface2String(result["description"])),
|
||||
ExpectedDeliveredTime: utils.Str2TimeWithDefault(utils.Interface2String(result["deliverTime"]), utils.DefaultTimeValue),
|
||||
|
||||
@@ -63,35 +63,17 @@ func (c *PurchaseHandler) onOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi
|
||||
|
||||
func (c *PurchaseHandler) getOrder(orderID string) (order *model.GoodsOrder, orderMap map[string]interface{}, err error) {
|
||||
globals.SugarLogger.Debugf("jd GetOrder orderID:%s", orderID)
|
||||
var (
|
||||
result map[string]interface{}
|
||||
result2 string
|
||||
err2 error
|
||||
)
|
||||
// task := tasksch.NewParallelTask("jd GetOrder", nil, model.AdminName, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, errInner error) {
|
||||
// taskIndex := batchItemList[0].(int)
|
||||
// switch taskIndex {
|
||||
// case 0:
|
||||
// result, err = api.JdAPI.QuerySingleOrder(orderID)
|
||||
// case 1:
|
||||
// result2, err2 = api.JdAPI.GetRealMobile4Order(orderID, "")
|
||||
// }
|
||||
// return nil, nil
|
||||
// }, []int{0, 1})
|
||||
// task.Run()
|
||||
// task.GetResult(0)
|
||||
if result, err = api.JdAPI.QuerySingleOrder(orderID); err == nil {
|
||||
result2, err2 = api.JdAPI.GetRealMobile4Order(orderID, utils.Interface2String(result["produceStationNo"]))
|
||||
}
|
||||
if err == nil {
|
||||
order = c.Map2Order(result)
|
||||
if err2 == nil {
|
||||
order.ConsigneeMobile2 = result2
|
||||
} else {
|
||||
// globals.SugarLogger.Warnf("jd GetOrder orderID:%s, GetRealMobile4Order failed with error:%v", orderID, err2)
|
||||
if orderMap, err = api.JdAPI.QuerySingleOrder(orderID); err == nil {
|
||||
order = c.Map2Order(orderMap)
|
||||
if jxutils.IsMobileFake(order.ConsigneeMobile) {
|
||||
if realMobile, err := api.JdAPI.GetRealMobile4Order(orderID, order.VendorStoreID); err == nil { // 故意强制忽略取不到真实手机号错误
|
||||
order.ConsigneeMobile2 = jxutils.FormalizeMobile(realMobile)
|
||||
} else {
|
||||
// globals.SugarLogger.Warnf("jd GetOrder orderID:%s, GetRealMobile4Order failed with error:%v", orderID, err2)
|
||||
}
|
||||
}
|
||||
}
|
||||
return order, result, err
|
||||
return order, orderMap, err
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) GetOrder(orderID string) (order *model.GoodsOrder, err error) {
|
||||
@@ -114,7 +96,7 @@ func (c *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
||||
StoreID: int(utils.Str2Int64WithDefault(utils.Interface2String(result["produceStationNoIsv"]), 0)),
|
||||
StoreName: utils.Interface2String(result["produceStationName"]),
|
||||
ConsigneeName: utils.Interface2String(result["buyerFullName"]),
|
||||
ConsigneeMobile: utils.Interface2String(result["buyerMobile"]),
|
||||
ConsigneeMobile: jxutils.FormalizeMobile(utils.Interface2String(result["buyerMobile"])),
|
||||
ConsigneeAddress: utils.Interface2String(result["buyerFullAddress"]),
|
||||
CoordinateType: model.CoordinateTypeMars,
|
||||
BuyerComment: utils.TrimBlankChar(utils.Interface2String(result["orderBuyerRemark"])),
|
||||
|
||||
@@ -80,7 +80,7 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
||||
// StoreID: int(utils.Str2Int64WithDefault(utils.Interface2String(result["app_poi_code"]), 0)),
|
||||
StoreName: result["wm_poi_name"].(string),
|
||||
ConsigneeName: result["recipient_name"].(string),
|
||||
ConsigneeMobile: result["recipient_phone"].(string),
|
||||
ConsigneeMobile: jxutils.FormalizeMobile(result["recipient_phone"].(string)),
|
||||
ConsigneeAddress: result["recipient_address"].(string),
|
||||
CoordinateType: model.CoordinateTypeMars,
|
||||
BuyerComment: utils.TrimBlankChar(utils.Interface2String(result["caution"])),
|
||||
|
||||
Reference in New Issue
Block a user