This commit is contained in:
suyl
2021-05-31 14:27:26 +08:00
parent ce5eb03e12
commit fbcc7ac754
3 changed files with 24 additions and 10 deletions

View File

@@ -77,6 +77,7 @@ type StoreSkuBindSkuInfo struct {
Stock *int `json:"stock"`
// ElmID int64 `json:"elmID,omitempty"`
// EbaiID int64 `json:"ebaiID,omitempty"`
MtLadderBoxPrice int `json:"mtLadderBoxPrice"`
}
// UpdateStoreSku用API调用时
@@ -817,7 +818,7 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []str
t4.jd_sync_status, t4.ebai_sync_status, t4.mtwm_sync_status, t4.yb_sync_status, t4.jds_sync_status,
t4.jd_price, t4.ebai_price, t4.mtwm_price, t4.jx_price, t4.yb_price, t4.jds_price,
t4.jd_lock_time, t4.ebai_lock_time, t4.mtwm_lock_time, t4.jx_lock_time, t4.yb_lock_time, t4.jds_lock_time,
t4.status_sale_begin, t4.status_sale_end, t4.stock,
t4.status_sale_begin, t4.status_sale_end, t4.stock, t4.mt_ladder_box_price,
t6.mid_unit_price real_mid_unit_price,
t7.unit_price audit_unit_price
` + sql
@@ -1595,6 +1596,11 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
skuBind.Stock = *inSkuBind.Stock
setStoreSkuBindStatus(skuBind, model.SyncFlagStockMask)
}
if inSkuBind.MtLadderBoxPrice != 0 {
updateFieldMap["MtLadderBoxPrice"] = 1
skuBind.MtLadderBoxPrice = inSkuBind.MtLadderBoxPrice
setStoreSkuBindStatus(skuBind, model.SyncFlagModifiedMask)
}
}
if skuBindInfo.UnitPrice != 0 && isCanChangePrice { // 这里是否需要加此条件限制
price := jxutils.CaculateSkuPrice(unitPrice, v.SpecQuality, v.SpecUnit, v.SkuNameUnit)

View File

@@ -136,10 +136,11 @@ type StoreSkuSyncInfo struct {
StatusSaleBegin int16 `json:"statusSaleBegin"` //商品可售时间范围
StatusSaleEnd int16 `json:"statusSaleEnd"`
VendorActID string `orm:"column(vendor_act_id);size(48)" json:"vendorActID"`
ActPercentage int `json:"actPercentage"` // 直降活动百分比
ActSyncStatus int8 `orm:"default(2)" json:"actSyncStatus"`
VendorActPrice int64 `json:"vendorActPrice"` // 保存数据用,实际的活动价
VendorActID string `orm:"column(vendor_act_id);size(48)" json:"vendorActID"`
ActPercentage int `json:"actPercentage"` // 直降活动百分比
ActSyncStatus int8 `orm:"default(2)" json:"actSyncStatus"`
VendorActPrice int64 `json:"vendorActPrice"` // 保存数据用,实际的活动价
MtLadderBoxPrice int `json:"mtLadderBoxPrice"` //美团门店商品的包装费
IsDeletedBySku bool `json:"isDeletedBySku"` //京东商城用同步下架的商品库里的sku时要做区分来决定调的api
}
@@ -316,9 +317,10 @@ type StoreSkuExt struct {
EarningPrice int `json:"earningPrice"`
EarningActID int `orm:"column(earning_act_id)" json:"earningActID"`
EclpID string `orm:"column(eclp_id)" json:"eclpID"`
TrendType int `json:"trendType"`
TrendPrice int `json:"trendPrice"`
EclpID string `orm:"column(eclp_id)" json:"eclpID"`
TrendType int `json:"trendType"`
TrendPrice int `json:"trendPrice"`
MtLadderBoxPrice int `json:"mtLadderBoxPrice"`
}
type SkuNameAndPlace struct {
@@ -482,7 +484,7 @@ func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty boo
t14.vendor_id, t14.vendor_org_code,
t1.id bind_id, t1.sku_id, t1.price, t1.unit_price, t1.status store_sku_status,
%s vendor_sku_id, t1.%s_sync_status sku_sync_status, t1.%s_price vendor_price, t1.%s_lock_time lock_time,
t1.store_id, t1.deleted_at bind_deleted_at,t1.status_sale_begin,t1.status_sale_end, t1.jds_ware_id, t1.stock,
t1.store_id, t1.deleted_at bind_deleted_at,t1.status_sale_begin,t1.status_sale_end, t1.jds_ware_id, t1.stock, t1.mt_ladder_box_price,
t2.*,
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.category_id name_category_id, t3.yb_name_suffix,
t3.jds_stock_switch, t3.preparation_time, t3.img_watermark, t3.ex_vendor_id, t3.img img_origin,

View File

@@ -327,7 +327,13 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
skus[0]["upc"] = storeSku.Upc
}
skus[0]["ladder_box_num"] = storeSku.LadderBoxNum
skus[0]["ladder_box_price"] = jxutils.IntPrice2Standard(int64(storeSku.LadderBoxPrice))
boxPirce := 0
if storeSku.MtLadderBoxPrice != 0 {
boxPirce = storeSku.MtLadderBoxPrice
} else {
boxPirce = storeSku.LadderBoxPrice
}
skus[0]["ladder_box_price"] = jxutils.IntPrice2Standard(int64(boxPirce))
if foodData["tag_id"] != nil {
skus[0]["weight"] = storeSku.Weight // weight字段仅限服饰鞋帽、美妆、日用品、母婴、生鲜果蔬、生活超市下的便利店/超市门店品类的商家使用
}