1
This commit is contained in:
@@ -97,17 +97,23 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve
|
|||||||
order.ConsigneeLat = jxutils.StandardCoordinate2Int(utils.Str2Float64(originalList[1]))
|
order.ConsigneeLat = jxutils.StandardCoordinate2Int(utils.Str2Float64(originalList[1]))
|
||||||
order.DiscountMoney = *orderDetail.DiscountFee
|
order.DiscountMoney = *orderDetail.DiscountFee
|
||||||
|
|
||||||
//var salePrice int64 = 0
|
|
||||||
//var weight int = 0
|
|
||||||
order.PmSubsidyMoney = *orderDetail.SkuDiscountPlatformFee // 平台承担优惠
|
order.PmSubsidyMoney = *orderDetail.SkuDiscountPlatformFee // 平台承担优惠
|
||||||
// 添加需要赠送的东西(暂时没有赠品套餐直接商品)
|
// 添加需要赠送的东西(暂时没有赠品套餐直接商品)
|
||||||
multiSkuMap := make(map[int]int)
|
multiSkuMap := make(map[int]int)
|
||||||
|
var (
|
||||||
|
skuSalePrice int64 = 0 // 商品售卖价
|
||||||
|
merchantDiscountsPrice int64 = 0 // 商户优惠价
|
||||||
|
// 平台优惠价
|
||||||
|
platformDiscountsPrice int64 = *orderDetail.PlatformDeduction.BaseLogisticsFee + *orderDetail.PlatformDeduction.TechnicalServiceFee + *orderDetail.PlatformDeduction.PayServiceFee + *orderDetail.PlatformDeduction.ThirdpartnarFee
|
||||||
|
)
|
||||||
if len(*orderDetail.SubOrderResponseList) > 0 {
|
if len(*orderDetail.SubOrderResponseList) > 0 {
|
||||||
for _, extra := range *orderDetail.SubOrderResponseList {
|
for _, extra := range *orderDetail.SubOrderResponseList {
|
||||||
// 这个是包装袋的价格,用户退款是包装袋未推送退款,导致本地订单退款状态无法更新,取消包装袋的记录
|
// 这个是包装袋的价格,用户退款是包装袋未推送退款,导致本地订单退款状态无法更新,取消包装袋的记录
|
||||||
if *extra.SkuCode == "6108080" {
|
if *extra.SkuCode == "6108080" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
skuSalePrice += *extra.OriginalFee
|
||||||
|
merchantDiscountsPrice += *extra.DiscountMerchantFee
|
||||||
sku := &model.OrderSku{
|
sku := &model.OrderSku{
|
||||||
VendorOrderID: order.VendorOrderID,
|
VendorOrderID: order.VendorOrderID,
|
||||||
VendorSubOrderID: *extra.OutSubOrderId,
|
VendorSubOrderID: *extra.OutSubOrderId,
|
||||||
@@ -200,7 +206,7 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve
|
|||||||
v.IsVendorAct = model.YES
|
v.IsVendorAct = model.YES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 抖音订单手机号和收货地址是否同城(虚拟号,无法获取到正确地址)
|
//订单手机号和收货地址是否同城(虚拟号,无法获取到正确地址)
|
||||||
order.PhoneAscription = model.PhoneAscriptionAddressNo + "-" + "归属信息不匹配:" + "虚拟电话号码"
|
order.PhoneAscription = model.PhoneAscriptionAddressNo + "-" + "归属信息不匹配:" + "虚拟电话号码"
|
||||||
|
|
||||||
// 本地获取订单记录
|
// 本地获取订单记录
|
||||||
@@ -217,6 +223,28 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve
|
|||||||
order.StoreName = "未获取到" // 真实门店名称
|
order.StoreName = "未获取到" // 真实门店名称
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//结算类型
|
||||||
|
if store.PayPercentage < 50 {
|
||||||
|
order.EarningType = model.EarningTypePoints
|
||||||
|
} else {
|
||||||
|
order.EarningType = model.EarningTypeQuote
|
||||||
|
}
|
||||||
|
|
||||||
|
// 平台结算金额
|
||||||
|
order.TotalShopMoney = skuSalePrice + *orderDetail.PostFee - merchantDiscountsPrice - platformDiscountsPrice
|
||||||
|
if order.EarningType == model.EarningTypePoints {
|
||||||
|
waybill, _ := partner.CurOrderManager.LoadWaybill(order.VendorWaybillID, order.WaybillVendorID)
|
||||||
|
if waybill == nil {
|
||||||
|
if (order.NewEarningPrice == 0 || order.NewEarningPrice != order.TotalShopMoney*int64(100-order.OrderPayPercentage/2)/int64(100)) && order.OrderPayPercentage <= 50 {
|
||||||
|
order.NewEarningPrice = order.TotalShopMoney * int64(100-order.OrderPayPercentage/2) / int64(100)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (order.NewEarningPrice == 0 || order.NewEarningPrice != (order.TotalShopMoney-waybill.DesiredFee)*int64(100-order.OrderPayPercentage/2)/int64(100)) && order.OrderPayPercentage <= 50 {
|
||||||
|
order.NewEarningPrice = order.TotalShopMoney*int64(100-order.OrderPayPercentage/2)/int64(100) - waybill.DesiredFee
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return order, orderMap, err
|
return order, orderMap, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user