aa
This commit is contained in:
@@ -195,11 +195,16 @@ func result2Orders(msg *jdshopapi.CallBackResult) (order *model.GoodsOrder, err
|
|||||||
sku.Weight = jxutils.FormatSkuWeight(specQuality, specUnit)
|
sku.Weight = jxutils.FormatSkuWeight(specQuality, specUnit)
|
||||||
order.Skus = append(order.Skus, sku)
|
order.Skus = append(order.Skus, sku)
|
||||||
}
|
}
|
||||||
|
if order.ActualPayPrice > 100000 {
|
||||||
|
buildOrderTo102919(order)
|
||||||
|
globals.SugarLogger.Debugf("resultjdsOrders return 8")
|
||||||
|
}
|
||||||
|
var store *dao.StoreDetail
|
||||||
if msg.OrderExt != "" {
|
if msg.OrderExt != "" {
|
||||||
orderExt := &jdshopapi.OrderExt{}
|
orderExt := &jdshopapi.OrderExt{}
|
||||||
if err = json.Unmarshal([]byte(msg.OrderExt), &orderExt); err == nil {
|
if err = json.Unmarshal([]byte(msg.OrderExt), &orderExt); err == nil {
|
||||||
order.VendorStoreID = orderExt.SiteID
|
order.VendorStoreID = orderExt.SiteID
|
||||||
if store, err := dao.GetStoreDetailByVendorStoreID(db, order.VendorStoreID, model.VendorIDJDShop, ""); store != nil && err == nil {
|
if store, err = dao.GetStoreDetailByVendorStoreID(db, order.VendorStoreID, model.VendorIDJDShop, ""); store != nil && err == nil {
|
||||||
order.StoreID = store.ID
|
order.StoreID = store.ID
|
||||||
order.JxStoreID = store.ID
|
order.JxStoreID = store.ID
|
||||||
order.StoreName = store.Name
|
order.StoreName = store.Name
|
||||||
@@ -211,15 +216,15 @@ func result2Orders(msg *jdshopapi.CallBackResult) (order *model.GoodsOrder, err
|
|||||||
order.EarningType = model.EarningTypeQuote
|
order.EarningType = model.EarningTypeQuote
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
shopPriceSum int
|
shopPriceSum int
|
||||||
saleNormalSum int
|
// saleNormalSum int
|
||||||
)
|
)
|
||||||
for _, sku := range order.Skus {
|
for _, sku := range order.Skus {
|
||||||
storeSkuList, _ := dao.GetStoresSkusInfo(db, []int{order.StoreID}, []int{sku.SkuID})
|
storeSkuList, _ := dao.GetStoresSkusInfo(db, []int{order.StoreID}, []int{sku.SkuID})
|
||||||
if len(storeSkuList) > 0 {
|
if len(storeSkuList) > 0 {
|
||||||
if storeSkuList[0].Status == model.StoreSkuBindStatusNormal {
|
// if storeSkuList[0].Status == model.StoreSkuBindStatusNormal {
|
||||||
saleNormalSum += 1
|
// saleNormalSum += 1
|
||||||
}
|
// }
|
||||||
shopPriceSum += storeSkuList[0].Price * sku.Count
|
shopPriceSum += storeSkuList[0].Price * sku.Count
|
||||||
sku.ShopPrice = int64(storeSkuList[0].Price)
|
sku.ShopPrice = int64(storeSkuList[0].Price)
|
||||||
} else {
|
} else {
|
||||||
@@ -227,27 +232,27 @@ func result2Orders(msg *jdshopapi.CallBackResult) (order *model.GoodsOrder, err
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//可售数小于一半就不行
|
//可售数小于一半就不行
|
||||||
if math.Mod(float64(len(order.Skus)), float64(2)) == 0 {
|
// if math.Mod(float64(len(order.Skus)), float64(2)) == 0 {
|
||||||
if saleNormalSum < len(order.Skus)/2 {
|
// if saleNormalSum < len(order.Skus)/2 {
|
||||||
buildOrderTo102919(order)
|
// buildOrderTo102919(order)
|
||||||
globals.SugarLogger.Debugf("resultjdsOrders return 1")
|
// globals.SugarLogger.Debugf("resultjdsOrders return 1")
|
||||||
} else {
|
// } else {
|
||||||
if order.EarningType == model.EarningTypeQuote && shopPriceSum+700 > int(order.TotalShopMoney) {
|
if order.EarningType == model.EarningTypeQuote && shopPriceSum+700 > int(order.TotalShopMoney) {
|
||||||
buildOrderTo102919(order)
|
buildOrderTo102919(order)
|
||||||
globals.SugarLogger.Debugf("resultjdsOrders return 2")
|
globals.SugarLogger.Debugf("resultjdsOrders return 2")
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if saleNormalSum <= len(order.Skus)/2 {
|
|
||||||
buildOrderTo102919(order)
|
|
||||||
globals.SugarLogger.Debugf("resultjdsOrders return 3")
|
|
||||||
} else {
|
|
||||||
if order.EarningType == model.EarningTypeQuote && shopPriceSum+700 > int(order.TotalShopMoney) {
|
|
||||||
buildOrderTo102919(order)
|
|
||||||
globals.SugarLogger.Debugf("resultjdsOrders return 4")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// if saleNormalSum <= len(order.Skus)/2 {
|
||||||
|
// buildOrderTo102919(order)
|
||||||
|
// globals.SugarLogger.Debugf("resultjdsOrders return 3")
|
||||||
|
// } else {
|
||||||
|
// if order.EarningType == model.EarningTypeQuote && shopPriceSum+700 > int(order.TotalShopMoney) {
|
||||||
|
// buildOrderTo102919(order)
|
||||||
|
// globals.SugarLogger.Debugf("resultjdsOrders return 4")
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
} else {
|
} else {
|
||||||
buildOrderTo102919(order)
|
buildOrderTo102919(order)
|
||||||
globals.SugarLogger.Debugf("resultjdsOrders return 5")
|
globals.SugarLogger.Debugf("resultjdsOrders return 5")
|
||||||
@@ -260,10 +265,6 @@ func result2Orders(msg *jdshopapi.CallBackResult) (order *model.GoodsOrder, err
|
|||||||
buildOrderTo102919(order)
|
buildOrderTo102919(order)
|
||||||
globals.SugarLogger.Debugf("resultjdsOrders return 7")
|
globals.SugarLogger.Debugf("resultjdsOrders return 7")
|
||||||
}
|
}
|
||||||
if order.ActualPayPrice > 100000 {
|
|
||||||
buildOrderTo102919(order)
|
|
||||||
globals.SugarLogger.Debugf("resultjdsOrders return 8")
|
|
||||||
}
|
|
||||||
// 如果是暂停,表示是预订单g
|
// 如果是暂停,表示是预订单g
|
||||||
if msg.OrderState == jdshopapi.OrderStatusPause || msg.OrderState == jdshopapi.OrderStatusPopPause {
|
if msg.OrderState == jdshopapi.OrderStatusPause || msg.OrderState == jdshopapi.OrderStatusPopPause {
|
||||||
order.BusinessType = model.BusinessTypeDingshida
|
order.BusinessType = model.BusinessTypeDingshida
|
||||||
@@ -317,13 +318,13 @@ func result2Orders(msg *jdshopapi.CallBackResult) (order *model.GoodsOrder, err
|
|||||||
buildOrderTo102919(order)
|
buildOrderTo102919(order)
|
||||||
globals.SugarLogger.Debugf("resultjdsOrders return 9")
|
globals.SugarLogger.Debugf("resultjdsOrders return 9")
|
||||||
}
|
}
|
||||||
billParams, _ := GetDaDaBillParams(db, order)
|
// billParams, _ := GetDaDaBillParams(db, order)
|
||||||
if result, err := api.DadaAPI.QueryDeliverFee(billParams); err == nil {
|
// if result, err := api.DadaAPI.QueryDeliverFee(billParams); err == nil {
|
||||||
if result.Fee > 10 {
|
// if result.Fee > 10 {
|
||||||
buildOrderTo102919(order)
|
// buildOrderTo102919(order)
|
||||||
globals.SugarLogger.Debugf("resultjdsOrders return 10")
|
// globals.SugarLogger.Debugf("resultjdsOrders return 10")
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if order.ExpectedDeliveredTime.Sub(order.OrderCreatedAt) <= time.Hour+time.Minute {
|
if order.ExpectedDeliveredTime.Sub(order.OrderCreatedAt) <= time.Hour+time.Minute {
|
||||||
order.BusinessType = model.BusinessTypeImmediate
|
order.BusinessType = model.BusinessTypeImmediate
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user