1
This commit is contained in:
@@ -438,7 +438,6 @@ func isSkuLockTimeValid(sku *dao.StoreSkuSyncInfo) bool {
|
||||
}
|
||||
|
||||
func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag int, isFull bool, vendorID, storeID int, vendorOrgCode string, nameIDs, skuIDs, excludeSkuIDs []int, useVendorPriceDirectly, isContinueWhenError bool) (err error) {
|
||||
globals.SugarLogger.Debugf("=是不是正儿八经的京东商城 %d,%d,%s,%s", vendorID, storeID, vendorOrgCode, utils.Format4Output(skuIDs, false))
|
||||
db := dao.GetDB()
|
||||
storeDetail, err := dao.GetStoreDetail(db, storeID, vendorID, vendorOrgCode)
|
||||
if err != nil {
|
||||
|
||||
@@ -238,19 +238,16 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
} else {
|
||||
// 本地不存在,线上存在.直接创建子商品保存本地同步记录
|
||||
var childrenProductId int64 = 0
|
||||
var syncStatus int8 = 0
|
||||
if mainOrderDetail.CheckStatus == 3 {
|
||||
childrenProductId, err = api.CreateSubProduct(mainOrderDetail.MainProductId, utils.Str2Int64(vendorStoreID))
|
||||
if err != nil {
|
||||
syncStatus = model.SyncFlagNewMask
|
||||
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
||||
if storeSku.VendorSkuID == "" {
|
||||
storeSku.VendorSkuID = utils.Int2Str(storeSku.SkuID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err := dao.CreateThingMap(int64(storeSku.SkuID), mainOrderDetail.ProductIdStr, storeDetail.VendorOrgCode+"|"+vendorStoreID, storeSku.VendorSkuAttrId, model.ThingTypeSku, syncStatus); err != nil {
|
||||
if err := dao.CreateThingMap(int64(storeSku.SkuID), mainOrderDetail.ProductIdStr, storeDetail.VendorOrgCode, storeSku.VendorSkuAttrId, model.ThingTypeSku, 0); err != nil {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
||||
if storeSku.VendorSkuID == "" {
|
||||
storeSku.VendorSkuID = utils.Int2Str(storeSku.SkuID)
|
||||
@@ -266,9 +263,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
storeSku.VendorSkuID = utils.Int64ToStr(childrenProductId) // 子商品主id
|
||||
}
|
||||
} else {
|
||||
if localThing[0].SyncStatus != model.NO {
|
||||
|
||||
}
|
||||
// 主商品存在,直接同步子商品
|
||||
childrenProductId, err := api.CreateSubProduct(utils.Str2Int64(localThing[0].VendorThingID), utils.Str2Int64(vendorStoreID))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user