diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index 218a505b7..f1033b1a0 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -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 } diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index b540ec1e9..235640d4e 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -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) } diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index ba9e25b30..857b009b2 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -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 } diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index fcea71ea1..e9ecf8fc6 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -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 } diff --git a/business/model/store.go b/business/model/store.go index 94b1fedfd..9239c82a7 100644 --- a/business/model/store.go +++ b/business/model/store.go @@ -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"` diff --git a/business/model/store_sku.go b/business/model/store_sku.go index bec872f4a..8d68cec39 100644 --- a/business/model/store_sku.go +++ b/business/model/store_sku.go @@ -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"`