门店商品添加锁定概念
This commit is contained in:
@@ -952,7 +952,7 @@ func DeleteSkusFromAct(ctx *jxcontext.Context, vendorID int, actTypes, skuIDs []
|
||||
return hint, err
|
||||
}
|
||||
|
||||
func ForceUpdateVendorPrice(ctx *jxcontext.Context, vendorID int, actType int, storeSkuList []*ActStoreSkuParam, isAsync bool) (hint string, err error) {
|
||||
func ForceUpdateVendorPrice(ctx *jxcontext.Context, vendorID int, actType int, storeSkuList []*ActStoreSkuParam, lockTime time.Time, isAsync bool) (hint string, err error) {
|
||||
var wrongSkuList []*ActStoreSkuParam
|
||||
var storeSkuBindList []*model.StoreSkuBind
|
||||
|
||||
@@ -986,7 +986,7 @@ func ForceUpdateVendorPrice(ctx *jxcontext.Context, vendorID int, actType int, s
|
||||
}
|
||||
}
|
||||
if storeSkuBind != nil {
|
||||
dao.SetStoreSkuBindVendorPrice(storeSkuBind, vendorID, vendorPrice)
|
||||
dao.SetStoreSkuBindVendorPrice(storeSkuBind, vendorID, vendorPrice, lockTime)
|
||||
if vendorID != model.VendorIDJX {
|
||||
dao.SetStoreSkuBindSyncStatus(storeSkuBind, vendorID, dao.GetStoreSkuBindSyncStatus(storeSkuBind, vendorID)|model.SyncFlagPriceMask)
|
||||
}
|
||||
|
||||
@@ -319,6 +319,12 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, isFocus bool
|
||||
sqlParams = append(sqlParams, skuID)
|
||||
}
|
||||
}
|
||||
if lockTimeStr, ok := params["lockTime"].(string); ok && lockTimeStr != "" {
|
||||
if timeList, err2 := jxutils.BatchStr2Time(lockTimeStr); err2 == nil {
|
||||
sql += " AND (t4.jd_lock_time > ? OR t4.mtwm_lock_time > ? OR t4.ebai_lock_time > ? OR t4.jx_lock_time > ?)"
|
||||
sqlParams = append(sqlParams, timeList[0], timeList[0], timeList[0], timeList[0])
|
||||
}
|
||||
}
|
||||
if isFocus {
|
||||
if params["fromStatus"] != nil {
|
||||
fromStatus := params["fromStatus"].(int)
|
||||
@@ -451,6 +457,7 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus bo
|
||||
t4.ebai_id, t4.mtwm_id,
|
||||
t4.jd_sync_status, t4.ebai_sync_status, t4.mtwm_sync_status,
|
||||
t4.jd_price, t4.ebai_price, t4.mtwm_price, t4.jx_price,
|
||||
t4.jd_lock_time, t4.ebai_lock_time, t4.mtwm_lock_time, t4.jx_lock_time,
|
||||
t4.status_sale_begin, t4.status_sale_end
|
||||
`, jdVendorIDField) + sql
|
||||
var tmpList []*tGetStoresSkusInfo
|
||||
|
||||
@@ -335,7 +335,8 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
|
||||
}
|
||||
now := jxutils.OperationTime2HourMinuteFormat(time.Now())
|
||||
for _, sku := range skus {
|
||||
if !useVendorPriceDirectly {
|
||||
if !useVendorPriceDirectly &&
|
||||
(sku.LockTime == nil || time.Now().Sub(*sku.LockTime) > 0) {
|
||||
sku.VendorPrice = 0
|
||||
}
|
||||
sku.MergedStatus = MergeSkuSaleStatusWithStoreOpTime(sku, storeDetail, now)
|
||||
|
||||
Reference in New Issue
Block a user