diff --git a/business/jxcallback/auto_delivery/auto_delivery.go b/business/jxcallback/auto_delivery/auto_delivery.go index f53113b4b..c9030077e 100644 --- a/business/jxcallback/auto_delivery/auto_delivery.go +++ b/business/jxcallback/auto_delivery/auto_delivery.go @@ -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) diff --git a/business/model/const.go b/business/model/const.go index 6887061f2..27469a812 100644 --- a/business/model/const.go +++ b/business/model/const.go @@ -375,6 +375,11 @@ const ( BusinessTypeDingshida = 2 // 定时达 ) +const ( + PhoneAscriptionAddressYes = "YES" // 抖音订单收货地址和电话号码归属地是否一致 + PhoneAscriptionAddressNo = "No" // 抖音订单收货地址和电话号码归属地是否一致 +) + var ( ElmSkuPromotion = map[int]int{ 11: 1, diff --git a/business/model/order.go b/business/model/order.go index 212e2e3c4..a35834342 100644 --- a/business/model/order.go +++ b/business/model/order.go @@ -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:"column(phone_ascription)" json:"phoneAscription"` // 电话号码归属地 // 以下只是用于传递数据 OriginalData string `orm:"-" json:"-"` diff --git a/business/partner/purchase/tiktok_store/order.go b/business/partner/purchase/tiktok_store/order.go index 70e2d73c6..de7b1f0f5 100644 --- a/business/partner/purchase/tiktok_store/order.go +++ b/business/partner/purchase/tiktok_store/order.go @@ -3,6 +3,7 @@ package tiktok_store import ( "errors" "fmt" + "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/ascription_place" "regexp" "strings" "time" @@ -237,6 +238,20 @@ 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) + ascription, err := ascription_place.Find(order.ConsigneeMobile) + 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 + "-" + "归属信息不匹配:" + ascription.Province + ascription.City + } + } + jxutils.RefreshOrderSkuRelated(order) return order, orderMap, nil }