Merge remote-tracking branch 'origin/mark' into su
This commit is contained in:
@@ -98,6 +98,8 @@ func InitServiceInfo(version string, buildTime time.Time, gitCommit string) {
|
||||
"autoSaleAt": AutoSaleAtStr,
|
||||
"userTypeName": model.UserTypeName,
|
||||
"storePriceTypeName": model.StorePriceTypeName,
|
||||
"payStatusName": model.PayStatusName,
|
||||
"refundStatusName": model.RefundStatusName,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,6 +139,10 @@ func SyncStoreCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
|
||||
}
|
||||
|
||||
func SyncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID, storeID int, vendorStoreID string, nameIDs, skuIDs, excludeSkuIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
return SyncStoreSkuNew2(ctx, parentTask, vendorID, storeID, vendorStoreID, nameIDs, skuIDs, excludeSkuIDs, false, isAsync, isContinueWhenError)
|
||||
}
|
||||
|
||||
func SyncStoreSkuNew2(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID, storeID int, vendorStoreID string, nameIDs, skuIDs, excludeSkuIDs []int, useVendorPriceDirectly, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
singleStoreHandler, _ := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
|
||||
if singleStoreHandler != nil {
|
||||
if err = CreateStoreCategoryByStoreSku(ctx, vendorID, storeID, vendorStoreID, nameIDs, skuIDs); err != nil {
|
||||
@@ -153,7 +157,7 @@ func SyncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID,
|
||||
_, err = SyncStoreCategories(ctx, task, vendorID, storeID, vendorStoreID, nameIDs, skuIDs, false, isContinueWhenError)
|
||||
}
|
||||
case 1:
|
||||
err = syncStoreSkuNew(ctx, task, false, vendorID, storeID, nameIDs, skuIDs, excludeSkuIDs, isContinueWhenError)
|
||||
err = syncStoreSkuNew(ctx, task, false, vendorID, storeID, nameIDs, skuIDs, excludeSkuIDs, useVendorPriceDirectly, isContinueWhenError)
|
||||
}
|
||||
return result, err
|
||||
}, 2)
|
||||
@@ -183,7 +187,7 @@ func FullSyncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
|
||||
if singleStoreHandler != nil {
|
||||
_, err = SyncStoreSkuNew(ctx, task, vendorID, storeID, vendorStoreID, nil, nil, nil, false, isContinueWhenError)
|
||||
} else {
|
||||
err = syncStoreSkuNew(ctx, task, true, vendorID, storeID, nil, nil, nil, isContinueWhenError)
|
||||
err = syncStoreSkuNew(ctx, task, true, vendorID, storeID, nil, nil, nil, false, isContinueWhenError)
|
||||
}
|
||||
}
|
||||
return retVal, err
|
||||
@@ -292,7 +296,7 @@ func updateStoreSku(db *dao.DaoDB, vendorID int, storeSkuList []*dao.StoreSkuSyn
|
||||
return num, err
|
||||
}
|
||||
|
||||
func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bool, vendorID, storeID int, nameIDs, skuIDs, excludeSkuIDs []int, isContinueWhenError bool) (err error) {
|
||||
func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bool, vendorID, storeID int, nameIDs, skuIDs, excludeSkuIDs []int, useVendorPriceDirectly, isContinueWhenError bool) (err error) {
|
||||
db := dao.GetDB()
|
||||
storeDetail, err := dao.GetStoreDetail(db, storeID, vendorID)
|
||||
if err != nil {
|
||||
@@ -337,6 +341,9 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
|
||||
}
|
||||
now := jxutils.OperationTime2HourMinuteFormat(time.Now())
|
||||
for _, sku := range skus {
|
||||
if !useVendorPriceDirectly {
|
||||
sku.VendorPrice = 0
|
||||
}
|
||||
sku.MergedStatus = MergeSkuSaleStatusWithStoreOpTime(sku, storeDetail, now)
|
||||
var bareSku *partner.StoreSkuInfo
|
||||
isNeedReorder := false
|
||||
|
||||
Reference in New Issue
Block a user