This commit is contained in:
邹宗楠
2022-10-08 17:47:19 +08:00
parent 385d8d5999
commit 3466efa552
6 changed files with 27 additions and 3 deletions

View File

@@ -175,6 +175,8 @@ func getVendorPriceFromStoreSkuBind(bind *model.StoreSkuBind, vendorID int) (ven
vendorPrice = bind.EbaiPrice
case model.VendorIDJX:
vendorPrice = bind.JxPrice
case model.VendorIDDD:
vendorPrice = bind.DdPrice
}
return vendorPrice
}

View File

@@ -260,8 +260,8 @@ func UpdateCategory(ctx *jxcontext.Context, categoryID int, payload map[string]i
SetStoreCategorySyncStatus2(db, nil, []int{categoryID}, model.SyncFlagModifiedMask)
var skuIDs []int
if valid["jdCategoryID"] != nil || valid["ebaiCategoryID"] != nil || valid["mtwmCategoryID"] != nil ||
valid["jdPricePercentage"] != nil || valid["ebaiPricePercentage"] != nil || valid["mtwmPricePercentage"] != nil {
if valid["jdCategoryID"] != nil || valid["ebaiCategoryID"] != nil || valid["mtwmCategoryID"] != nil || valid["ddCategoryID"] != nil ||
valid["jdPricePercentage"] != nil || valid["ebaiPricePercentage"] != nil || valid["mtwmPricePercentage"] != nil || valid["ddPricePercentage"] != nil {
if skuList, err2 := dao.GetSkuByCats(db, []int{categoryID}); err2 == nil && len(skuList) > 0 {
for _, sku := range skuList {
skuIDs = append(skuIDs, sku.ID)
@@ -291,6 +291,13 @@ func UpdateCategory(ctx *jxcontext.Context, categoryID int, payload map[string]i
} else if valid["mtwmCategoryID"] != nil {
vendorIDs = append(vendorIDs, model.VendorIDMTWM)
}
if valid["ddPricePercentage"] != nil {
vendorIDs = append(vendorIDs, model.VendorIDDD)
syncStatus |= model.SyncFlagPriceMask
} else if valid["ddCategoryID"] != nil {
vendorIDs = append(vendorIDs, model.VendorIDDD)
}
if len(vendorIDs) > 0 {
SetStoreSkuSyncStatus2(db, nil, vendorIDs, skuIDs, syncStatus)
}

View File

@@ -3588,6 +3588,8 @@ func vendorPriceTransForm(storeSkuExt *dao.StoreSkuExt, vendorID int) int64 {
return int64(storeSkuExt.YbPrice)
case 5:
return int64(storeSkuExt.JdsPrice)
case 14:
return int64(storeSkuExt.DdPrice)
default:
return 0
}

View File

@@ -300,6 +300,7 @@ type StoreSkuExt struct {
JxPrice int `json:"jxPrice"`
YbPrice int `json:"ybPrice"`
JdsPrice int `json:"jdsPrice"`
DdPrice int `json:"ddPrice"`
JdLockTime *time.Time `orm:"null" json:"jdLockTime,omitempty"`
JdsLockTime *time.Time `orm:"null" json:"jdsLockTime,omitempty"`
@@ -1428,6 +1429,9 @@ func SetStoreSkuBindVendorPrice(storeSkuBind *model.StoreSkuBind, vendorID int,
case model.VendorIDJX:
storeSkuBind.JxPrice = vendorPrice
storeSkuBind.JxLockTime = pLockTime
case model.VendorIDDD:
storeSkuBind.DdPrice = vendorPrice
storeSkuBind.DdLockTime = pLockTime
}
}
@@ -1441,6 +1445,8 @@ func GetStoreSkuBindVendorPrice(storeSkuBind *model.StoreSkuBind, vendorID int)
vendorPrice = storeSkuBind.EbaiPrice
case model.VendorIDJX:
vendorPrice = storeSkuBind.JxPrice
case model.VendorIDDD:
vendorPrice = storeSkuBind.DdPrice
}
return vendorPrice
}

View File

@@ -576,9 +576,13 @@ type PriceReferSnapshot struct {
AvgEbaiPrice int `json:"avgEbaiPrice"`
MidEbaiPrice int `json:"midEbaiPrice"`
MaxMtwmPrice int `json:"maxMtwmPrice"`
MaxDdPrice int `json:"maxDdPrice"`
MinMtwmPrice int `json:"minMtwmPrice"`
MinDdPrice int `json:"minDdPrice"`
AvgMtwmPrice int `json:"avgMtwmPrice"`
AvgDdPrice int `json:"avgDdPrice"`
MidMtwmPrice int `json:"midMtwmPrice"`
MidDdPrice int `json:"midDdPrice"`
MaxSalePrice int `json:"maxSalePrice"`
MinSalePrice int `json:"minSalePrice"`
AvgSalePrice int `json:"avgSalePrice"`

View File

@@ -113,6 +113,7 @@ type StoreSkuBind struct {
// ElmID int64 `orm:"column(elm_id);index"`
MtwmID int64 `orm:"column(mtwm_id);index"`
EbaiID int64 `orm:"column(ebai_id);index"`
DdID int64 `orm:"column(dd_id);index"`
YbID int64 `orm:"column(yb_id);index"`
JdsID int64 `orm:"column(jds_id);index"`
JdsWareID int64 `orm:"column(jds_ware_id)"`
@@ -123,6 +124,7 @@ type StoreSkuBind struct {
// ElmSyncStatus int8 `orm:"default(2)"`
JdSyncStatus int8 `orm:"default(2)"`
MtwmSyncStatus int8 `orm:"default(2)"`
DdSyncStatus int8 `orm:"default(2)"`
EbaiSyncStatus int8 `orm:"default(2)"`
YbSyncStatus int8 `orm:"default(2)"`
JdsSyncStatus int8 `orm:"default(2)"` //京东商城
@@ -133,6 +135,7 @@ type StoreSkuBind struct {
MtwmPrice int `json:"mtwmPrice"`
EbaiPrice int `json:"ebaiPrice"`
JxPrice int `json:"jxPrice"`
DdPrice int `json:"ddPrice"`
YbPrice int `json:"ybPrice"`
JdsPrice int `json:"jdsPrice"`
//GmPrice int `json:"gmPrice"`
@@ -143,7 +146,7 @@ type StoreSkuBind struct {
EbaiLockTime *time.Time `orm:"null" json:"ebaiLockTime"`
JxLockTime *time.Time `orm:"null" json:"jxLockTime"`
YbLockTime *time.Time `orm:"null" json:"ybLockTime"`
//GmLockTime *time.Time `orm:"null" json:"gmLockTime"`
DdLockTime *time.Time `orm:"null" json:"ddLockTime"`
AutoSaleAt time.Time `orm:"type(datetime);null" json:"autoSaleAt"`