添加手机归属地查询
This commit is contained in:
@@ -130,7 +130,9 @@ func AutoSettingFakeDelivery() {
|
||||
if randTime >= int64(len(riderListInfo[riderKey])) {
|
||||
randTime = int64(len(riderListInfo[riderKey])) - 1
|
||||
}
|
||||
|
||||
if v.PhoneAscription == "" || strings.Split(v.PhoneAscription, "-")[0] != model.PhoneAscriptionAddressYes {
|
||||
continue
|
||||
}
|
||||
// 自动拣货
|
||||
if v.Status < model.OrderStatusFinishedPickup { // 未拣货
|
||||
handler := partner.GetPurchaseOrderHandlerFromVendorID(v.VendorID)
|
||||
|
||||
@@ -375,6 +375,11 @@ const (
|
||||
BusinessTypeDingshida = 2 // 定时达
|
||||
)
|
||||
|
||||
const (
|
||||
PhoneAscriptionAddressYes = "YES" // 抖音订单收货地址和电话号码归属地是否一致
|
||||
PhoneAscriptionAddressNo = "No" // 抖音订单收货地址和电话号码归属地是否一致
|
||||
)
|
||||
|
||||
var (
|
||||
ElmSkuPromotion = map[int]int{
|
||||
11: 1,
|
||||
|
||||
@@ -158,8 +158,9 @@ type GoodsOrder struct {
|
||||
EarningType int `json:"earningType"` //订单结算方式,2为扣点,1为报价
|
||||
OrderType int `json:"orderType"` //订单类型,0为普通订单,1为物料订单,2为进货订单
|
||||
OrderPayPercentage int `json:"orderPayPercentage"`
|
||||
CouponIDs string `orm:"column(coupon_ids)" json:"couponIDs"` //优惠券IDs(京西商城)
|
||||
NotifyType int `json:"notifyType"` //0表示没有通知,1表示发的短信,2表示发的语音
|
||||
CouponIDs string `orm:"column(coupon_ids)" json:"couponIDs"` //优惠券IDs(京西商城)
|
||||
NotifyType int `json:"notifyType"` //0表示没有通知,1表示发的短信,2表示发的语音
|
||||
PhoneAscription string `orm:"phone_ascription" json:"phoneAscription"` // 电话号码归属地
|
||||
|
||||
// 以下只是用于传递数据
|
||||
OriginalData string `orm:"-" json:"-"`
|
||||
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"github.com/xluohome/phonedata"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -237,6 +238,21 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode, vendorOrderID, vendorStoreID s
|
||||
orderSeq, _ := dao.GetVendorOrderNumber(dao.GetDB(), model.VendorIDDD, order.VendorStoreID)
|
||||
order.OrderSeq = orderSeq + 1
|
||||
|
||||
// 抖音订单手机号和收货地址是否同城
|
||||
order.PhoneAscription = ""
|
||||
ascription, err := phonedata.Find(order.ConsigneeMobile)
|
||||
globals.SugarLogger.Debugf("=============ascription=:%s", utils.Format4Output(ascription, false))
|
||||
globals.SugarLogger.Debugf("=============err=:%v", err)
|
||||
if err != nil {
|
||||
order.PhoneAscription = model.PhoneAscriptionAddressNo + "-" + err.Error()
|
||||
} else {
|
||||
if strings.Contains(order.ConsigneeAddress, ascription.Province) && strings.Contains(order.ConsigneeAddress, ascription.City) {
|
||||
order.PhoneAscription = model.PhoneAscriptionAddressYes + "-" + ascription.Province + ascription.City
|
||||
} else {
|
||||
order.PhoneAscription = model.PhoneAscriptionAddressNo + "-电话号码异常解析"
|
||||
}
|
||||
}
|
||||
|
||||
jxutils.RefreshOrderSkuRelated(order)
|
||||
return order, orderMap, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user