1
This commit is contained in:
@@ -168,7 +168,7 @@ func (p *PurchaseHandler) OrderDetail2Financial(result *domain591.AlibabaAelophy
|
||||
SkuID: utils.Str2Int(*x.SkuCode),
|
||||
Name: utils.Interface2String(x.SkuName),
|
||||
SalePrice: *x.Price,
|
||||
Count: utils.Str2Int(*x.BuySaleQuantity),
|
||||
Count: utils.Float64TwoInt(*x.BuySaleQuantity),
|
||||
SkuBoxMoney: 0,
|
||||
IsAfsOrder: 0,
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve
|
||||
BizOrderId: utils.Int64ToPointer(vendorOrderID),
|
||||
}}
|
||||
orderDetail, err := getAPI(vendorOrgCode, 0, vendorStoreID).QueryOrderDetail(requestParam)
|
||||
globals.SugarLogger.Debugf("orderDetail := %s", utils.Format4Output(orderDetail, false))
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
@@ -105,13 +106,13 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve
|
||||
VendorID: model.VendorIDTaoVegetable,
|
||||
StoreSubID: 0,
|
||||
StoreSubName: "",
|
||||
Count: utils.Str2Int(*extra.BuySaleQuantity),
|
||||
Count: utils.Float64TwoInt(*extra.BuySaleQuantity),
|
||||
VendorSkuID: *extra.SkuCode,
|
||||
SkuID: utils.Str2Int(*extra.SkuCode),
|
||||
JxSkuID: utils.Str2Int(*extra.SkuCode),
|
||||
SkuName: *extra.SkuName,
|
||||
ShopPrice: *extra.Price,
|
||||
VendorPrice: *extra.OriginalFee / utils.Str2Int64(*extra.BuySaleQuantity),
|
||||
VendorPrice: *extra.OriginalFee / utils.Float64TwoInt64(*extra.BuySaleQuantity),
|
||||
SalePrice: *extra.OriginalFee,
|
||||
EarningPrice: 0,
|
||||
Weight: int(*extra.Weight),
|
||||
@@ -124,23 +125,26 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve
|
||||
|
||||
activityId := make([]int64, 0)
|
||||
activityName := make([]string, 0)
|
||||
for _, v := range *extra.Activitys {
|
||||
// 渠道活动
|
||||
if v.ChannelActivityId != nil {
|
||||
activityId = append(activityId, utils.Str2Int64WithDefault(*v.ChannelActivityId, 999))
|
||||
activityName = append(activityName, *v.ChannelActivityId+":"+*v.ActivityName)
|
||||
}
|
||||
// 业务活动
|
||||
if v.BizActivityId != nil {
|
||||
activityId = append(activityId, utils.Str2Int64WithDefault(*v.BizActivityId, 999))
|
||||
activityName = append(activityName, *v.BizActivityId+":"+*v.ActivityName)
|
||||
}
|
||||
// 商家erp活动
|
||||
if v.MerchantActivityId != nil {
|
||||
activityId = append(activityId, utils.Str2Int64WithDefault(*v.MerchantActivityId, 999))
|
||||
activityName = append(activityName, *v.MerchantActivityId+":"+*v.ActivityName)
|
||||
if extra.Activitys != nil {
|
||||
for _, v := range *extra.Activitys {
|
||||
// 渠道活动
|
||||
if v.ChannelActivityId != nil {
|
||||
activityId = append(activityId, utils.Str2Int64WithDefault(*v.ChannelActivityId, 999))
|
||||
activityName = append(activityName, *v.ChannelActivityId+":"+*v.ActivityName)
|
||||
}
|
||||
// 业务活动
|
||||
if v.BizActivityId != nil {
|
||||
activityId = append(activityId, utils.Str2Int64WithDefault(*v.BizActivityId, 999))
|
||||
activityName = append(activityName, *v.BizActivityId+":"+*v.ActivityName)
|
||||
}
|
||||
// 商家erp活动
|
||||
if v.MerchantActivityId != nil {
|
||||
activityId = append(activityId, utils.Str2Int64WithDefault(*v.MerchantActivityId, 999))
|
||||
activityName = append(activityName, *v.MerchantActivityId+":"+*v.ActivityName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(activityId) > 0 {
|
||||
sku.StoreSubID = int(activityId[0])
|
||||
sku.StoreSubName = strings.Join(activityName, ",")
|
||||
@@ -155,9 +159,11 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve
|
||||
}
|
||||
// 淘宝默认自配送
|
||||
if *orderDetail.DeliveryType == tao_vegetable.OrderDeliveryTypeTime {
|
||||
order.DeliveryType = model.OrderDeliveryTypeStoreSelf
|
||||
order.DeliveryType = model.OrderDeliveryTypePlatform
|
||||
} else if *orderDetail.DeliveryType == tao_vegetable.OrderDeliveryTypeSelf {
|
||||
order.DeliveryType = model.OrderDeliveryTypeSelfTake
|
||||
} else if *orderDetail.DeliveryType == tao_vegetable.OrderDeliveryTypeStore {
|
||||
order.DeliveryType = model.OrderDeliveryTypeStoreSelf
|
||||
}
|
||||
|
||||
// 期望送达时间两小时内为立即达
|
||||
@@ -198,7 +204,11 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve
|
||||
|
||||
// 包装袋金额
|
||||
store, _ := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
|
||||
order.PackagePrice = int(*orderDetail.PackageFee) + store.PackageSetting
|
||||
if store != nil {
|
||||
order.PackagePrice = int(*orderDetail.PackageFee) + store.PackageSetting
|
||||
} else {
|
||||
order.PackagePrice = int(*orderDetail.PackageFee)
|
||||
}
|
||||
order.StoreName = store.Name // 真实门店名称
|
||||
|
||||
return order, orderMap, err
|
||||
|
||||
@@ -118,7 +118,7 @@ func (c *PurchaseHandler) onAfsOrderMsg(status string, msg interface{}) (retVal
|
||||
}
|
||||
for _, sku := range *skuList.SubOrderResponseList {
|
||||
orderSku := &model.OrderSkuFinancial{
|
||||
Count: utils.Str2Int(*sku.BuySaleQuantity),
|
||||
Count: utils.Float64TwoInt(*sku.BuySaleQuantity),
|
||||
VendorSkuID: *sku.SkuCode,
|
||||
SkuID: utils.Str2Int(*sku.SkuCode),
|
||||
Name: *sku.SkuName,
|
||||
|
||||
Reference in New Issue
Block a user