差异对比程序修改
This commit is contained in:
@@ -36,7 +36,7 @@ const (
|
|||||||
DatAanalyse5 = "京西商品库没有,平台商品库有 "
|
DatAanalyse5 = "京西商品库没有,平台商品库有 "
|
||||||
DatAanalyse6 = "京西商品库有,平台商品库没有"
|
DatAanalyse6 = "京西商品库有,平台商品库没有"
|
||||||
DatAanalyse7 = "同步状态异常"
|
DatAanalyse7 = "同步状态异常"
|
||||||
DatAanalyse8 = "平台门店未关注,应添加对应的平台门店商品"
|
DatAanalyse8 = "平台门店未关注或平台门店商品库存为0,应添加对应的平台门店商品"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -369,11 +369,14 @@ func CompareJxAndVendor(vendorID int, storeIDStr, vendorStoreID, storeName strin
|
|||||||
if isSaleStatusDiff {
|
if isSaleStatusDiff {
|
||||||
reason += DatAanalyse4
|
reason += DatAanalyse4
|
||||||
}
|
}
|
||||||
|
if status != model.SkuStatusDontSale {
|
||||||
|
reason += DatAanalyse7
|
||||||
|
}
|
||||||
outPutData := DiffData{storeIDStr, vendorStoreID, storeName, skuIDStr, syncStatus, toBeCreate, toBeDel, jxSkuDetailName, vendorSkuDetailName, jxSkuSaleStatusName, vendorSkuSaleStatusName, reason}
|
outPutData := DiffData{storeIDStr, vendorStoreID, storeName, skuIDStr, syncStatus, toBeCreate, toBeDel, jxSkuDetailName, vendorSkuDetailName, jxSkuSaleStatusName, vendorSkuSaleStatusName, reason}
|
||||||
diffData.AppendData(vendorID, outPutData)
|
diffData.AppendData(vendorID, outPutData)
|
||||||
}
|
}
|
||||||
if !isSaleStatusDiff && !isNameDiff {
|
if !isSaleStatusDiff && !isNameDiff {
|
||||||
if status != 0 {
|
if status != model.SkuStatusDontSale {
|
||||||
outPutData := DiffData{storeIDStr, vendorStoreID, storeName, skuIDStr, syncStatus, toBeCreate, toBeDel, jxSkuDetailName, vendorSkuDetailName, jxSkuSaleStatusName, vendorSkuSaleStatusName, DatAanalyse7}
|
outPutData := DiffData{storeIDStr, vendorStoreID, storeName, skuIDStr, syncStatus, toBeCreate, toBeDel, jxSkuDetailName, vendorSkuDetailName, jxSkuSaleStatusName, vendorSkuSaleStatusName, DatAanalyse7}
|
||||||
diffData.AppendData(vendorID, outPutData)
|
diffData.AppendData(vendorID, outPutData)
|
||||||
}
|
}
|
||||||
@@ -383,11 +386,14 @@ func CompareJxAndVendor(vendorID int, storeIDStr, vendorStoreID, storeName strin
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
reason := ""
|
reason := ""
|
||||||
if status == 0 {
|
if status == model.SkuStatusDontSale {
|
||||||
reason = DatAanalyse8
|
reason = DatAanalyse8
|
||||||
} else {
|
} else {
|
||||||
reason = DatAanalyse2
|
reason = DatAanalyse2
|
||||||
}
|
}
|
||||||
|
if status != model.SkuStatusDontSale {
|
||||||
|
reason += DatAanalyse7
|
||||||
|
}
|
||||||
outPutData := DiffData{storeIDStr, vendorStoreID, storeName, skuIDStr, syncStatus, toBeCreate, toBeDel, jxSkuDetailName, "", jxSkuSaleStatusName, "", reason}
|
outPutData := DiffData{storeIDStr, vendorStoreID, storeName, skuIDStr, syncStatus, toBeCreate, toBeDel, jxSkuDetailName, "", jxSkuSaleStatusName, "", reason}
|
||||||
diffData.AppendData(vendorID, outPutData)
|
diffData.AppendData(vendorID, outPutData)
|
||||||
}
|
}
|
||||||
@@ -537,15 +543,26 @@ func CheckSkuDiffBetweenJxAndVendor(ctx *jxcontext.Context, vendorIDList []int,
|
|||||||
storeIDStr := utils.Int2Str(storeID)
|
storeIDStr := utils.Int2Str(storeID)
|
||||||
storeName := jxStoreInfoListValue.Name
|
storeName := jxStoreInfoListValue.Name
|
||||||
if jxStoreInfoListValue.StoreMaps != nil {
|
if jxStoreInfoListValue.StoreMaps != nil {
|
||||||
isGetJxSkuInfoData := false
|
var filterJxSkuInfoMapSingle map[int]*StoreSkuNameExt
|
||||||
var filterJxSkuInfoMap map[int]*StoreSkuNameExt
|
var filterJxSkuInfoMapMulti map[int]*StoreSkuNameExt
|
||||||
for _, vendorListValue := range jxStoreInfoListValue.StoreMaps {
|
for _, vendorListValue := range jxStoreInfoListValue.StoreMaps {
|
||||||
vendorID := int(utils.MustInterface2Int64(vendorListValue["vendorID"]))
|
vendorID := int(utils.MustInterface2Int64(vendorListValue["vendorID"]))
|
||||||
|
//京西的门店商品只取一次
|
||||||
if isGetJxSkuInfoData == false { //only get once jx sku info list every store id
|
flag := false
|
||||||
isGetJxSkuInfoData = true
|
jxSkuInfoDataSingle := &StoreSkuNamesInfo{}
|
||||||
jxSkuInfoData, _ := GetStoreSkus(ctx, storeID, filterJxDepotUnSaleSkuIds, true, "", true, false, map[string]interface{}{}, 0, -1)
|
jxSkuInfoDataMulti := &StoreSkuNamesInfo{}
|
||||||
filterJxSkuInfoMap = GetFilterJxSkuInfoMap(jxSkuInfoData.SkuNames) //map[京西商品ID:StoreSkuNameExt]
|
if partner.IsMultiStore(vendorID) {
|
||||||
|
if flag == false {
|
||||||
|
jxSkuInfoDataMulti, _ = GetStoreSkus(ctx, storeID, filterJxDepotUnSaleSkuIds, true, "", true, false, map[string]interface{}{}, 0, -1)
|
||||||
|
filterJxSkuInfoMapMulti = GetFilterJxSkuInfoMap(jxSkuInfoDataMulti.SkuNames) //map[京西商品ID:StoreSkuNameExt]
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if flag == false {
|
||||||
|
jxSkuInfoDataSingle, _ = GetStoreSkus(ctx, storeID, []int{}, true, "", true, false, map[string]interface{}{}, 0, -1)
|
||||||
|
filterJxSkuInfoMapSingle = GetFilterJxSkuInfoMap(jxSkuInfoDataSingle.SkuNames) //map[京西商品ID:StoreSkuNameExt]
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vendorStoreID := utils.Interface2String(vendorListValue["vendorStoreID"])
|
vendorStoreID := utils.Interface2String(vendorListValue["vendorStoreID"])
|
||||||
@@ -559,7 +576,7 @@ func CheckSkuDiffBetweenJxAndVendor(ctx *jxcontext.Context, vendorIDList []int,
|
|||||||
baseapi.SugarLogger.Infof("CheckSkuDiffBetweenJxAndVendor GetStoreSkusBareInfo error:%v", err)
|
baseapi.SugarLogger.Infof("CheckSkuDiffBetweenJxAndVendor GetStoreSkusBareInfo error:%v", err)
|
||||||
} else if len(skuBareInfoList) > 0 {
|
} else if len(skuBareInfoList) > 0 {
|
||||||
filterSkuInfoMap := GetFilterMultiStoreSkuInfoMap(vendorID, skuBareInfoList) //map[京东商品ID:SkuNameInfo]
|
filterSkuInfoMap := GetFilterMultiStoreSkuInfoMap(vendorID, skuBareInfoList) //map[京东商品ID:SkuNameInfo]
|
||||||
CompareJxAndVendor(vendorID, storeIDStr, vendorStoreID, storeName, filterJxSkuInfoMap, filterSkuInfoMap)
|
CompareJxAndVendor(vendorID, storeIDStr, vendorStoreID, storeName, filterJxSkuInfoMapMulti, filterSkuInfoMap)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
singleStoreHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
|
singleStoreHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
|
||||||
@@ -568,7 +585,7 @@ func CheckSkuDiffBetweenJxAndVendor(ctx *jxcontext.Context, vendorIDList []int,
|
|||||||
baseapi.SugarLogger.Infof("CheckSkuDiffBetweenJxAndVendor GetStoreSkusFullInfo error:%v", err)
|
baseapi.SugarLogger.Infof("CheckSkuDiffBetweenJxAndVendor GetStoreSkusFullInfo error:%v", err)
|
||||||
} else if len(vendorSkuInfoList) > 0 {
|
} else if len(vendorSkuInfoList) > 0 {
|
||||||
filterVendorSkuInfoMap := GetFilterVendorSkuInfoMap(vendorSkuInfoList) //map[平台商品ID:SkuNameInfo]
|
filterVendorSkuInfoMap := GetFilterVendorSkuInfoMap(vendorSkuInfoList) //map[平台商品ID:SkuNameInfo]
|
||||||
CompareJxAndVendor(vendorID, storeIDStr, vendorStoreID, storeName, filterJxSkuInfoMap, filterVendorSkuInfoMap)
|
CompareJxAndVendor(vendorID, storeIDStr, vendorStoreID, storeName, filterJxSkuInfoMapSingle, filterVendorSkuInfoMap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user