Merge remote-tracking branch 'origin/jdshop' into qidongsheng
This commit is contained in:
@@ -3334,6 +3334,7 @@ func AutoFocusStoreSkusForTopSkus(ctx *jxcontext.Context, isAsync, isContinueWhe
|
||||
var skuBindInfoList []*StoreSkuBindInfo
|
||||
for _, vv := range skuNameAndPlaceList {
|
||||
if skuNameMap[vv.ID] != 0 {
|
||||
globals.SugarLogger.Debugf("testAutoFocusStoreSkusForTopSkus,storeID:%v,nameID:%v", v.ID, vv.ID)
|
||||
storeSkuBindInfo := &StoreSkuBindInfo{
|
||||
StoreID: v.ID,
|
||||
NameID: vv.ID,
|
||||
@@ -4693,4 +4694,3 @@ func StoreSkuPriceAudit(ctx *jxcontext.Context, storeSkuAudits []*model.StoreSku
|
||||
}
|
||||
return hint, err
|
||||
}
|
||||
|
||||
|
||||
@@ -1115,7 +1115,7 @@ func syncJdsStoreStock(ctx *jxcontext.Context, db *dao.DaoDB, storeSkus []*model
|
||||
}
|
||||
storeSku2, _ := dao.GetStoresSkusInfo(db, []int{storeMap.StoreID}, []int{storeSku.SkuID})
|
||||
if storeSku.JdsID != 0 && len(storeSku2) > 0 {
|
||||
if storeSku.Status != storeSku2[0].Status {
|
||||
if storeSku.Status != storeSku2[0].Status && storeMap.VendorStoreID != "" {
|
||||
err = api.JdShopAPI.UpdateSkuSiteStock(storeSku.JdsID, stock, utils.Str2Int(storeMap.VendorStoreID))
|
||||
}
|
||||
}
|
||||
@@ -1184,14 +1184,14 @@ func syncJdsStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch
|
||||
for _, v := range updateList {
|
||||
skuBindInfos1 = append(skuBindInfos1, buildStoreSkuBindInfo(db, storeMap.StoreID, v, false))
|
||||
}
|
||||
_, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos1, isAsync, isContinueWhenError, false)
|
||||
UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos1, isAsync, isContinueWhenError, false)
|
||||
}
|
||||
|
||||
if len(addList) > 0 {
|
||||
for _, v := range addList {
|
||||
skuBindInfos2 = append(skuBindInfos2, buildStoreSkuBindInfo(db, storeMap.StoreID, v, true))
|
||||
}
|
||||
_, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos2, isAsync, isContinueWhenError, false)
|
||||
UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos2, isAsync, isContinueWhenError, false)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -283,7 +283,6 @@ func formalizeStoreSkuList(inSkuList []*dao.StoreSkuSyncInfo) []*dao.StoreSkuSyn
|
||||
skuItem.SkuNameOrigin = jxutils.ComposeSkuNameOriginal(skuItem.Prefix, skuItem.Name, skuItem.Comment, skuItem.Unit, skuItem.SpecQuality, skuItem.SpecUnit, 0)
|
||||
if skuItem.ImgWatermark != "" {
|
||||
downLoad, _ := uploadImgStandard(skuItem.ImgWatermark)
|
||||
fmt.Println("testdo", downLoad)
|
||||
skuItem.ImgMix = jxutils.MixWatermarkImg(downLoad, skuItem.ImgOrigin, skuItem.ExPrefixBegin, skuItem.ExPrefixEnd)
|
||||
}
|
||||
}
|
||||
@@ -483,9 +482,9 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
} else {
|
||||
if sku.MergedStatus == model.SkuStatusNormal {
|
||||
if dao.IsVendorThingIDEmpty(sku.VendorCatID) && !strings.Contains(sku.StoreName, model.ExdStoreName) && vendorID != model.VendorIDYB && vendorID != model.VendorIDJDShop {
|
||||
globals.SugarLogger.Warnf("syncStoreSkuNew 创建门店:%d商品:%d,但没有平台分类ID", storeID, sku.SkuID)
|
||||
// globals.SugarLogger.Warnf("syncStoreSkuNew 创建门店:%d商品:%d,但没有平台分类ID", storeID, sku.SkuID)
|
||||
} else if dao.IsVendorThingIDEmpty(utils.Int64ToStr(sku.VendorVendorCatID)) && vendorID == model.VendorIDJDShop {
|
||||
globals.SugarLogger.Warnf("syncStoreSkuNew 创建门店:%d商品:%d,但没有映射的平台ID", storeID, sku.SkuID)
|
||||
// globals.SugarLogger.Warnf("syncStoreSkuNew 创建门店:%d商品:%d,但没有映射的平台ID", storeID, sku.SkuID)
|
||||
} else {
|
||||
createList = append(createList, sku)
|
||||
}
|
||||
@@ -509,7 +508,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
// 修改商品信息时不改价(以免活动引起的失败),而用单独的改价来改
|
||||
if (model.IsSyncStatusUpdate(sku.SkuSyncStatus) || (model.IsSyncStatusSeq(sku.SkuSyncStatus) && reorderHandler == nil)) && singleStoreHandler != nil {
|
||||
if dao.IsVendorThingIDEmpty(sku.VendorCatID) && !strings.Contains(sku.StoreName, model.ExdStoreName) && vendorID != model.VendorIDYB && vendorID != model.VendorIDJDShop {
|
||||
globals.SugarLogger.Warnf("syncStoreSkuNew 修改门店:%d商品:%d,但没有平台分类ID", storeID, sku.SkuID)
|
||||
// globals.SugarLogger.Warnf("syncStoreSkuNew 修改门店:%d商品:%d,但没有平台分类ID", storeID, sku.SkuID)
|
||||
} else {
|
||||
isAdded2Update = true
|
||||
updateList = append(updateList, calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
|
||||
@@ -915,7 +914,9 @@ func amendAndPruneStoreStuff(ctx *jxcontext.Context, parentTask tasksch.ITask, v
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if storeID == 103075 {
|
||||
fmt.Println("sku2Delete", utils.Format4Output(sku2Delete, false))
|
||||
}
|
||||
if opType == AmendPruneOnlyAmend || opType == AmendPruneAll {
|
||||
for _, v := range localSkuList {
|
||||
if !model.IsSyncStatusDelete(v.SkuSyncStatus) && v.BindID != 0 {
|
||||
|
||||
@@ -46,10 +46,10 @@ var (
|
||||
"22:00:00",
|
||||
}
|
||||
dailyWorkTimeList2 = []string{
|
||||
"23:00:00",
|
||||
"04:00:00",
|
||||
}
|
||||
priceReferTimeList = []string{
|
||||
"01:00:00",
|
||||
"03:00:00",
|
||||
}
|
||||
checkCookieList = []string{
|
||||
"08:00:00",
|
||||
@@ -57,7 +57,7 @@ var (
|
||||
"18:00:00",
|
||||
}
|
||||
createStorePriceTimeList = []string{
|
||||
"02:00:00",
|
||||
"04:00:00",
|
||||
}
|
||||
refreshPageActTimeList = []string{
|
||||
"7:00:00",
|
||||
@@ -393,7 +393,7 @@ func doDailyWork() {
|
||||
dao.SetStoresMapSyncStatus(dao.GetDB(), nil, nil, model.SyncFlagStoreStatus)
|
||||
cms.CurVendorSync.SyncStore2(jxcontext.AdminCtx, dao.GetDB(), nil, nil, true, true)
|
||||
|
||||
syncStoreSku()
|
||||
// syncStoreSku()
|
||||
InitEx()
|
||||
cms.SyncStoresCourierInfo(jxcontext.AdminCtx, nil, false, true)
|
||||
netprinter.RebindAllPrinters(jxcontext.AdminCtx, false, true)
|
||||
|
||||
@@ -8,8 +8,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdshopapi"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/delivery"
|
||||
"github.com/360EntSecGroup-Skylar/excelize"
|
||||
@@ -1611,295 +1609,6 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
||||
// continue
|
||||
// }
|
||||
// }
|
||||
var jdsIds = []int64{69355523686,
|
||||
69353698875,
|
||||
69353633443,
|
||||
69353579080,
|
||||
69353592976,
|
||||
69353575450,
|
||||
69353669915,
|
||||
69353617240,
|
||||
69353711276,
|
||||
69355552630,
|
||||
69353579078,
|
||||
69633169613,
|
||||
69353608855,
|
||||
69634881612,
|
||||
69353634806,
|
||||
69353675911,
|
||||
69353698186,
|
||||
69353698877,
|
||||
69607962771,
|
||||
69608002604,
|
||||
69666543870,
|
||||
69353541693,
|
||||
69411607058,
|
||||
69353594629,
|
||||
69353602818,
|
||||
69353698187,
|
||||
69355538267,
|
||||
69353633269,
|
||||
69355549016,
|
||||
69411607059,
|
||||
69593365617,
|
||||
69353589341,
|
||||
69353618034,
|
||||
69353633445,
|
||||
69353644658,
|
||||
69353644659,
|
||||
69353664332,
|
||||
69355505481,
|
||||
69355531215,
|
||||
69355552632,
|
||||
69353618035,
|
||||
69353619589,
|
||||
69353684423,
|
||||
69353687174,
|
||||
69353722053,
|
||||
69355493882,
|
||||
69627859883,
|
||||
69680935348,
|
||||
69353555847,
|
||||
69353570677,
|
||||
69353589397,
|
||||
69353592975,
|
||||
69353594611,
|
||||
69353602819,
|
||||
69353616402,
|
||||
69353624528,
|
||||
69353654004,
|
||||
69353668114,
|
||||
69353687173,
|
||||
69353701089,
|
||||
69353722052,
|
||||
69353723922,
|
||||
69355527850,
|
||||
69355552631,
|
||||
69628257042,
|
||||
69636525703,
|
||||
69680935349,
|
||||
69353579081,
|
||||
69353589342,
|
||||
69353632136,
|
||||
69353654006,
|
||||
69353726354,
|
||||
69355496067,
|
||||
69355515747,
|
||||
69355516049,
|
||||
69355527036,
|
||||
69355532703,
|
||||
69355558164,
|
||||
69355560640,
|
||||
69608002434,
|
||||
69608089252,
|
||||
69626869676,
|
||||
69628142211,
|
||||
69651275202,
|
||||
69665458721,
|
||||
69980157422,
|
||||
69353511255,
|
||||
69353550931,
|
||||
69353555846,
|
||||
69353579079,
|
||||
69353593375,
|
||||
69353595563,
|
||||
69353603501,
|
||||
69353608856,
|
||||
69353618036,
|
||||
69353628469,
|
||||
69353628470,
|
||||
69353632137,
|
||||
69353633267,
|
||||
69353633444,
|
||||
69353651935,
|
||||
69353668115,
|
||||
69353683331,
|
||||
69353684157,
|
||||
69353701088,
|
||||
69353723844,
|
||||
69353723845,
|
||||
69353726353,
|
||||
69355490631,
|
||||
69355493881,
|
||||
69355493884,
|
||||
69355520278,
|
||||
69355523687,
|
||||
69355532705,
|
||||
69355533814,
|
||||
69355536851,
|
||||
69355538268,
|
||||
69355538269,
|
||||
69593321185,
|
||||
69593321186,
|
||||
69607997022,
|
||||
69626638026,
|
||||
69626638027,
|
||||
69626872037,
|
||||
69627693305,
|
||||
69627954144,
|
||||
69628180933,
|
||||
69633580083,
|
||||
69633580085,
|
||||
69634881613,
|
||||
69635037810,
|
||||
69635204944,
|
||||
69636212985,
|
||||
69636446354,
|
||||
69659137913,
|
||||
69659219611,
|
||||
69665406179,
|
||||
69666460731,
|
||||
69673523007,
|
||||
69680905913,
|
||||
69681869918,
|
||||
69821176674,
|
||||
69913341309,
|
||||
69916445013,
|
||||
69353511254,
|
||||
69353570678,
|
||||
69353581400,
|
||||
69353589343,
|
||||
69353589398,
|
||||
69353593376,
|
||||
69353594630,
|
||||
69353609816,
|
||||
69353616406,
|
||||
69353617241,
|
||||
69353619591,
|
||||
69353633268,
|
||||
69353634833,
|
||||
69353642793,
|
||||
69353647695,
|
||||
69353651934,
|
||||
69353654005,
|
||||
69353664333,
|
||||
69353669914,
|
||||
69353673334,
|
||||
69353684159,
|
||||
69353684603,
|
||||
69353684604,
|
||||
69353684605,
|
||||
69353684607,
|
||||
69353698876,
|
||||
69353701090,
|
||||
69353711277,
|
||||
69353711278,
|
||||
69353726357,
|
||||
69355496066,
|
||||
69355520277,
|
||||
69355523688,
|
||||
69355527851,
|
||||
69355533813,
|
||||
69355533815,
|
||||
69355538270,
|
||||
69355559874,
|
||||
69355559875,
|
||||
69355559876,
|
||||
69355560641,
|
||||
69607988687,
|
||||
69608089253,
|
||||
69625036409,
|
||||
69625436705,
|
||||
69626674146,
|
||||
69626756838,
|
||||
69626849783,
|
||||
69626872040,
|
||||
69627211928,
|
||||
69627823696,
|
||||
69627823697,
|
||||
69627824429,
|
||||
69627859882,
|
||||
69627954146,
|
||||
69628055157,
|
||||
69628209840,
|
||||
69628220046,
|
||||
69628244518,
|
||||
69628620179,
|
||||
69628645373,
|
||||
69633038980,
|
||||
69633169614,
|
||||
69633311068,
|
||||
69633433209,
|
||||
69634285577,
|
||||
69634285578,
|
||||
69634566319,
|
||||
69634566320,
|
||||
69634620948,
|
||||
69635037811,
|
||||
69635075404,
|
||||
69635108188,
|
||||
69636525704,
|
||||
69636563250,
|
||||
69636658901,
|
||||
69636658902,
|
||||
69651265114,
|
||||
69659219612,
|
||||
69659883978,
|
||||
69662122661,
|
||||
69666543871,
|
||||
69666543872,
|
||||
69666660395,
|
||||
69666907986,
|
||||
69666931214,
|
||||
69673508504,
|
||||
69680887348,
|
||||
69818078270,
|
||||
69881553035,
|
||||
69901783885,
|
||||
69913362221,
|
||||
69916396643,
|
||||
69925717199,
|
||||
69933144351,
|
||||
69933974117,
|
||||
69935756246,
|
||||
69935768981,
|
||||
69935855227,
|
||||
69935915640,
|
||||
69937601360,
|
||||
69937642148,
|
||||
69939562884,
|
||||
69939571687,
|
||||
69948026907,
|
||||
}
|
||||
db := dao.GetDB()
|
||||
for _, v := range jdsIds {
|
||||
vendorSku, _ := api.JdShopAPI.FindSkuById(v)
|
||||
var sku *model.Sku
|
||||
sql := `
|
||||
SELECT b.* FROM store_sku_bind a,sku b WHERE a.sku_id = b.id AND a.store_id = 102919 AND a.jds_id = ?
|
||||
`
|
||||
sqlParams := []interface{}{v}
|
||||
err = dao.GetRow(db, &sku, sql, sqlParams)
|
||||
skus, _ := dao.GetStoreSkus(db, model.VendorIDJDShop, model.JdShopMainStoreID, []int{sku.ID})
|
||||
storeSku := skus[0]
|
||||
if sku.Comment != "" {
|
||||
var specQuality = utils.Float64ToStr(float64(storeSku.SpecQuality)) + storeSku.SpecUnit
|
||||
vendorSkuAttr := vendorSku.SaleAttrs[0].AttrValueAlias[0]
|
||||
if vendorSkuAttr == specQuality {
|
||||
err = api.JdShopAPI.UpdateWareSaleAttrvalueAlias(&jdshopapi.UpdateWareSaleAttrvalueAliasParam{
|
||||
WareID: vendorSku.WareID,
|
||||
Props: []*jdshopapi.CreateSkuParamAttrs2{
|
||||
&jdshopapi.CreateSkuParamAttrs2{
|
||||
AttrID: vendorSku.SaleAttrs[0].AttrID,
|
||||
AttrValues: []string{vendorSku.SaleAttrs[0].AttrValues[0]},
|
||||
AttrValueAlias: []string{sku.Comment},
|
||||
Type: "com.jd.pop.ware.ic.api.domain.prop",
|
||||
Type2: "com.jd.pop.ware.ic.api.domain.Prop",
|
||||
},
|
||||
},
|
||||
})
|
||||
} else {
|
||||
if vendorSkuAttr != sku.Comment {
|
||||
_, maxNo, _ := api.JdShopAPI.FindValuesByAttrId(utils.Str2Int(vendorSku.SaleAttrs[0].AttrID))
|
||||
api.JdShopAPI.SaveVenderAttrValue(sku.Comment, utils.Str2Int(vendorSku.SaleAttrs[0].AttrID), int(storeSku.VendorVendorCatID), maxNo+1)
|
||||
}
|
||||
}
|
||||
}
|
||||
// attrValue := vendorSku.SaleAttrs[0].AttrValueAlias[0]
|
||||
// if storeSkus != nil {
|
||||
// cms.CurVendorSync.SyncStoresSkus(ctx, nil, 0, db, []int{model.VendorIDJDShop}, []int{model.JdShopMainStoreID}, []int{storeSkus.SkuID}, false, true, true)
|
||||
// }
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user