- 饿百对订单也设置deliveryType
This commit is contained in:
@@ -195,7 +195,7 @@ func (p *PurchaseHandler) OrderDetail2Financial(result map[string]interface{}) (
|
|||||||
orderFinancial.ReceivableFreight = utils.MustInterface2Int64(order1["send_fee"])
|
orderFinancial.ReceivableFreight = utils.MustInterface2Int64(order1["send_fee"])
|
||||||
orderFinancial.DownFlag = int8(utils.MustInterface2Int64(order1["down_flag"]))
|
orderFinancial.DownFlag = int8(utils.MustInterface2Int64(order1["down_flag"]))
|
||||||
|
|
||||||
if int(getInt64FromInterface(order1["delivery_party"])) == ebaiapi.SendImmediatelySelf {
|
if int(getInt64FromInterface(order1["delivery_party"])) == ebaiapi.DeliveryPartyFengElmSelf {
|
||||||
orderFinancial.SelfDeliveryDiscountMoney = orderFinancial.ReceivableFreight
|
orderFinancial.SelfDeliveryDiscountMoney = orderFinancial.ReceivableFreight
|
||||||
orderFinancial.DistanceFreightMoney = 0
|
orderFinancial.DistanceFreightMoney = 0
|
||||||
// 通过本地数据库去取是否转美团/达达,并计算运费
|
// 通过本地数据库去取是否转美团/达达,并计算运费
|
||||||
|
|||||||
@@ -56,8 +56,19 @@ var (
|
|||||||
ebaiapi.OrderSkuDiscountTypeZhe: 1,
|
ebaiapi.OrderSkuDiscountTypeZhe: 1,
|
||||||
ebaiapi.OrderSkuDiscountTypeReduce: 1,
|
ebaiapi.OrderSkuDiscountTypeReduce: 1,
|
||||||
}
|
}
|
||||||
|
deliveryTypeMap = map[int]string{
|
||||||
|
ebaiapi.DeliveryPartyFengElmSelf: model.OrderDeliveryTypeStoreSelf,
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func mapDeliveryType(ebaiDeliveryParty int) (deliveryType string) {
|
||||||
|
deliveryType = deliveryTypeMap[ebaiDeliveryParty]
|
||||||
|
if deliveryType == "" {
|
||||||
|
deliveryType = model.OrderDeliveryTypePlatform
|
||||||
|
}
|
||||||
|
return deliveryType
|
||||||
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) getStatusFromVendorStatus(vendorStatus string) int {
|
func (p *PurchaseHandler) getStatusFromVendorStatus(vendorStatus string) int {
|
||||||
if status, ok := VendorStatus2StatusMap[vendorStatus]; ok {
|
if status, ok := VendorStatus2StatusMap[vendorStatus]; ok {
|
||||||
return status
|
return status
|
||||||
@@ -190,6 +201,7 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
|||||||
OriginalData: string(utils.MustMarshal(result)),
|
OriginalData: string(utils.MustMarshal(result)),
|
||||||
ActualPayPrice: utils.ForceInterface2Int64(orderMap["user_fee"]),
|
ActualPayPrice: utils.ForceInterface2Int64(orderMap["user_fee"]),
|
||||||
TotalShopMoney: utils.ForceInterface2Int64(orderMap["shop_fee"]),
|
TotalShopMoney: utils.ForceInterface2Int64(orderMap["shop_fee"]),
|
||||||
|
DeliveryType: mapDeliveryType(int(utils.ForceInterface2Int64(orderMap["delivery_party"]))),
|
||||||
}
|
}
|
||||||
if utils.IsTimeZero(order.PickDeadline) && !utils.IsTimeZero(order.StatusTime) {
|
if utils.IsTimeZero(order.PickDeadline) && !utils.IsTimeZero(order.StatusTime) {
|
||||||
order.PickDeadline = order.StatusTime.Add(pickupOrderDelay) // 饿百要求在5分钟内拣货,不然订单会被取消
|
order.PickDeadline = order.StatusTime.Add(pickupOrderDelay) // 饿百要求在5分钟内拣货,不然订单会被取消
|
||||||
|
|||||||
Reference in New Issue
Block a user