结算价规则修改

This commit is contained in:
苏尹岚
2020-05-18 09:07:09 +08:00
parent 9c30665801
commit d5f2e1eaa0
3 changed files with 26 additions and 26 deletions

View File

@@ -377,27 +377,28 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao.
//TODO 重复购买有活动且结算价大于0的商品需要拆分第一个商品按结算价后面的商品按shopprice 或者 saleprice, 2020-05-06
//TODO 京东美团的订单,做活动的商品之前就会拆分出来,所以只做更新,饿百暂时不管, 2020-05-07
//TODO 不根据商品是否拆分直接根据该商品做了活动并且他的vendorPrice 和 salePrice 相等,就按新规则结算, 2020-05-11
//TODO 现在不判断商品做没做活动只要vendorPrice和salePrice不等就默认为做了活动不做活动的商品就按新规则结算2020-05-18
if order.VendorID == model.VendorIDJD || order.VendorID == model.VendorIDMTWM {
for _, v := range orderSkus {
if v.EarningPrice > 0 {
var storeID int
if order.StoreID == 0 {
storeID = order.JxStoreID
} else {
storeID = order.StoreID
}
result, err := dao.GetEffectiveActStoreSkuInfo2(db, 0, []int{order.VendorID}, []int{model.ActSkuSecKill, model.ActSkuDirectDown}, []int{storeID}, []int{v.SkuID}, order.OrderCreatedAt, order.OrderCreatedAt)
if (len(result) > 0 && err == nil) || v.IsVendorAct == model.YES {
if v.VendorPrice == v.SalePrice {
var earningPrice = 0
if v.ShopPrice < v.SalePrice {
earningPrice = int(utils.Float64TwoInt64(math.Round(utils.Int2Float64(int(v.ShopPrice)) * utils.Int2Float64(storePayPercentage) / 100)))
} else {
earningPrice = int(utils.Float64TwoInt64(math.Round(utils.Int2Float64(int(v.SalePrice)) * utils.Int2Float64(storePayPercentage) / 100)))
}
v.EarningPrice = int64(earningPrice)
// var storeID int
// if order.StoreID == 0 {
// storeID = order.JxStoreID
// } else {
// storeID = order.StoreID
// }
// result, err := dao.GetEffectiveActStoreSkuInfo2(db, 0, []int{order.VendorID}, []int{model.ActSkuSecKill, model.ActSkuDirectDown}, []int{storeID}, []int{v.SkuID}, order.OrderCreatedAt, order.OrderCreatedAt)
// if (len(result) > 0 && err == nil) || v.IsVendorAct == model.YES {
if v.VendorPrice == v.SalePrice {
var earningPrice = 0
if v.ShopPrice < v.SalePrice {
earningPrice = int(utils.Float64TwoInt64(math.Round(utils.Int2Float64(int(v.ShopPrice)) * utils.Int2Float64(storePayPercentage) / 100)))
} else {
earningPrice = int(utils.Float64TwoInt64(math.Round(utils.Int2Float64(int(v.SalePrice)) * utils.Int2Float64(storePayPercentage) / 100)))
}
v.EarningPrice = int64(earningPrice)
}
// }
}
}
}

View File

@@ -294,7 +294,6 @@ func Init() {
}
if configs, err := dao.QueryConfigs(dao.GetDB(), "jdsCookie", model.ConfigTypeCookie, ""); err == nil {
jdsCookie = configs[0].Value
fmt.Println("test111111111111111111111", jdsCookie)
}
if configs, err := dao.QueryConfigs(dao.GetDB(), "yinbaoCookie", model.ConfigTypeCookie, ""); err == nil {
yinbaoCookie := configs[0].Value

View File

@@ -93,15 +93,15 @@ func (p *PurchaseHandler) UpdateStoreSkus(ctx *jxcontext.Context, storeID int, v
func (p *PurchaseHandler) DeleteStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
if globals.EnableJdShopWrite && vendorStoreID == model.JdShopMainVendorStoreID {
for _, v := range storeSkuList {
err = api.JdShopAPI.UpOrDown(utils.Str2Int64(v.VendorSkuID2), 2)
if err == nil {
err = api.JdShopAPI.DeleteWare(utils.Str2Int(v.VendorSkuID2))
}
}
if err != nil {
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDJDShop], "删除商品")
}
// for _, v := range storeSkuList {
// err = api.JdShopAPI.UpOrDown(utils.Str2Int64(v.VendorSkuID2), 2)
// if err == nil {
// err = api.JdShopAPI.DeleteWare(utils.Str2Int(v.VendorSkuID2))
// }
// }
// if err != nil {
// failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDJDShop], "删除商品")
// }
}
return failedList, err
}