From 1a0a535d7bbff7aaed13f6ffac907e798e08eda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 09:12:31 +0800 Subject: [PATCH 01/27] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=8E=89=E9=A5=BF=E9=B2=9C=E8=BE=BE=E4=B8=8D=E8=A6=81=E7=9A=84?= =?UTF-8?q?=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 24 ++++++++++++++++++ business/partner/purchase/ebai/store_sku2.go | 26 ++++++++++++++------ controllers/cms_sku.go | 13 ++++++++++ routers/commentsRouter_controllers.go | 9 +++++++ 4 files changed, 65 insertions(+), 7 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 139dbd7d8..040557d08 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -1511,3 +1511,27 @@ func SumExianDaDepot(ctx *jxcontext.Context) (err error) { } return err } + +func CopyEbaiSkuPriceToJx(ctx *jxcontext.Context) (err error) { + db := dao.GetDB() + skuList, err := api.EbaiAPI.PageGetSkuList(32267350915) + for _, v := range skuList { + price := int(utils.Float64TwoInt64(v["sale_price"].(float64) * 100)) + var skuNameList []*model.SkuName + sql := ` + SELECT * + FROM sku_name + WHERE upc = ? + AND exd_sku_id <> '' + ` + sqlParams := []interface{}{ + v["upc"].(string), + } + err = dao.GetRows(db, &skuNameList, sql, sqlParams...) + for _, vv := range skuNameList { + vv.Price = price + dao.UpdateEntity(db, vv, "Price") + } + } + return err +} diff --git a/business/partner/purchase/ebai/store_sku2.go b/business/partner/purchase/ebai/store_sku2.go index aac799413..2e5c1b2e5 100644 --- a/business/partner/purchase/ebai/store_sku2.go +++ b/business/partner/purchase/ebai/store_sku2.go @@ -24,6 +24,9 @@ const ( var ( sensitiveWordRegexp = regexp.MustCompile(`商品名称中含有敏感词(\[.*\])`) + categoryCheck = map[string]string{ + "赠品专区": "赠品专区", + } ) func (p *PurchaseHandler) GetStoreSkusBatchSize(funcID int) (batchSize int) { @@ -71,23 +74,29 @@ func (p *PurchaseHandler) IsErrCategoryNotExist(err error) (isNotExist bool) { return ebaiapi.IsErrCategoryNotExist(err) } -func getCheckExdStoreNameAndSeq(storeID int, storeCat *dao.SkuStoreCatInfo) (name string, seq int) { +func getCheckExdStoreNameAndSeq(storeID int, storeCat *dao.SkuStoreCatInfo) (name string, seq int, isCheck bool) { store, err := dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDEBAI) if err != nil || store == nil { - return storeCat.Name, storeCat.Seq + return storeCat.Name, storeCat.Seq, false } if strings.Contains(store.Name, model.ExdStoreName) { - return storeCat.ExdName, storeCat.ExdSeq + if categoryCheck[storeCat.ExdName] != "" { + return storeCat.ExdName, storeCat.ExdSeq, true + } + return storeCat.ExdName, storeCat.ExdSeq, false } else { - return storeCat.Name, storeCat.Seq + return storeCat.Name, storeCat.Seq, false } - return name, seq + return name, seq, false } func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) { var vendorCatID int64 if globals.EnableEbaiStoreWrite { - catName, catSeq := getCheckExdStoreNameAndSeq(storeID, storeCat) + catName, catSeq, isCheck := getCheckExdStoreNameAndSeq(storeID, storeCat) + if isCheck { + return nil + } vendorCatID, err = api.EbaiAPI.ShopCategoryCreate(utils.Int2Str(storeID), utils.Str2Int64WithDefault(storeCat.ParentVendorCatID, 0), formatCatName(catName), jxCatSeq2Ebai(catSeq)) } else { vendorCatID = jxutils.GenFakeID() @@ -98,7 +107,10 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID in func (p *PurchaseHandler) UpdateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) { if globals.EnableEbaiStoreWrite { - catName, catSeq := getCheckExdStoreNameAndSeq(storeID, storeCat) + catName, catSeq, isCheck := getCheckExdStoreNameAndSeq(storeID, storeCat) + if isCheck { + return nil + } err = api.EbaiAPI.ShopCategoryUpdate(utils.Int2Str(storeID), utils.Str2Int64WithDefault(storeCat.VendorCatID, 0), formatCatName(catName), jxCatSeq2Ebai(catSeq)) // todo, 饿百将一个分类重复改名,也会报分类名重复错,特殊处理一下,不过因为GetStoreCategory其实会拉取所有的门店分类,是比较耗时的操作 if utils.IsErrMatch(err, "1", []string{"分类名称已经存在"}) { diff --git a/controllers/cms_sku.go b/controllers/cms_sku.go index 59d441406..339ea9933 100644 --- a/controllers/cms_sku.go +++ b/controllers/cms_sku.go @@ -431,3 +431,16 @@ func (c *SkuController) SumExianDaDepot() { return retVal, "", err }) } + +// @Title 复制一个饿百的店的商品的价格到京西饿鲜达商品 +// @Description 复制一个饿百的店的商品的价格到京西饿鲜达商品 +// @Param token header string true "认证token" +// @Success 200 {object} controllers.CallResult +// @Failure 200 {object} controllers.CallResult +// @router /CopyEbaiSkuPriceToJx [put] +func (c *SkuController) CopyEbaiSkuPriceToJx() { + c.callCopyEbaiSkuPriceToJx(func(params *tSkuCopyEbaiSkuPriceToJxParams) (retVal interface{}, errCode string, err error) { + err = cms.CopyEbaiSkuPriceToJx(params.Ctx) + return retVal, "", err + }) +} diff --git a/routers/commentsRouter_controllers.go b/routers/commentsRouter_controllers.go index b2a20cdfc..d1add6505 100644 --- a/routers/commentsRouter_controllers.go +++ b/routers/commentsRouter_controllers.go @@ -1251,6 +1251,15 @@ func init() { Filters: nil, Params: nil}) + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:SkuController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:SkuController"], + beego.ControllerComments{ + Method: "CopyEbaiSkuPriceToJx", + Router: `/CopyEbaiSkuPriceToJx`, + AllowHTTPMethods: []string{"put"}, + MethodParams: param.Make(), + Filters: nil, + Params: nil}) + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:SkuController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:SkuController"], beego.ControllerComments{ Method: "DeleteCategory", From 49ede2c9d89046a1280d05a8949ac336322167c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 09:17:33 +0800 Subject: [PATCH 02/27] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=8E=89=E9=A5=BF=E9=B2=9C=E8=BE=BE=E4=B8=8D=E8=A6=81=E7=9A=84?= =?UTF-8?q?=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/ebai/store_sku2.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/business/partner/purchase/ebai/store_sku2.go b/business/partner/purchase/ebai/store_sku2.go index 2e5c1b2e5..dadf35cea 100644 --- a/business/partner/purchase/ebai/store_sku2.go +++ b/business/partner/purchase/ebai/store_sku2.go @@ -93,10 +93,10 @@ func getCheckExdStoreNameAndSeq(storeID int, storeCat *dao.SkuStoreCatInfo) (nam func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) { var vendorCatID int64 if globals.EnableEbaiStoreWrite { - catName, catSeq, isCheck := getCheckExdStoreNameAndSeq(storeID, storeCat) - if isCheck { - return nil - } + catName, catSeq, _ := getCheckExdStoreNameAndSeq(storeID, storeCat) + // if isCheck { + // return nil + // } vendorCatID, err = api.EbaiAPI.ShopCategoryCreate(utils.Int2Str(storeID), utils.Str2Int64WithDefault(storeCat.ParentVendorCatID, 0), formatCatName(catName), jxCatSeq2Ebai(catSeq)) } else { vendorCatID = jxutils.GenFakeID() @@ -107,10 +107,10 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID in func (p *PurchaseHandler) UpdateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) { if globals.EnableEbaiStoreWrite { - catName, catSeq, isCheck := getCheckExdStoreNameAndSeq(storeID, storeCat) - if isCheck { - return nil - } + catName, catSeq, _ := getCheckExdStoreNameAndSeq(storeID, storeCat) + // if isCheck { + // return nil + // } err = api.EbaiAPI.ShopCategoryUpdate(utils.Int2Str(storeID), utils.Str2Int64WithDefault(storeCat.VendorCatID, 0), formatCatName(catName), jxCatSeq2Ebai(catSeq)) // todo, 饿百将一个分类重复改名,也会报分类名重复错,特殊处理一下,不过因为GetStoreCategory其实会拉取所有的门店分类,是比较耗时的操作 if utils.IsErrMatch(err, "1", []string{"分类名称已经存在"}) { From 0dfc27c84e2e5cec81286c8de52303267f5a45c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 14:54:04 +0800 Subject: [PATCH 03/27] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BA=AC=E4=B8=9C?= =?UTF-8?q?=E9=97=A8=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 88 +++++++++++++++++++++++++++ controllers/cms_store.go | 13 ++++ routers/commentsRouter_controllers.go | 9 +++ 3 files changed, 110 insertions(+) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index f5326f72b..219983f22 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -2745,3 +2745,91 @@ func RefreshJdLevel(ctx *jxcontext.Context) (err error) { } return err } + +type tJdStoreInfo struct { + model.Store + VendorOrgCode string `orm:"size(32)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空 + + FreightDeductionPack string `orm:"size(32)" json:"freightDeductionPack"` // + + JdCityCode int + JdDistrictCode int + JdStoreStatus int + VendorStoreID string `orm:"column(vendor_store_id)"` + RealLastOperator string + SyncStatus int + VendorStoreName string +} + +func UpdateJdStoreNameAll(ctx *jxcontext.Context) (err error) { + db := dao.GetDB() + userName := ctx.GetUserName() + var stores []*tJdStoreInfo + sql := ` + SELECT + t1.*, city.jd_code jd_city_code, district.jd_code jd_district_code, + t2.status jd_store_status, t2.vendor_store_id, IF(t1.updated_at > t2.updated_at, t1.last_operator, + t2.last_operator) real_last_operator, + t2.sync_status, t2.freight_deduction_pack, t2.vendor_org_code, t2.vendor_store_name + FROM store t1 + JOIN store_map t2 ON t1.id = t2.store_id AND t2.vendor_id = ? + LEFT JOIN place city ON t1.city_code = city.code + LEFT JOIN place district ON t1.district_code = district.code + WHERE t1.id = ? + ORDER BY t2.updated_at + ` + if err = dao.GetRows(db, &stores, sql, model.VendorIDJD, 102108); err == nil { + for _, store := range stores { + a := jd.GetAPI(store.VendorOrgCode) + storeParams := &jdapi.OpStoreParams{ + StationNo: store.VendorStoreID, + Operator: userName, + Phone: store.Tel1, + Mobile: store.Tel2, + } + if store.SyncStatus&model.SyncFlagDeletedMask == 0 { + storeParams.OutSystemID = utils.Int2Str(int(store.ID)) + } else { + storeParams.OutSystemID = store.VendorStoreID + } + if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreName) != 0 { + if store.VendorStoreName != "" { + storeParams.StationName = store.VendorStoreName + } else { + storeParams.StationName = jxutils.ComposeStoreName(store.Name, model.VendorIDJD) + } + storeParams.StationName = utils.LimitUTF8StringLen(storeParams.StationName, jdapi.MaxStoreNameLen) + } + if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreAddress) != 0 { + storeParams.StationAddress = store.Address + storeParams.CoordinateType = jdapi.CoordinateTypeAutonavi // 一直用高德 + storeParams.Lng = jxutils.IntCoordinate2Standard(store.Lng) + storeParams.Lat = jxutils.IntCoordinate2Standard(store.Lat) + if store.JdCityCode != 0 { + storeParams.City = store.JdCityCode + } + if store.JdDistrictCode != 0 { + storeParams.County = store.JdDistrictCode + } + } + // if specialDistrictMap[storeParams.County] != 0 { + // storeParams.City = storeParams.County + // storeParams.County = specialDistrictMap[storeParams.County] + // } + storeParams.StoreNotice = store.PromoteInfo + modifyCloseStatus := false + if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagDeletedMask|model.SyncFlagStoreStatus) != 0 { + modifyCloseStatus = true + _, storeParams.CloseStatus = jd.JxStoreStatus2JdStatus(jxutils.MergeStoreStatus(store.Status, store.JdStoreStatus)) + } + // fillOpTimeParams(storeParams, store.GetOpTimeList()) + // globals.SugarLogger.Debug(utils.Format4Output(storeParams, false)) + errList := errlist.New() + if globals.EnableJdStoreWrite { + errList.AddErr(a.UpdateStoreInfo4Open2(storeParams, modifyCloseStatus)) + } + err = errList.GetErrListAsOne() + } + } + return err +} diff --git a/controllers/cms_store.go b/controllers/cms_store.go index 180344e6b..e30712941 100644 --- a/controllers/cms_store.go +++ b/controllers/cms_store.go @@ -634,3 +634,16 @@ func (c *StoreController) RefreshJdLevel() { return retVal, "", err }) } + +// @Title 同步指定京东门店 +// @Description 同步京东门店 +// @Param token header string true "认证token" +// @Success 200 {object} controllers.CallResult +// @Failure 200 {object} controllers.CallResult +// @router /SyncJdStore [post] +func (c *StoreController) SyncJdStore() { + c.callSyncJdStore(func(params *tStoreSyncJdStoreParams) (retVal interface{}, errCode string, err error) { + err = cms.UpdateJdStoreNameAll(params.Ctx) + return retVal, "", err + }) +} diff --git a/routers/commentsRouter_controllers.go b/routers/commentsRouter_controllers.go index d1add6505..b040b6c6e 100644 --- a/routers/commentsRouter_controllers.go +++ b/routers/commentsRouter_controllers.go @@ -1647,6 +1647,15 @@ func init() { Filters: nil, Params: nil}) + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"], + beego.ControllerComments{ + Method: "SyncJdStore", + Router: `/SyncJdStore`, + AllowHTTPMethods: []string{"post"}, + MethodParams: param.Make(), + Filters: nil, + Params: nil}) + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"], beego.ControllerComments{ Method: "SyncStoresCourierInfo", From e10becd5eb1f544b1f8f036be50453742ee8c9a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 15:01:26 +0800 Subject: [PATCH 04/27] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BA=AC=E4=B8=9C?= =?UTF-8?q?=E9=97=A8=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 127 ++++++++++++++++++---------------- 1 file changed, 67 insertions(+), 60 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 219983f22..19d2e0d64 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -2762,73 +2762,80 @@ type tJdStoreInfo struct { } func UpdateJdStoreNameAll(ctx *jxcontext.Context) (err error) { + storeMap := map[int]int{ + 100653: 100653, + 100037: 100037, + 100968: 100968, + } db := dao.GetDB() userName := ctx.GetUserName() - var stores []*tJdStoreInfo - sql := ` - SELECT - t1.*, city.jd_code jd_city_code, district.jd_code jd_district_code, - t2.status jd_store_status, t2.vendor_store_id, IF(t1.updated_at > t2.updated_at, t1.last_operator, - t2.last_operator) real_last_operator, - t2.sync_status, t2.freight_deduction_pack, t2.vendor_org_code, t2.vendor_store_name - FROM store t1 - JOIN store_map t2 ON t1.id = t2.store_id AND t2.vendor_id = ? - LEFT JOIN place city ON t1.city_code = city.code - LEFT JOIN place district ON t1.district_code = district.code - WHERE t1.id = ? - ORDER BY t2.updated_at - ` - if err = dao.GetRows(db, &stores, sql, model.VendorIDJD, 102108); err == nil { - for _, store := range stores { - a := jd.GetAPI(store.VendorOrgCode) - storeParams := &jdapi.OpStoreParams{ - StationNo: store.VendorStoreID, - Operator: userName, - Phone: store.Tel1, - Mobile: store.Tel2, - } - if store.SyncStatus&model.SyncFlagDeletedMask == 0 { - storeParams.OutSystemID = utils.Int2Str(int(store.ID)) - } else { - storeParams.OutSystemID = store.VendorStoreID - } - if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreName) != 0 { - if store.VendorStoreName != "" { - storeParams.StationName = store.VendorStoreName + for _, v := range storeMap { + var stores []*tJdStoreInfo + sql := ` + SELECT + t1.*, city.jd_code jd_city_code, district.jd_code jd_district_code, + t2.status jd_store_status, t2.vendor_store_id, IF(t1.updated_at > t2.updated_at, t1.last_operator, + t2.last_operator) real_last_operator, + t2.sync_status, t2.freight_deduction_pack, t2.vendor_org_code, t2.vendor_store_name + FROM store t1 + JOIN store_map t2 ON t1.id = t2.store_id AND t2.vendor_id = ? + LEFT JOIN place city ON t1.city_code = city.code + LEFT JOIN place district ON t1.district_code = district.code + WHERE t1.id = ? + ORDER BY t2.updated_at + ` + if err = dao.GetRows(db, &stores, sql, model.VendorIDJD, v); err == nil { + for _, store := range stores { + a := jd.GetAPI(store.VendorOrgCode) + storeParams := &jdapi.OpStoreParams{ + StationNo: store.VendorStoreID, + Operator: userName, + Phone: store.Tel1, + Mobile: store.Tel2, + } + if store.SyncStatus&model.SyncFlagDeletedMask == 0 { + storeParams.OutSystemID = utils.Int2Str(int(store.ID)) } else { - storeParams.StationName = jxutils.ComposeStoreName(store.Name, model.VendorIDJD) + storeParams.OutSystemID = store.VendorStoreID } - storeParams.StationName = utils.LimitUTF8StringLen(storeParams.StationName, jdapi.MaxStoreNameLen) - } - if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreAddress) != 0 { - storeParams.StationAddress = store.Address - storeParams.CoordinateType = jdapi.CoordinateTypeAutonavi // 一直用高德 - storeParams.Lng = jxutils.IntCoordinate2Standard(store.Lng) - storeParams.Lat = jxutils.IntCoordinate2Standard(store.Lat) - if store.JdCityCode != 0 { - storeParams.City = store.JdCityCode + if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreName) != 0 { + if store.VendorStoreName != "" { + storeParams.StationName = store.VendorStoreName + } else { + storeParams.StationName = jxutils.ComposeStoreName(store.Name, model.VendorIDJD) + } + storeParams.StationName = utils.LimitUTF8StringLen(storeParams.StationName, jdapi.MaxStoreNameLen) } - if store.JdDistrictCode != 0 { - storeParams.County = store.JdDistrictCode + if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreAddress) != 0 { + storeParams.StationAddress = store.Address + storeParams.CoordinateType = jdapi.CoordinateTypeAutonavi // 一直用高德 + storeParams.Lng = jxutils.IntCoordinate2Standard(store.Lng) + storeParams.Lat = jxutils.IntCoordinate2Standard(store.Lat) + if store.JdCityCode != 0 { + storeParams.City = store.JdCityCode + } + if store.JdDistrictCode != 0 { + storeParams.County = store.JdDistrictCode + } } + // if specialDistrictMap[storeParams.County] != 0 { + // storeParams.City = storeParams.County + // storeParams.County = specialDistrictMap[storeParams.County] + // } + storeParams.StoreNotice = store.PromoteInfo + modifyCloseStatus := false + if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagDeletedMask|model.SyncFlagStoreStatus) != 0 { + modifyCloseStatus = true + _, storeParams.CloseStatus = jd.JxStoreStatus2JdStatus(jxutils.MergeStoreStatus(store.Status, store.JdStoreStatus)) + } + // fillOpTimeParams(storeParams, store.GetOpTimeList()) + // globals.SugarLogger.Debug(utils.Format4Output(storeParams, false)) + errList := errlist.New() + if globals.EnableJdStoreWrite { + errList.AddErr(a.UpdateStoreInfo4Open2(storeParams, modifyCloseStatus)) + } + err = errList.GetErrListAsOne() } - // if specialDistrictMap[storeParams.County] != 0 { - // storeParams.City = storeParams.County - // storeParams.County = specialDistrictMap[storeParams.County] - // } - storeParams.StoreNotice = store.PromoteInfo - modifyCloseStatus := false - if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagDeletedMask|model.SyncFlagStoreStatus) != 0 { - modifyCloseStatus = true - _, storeParams.CloseStatus = jd.JxStoreStatus2JdStatus(jxutils.MergeStoreStatus(store.Status, store.JdStoreStatus)) - } - // fillOpTimeParams(storeParams, store.GetOpTimeList()) - // globals.SugarLogger.Debug(utils.Format4Output(storeParams, false)) - errList := errlist.New() - if globals.EnableJdStoreWrite { - errList.AddErr(a.UpdateStoreInfo4Open2(storeParams, modifyCloseStatus)) - } - err = errList.GetErrListAsOne() } } return err From db5dc69e4091c29c504ac49d6b5feb52b18ec54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 15:10:18 +0800 Subject: [PATCH 05/27] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BA=AC=E4=B8=9C?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E6=9C=80=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 840 +++++++++++++++++++++++++++++++++- 1 file changed, 836 insertions(+), 4 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 19d2e0d64..bb937ecec 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -2763,14 +2763,846 @@ type tJdStoreInfo struct { func UpdateJdStoreNameAll(ctx *jxcontext.Context) (err error) { storeMap := map[int]int{ - 100653: 100653, - 100037: 100037, - 100968: 100968, + 11732425: 11732425, + 11732427: 11732427, + 11732447: 11732447, + 11732449: 11732449, + 11732462: 11732462, + 11732465: 11732465, + 11732466: 11732466, + 11732783: 11732783, + 11733018: 11733018, + 11733036: 11733036, + 11733040: 11733040, + 11733050: 11733050, + 11733057: 11733057, + 11733058: 11733058, + 11733062: 11733062, + 11733068: 11733068, + 11733070: 11733070, + 11733074: 11733074, + 11733882: 11733882, + 11733886: 11733886, + 11733887: 11733887, + 11733889: 11733889, + 11733892: 11733892, + 11733905: 11733905, + 11733912: 11733912, + 11733917: 11733917, + 11734846: 11734846, + 11734848: 11734848, + 11734849: 11734849, + 11734850: 11734850, + 11734851: 11734851, + 11734852: 11734852, + 11734853: 11734853, + 11734854: 11734854, + 11734856: 11734856, + 11734857: 11734857, + 11734859: 11734859, + 11734861: 11734861, + 11734862: 11734862, + 11734863: 11734863, + 11734864: 11734864, + 11734865: 11734865, + 11734866: 11734866, + 11734867: 11734867, + 11734868: 11734868, + 11734872: 11734872, + 11734873: 11734873, + 11734874: 11734874, + 11734876: 11734876, + 11734877: 11734877, + 11734878: 11734878, + 11734879: 11734879, + 11734883: 11734883, + 11734884: 11734884, + 11734885: 11734885, + 11734886: 11734886, + 11734887: 11734887, + 11734888: 11734888, + 11734889: 11734889, + 11736964: 11736964, + 11736982: 11736982, + 11736984: 11736984, + 11736990: 11736990, + 11736993: 11736993, + 11738048: 11738048, + 11738051: 11738051, + 11738056: 11738056, + 11738059: 11738059, + 11738060: 11738060, + 11738063: 11738063, + 11738065: 11738065, + 11738066: 11738066, + 11738113: 11738113, + 11738114: 11738114, + 11738115: 11738115, + 11738116: 11738116, + 11738119: 11738119, + 11738120: 11738120, + 11738123: 11738123, + 11738127: 11738127, + 11738128: 11738128, + 11738149: 11738149, + 11738150: 11738150, + 11738153: 11738153, + 11738154: 11738154, + 11738155: 11738155, + 11738157: 11738157, + 11738159: 11738159, + 11738160: 11738160, + 11738162: 11738162, + 11738163: 11738163, + 11738165: 11738165, + 11738166: 11738166, + 11738167: 11738167, + 11738168: 11738168, + 11738170: 11738170, + 11738171: 11738171, + 11738172: 11738172, + 11738290: 11738290, + 11738304: 11738304, + 11738305: 11738305, + 11738306: 11738306, + 11738307: 11738307, + 11738309: 11738309, + 11738312: 11738312, + 11738313: 11738313, + 11738314: 11738314, + 11738315: 11738315, + 11738317: 11738317, + 11738318: 11738318, + 11738319: 11738319, + 11738321: 11738321, + 11738322: 11738322, + 11738323: 11738323, + 11738324: 11738324, + 11738325: 11738325, + 11738326: 11738326, + 11738327: 11738327, + 11738329: 11738329, + 11738331: 11738331, + 11738335: 11738335, + 11738338: 11738338, + 11738347: 11738347, + 11738348: 11738348, + 11738351: 11738351, + 11738354: 11738354, + 11738356: 11738356, + 11738362: 11738362, + 11738363: 11738363, + 11738364: 11738364, + 11738389: 11738389, + 11738391: 11738391, + 11738392: 11738392, + 11738393: 11738393, + 11738396: 11738396, + 11738397: 11738397, + 11738398: 11738398, + 11738399: 11738399, + 11738404: 11738404, + 11738408: 11738408, + 11738410: 11738410, + 11738440: 11738440, + 11738444: 11738444, + 11738446: 11738446, + 11738473: 11738473, + 11741810: 11741810, + 11743375: 11743375, + 11743493: 11743493, + 11744471: 11744471, + 11745016: 11745016, + 11746669: 11746669, + 11746671: 11746671, + 11746686: 11746686, + 11747161: 11747161, + 11747203: 11747203, + 11747205: 11747205, + 11747735: 11747735, + 11747750: 11747750, + 11747759: 11747759, + 11747762: 11747762, + 11748353: 11748353, + 11749018: 11749018, + 11749156: 11749156, + 11749347: 11749347, + 11749704: 11749704, + 11749729: 11749729, + 11749731: 11749731, + 11749732: 11749732, + 11749733: 11749733, + 11750155: 11750155, + 11750184: 11750184, + 11750488: 11750488, + 11750565: 11750565, + 11750752: 11750752, + 11752596: 11752596, + 11752755: 11752755, + 11752759: 11752759, + 11752765: 11752765, + 11752774: 11752774, + 11752777: 11752777, + 11752780: 11752780, + 11752782: 11752782, + 11752783: 11752783, + 11753633: 11753633, + 11754775: 11754775, + 11755605: 11755605, + 11755916: 11755916, + 11757549: 11757549, + 11762508: 11762508, + 11765538: 11765538, + 11765540: 11765540, + 11765541: 11765541, + 11765546: 11765546, + 11765547: 11765547, + 11765549: 11765549, + 11765550: 11765550, + 11769090: 11769090, + 11774174: 11774174, + 11774187: 11774187, + 11774193: 11774193, + 11774966: 11774966, + 11777744: 11777744, + 11777747: 11777747, + 11777755: 11777755, + 11777762: 11777762, + 11777765: 11777765, + 11777782: 11777782, + 11780947: 11780947, + 11780954: 11780954, + 11780956: 11780956, + 11780957: 11780957, + 11781300: 11781300, + 11781621: 11781621, + 11784258: 11784258, + 11784274: 11784274, + 11784399: 11784399, + 11785736: 11785736, + 11785742: 11785742, + 11786742: 11786742, + 11786819: 11786819, + 11786823: 11786823, + 11789517: 11789517, + 11789518: 11789518, + 11789520: 11789520, + 11789524: 11789524, + 11789525: 11789525, + 11789526: 11789526, + 11789528: 11789528, + 11789529: 11789529, + 11790117: 11790117, + 11791157: 11791157, + 11791749: 11791749, + 11792563: 11792563, + 11792566: 11792566, + 11792567: 11792567, + 11792568: 11792568, + 11797786: 11797786, + 11799502: 11799502, + 11800399: 11800399, + 11800400: 11800400, + 11800403: 11800403, + 11800405: 11800405, + 11800407: 11800407, + 11801478: 11801478, + 11801522: 11801522, + 11801616: 11801616, + 11802191: 11802191, + 11803802: 11803802, + 11805596: 11805596, + 11806265: 11806265, + 11806266: 11806266, + 11806270: 11806270, + 11806273: 11806273, + 11806278: 11806278, + 11806280: 11806280, + 11806283: 11806283, + 11808053: 11808053, + 11811576: 11811576, + 11811578: 11811578, + 11812596: 11812596, + 11813030: 11813030, + 11813260: 11813260, + 11816843: 11816843, + 11816848: 11816848, + 11817931: 11817931, + 11823780: 11823780, + 11824252: 11824252, + 11826577: 11826577, + 11826614: 11826614, + 11826615: 11826615, + 11827588: 11827588, + 11827615: 11827615, + 11827847: 11827847, + 11827848: 11827848, + 11827924: 11827924, + 11827925: 11827925, + 11828109: 11828109, + 11828136: 11828136, + 11828144: 11828144, + 11828147: 11828147, + 11837990: 11837990, + 11838380: 11838380, + 11838398: 11838398, + 11839083: 11839083, + 11839112: 11839112, + 11839947: 11839947, + 11841528: 11841528, + 11841659: 11841659, + 11845323: 11845323, + 11846487: 11846487, + 11850503: 11850503, + 11851018: 11851018, + 11851024: 11851024, + 11851063: 11851063, + 11851092: 11851092, + 11851305: 11851305, + 11852191: 11852191, + 11852636: 11852636, + 11853094: 11853094, + 11853163: 11853163, + 11853833: 11853833, + 11854244: 11854244, + 11854804: 11854804, + 11854868: 11854868, + 11855405: 11855405, + 11855898: 11855898, + 11855966: 11855966, + 11856299: 11856299, + 11856665: 11856665, + 11856835: 11856835, + 11856922: 11856922, + 11857025: 11857025, + 11857086: 11857086, + 11857499: 11857499, + 11857692: 11857692, + 11857743: 11857743, + 11857889: 11857889, + 11858126: 11858126, + 11858268: 11858268, + 11858769: 11858769, + 11858885: 11858885, + 11858947: 11858947, + 11859124: 11859124, + 11859144: 11859144, + 11859328: 11859328, + 11859926: 11859926, + 11860408: 11860408, + 11860688: 11860688, + 11860695: 11860695, + 11861208: 11861208, + 11862153: 11862153, + 11862364: 11862364, + 11862404: 11862404, + 11862417: 11862417, + 11862434: 11862434, + 11863524: 11863524, + 11863739: 11863739, + 11864813: 11864813, + 11865523: 11865523, + 11865677: 11865677, + 11865896: 11865896, + 11865909: 11865909, + 11866855: 11866855, + 11866873: 11866873, + 11866875: 11866875, + 11867012: 11867012, + 11867653: 11867653, + 11868002: 11868002, + 11868022: 11868022, + 11868742: 11868742, + 11868912: 11868912, + 11869150: 11869150, + 11869709: 11869709, + 11869886: 11869886, + 11869887: 11869887, + 11870147: 11870147, + 11870507: 11870507, + 11871237: 11871237, + 11871704: 11871704, + 11871708: 11871708, + 11871709: 11871709, + 11871713: 11871713, + 11872683: 11872683, + 11872786: 11872786, + 11873372: 11873372, + 11873380: 11873380, + 11873386: 11873386, + 11873418: 11873418, + 11873440: 11873440, + 11873447: 11873447, + 11873468: 11873468, + 11873938: 11873938, + 11874159: 11874159, + 11874162: 11874162, + 11874164: 11874164, + 11874404: 11874404, + 11874614: 11874614, + 11874685: 11874685, + 11875038: 11875038, + 11875494: 11875494, + 11875563: 11875563, + 11875906: 11875906, + 11875982: 11875982, + 11876320: 11876320, + 11876323: 11876323, + 11876359: 11876359, + 11876470: 11876470, + 11876543: 11876543, + 11877348: 11877348, + 11877586: 11877586, + 11877676: 11877676, + 11877839: 11877839, + 11878592: 11878592, + 11879602: 11879602, + 11880095: 11880095, + 11880118: 11880118, + 11880690: 11880690, + 11881165: 11881165, + 11881183: 11881183, + 11881187: 11881187, + 11881200: 11881200, + 11881484: 11881484, + 11881499: 11881499, + 11881506: 11881506, + 11881532: 11881532, + 11881764: 11881764, + 11881998: 11881998, + 11882539: 11882539, + 11883071: 11883071, + 11883852: 11883852, + 11883907: 11883907, + 11884261: 11884261, + 11884358: 11884358, + 11884630: 11884630, + 11885360: 11885360, + 11885533: 11885533, + 11885798: 11885798, + 11885800: 11885800, + 11885804: 11885804, + 11885845: 11885845, + 11886233: 11886233, + 11886249: 11886249, + 11886761: 11886761, + 11886763: 11886763, + 11886988: 11886988, + 11887088: 11887088, + 11887090: 11887090, + 11887094: 11887094, + 11887156: 11887156, + 11887166: 11887166, + 11888362: 11888362, + 11888391: 11888391, + 11888392: 11888392, + 11888395: 11888395, + 11888418: 11888418, + 11888422: 11888422, + 11888434: 11888434, + 11888488: 11888488, + 11888507: 11888507, + 11888682: 11888682, + 11888685: 11888685, + 11888687: 11888687, + 11888727: 11888727, + 11889665: 11889665, + 11889674: 11889674, + 11890095: 11890095, + 11890096: 11890096, + 11890393: 11890393, + 11890394: 11890394, + 11890405: 11890405, + 11890952: 11890952, + 11890957: 11890957, + 11891050: 11891050, + 11892008: 11892008, + 11892425: 11892425, + 11892572: 11892572, + 11892576: 11892576, + 11892594: 11892594, + 11892597: 11892597, + 11892758: 11892758, + 11893062: 11893062, + 11893066: 11893066, + 11893132: 11893132, + 11893168: 11893168, + 11893205: 11893205, + 11893207: 11893207, + 11893208: 11893208, + 11893332: 11893332, + 11893333: 11893333, + 11893334: 11893334, + 11893945: 11893945, + 11894138: 11894138, + 11894141: 11894141, + 11894142: 11894142, + 11894144: 11894144, + 11894215: 11894215, + 11894259: 11894259, + 11894284: 11894284, + 11894420: 11894420, + 11894777: 11894777, + 11894783: 11894783, + 11894797: 11894797, + 11894811: 11894811, + 11894847: 11894847, + 11895506: 11895506, + 11895507: 11895507, + 11895508: 11895508, + 11895509: 11895509, + 11895512: 11895512, + 11895545: 11895545, + 11895708: 11895708, + 11896037: 11896037, + 11896045: 11896045, + 11896049: 11896049, + 11896052: 11896052, + 11896054: 11896054, + 11896085: 11896085, + 11896088: 11896088, + 11896459: 11896459, + 11896696: 11896696, + 11896861: 11896861, + 11897248: 11897248, + 11897287: 11897287, + 11897388: 11897388, + 11897398: 11897398, + 11897464: 11897464, + 11897472: 11897472, + 11897872: 11897872, + 11897887: 11897887, + 11897914: 11897914, + 11897942: 11897942, + 11897943: 11897943, + 11897949: 11897949, + 11897984: 11897984, + 11898017: 11898017, + 11898074: 11898074, + 11898201: 11898201, + 11898303: 11898303, + 11898338: 11898338, + 11898782: 11898782, + 11898784: 11898784, + 11898793: 11898793, + 11898800: 11898800, + 11899397: 11899397, + 11899411: 11899411, + 11899573: 11899573, + 11899647: 11899647, + 11899656: 11899656, + 11899736: 11899736, + 11900093: 11900093, + 11900103: 11900103, + 11900120: 11900120, + 11900125: 11900125, + 11900161: 11900161, + 11900765: 11900765, + 11900806: 11900806, + 11900820: 11900820, + 11900850: 11900850, + 11900857: 11900857, + 11901085: 11901085, + 11901099: 11901099, + 11901408: 11901408, + 11901480: 11901480, + 11901500: 11901500, + 11901536: 11901536, + 11901538: 11901538, + 11902117: 11902117, + 11902258: 11902258, + 11902261: 11902261, + 11903073: 11903073, + 11903414: 11903414, + 11903515: 11903515, + 11903522: 11903522, + 11903532: 11903532, + 11903766: 11903766, + 11903846: 11903846, + 11904171: 11904171, + 11904173: 11904173, + 11904301: 11904301, + 11904308: 11904308, + 11904529: 11904529, + 11904782: 11904782, + 11904958: 11904958, + 11905272: 11905272, + 11905599: 11905599, + 11905637: 11905637, + 11905716: 11905716, + 11905815: 11905815, + 11905911: 11905911, + 11906207: 11906207, + 11906384: 11906384, + 11906577: 11906577, + 11907008: 11907008, + 11907010: 11907010, + 11907223: 11907223, + 11907282: 11907282, + 11907449: 11907449, + 11907614: 11907614, + 11907625: 11907625, + 11907651: 11907651, + 11908534: 11908534, + 11908569: 11908569, + 11908576: 11908576, + 11908588: 11908588, + 11908599: 11908599, + 11908600: 11908600, + 11909075: 11909075, + 11909085: 11909085, + 11909191: 11909191, + 11909341: 11909341, + 11909476: 11909476, + 11909479: 11909479, + 11909613: 11909613, + 11909728: 11909728, + 11909739: 11909739, + 11909757: 11909757, + 11909759: 11909759, + 11909788: 11909788, + 11910090: 11910090, + 11910329: 11910329, + 11910331: 11910331, + 11910346: 11910346, + 11910552: 11910552, + 11910595: 11910595, + 11910613: 11910613, + 11910720: 11910720, + 11910721: 11910721, + 11910981: 11910981, + 11910986: 11910986, + 11911241: 11911241, + 11911253: 11911253, + 11911254: 11911254, + 11911354: 11911354, + 11911635: 11911635, + 11911640: 11911640, + 11911654: 11911654, + 11911692: 11911692, + 11911703: 11911703, + 11911752: 11911752, + 11912011: 11912011, + 11912465: 11912465, + 11912678: 11912678, + 11912891: 11912891, + 11912895: 11912895, + 11913072: 11913072, + 11913589: 11913589, + 11913597: 11913597, + 11913608: 11913608, + 11913695: 11913695, + 11913817: 11913817, + 11913938: 11913938, + 11913942: 11913942, + 11913950: 11913950, + 11913962: 11913962, + 11914046: 11914046, + 11914053: 11914053, + 11914412: 11914412, + 11914739: 11914739, + 11915609: 11915609, + 11915612: 11915612, + 11915618: 11915618, + 11915883: 11915883, + 11915887: 11915887, + 11915889: 11915889, + 11916102: 11916102, + 11916103: 11916103, + 11916583: 11916583, + 11916586: 11916586, + 11916853: 11916853, + 11917014: 11917014, + 11917029: 11917029, + 11917133: 11917133, + 11917235: 11917235, + 11917237: 11917237, + 11917247: 11917247, + 11917270: 11917270, + 11917463: 11917463, + 11917717: 11917717, + 11917719: 11917719, + 11917720: 11917720, + 11917939: 11917939, + 11917947: 11917947, + 11917950: 11917950, + 11917961: 11917961, + 11918269: 11918269, + 11918437: 11918437, + 11918527: 11918527, + 11918689: 11918689, + 11918930: 11918930, + 11918940: 11918940, + 11918953: 11918953, + 11918966: 11918966, + 11918980: 11918980, + 11918987: 11918987, + 11919050: 11919050, + 11919113: 11919113, + 11919127: 11919127, + 11919143: 11919143, + 11919159: 11919159, + 11919160: 11919160, + 11919175: 11919175, + 11919347: 11919347, + 11919442: 11919442, + 11919444: 11919444, + 11920007: 11920007, + 11920020: 11920020, + 11920109: 11920109, + 11920110: 11920110, + 11920132: 11920132, + 11920195: 11920195, + 11920349: 11920349, + 11920365: 11920365, + 11920377: 11920377, + 11920379: 11920379, + 11920542: 11920542, + 11920545: 11920545, + 11920547: 11920547, + 11920552: 11920552, + 11921032: 11921032, + 11921264: 11921264, + 11921474: 11921474, + 11921484: 11921484, + 11921517: 11921517, + 11921557: 11921557, + 11921770: 11921770, + 11921841: 11921841, + 11922295: 11922295, + 11922405: 11922405, + 11922741: 11922741, + 11923044: 11923044, + 11923061: 11923061, + 11923146: 11923146, + 11923186: 11923186, + 11923187: 11923187, + 11923247: 11923247, + 11923530: 11923530, + 11923545: 11923545, + 11923673: 11923673, + 11923781: 11923781, + 11923791: 11923791, + 11924020: 11924020, + 11924029: 11924029, + 11924065: 11924065, + 11924267: 11924267, + 11924405: 11924405, + 11924416: 11924416, + 11924446: 11924446, + 11924652: 11924652, + 11924684: 11924684, + 11924744: 11924744, + 11924793: 11924793, + 11924891: 11924891, + 11924898: 11924898, + 11925475: 11925475, + 11925476: 11925476, + 11925479: 11925479, + 11925518: 11925518, + 11925831: 11925831, + 11925838: 11925838, + 11925934: 11925934, + 11925936: 11925936, + 11925938: 11925938, + 11925944: 11925944, + 11925990: 11925990, + 11925991: 11925991, + 11926101: 11926101, + 11926449: 11926449, + 11926490: 11926490, + 11926674: 11926674, + 11926817: 11926817, + 11927116: 11927116, + 11927208: 11927208, + 11927211: 11927211, + 11927853: 11927853, + 11927855: 11927855, + 11927951: 11927951, + 11927962: 11927962, + 11928095: 11928095, + 11928143: 11928143, + 11928523: 11928523, + 11928567: 11928567, + 11928766: 11928766, + 11929173: 11929173, + 11929445: 11929445, + 11929458: 11929458, + 11929464: 11929464, + 11929556: 11929556, + 11929562: 11929562, + 11929564: 11929564, + 11929590: 11929590, + 11929668: 11929668, + 11929670: 11929670, + 11929672: 11929672, + 11929677: 11929677, + 11929687: 11929687, + 11929861: 11929861, + 11930069: 11930069, + 11930078: 11930078, + 11930088: 11930088, + 11930117: 11930117, + 11930187: 11930187, + 11930232: 11930232, + 11930250: 11930250, + 11930291: 11930291, + 11930333: 11930333, + 11930385: 11930385, + 11930465: 11930465, + 11930502: 11930502, + 11930670: 11930670, + 11930780: 11930780, + 11930793: 11930793, + 11930798: 11930798, + 11930898: 11930898, + 11930981: 11930981, + 11931666: 11931666, + 11931667: 11931667, + 11931818: 11931818, + 11931820: 11931820, + 11931821: 11931821, + 11931823: 11931823, + 11932223: 11932223, + 11932337: 11932337, + 11932352: 11932352, + 11932365: 11932365, + 11932378: 11932378, + 11932381: 11932381, + 11932383: 11932383, + 11932384: 11932384, + 11932402: 11932402, + 11933251: 11933251, + 11933352: 11933352, + 11935022: 11935022, + 11935482: 11935482, + 11935503: 11935503, + 11935582: 11935582, + 11935842: 11935842, + 11936082: 11936082, + 11936267: 11936267, + 11937200: 11937200, + 11938359: 11938359, + 11939097: 11939097, + 11939392: 11939392, + 11939685: 11939685, + 11940019: 11940019, + 11940680: 11940680, + 11941959: 11941959, + 11942553: 11942553, + 11943050: 11943050, + 11943154: 11943154, + 11946098: 11946098, + 11946249: 11946249, + 11947212: 11947212, + 11947481: 11947481, + 11947757: 11947757, } db := dao.GetDB() userName := ctx.GetUserName() for _, v := range storeMap { var stores []*tJdStoreInfo + store, _ := dao.GetStoreDetailByVendorStoreID(db, utils.Int2Str(v), model.VendorIDJD) sql := ` SELECT t1.*, city.jd_code jd_city_code, district.jd_code jd_district_code, @@ -2784,7 +3616,7 @@ func UpdateJdStoreNameAll(ctx *jxcontext.Context) (err error) { WHERE t1.id = ? ORDER BY t2.updated_at ` - if err = dao.GetRows(db, &stores, sql, model.VendorIDJD, v); err == nil { + if err = dao.GetRows(db, &stores, sql, model.VendorIDJD, store.ID); err == nil { for _, store := range stores { a := jd.GetAPI(store.VendorOrgCode) storeParams := &jdapi.OpStoreParams{ From 2facf15c1db056c21cea1afa22167cf73bb351cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 15:20:11 +0800 Subject: [PATCH 06/27] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E9=97=A8=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 1646 ++++++++++++++++----------------- 1 file changed, 810 insertions(+), 836 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index bb937ecec..88f27bd9a 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -2763,846 +2763,820 @@ type tJdStoreInfo struct { func UpdateJdStoreNameAll(ctx *jxcontext.Context) (err error) { storeMap := map[int]int{ - 11732425: 11732425, - 11732427: 11732427, - 11732447: 11732447, - 11732449: 11732449, - 11732462: 11732462, - 11732465: 11732465, - 11732466: 11732466, - 11732783: 11732783, - 11733018: 11733018, - 11733036: 11733036, - 11733040: 11733040, - 11733050: 11733050, - 11733057: 11733057, - 11733058: 11733058, - 11733062: 11733062, - 11733068: 11733068, - 11733070: 11733070, - 11733074: 11733074, - 11733882: 11733882, - 11733886: 11733886, - 11733887: 11733887, - 11733889: 11733889, - 11733892: 11733892, - 11733905: 11733905, - 11733912: 11733912, - 11733917: 11733917, - 11734846: 11734846, - 11734848: 11734848, - 11734849: 11734849, - 11734850: 11734850, - 11734851: 11734851, - 11734852: 11734852, - 11734853: 11734853, - 11734854: 11734854, - 11734856: 11734856, - 11734857: 11734857, - 11734859: 11734859, - 11734861: 11734861, - 11734862: 11734862, - 11734863: 11734863, - 11734864: 11734864, - 11734865: 11734865, - 11734866: 11734866, - 11734867: 11734867, - 11734868: 11734868, - 11734872: 11734872, - 11734873: 11734873, - 11734874: 11734874, - 11734876: 11734876, - 11734877: 11734877, - 11734878: 11734878, - 11734879: 11734879, - 11734883: 11734883, - 11734884: 11734884, - 11734885: 11734885, - 11734886: 11734886, - 11734887: 11734887, - 11734888: 11734888, - 11734889: 11734889, - 11736964: 11736964, - 11736982: 11736982, - 11736984: 11736984, - 11736990: 11736990, - 11736993: 11736993, - 11738048: 11738048, - 11738051: 11738051, - 11738056: 11738056, - 11738059: 11738059, - 11738060: 11738060, - 11738063: 11738063, - 11738065: 11738065, - 11738066: 11738066, - 11738113: 11738113, - 11738114: 11738114, - 11738115: 11738115, - 11738116: 11738116, - 11738119: 11738119, - 11738120: 11738120, - 11738123: 11738123, - 11738127: 11738127, - 11738128: 11738128, - 11738149: 11738149, - 11738150: 11738150, - 11738153: 11738153, - 11738154: 11738154, - 11738155: 11738155, - 11738157: 11738157, - 11738159: 11738159, - 11738160: 11738160, - 11738162: 11738162, - 11738163: 11738163, - 11738165: 11738165, - 11738166: 11738166, - 11738167: 11738167, - 11738168: 11738168, - 11738170: 11738170, - 11738171: 11738171, - 11738172: 11738172, - 11738290: 11738290, - 11738304: 11738304, - 11738305: 11738305, - 11738306: 11738306, - 11738307: 11738307, - 11738309: 11738309, - 11738312: 11738312, - 11738313: 11738313, - 11738314: 11738314, - 11738315: 11738315, - 11738317: 11738317, - 11738318: 11738318, - 11738319: 11738319, - 11738321: 11738321, - 11738322: 11738322, - 11738323: 11738323, - 11738324: 11738324, - 11738325: 11738325, - 11738326: 11738326, - 11738327: 11738327, - 11738329: 11738329, - 11738331: 11738331, - 11738335: 11738335, - 11738338: 11738338, - 11738347: 11738347, - 11738348: 11738348, - 11738351: 11738351, - 11738354: 11738354, - 11738356: 11738356, - 11738362: 11738362, - 11738363: 11738363, - 11738364: 11738364, - 11738389: 11738389, - 11738391: 11738391, - 11738392: 11738392, - 11738393: 11738393, - 11738396: 11738396, - 11738397: 11738397, - 11738398: 11738398, - 11738399: 11738399, - 11738404: 11738404, - 11738408: 11738408, - 11738410: 11738410, - 11738440: 11738440, - 11738444: 11738444, - 11738446: 11738446, - 11738473: 11738473, - 11741810: 11741810, - 11743375: 11743375, - 11743493: 11743493, - 11744471: 11744471, - 11745016: 11745016, - 11746669: 11746669, - 11746671: 11746671, - 11746686: 11746686, - 11747161: 11747161, - 11747203: 11747203, - 11747205: 11747205, - 11747735: 11747735, - 11747750: 11747750, - 11747759: 11747759, - 11747762: 11747762, - 11748353: 11748353, - 11749018: 11749018, - 11749156: 11749156, - 11749347: 11749347, - 11749704: 11749704, - 11749729: 11749729, - 11749731: 11749731, - 11749732: 11749732, - 11749733: 11749733, - 11750155: 11750155, - 11750184: 11750184, - 11750488: 11750488, - 11750565: 11750565, - 11750752: 11750752, - 11752596: 11752596, - 11752755: 11752755, - 11752759: 11752759, - 11752765: 11752765, - 11752774: 11752774, - 11752777: 11752777, - 11752780: 11752780, - 11752782: 11752782, - 11752783: 11752783, - 11753633: 11753633, - 11754775: 11754775, - 11755605: 11755605, - 11755916: 11755916, - 11757549: 11757549, - 11762508: 11762508, - 11765538: 11765538, - 11765540: 11765540, - 11765541: 11765541, - 11765546: 11765546, - 11765547: 11765547, - 11765549: 11765549, - 11765550: 11765550, - 11769090: 11769090, - 11774174: 11774174, - 11774187: 11774187, - 11774193: 11774193, - 11774966: 11774966, - 11777744: 11777744, - 11777747: 11777747, - 11777755: 11777755, - 11777762: 11777762, - 11777765: 11777765, - 11777782: 11777782, - 11780947: 11780947, - 11780954: 11780954, - 11780956: 11780956, - 11780957: 11780957, - 11781300: 11781300, - 11781621: 11781621, - 11784258: 11784258, - 11784274: 11784274, - 11784399: 11784399, - 11785736: 11785736, - 11785742: 11785742, - 11786742: 11786742, - 11786819: 11786819, - 11786823: 11786823, - 11789517: 11789517, - 11789518: 11789518, - 11789520: 11789520, - 11789524: 11789524, - 11789525: 11789525, - 11789526: 11789526, - 11789528: 11789528, - 11789529: 11789529, - 11790117: 11790117, - 11791157: 11791157, - 11791749: 11791749, - 11792563: 11792563, - 11792566: 11792566, - 11792567: 11792567, - 11792568: 11792568, - 11797786: 11797786, - 11799502: 11799502, - 11800399: 11800399, - 11800400: 11800400, - 11800403: 11800403, - 11800405: 11800405, - 11800407: 11800407, - 11801478: 11801478, - 11801522: 11801522, - 11801616: 11801616, - 11802191: 11802191, - 11803802: 11803802, - 11805596: 11805596, - 11806265: 11806265, - 11806266: 11806266, - 11806270: 11806270, - 11806273: 11806273, - 11806278: 11806278, - 11806280: 11806280, - 11806283: 11806283, - 11808053: 11808053, - 11811576: 11811576, - 11811578: 11811578, - 11812596: 11812596, - 11813030: 11813030, - 11813260: 11813260, - 11816843: 11816843, - 11816848: 11816848, - 11817931: 11817931, - 11823780: 11823780, - 11824252: 11824252, - 11826577: 11826577, - 11826614: 11826614, - 11826615: 11826615, - 11827588: 11827588, - 11827615: 11827615, - 11827847: 11827847, - 11827848: 11827848, - 11827924: 11827924, - 11827925: 11827925, - 11828109: 11828109, - 11828136: 11828136, - 11828144: 11828144, - 11828147: 11828147, - 11837990: 11837990, - 11838380: 11838380, - 11838398: 11838398, - 11839083: 11839083, - 11839112: 11839112, - 11839947: 11839947, - 11841528: 11841528, - 11841659: 11841659, - 11845323: 11845323, - 11846487: 11846487, - 11850503: 11850503, - 11851018: 11851018, - 11851024: 11851024, - 11851063: 11851063, - 11851092: 11851092, - 11851305: 11851305, - 11852191: 11852191, - 11852636: 11852636, - 11853094: 11853094, - 11853163: 11853163, - 11853833: 11853833, - 11854244: 11854244, - 11854804: 11854804, - 11854868: 11854868, - 11855405: 11855405, - 11855898: 11855898, - 11855966: 11855966, - 11856299: 11856299, - 11856665: 11856665, - 11856835: 11856835, - 11856922: 11856922, - 11857025: 11857025, - 11857086: 11857086, - 11857499: 11857499, - 11857692: 11857692, - 11857743: 11857743, - 11857889: 11857889, - 11858126: 11858126, - 11858268: 11858268, - 11858769: 11858769, - 11858885: 11858885, - 11858947: 11858947, - 11859124: 11859124, - 11859144: 11859144, - 11859328: 11859328, - 11859926: 11859926, - 11860408: 11860408, - 11860688: 11860688, - 11860695: 11860695, - 11861208: 11861208, - 11862153: 11862153, - 11862364: 11862364, - 11862404: 11862404, - 11862417: 11862417, - 11862434: 11862434, - 11863524: 11863524, - 11863739: 11863739, - 11864813: 11864813, - 11865523: 11865523, - 11865677: 11865677, - 11865896: 11865896, - 11865909: 11865909, - 11866855: 11866855, - 11866873: 11866873, - 11866875: 11866875, - 11867012: 11867012, - 11867653: 11867653, - 11868002: 11868002, - 11868022: 11868022, - 11868742: 11868742, - 11868912: 11868912, - 11869150: 11869150, - 11869709: 11869709, - 11869886: 11869886, - 11869887: 11869887, - 11870147: 11870147, - 11870507: 11870507, - 11871237: 11871237, - 11871704: 11871704, - 11871708: 11871708, - 11871709: 11871709, - 11871713: 11871713, - 11872683: 11872683, - 11872786: 11872786, - 11873372: 11873372, - 11873380: 11873380, - 11873386: 11873386, - 11873418: 11873418, - 11873440: 11873440, - 11873447: 11873447, - 11873468: 11873468, - 11873938: 11873938, - 11874159: 11874159, - 11874162: 11874162, - 11874164: 11874164, - 11874404: 11874404, - 11874614: 11874614, - 11874685: 11874685, - 11875038: 11875038, - 11875494: 11875494, - 11875563: 11875563, - 11875906: 11875906, - 11875982: 11875982, - 11876320: 11876320, - 11876323: 11876323, - 11876359: 11876359, - 11876470: 11876470, - 11876543: 11876543, - 11877348: 11877348, - 11877586: 11877586, - 11877676: 11877676, - 11877839: 11877839, - 11878592: 11878592, - 11879602: 11879602, - 11880095: 11880095, - 11880118: 11880118, - 11880690: 11880690, - 11881165: 11881165, - 11881183: 11881183, - 11881187: 11881187, - 11881200: 11881200, - 11881484: 11881484, - 11881499: 11881499, - 11881506: 11881506, - 11881532: 11881532, - 11881764: 11881764, - 11881998: 11881998, - 11882539: 11882539, - 11883071: 11883071, - 11883852: 11883852, - 11883907: 11883907, - 11884261: 11884261, - 11884358: 11884358, - 11884630: 11884630, - 11885360: 11885360, - 11885533: 11885533, - 11885798: 11885798, - 11885800: 11885800, - 11885804: 11885804, - 11885845: 11885845, - 11886233: 11886233, - 11886249: 11886249, - 11886761: 11886761, - 11886763: 11886763, - 11886988: 11886988, - 11887088: 11887088, - 11887090: 11887090, - 11887094: 11887094, - 11887156: 11887156, - 11887166: 11887166, - 11888362: 11888362, - 11888391: 11888391, - 11888392: 11888392, - 11888395: 11888395, - 11888418: 11888418, - 11888422: 11888422, - 11888434: 11888434, - 11888488: 11888488, - 11888507: 11888507, - 11888682: 11888682, - 11888685: 11888685, - 11888687: 11888687, - 11888727: 11888727, - 11889665: 11889665, - 11889674: 11889674, - 11890095: 11890095, - 11890096: 11890096, - 11890393: 11890393, - 11890394: 11890394, - 11890405: 11890405, - 11890952: 11890952, - 11890957: 11890957, - 11891050: 11891050, - 11892008: 11892008, - 11892425: 11892425, - 11892572: 11892572, - 11892576: 11892576, - 11892594: 11892594, - 11892597: 11892597, - 11892758: 11892758, - 11893062: 11893062, - 11893066: 11893066, - 11893132: 11893132, - 11893168: 11893168, - 11893205: 11893205, - 11893207: 11893207, - 11893208: 11893208, - 11893332: 11893332, - 11893333: 11893333, - 11893334: 11893334, - 11893945: 11893945, - 11894138: 11894138, - 11894141: 11894141, - 11894142: 11894142, - 11894144: 11894144, - 11894215: 11894215, - 11894259: 11894259, - 11894284: 11894284, - 11894420: 11894420, - 11894777: 11894777, - 11894783: 11894783, - 11894797: 11894797, - 11894811: 11894811, - 11894847: 11894847, - 11895506: 11895506, - 11895507: 11895507, - 11895508: 11895508, - 11895509: 11895509, - 11895512: 11895512, - 11895545: 11895545, - 11895708: 11895708, - 11896037: 11896037, - 11896045: 11896045, - 11896049: 11896049, - 11896052: 11896052, - 11896054: 11896054, - 11896085: 11896085, - 11896088: 11896088, - 11896459: 11896459, - 11896696: 11896696, - 11896861: 11896861, - 11897248: 11897248, - 11897287: 11897287, - 11897388: 11897388, - 11897398: 11897398, - 11897464: 11897464, - 11897472: 11897472, - 11897872: 11897872, - 11897887: 11897887, - 11897914: 11897914, - 11897942: 11897942, - 11897943: 11897943, - 11897949: 11897949, - 11897984: 11897984, - 11898017: 11898017, - 11898074: 11898074, - 11898201: 11898201, - 11898303: 11898303, - 11898338: 11898338, - 11898782: 11898782, - 11898784: 11898784, - 11898793: 11898793, - 11898800: 11898800, - 11899397: 11899397, - 11899411: 11899411, - 11899573: 11899573, - 11899647: 11899647, - 11899656: 11899656, - 11899736: 11899736, - 11900093: 11900093, - 11900103: 11900103, - 11900120: 11900120, - 11900125: 11900125, - 11900161: 11900161, - 11900765: 11900765, - 11900806: 11900806, - 11900820: 11900820, - 11900850: 11900850, - 11900857: 11900857, - 11901085: 11901085, - 11901099: 11901099, - 11901408: 11901408, - 11901480: 11901480, - 11901500: 11901500, - 11901536: 11901536, - 11901538: 11901538, - 11902117: 11902117, - 11902258: 11902258, - 11902261: 11902261, - 11903073: 11903073, - 11903414: 11903414, - 11903515: 11903515, - 11903522: 11903522, - 11903532: 11903532, - 11903766: 11903766, - 11903846: 11903846, - 11904171: 11904171, - 11904173: 11904173, - 11904301: 11904301, - 11904308: 11904308, - 11904529: 11904529, - 11904782: 11904782, - 11904958: 11904958, - 11905272: 11905272, - 11905599: 11905599, - 11905637: 11905637, - 11905716: 11905716, - 11905815: 11905815, - 11905911: 11905911, - 11906207: 11906207, - 11906384: 11906384, - 11906577: 11906577, - 11907008: 11907008, - 11907010: 11907010, - 11907223: 11907223, - 11907282: 11907282, - 11907449: 11907449, - 11907614: 11907614, - 11907625: 11907625, - 11907651: 11907651, - 11908534: 11908534, - 11908569: 11908569, - 11908576: 11908576, - 11908588: 11908588, - 11908599: 11908599, - 11908600: 11908600, - 11909075: 11909075, - 11909085: 11909085, - 11909191: 11909191, - 11909341: 11909341, - 11909476: 11909476, - 11909479: 11909479, - 11909613: 11909613, - 11909728: 11909728, - 11909739: 11909739, - 11909757: 11909757, - 11909759: 11909759, - 11909788: 11909788, - 11910090: 11910090, - 11910329: 11910329, - 11910331: 11910331, - 11910346: 11910346, - 11910552: 11910552, - 11910595: 11910595, - 11910613: 11910613, - 11910720: 11910720, - 11910721: 11910721, - 11910981: 11910981, - 11910986: 11910986, - 11911241: 11911241, - 11911253: 11911253, - 11911254: 11911254, - 11911354: 11911354, - 11911635: 11911635, - 11911640: 11911640, - 11911654: 11911654, - 11911692: 11911692, - 11911703: 11911703, - 11911752: 11911752, - 11912011: 11912011, - 11912465: 11912465, - 11912678: 11912678, - 11912891: 11912891, - 11912895: 11912895, - 11913072: 11913072, - 11913589: 11913589, - 11913597: 11913597, - 11913608: 11913608, - 11913695: 11913695, - 11913817: 11913817, - 11913938: 11913938, - 11913942: 11913942, - 11913950: 11913950, - 11913962: 11913962, - 11914046: 11914046, - 11914053: 11914053, - 11914412: 11914412, - 11914739: 11914739, - 11915609: 11915609, - 11915612: 11915612, - 11915618: 11915618, - 11915883: 11915883, - 11915887: 11915887, - 11915889: 11915889, - 11916102: 11916102, - 11916103: 11916103, - 11916583: 11916583, - 11916586: 11916586, - 11916853: 11916853, - 11917014: 11917014, - 11917029: 11917029, - 11917133: 11917133, - 11917235: 11917235, - 11917237: 11917237, - 11917247: 11917247, - 11917270: 11917270, - 11917463: 11917463, - 11917717: 11917717, - 11917719: 11917719, - 11917720: 11917720, - 11917939: 11917939, - 11917947: 11917947, - 11917950: 11917950, - 11917961: 11917961, - 11918269: 11918269, - 11918437: 11918437, - 11918527: 11918527, - 11918689: 11918689, - 11918930: 11918930, - 11918940: 11918940, - 11918953: 11918953, - 11918966: 11918966, - 11918980: 11918980, - 11918987: 11918987, - 11919050: 11919050, - 11919113: 11919113, - 11919127: 11919127, - 11919143: 11919143, - 11919159: 11919159, - 11919160: 11919160, - 11919175: 11919175, - 11919347: 11919347, - 11919442: 11919442, - 11919444: 11919444, - 11920007: 11920007, - 11920020: 11920020, - 11920109: 11920109, - 11920110: 11920110, - 11920132: 11920132, - 11920195: 11920195, - 11920349: 11920349, - 11920365: 11920365, - 11920377: 11920377, - 11920379: 11920379, - 11920542: 11920542, - 11920545: 11920545, - 11920547: 11920547, - 11920552: 11920552, - 11921032: 11921032, - 11921264: 11921264, - 11921474: 11921474, - 11921484: 11921484, - 11921517: 11921517, - 11921557: 11921557, - 11921770: 11921770, - 11921841: 11921841, - 11922295: 11922295, - 11922405: 11922405, - 11922741: 11922741, - 11923044: 11923044, - 11923061: 11923061, - 11923146: 11923146, - 11923186: 11923186, - 11923187: 11923187, - 11923247: 11923247, - 11923530: 11923530, - 11923545: 11923545, - 11923673: 11923673, - 11923781: 11923781, - 11923791: 11923791, - 11924020: 11924020, - 11924029: 11924029, - 11924065: 11924065, - 11924267: 11924267, - 11924405: 11924405, - 11924416: 11924416, - 11924446: 11924446, - 11924652: 11924652, - 11924684: 11924684, - 11924744: 11924744, - 11924793: 11924793, - 11924891: 11924891, - 11924898: 11924898, - 11925475: 11925475, - 11925476: 11925476, - 11925479: 11925479, - 11925518: 11925518, - 11925831: 11925831, - 11925838: 11925838, - 11925934: 11925934, - 11925936: 11925936, - 11925938: 11925938, - 11925944: 11925944, - 11925990: 11925990, - 11925991: 11925991, - 11926101: 11926101, - 11926449: 11926449, - 11926490: 11926490, - 11926674: 11926674, - 11926817: 11926817, - 11927116: 11927116, - 11927208: 11927208, - 11927211: 11927211, - 11927853: 11927853, - 11927855: 11927855, - 11927951: 11927951, - 11927962: 11927962, - 11928095: 11928095, - 11928143: 11928143, - 11928523: 11928523, - 11928567: 11928567, - 11928766: 11928766, - 11929173: 11929173, - 11929445: 11929445, - 11929458: 11929458, - 11929464: 11929464, - 11929556: 11929556, - 11929562: 11929562, - 11929564: 11929564, - 11929590: 11929590, - 11929668: 11929668, - 11929670: 11929670, - 11929672: 11929672, - 11929677: 11929677, - 11929687: 11929687, - 11929861: 11929861, - 11930069: 11930069, - 11930078: 11930078, - 11930088: 11930088, - 11930117: 11930117, - 11930187: 11930187, - 11930232: 11930232, - 11930250: 11930250, - 11930291: 11930291, - 11930333: 11930333, - 11930385: 11930385, - 11930465: 11930465, - 11930502: 11930502, - 11930670: 11930670, - 11930780: 11930780, - 11930793: 11930793, - 11930798: 11930798, - 11930898: 11930898, - 11930981: 11930981, - 11931666: 11931666, - 11931667: 11931667, - 11931818: 11931818, - 11931820: 11931820, - 11931821: 11931821, - 11931823: 11931823, - 11932223: 11932223, - 11932337: 11932337, - 11932352: 11932352, - 11932365: 11932365, - 11932378: 11932378, - 11932381: 11932381, - 11932383: 11932383, - 11932384: 11932384, - 11932402: 11932402, - 11933251: 11933251, - 11933352: 11933352, - 11935022: 11935022, - 11935482: 11935482, - 11935503: 11935503, - 11935582: 11935582, - 11935842: 11935842, - 11936082: 11936082, - 11936267: 11936267, - 11937200: 11937200, - 11938359: 11938359, - 11939097: 11939097, - 11939392: 11939392, - 11939685: 11939685, - 11940019: 11940019, - 11940680: 11940680, - 11941959: 11941959, - 11942553: 11942553, - 11943050: 11943050, - 11943154: 11943154, - 11946098: 11946098, - 11946249: 11946249, - 11947212: 11947212, - 11947481: 11947481, - 11947757: 11947757, + 100002: 100002, + 103417: 103417, + 102108: 102108, + 100015: 100015, + 100022: 100022, + 100653: 100653, + 100024: 100024, + 100028: 100028, + 100032: 100032, + 100044: 100044, + 100046: 100046, + 101687: 101687, + 100056: 100056, + 100057: 100057, + 101110: 101110, + 100065: 100065, + 100067: 100067, + 102544: 102544, + 100077: 100077, + 100081: 100081, + 100082: 100082, + 100084: 100084, + 100087: 100087, + 100100: 100100, + 100106: 100106, + 100111: 100111, + 100113: 100113, + 100115: 100115, + 100116: 100116, + 100117: 100117, + 100118: 100118, + 102613: 102613, + 100120: 100120, + 100121: 100121, + 100123: 100123, + 100124: 100124, + 100126: 100126, + 103408: 103408, + 100129: 100129, + 100130: 100130, + 100881: 100881, + 100132: 100132, + 100133: 100133, + 100134: 100134, + 100135: 100135, + 101034: 101034, + 100140: 100140, + 100141: 100141, + 102391: 102391, + 103105: 103105, + 100145: 100145, + 100146: 100146, + 100150: 100150, + 102996: 102996, + 100152: 100152, + 100153: 100153, + 102180: 102180, + 100155: 100155, + 100156: 100156, + 100157: 100157, + 100162: 100162, + 102950: 102950, + 100165: 100165, + 101008: 101008, + 100167: 100167, + 100170: 100170, + 100175: 100175, + 100178: 100178, + 101772: 101772, + 100778: 100778, + 100184: 100184, + 100978: 100978, + 100190: 100190, + 100191: 100191, + 100192: 100192, + 100193: 100193, + 102670: 102670, + 103196: 103196, + 101032: 101032, + 100204: 100204, + 100205: 100205, + 103032: 103032, + 101736: 101736, + 103073: 103073, + 100212: 100212, + 100213: 100213, + 100215: 100215, + 100217: 100217, + 100218: 100218, + 102594: 102594, + 100221: 100221, + 101902: 101902, + 100224: 100224, + 100225: 100225, + 102963: 102963, + 100228: 100228, + 100229: 100229, + 100230: 100230, + 102587: 102587, + 101936: 101936, + 100266: 100266, + 100267: 100267, + 100268: 100268, + 100273: 100273, + 100274: 100274, + 100275: 100275, + 100276: 100276, + 100278: 100278, + 100279: 100279, + 100280: 100280, + 100282: 100282, + 100283: 100283, + 101682: 101682, + 102267: 102267, + 100943: 100943, + 103191: 103191, + 100290: 100290, + 100292: 100292, + 100296: 100296, + 100299: 100299, + 100945: 100945, + 100309: 100309, + 103065: 103065, + 100905: 100905, + 100946: 100946, + 100935: 100935, + 100324: 100324, + 100325: 100325, + 100326: 100326, + 100328: 100328, + 100329: 100329, + 100330: 100330, + 100766: 100766, + 100334: 100334, + 100335: 100335, + 100336: 100336, + 100341: 100341, + 100345: 100345, + 100347: 100347, + 100377: 100377, + 100381: 100381, + 100383: 100383, + 101743: 101743, + 100977: 100977, + 100409: 100409, + 100410: 100410, + 100433: 100433, + 100969: 100969, + 101099: 101099, + 100442: 100442, + 100444: 100444, + 101011: 101011, + 100449: 100449, + 100451: 100451, + 100463: 100463, + 101013: 101013, + 101012: 101012, + 100470: 100470, + 100471: 100471, + 100741: 100741, + 100871: 100871, + 100487: 100487, + 101870: 101870, + 100501: 100501, + 100503: 100503, + 102534: 102534, + 102562: 102562, + 100512: 100512, + 101050: 101050, + 100515: 100515, + 100517: 100517, + 102705: 102705, + 102278: 102278, + 100525: 100525, + 100529: 100529, + 100535: 100535, + 102181: 102181, + 100543: 100543, + 100546: 100546, + 100548: 100548, + 100549: 100549, + 100563: 100563, + 101828: 101828, + 101078: 101078, + 102671: 102671, + 100888: 100888, + 100743: 100743, + 101677: 101677, + 100600: 100600, + 100601: 100601, + 100606: 100606, + 101949: 101949, + 101948: 101948, + 100610: 100610, + 100642: 100642, + 101750: 101750, + 100658: 100658, + 102255: 102255, + 100937: 100937, + 100661: 100661, + 100664: 100664, + 100670: 100670, + 102090: 102090, + 100678: 100678, + 100681: 100681, + 100712: 100712, + 101732: 101732, + 100714: 100714, + 100853: 100853, + 100705: 100705, + 100744: 100744, + 100800: 100800, + 103101: 103101, + 100867: 100867, + 101960: 101960, + 101945: 101945, + 100746: 100746, + 100748: 100748, + 100396: 100396, + 101832: 101832, + 101725: 101725, + 101887: 101887, + 101831: 101831, + 102712: 102712, + 102815: 102815, + 100828: 100828, + 100829: 100829, + 101027: 101027, + 100848: 100848, + 100802: 100802, + 100849: 100849, + 100852: 100852, + 100813: 100813, + 101909: 101909, + 100865: 100865, + 101031: 101031, + 101042: 101042, + 101043: 101043, + 102591: 102591, + 102047: 102047, + 100922: 100922, + 100920: 100920, + 102742: 102742, + 101825: 101825, + 100982: 100982, + 100989: 100989, + 100983: 100983, + 100984: 100984, + 100986: 100986, + 100987: 100987, + 100988: 100988, + 101134: 101134, + 101003: 101003, + 101061: 101061, + 101062: 101062, + 101036: 101036, + 101054: 101054, + 101111: 101111, + 101084: 101084, + 101096: 101096, + 103063: 103063, + 101840: 101840, + 101689: 101689, + 101718: 101718, + 101719: 101719, + 100270: 100270, + 101721: 101721, + 101722: 101722, + 101735: 101735, + 101787: 101787, + 101729: 101729, + 101730: 101730, + 101780: 101780, + 103111: 103111, + 102867: 102867, + 101785: 101785, + 102578: 102578, + 101763: 101763, + 101996: 101996, + 101776: 101776, + 101775: 101775, + 102433: 102433, + 101838: 101838, + 101842: 101842, + 101861: 101861, + 101919: 101919, + 100884: 100884, + 101916: 101916, + 101918: 101918, + 101920: 101920, + 100858: 100858, + 101938: 101938, + 101966: 101966, + 101983: 101983, + 103033: 103033, + 101991: 101991, + 102001: 102001, + 102516: 102516, + 102654: 102654, + 102058: 102058, + 102059: 102059, + 102071: 102071, + 102097: 102097, + 102035: 102035, + 102126: 102126, + 102112: 102112, + 101942: 101942, + 102136: 102136, + 102186: 102186, + 102160: 102160, + 102131: 102131, + 102147: 102147, + 103005: 103005, + 102198: 102198, + 102206: 102206, + 102167: 102167, + 102221: 102221, + 102235: 102235, + 102241: 102241, + 102244: 102244, + 102245: 102245, + 102262: 102262, + 102280: 102280, + 102293: 102293, + 102300: 102300, + 102297: 102297, + 102307: 102307, + 102320: 102320, + 102989: 102989, + 101986: 101986, + 102350: 102350, + 102089: 102089, + 102354: 102354, + 102365: 102365, + 102379: 102379, + 102533: 102533, + 102381: 102381, + 101118: 101118, + 102405: 102405, + 100284: 100284, + 102411: 102411, + 102415: 102415, + 102416: 102416, + 102417: 102417, + 102424: 102424, + 102425: 102425, + 102426: 102426, + 102430: 102430, + 102436: 102436, + 102444: 102444, + 102600: 102600, + 102455: 102455, + 102456: 102456, + 102461: 102461, + 102463: 102463, + 102464: 102464, + 102479: 102479, + 102223: 102223, + 102481: 102481, + 102476: 102476, + 102482: 102482, + 102473: 102473, + 102480: 102480, + 102487: 102487, + 102353: 102353, + 102495: 102495, + 102496: 102496, + 102498: 102498, + 102973: 102973, + 102505: 102505, + 102233: 102233, + 102511: 102511, + 102519: 102519, + 102526: 102526, + 102528: 102528, + 102500: 102500, + 102493: 102493, + 102531: 102531, + 102530: 102530, + 102488: 102488, + 102538: 102538, + 102539: 102539, + 103437: 103437, + 102545: 102545, + 102550: 102550, + 102551: 102551, + 102557: 102557, + 102563: 102563, + 102561: 102561, + 102558: 102558, + 102566: 102566, + 102572: 102572, + 102570: 102570, + 102011: 102011, + 102574: 102574, + 102576: 102576, + 102583: 102583, + 102595: 102595, + 102601: 102601, + 102987: 102987, + 102606: 102606, + 102609: 102609, + 102610: 102610, + 102614: 102614, + 103435: 103435, + 102617: 102617, + 102618: 102618, + 102607: 102607, + 102619: 102619, + 102605: 102605, + 102623: 102623, + 102599: 102599, + 102630: 102630, + 102638: 102638, + 102002: 102002, + 102640: 102640, + 102635: 102635, + 102629: 102629, + 102642: 102642, + 102637: 102637, + 102648: 102648, + 102626: 102626, + 102660: 102660, + 102661: 102661, + 102651: 102651, + 102662: 102662, + 103433: 103433, + 102669: 102669, + 102663: 102663, + 102666: 102666, + 102675: 102675, + 102676: 102676, + 100654: 100654, + 102679: 102679, + 103402: 103402, + 102685: 102685, + 102686: 102686, + 102689: 102689, + 102690: 102690, + 102692: 102692, + 102138: 102138, + 102699: 102699, + 102703: 102703, + 102704: 102704, + 102706: 102706, + 102708: 102708, + 102709: 102709, + 102596: 102596, + 102086: 102086, + 102711: 102711, + 102713: 102713, + 102714: 102714, + 102715: 102715, + 102720: 102720, + 102719: 102719, + 102718: 102718, + 102721: 102721, + 102731: 102731, + 102716: 102716, + 102878: 102878, + 102726: 102726, + 102724: 102724, + 102723: 102723, + 102736: 102736, + 102738: 102738, + 102739: 102739, + 102740: 102740, + 102741: 102741, + 102744: 102744, + 102747: 102747, + 102735: 102735, + 103174: 103174, + 102751: 102751, + 102749: 102749, + 102748: 102748, + 102752: 102752, + 102750: 102750, + 102763: 102763, + 102759: 102759, + 102757: 102757, + 102761: 102761, + 102762: 102762, + 102767: 102767, + 102769: 102769, + 102771: 102771, + 102775: 102775, + 102776: 102776, + 102777: 102777, + 102778: 102778, + 102756: 102756, + 102779: 102779, + 102780: 102780, + 102781: 102781, + 103414: 103414, + 102784: 102784, + 100068: 100068, + 103434: 103434, + 102789: 102789, + 102788: 102788, + 102743: 102743, + 102785: 102785, + 102791: 102791, + 102790: 102790, + 102793: 102793, + 102794: 102794, + 102795: 102795, + 102796: 102796, + 102804: 102804, + 102806: 102806, + 102808: 102808, + 102810: 102810, + 102811: 102811, + 102813: 102813, + 103038: 103038, + 102817: 102817, + 102818: 102818, + 102819: 102819, + 102821: 102821, + 102822: 102822, + 102823: 102823, + 102825: 102825, + 102807: 102807, + 102826: 102826, + 102831: 102831, + 103007: 103007, + 102837: 102837, + 102839: 102839, + 102838: 102838, + 102841: 102841, + 102842: 102842, + 102847: 102847, + 102848: 102848, + 102850: 102850, + 102851: 102851, + 102852: 102852, + 102853: 102853, + 103429: 103429, + 102856: 102856, + 102377: 102377, + 102857: 102857, + 102858: 102858, + 102859: 102859, + 102860: 102860, + 102863: 102863, + 102864: 102864, + 102865: 102865, + 102876: 102876, + 102877: 102877, + 102880: 102880, + 103426: 103426, + 102888: 102888, + 102891: 102891, + 102892: 102892, + 102898: 102898, + 102899: 102899, + 102902: 102902, + 102903: 102903, + 102906: 102906, + 102907: 102907, + 102908: 102908, + 102910: 102910, + 102913: 102913, + 102915: 102915, + 102911: 102911, + 102901: 102901, + 102879: 102879, + 100524: 100524, + 102920: 102920, + 102921: 102921, + 102922: 102922, + 102923: 102923, + 101176: 101176, + 102924: 102924, + 102925: 102925, + 102926: 102926, + 102928: 102928, + 102929: 102929, + 102930: 102930, + 102932: 102932, + 102844: 102844, + 102933: 102933, + 102934: 102934, + 102988: 102988, + 102948: 102948, + 102935: 102935, + 102937: 102937, + 102938: 102938, + 102939: 102939, + 102941: 102941, + 102944: 102944, + 102945: 102945, + 102946: 102946, + 102882: 102882, + 102951: 102951, + 102952: 102952, + 102954: 102954, + 102955: 102955, + 102956: 102956, + 102962: 102962, + 102964: 102964, + 102966: 102966, + 102967: 102967, + 102968: 102968, + 102969: 102969, + 102970: 102970, + 102974: 102974, + 102975: 102975, + 102976: 102976, + 102977: 102977, + 102978: 102978, + 102979: 102979, + 102980: 102980, + 102981: 102981, + 102982: 102982, + 102984: 102984, + 100210: 100210, + 100344: 100344, + 102985: 102985, + 102992: 102992, + 102993: 102993, + 102995: 102995, + 102998: 102998, + 102999: 102999, + 103000: 103000, + 103001: 103001, + 103002: 103002, + 102887: 102887, + 102893: 102893, + 101666: 101666, + 103006: 103006, + 103008: 103008, + 103009: 103009, + 102918: 102918, + 102896: 102896, + 103011: 103011, + 102881: 102881, + 103013: 103013, + 103014: 103014, + 103015: 103015, + 103019: 103019, + 103018: 103018, + 103020: 103020, + 103022: 103022, + 102173: 102173, + 103023: 103023, + 103026: 103026, + 100699: 100699, + 100356: 100356, + 100477: 100477, + 100369: 100369, + 100351: 100351, + 100366: 100366, + 103027: 103027, + 100361: 100361, + 100350: 100350, + 103069: 103069, + 100476: 100476, + 100754: 100754, + 103028: 103028, + 103030: 103030, + 103031: 103031, + 102940: 102940, + 103037: 103037, + 103036: 103036, + 100557: 100557, + 103034: 103034, + 103040: 103040, + 103035: 103035, + 103042: 103042, + 101755: 101755, + 103048: 103048, + 102085: 102085, + 103043: 103043, + 103039: 103039, + 103029: 103029, + 103050: 103050, + 103051: 103051, + 103052: 103052, + 103054: 103054, + 103055: 103055, + 103056: 103056, + 102890: 102890, + 100363: 100363, + 103059: 103059, + 103425: 103425, + 103021: 103021, + 103062: 103062, + 101797: 101797, + 103068: 103068, + 103071: 103071, + 103097: 103097, + 103072: 103072, + 103070: 103070, + 102270: 102270, + 103057: 103057, + 103074: 103074, + 103075: 103075, + 103077: 103077, + 103078: 103078, + 103079: 103079, + 103081: 103081, + 103083: 103083, + 103076: 103076, + 103084: 103084, + 103082: 103082, + 103086: 103086, + 103088: 103088, + 103087: 103087, + 103089: 103089, + 103085: 103085, + 103090: 103090, + 103093: 103093, + 103120: 103120, + 103092: 103092, + 103094: 103094, + 103095: 103095, + 103096: 103096, + 103098: 103098, + 103099: 103099, + 102772: 102772, + 103103: 103103, + 103102: 103102, + 103104: 103104, + 103106: 103106, + 103107: 103107, + 103110: 103110, + 103114: 103114, + 103112: 103112, + 103113: 103113, + 102357: 102357, + 101956: 101956, + 103115: 103115, + 103116: 103116, + 103117: 103117, + 103121: 103121, + 103122: 103122, + 103123: 103123, + 103186: 103186, + 103125: 103125, + 103127: 103127, + 103137: 103137, + 103126: 103126, + 103128: 103128, + 103129: 103129, + 103130: 103130, + 103131: 103131, + 103132: 103132, + 103133: 103133, + 103454: 103454, + 103135: 103135, + 103136: 103136, + 103181: 103181, + 102824: 102824, + 101028: 101028, + 103141: 103141, + 103142: 103142, + 103416: 103416, + 103144: 103144, + 103146: 103146, + 103147: 103147, + 103148: 103148, + 103149: 103149, + 103150: 103150, + 103151: 103151, + 103153: 103153, + 103154: 103154, + 103157: 103157, + 103158: 103158, + 103159: 103159, + 103145: 103145, + 103160: 103160, + 103166: 103166, + 103165: 103165, + 103162: 103162, + 103167: 103167, + 103164: 103164, + 103168: 103168, + 103169: 103169, + 103119: 103119, + 103170: 103170, + 103143: 103143, + 103171: 103171, + 103161: 103161, + 100726: 100726, + 101734: 101734, + 101058: 101058, + 102264: 102264, + 103172: 103172, + 103176: 103176, + 102172: 102172, + 103177: 103177, + 103178: 103178, + 103179: 103179, + 102960: 102960, + 103183: 103183, + 103184: 103184, + 103187: 103187, + 103190: 103190, + 103192: 103192, + 103193: 103193, + 103195: 103195, + 103197: 103197, + 103199: 103199, + 103201: 103201, + 103203: 103203, + 103204: 103204, + 103349: 103349, + 103361: 103361, + 103386: 103386, } db := dao.GetDB() userName := ctx.GetUserName() for _, v := range storeMap { var stores []*tJdStoreInfo - store, _ := dao.GetStoreDetailByVendorStoreID(db, utils.Int2Str(v), model.VendorIDJD) sql := ` SELECT t1.*, city.jd_code jd_city_code, district.jd_code jd_district_code, @@ -3616,7 +3590,7 @@ func UpdateJdStoreNameAll(ctx *jxcontext.Context) (err error) { WHERE t1.id = ? ORDER BY t2.updated_at ` - if err = dao.GetRows(db, &stores, sql, model.VendorIDJD, store.ID); err == nil { + if err = dao.GetRows(db, &stores, sql, model.VendorIDJD, v); err == nil { for _, store := range stores { a := jd.GetAPI(store.VendorOrgCode) storeParams := &jdapi.OpStoreParams{ From 3bb8aa34153e1731cf38ca329ee70311648a305b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 15:28:07 +0800 Subject: [PATCH 07/27] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BA=AC=E4=B8=9C?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E9=97=A8=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 801 ---------------------------------- 1 file changed, 801 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 88f27bd9a..04509d086 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -2763,815 +2763,14 @@ type tJdStoreInfo struct { func UpdateJdStoreNameAll(ctx *jxcontext.Context) (err error) { storeMap := map[int]int{ - 100002: 100002, - 103417: 103417, - 102108: 102108, - 100015: 100015, - 100022: 100022, - 100653: 100653, - 100024: 100024, - 100028: 100028, - 100032: 100032, - 100044: 100044, - 100046: 100046, - 101687: 101687, - 100056: 100056, - 100057: 100057, - 101110: 101110, - 100065: 100065, - 100067: 100067, - 102544: 102544, - 100077: 100077, - 100081: 100081, - 100082: 100082, - 100084: 100084, - 100087: 100087, - 100100: 100100, - 100106: 100106, - 100111: 100111, - 100113: 100113, - 100115: 100115, - 100116: 100116, - 100117: 100117, - 100118: 100118, - 102613: 102613, - 100120: 100120, - 100121: 100121, - 100123: 100123, - 100124: 100124, - 100126: 100126, - 103408: 103408, - 100129: 100129, - 100130: 100130, - 100881: 100881, - 100132: 100132, - 100133: 100133, - 100134: 100134, - 100135: 100135, - 101034: 101034, - 100140: 100140, - 100141: 100141, - 102391: 102391, - 103105: 103105, - 100145: 100145, - 100146: 100146, - 100150: 100150, - 102996: 102996, - 100152: 100152, - 100153: 100153, - 102180: 102180, - 100155: 100155, - 100156: 100156, - 100157: 100157, - 100162: 100162, - 102950: 102950, - 100165: 100165, - 101008: 101008, - 100167: 100167, - 100170: 100170, - 100175: 100175, - 100178: 100178, - 101772: 101772, - 100778: 100778, - 100184: 100184, - 100978: 100978, - 100190: 100190, - 100191: 100191, - 100192: 100192, - 100193: 100193, - 102670: 102670, - 103196: 103196, - 101032: 101032, - 100204: 100204, - 100205: 100205, - 103032: 103032, - 101736: 101736, - 103073: 103073, - 100212: 100212, - 100213: 100213, - 100215: 100215, - 100217: 100217, - 100218: 100218, - 102594: 102594, - 100221: 100221, - 101902: 101902, - 100224: 100224, - 100225: 100225, - 102963: 102963, - 100228: 100228, - 100229: 100229, - 100230: 100230, - 102587: 102587, - 101936: 101936, - 100266: 100266, - 100267: 100267, - 100268: 100268, - 100273: 100273, - 100274: 100274, - 100275: 100275, - 100276: 100276, - 100278: 100278, - 100279: 100279, - 100280: 100280, - 100282: 100282, - 100283: 100283, - 101682: 101682, - 102267: 102267, - 100943: 100943, - 103191: 103191, - 100290: 100290, - 100292: 100292, - 100296: 100296, - 100299: 100299, - 100945: 100945, - 100309: 100309, - 103065: 103065, - 100905: 100905, - 100946: 100946, - 100935: 100935, - 100324: 100324, - 100325: 100325, - 100326: 100326, - 100328: 100328, - 100329: 100329, - 100330: 100330, - 100766: 100766, - 100334: 100334, - 100335: 100335, - 100336: 100336, - 100341: 100341, 100345: 100345, 100347: 100347, - 100377: 100377, - 100381: 100381, - 100383: 100383, - 101743: 101743, - 100977: 100977, - 100409: 100409, - 100410: 100410, - 100433: 100433, - 100969: 100969, - 101099: 101099, - 100442: 100442, - 100444: 100444, - 101011: 101011, - 100449: 100449, - 100451: 100451, - 100463: 100463, - 101013: 101013, - 101012: 101012, - 100470: 100470, - 100471: 100471, - 100741: 100741, - 100871: 100871, - 100487: 100487, - 101870: 101870, - 100501: 100501, - 100503: 100503, - 102534: 102534, - 102562: 102562, - 100512: 100512, - 101050: 101050, - 100515: 100515, - 100517: 100517, - 102705: 102705, - 102278: 102278, - 100525: 100525, - 100529: 100529, - 100535: 100535, - 102181: 102181, - 100543: 100543, - 100546: 100546, - 100548: 100548, - 100549: 100549, - 100563: 100563, - 101828: 101828, - 101078: 101078, - 102671: 102671, - 100888: 100888, - 100743: 100743, - 101677: 101677, - 100600: 100600, - 100601: 100601, - 100606: 100606, - 101949: 101949, - 101948: 101948, - 100610: 100610, - 100642: 100642, - 101750: 101750, - 100658: 100658, - 102255: 102255, - 100937: 100937, - 100661: 100661, - 100664: 100664, - 100670: 100670, - 102090: 102090, - 100678: 100678, - 100681: 100681, - 100712: 100712, - 101732: 101732, - 100714: 100714, - 100853: 100853, - 100705: 100705, - 100744: 100744, - 100800: 100800, - 103101: 103101, - 100867: 100867, - 101960: 101960, - 101945: 101945, - 100746: 100746, - 100748: 100748, - 100396: 100396, - 101832: 101832, - 101725: 101725, - 101887: 101887, - 101831: 101831, - 102712: 102712, - 102815: 102815, - 100828: 100828, - 100829: 100829, - 101027: 101027, - 100848: 100848, - 100802: 100802, - 100849: 100849, 100852: 100852, - 100813: 100813, - 101909: 101909, - 100865: 100865, - 101031: 101031, - 101042: 101042, - 101043: 101043, - 102591: 102591, - 102047: 102047, - 100922: 100922, - 100920: 100920, - 102742: 102742, - 101825: 101825, - 100982: 100982, - 100989: 100989, - 100983: 100983, - 100984: 100984, - 100986: 100986, - 100987: 100987, - 100988: 100988, - 101134: 101134, - 101003: 101003, - 101061: 101061, - 101062: 101062, - 101036: 101036, - 101054: 101054, - 101111: 101111, - 101084: 101084, - 101096: 101096, - 103063: 103063, - 101840: 101840, 101689: 101689, - 101718: 101718, - 101719: 101719, - 100270: 100270, - 101721: 101721, - 101722: 101722, - 101735: 101735, - 101787: 101787, - 101729: 101729, - 101730: 101730, - 101780: 101780, - 103111: 103111, - 102867: 102867, - 101785: 101785, - 102578: 102578, - 101763: 101763, - 101996: 101996, - 101776: 101776, - 101775: 101775, - 102433: 102433, - 101838: 101838, - 101842: 101842, - 101861: 101861, - 101919: 101919, - 100884: 100884, - 101916: 101916, - 101918: 101918, - 101920: 101920, - 100858: 100858, - 101938: 101938, - 101966: 101966, - 101983: 101983, - 103033: 103033, - 101991: 101991, - 102001: 102001, - 102516: 102516, 102654: 102654, - 102058: 102058, - 102059: 102059, - 102071: 102071, - 102097: 102097, - 102035: 102035, - 102126: 102126, - 102112: 102112, - 101942: 101942, - 102136: 102136, - 102186: 102186, - 102160: 102160, - 102131: 102131, - 102147: 102147, - 103005: 103005, - 102198: 102198, - 102206: 102206, - 102167: 102167, - 102221: 102221, - 102235: 102235, - 102241: 102241, - 102244: 102244, - 102245: 102245, - 102262: 102262, - 102280: 102280, - 102293: 102293, - 102300: 102300, - 102297: 102297, - 102307: 102307, - 102320: 102320, - 102989: 102989, - 101986: 101986, - 102350: 102350, - 102089: 102089, - 102354: 102354, - 102365: 102365, - 102379: 102379, - 102533: 102533, 102381: 102381, - 101118: 101118, - 102405: 102405, - 100284: 100284, - 102411: 102411, - 102415: 102415, - 102416: 102416, - 102417: 102417, - 102424: 102424, - 102425: 102425, - 102426: 102426, - 102430: 102430, - 102436: 102436, - 102444: 102444, - 102600: 102600, - 102455: 102455, - 102456: 102456, - 102461: 102461, - 102463: 102463, - 102464: 102464, - 102479: 102479, - 102223: 102223, - 102481: 102481, - 102476: 102476, - 102482: 102482, - 102473: 102473, - 102480: 102480, - 102487: 102487, - 102353: 102353, - 102495: 102495, - 102496: 102496, - 102498: 102498, - 102973: 102973, - 102505: 102505, - 102233: 102233, - 102511: 102511, - 102519: 102519, - 102526: 102526, - 102528: 102528, 102500: 102500, - 102493: 102493, - 102531: 102531, - 102530: 102530, - 102488: 102488, - 102538: 102538, - 102539: 102539, - 103437: 103437, - 102545: 102545, - 102550: 102550, - 102551: 102551, - 102557: 102557, - 102563: 102563, - 102561: 102561, - 102558: 102558, - 102566: 102566, - 102572: 102572, - 102570: 102570, - 102011: 102011, - 102574: 102574, - 102576: 102576, - 102583: 102583, - 102595: 102595, - 102601: 102601, - 102987: 102987, - 102606: 102606, - 102609: 102609, - 102610: 102610, - 102614: 102614, - 103435: 103435, - 102617: 102617, - 102618: 102618, - 102607: 102607, - 102619: 102619, - 102605: 102605, - 102623: 102623, - 102599: 102599, - 102630: 102630, - 102638: 102638, - 102002: 102002, - 102640: 102640, - 102635: 102635, - 102629: 102629, - 102642: 102642, - 102637: 102637, - 102648: 102648, - 102626: 102626, - 102660: 102660, - 102661: 102661, - 102651: 102651, - 102662: 102662, - 103433: 103433, - 102669: 102669, - 102663: 102663, - 102666: 102666, - 102675: 102675, - 102676: 102676, - 100654: 100654, - 102679: 102679, - 103402: 103402, - 102685: 102685, - 102686: 102686, - 102689: 102689, - 102690: 102690, - 102692: 102692, - 102138: 102138, - 102699: 102699, - 102703: 102703, - 102704: 102704, - 102706: 102706, - 102708: 102708, - 102709: 102709, - 102596: 102596, - 102086: 102086, - 102711: 102711, - 102713: 102713, - 102714: 102714, - 102715: 102715, - 102720: 102720, - 102719: 102719, - 102718: 102718, - 102721: 102721, - 102731: 102731, - 102716: 102716, - 102878: 102878, - 102726: 102726, - 102724: 102724, - 102723: 102723, - 102736: 102736, - 102738: 102738, - 102739: 102739, - 102740: 102740, - 102741: 102741, - 102744: 102744, - 102747: 102747, - 102735: 102735, - 103174: 103174, - 102751: 102751, - 102749: 102749, - 102748: 102748, - 102752: 102752, - 102750: 102750, - 102763: 102763, - 102759: 102759, - 102757: 102757, - 102761: 102761, - 102762: 102762, - 102767: 102767, - 102769: 102769, - 102771: 102771, - 102775: 102775, - 102776: 102776, - 102777: 102777, - 102778: 102778, - 102756: 102756, - 102779: 102779, - 102780: 102780, - 102781: 102781, - 103414: 103414, - 102784: 102784, - 100068: 100068, - 103434: 103434, - 102789: 102789, - 102788: 102788, - 102743: 102743, - 102785: 102785, - 102791: 102791, - 102790: 102790, - 102793: 102793, - 102794: 102794, - 102795: 102795, - 102796: 102796, - 102804: 102804, - 102806: 102806, - 102808: 102808, 102810: 102810, - 102811: 102811, - 102813: 102813, - 103038: 103038, - 102817: 102817, - 102818: 102818, - 102819: 102819, - 102821: 102821, - 102822: 102822, - 102823: 102823, - 102825: 102825, - 102807: 102807, - 102826: 102826, - 102831: 102831, - 103007: 103007, - 102837: 102837, - 102839: 102839, - 102838: 102838, - 102841: 102841, - 102842: 102842, - 102847: 102847, - 102848: 102848, - 102850: 102850, - 102851: 102851, - 102852: 102852, - 102853: 102853, - 103429: 103429, - 102856: 102856, - 102377: 102377, - 102857: 102857, - 102858: 102858, - 102859: 102859, - 102860: 102860, - 102863: 102863, - 102864: 102864, - 102865: 102865, - 102876: 102876, - 102877: 102877, - 102880: 102880, - 103426: 103426, - 102888: 102888, - 102891: 102891, - 102892: 102892, - 102898: 102898, - 102899: 102899, - 102902: 102902, - 102903: 102903, - 102906: 102906, - 102907: 102907, - 102908: 102908, - 102910: 102910, - 102913: 102913, - 102915: 102915, - 102911: 102911, - 102901: 102901, - 102879: 102879, - 100524: 100524, - 102920: 102920, - 102921: 102921, - 102922: 102922, - 102923: 102923, - 101176: 101176, - 102924: 102924, - 102925: 102925, - 102926: 102926, - 102928: 102928, - 102929: 102929, - 102930: 102930, - 102932: 102932, - 102844: 102844, - 102933: 102933, - 102934: 102934, - 102988: 102988, - 102948: 102948, - 102935: 102935, - 102937: 102937, - 102938: 102938, - 102939: 102939, - 102941: 102941, - 102944: 102944, - 102945: 102945, - 102946: 102946, - 102882: 102882, - 102951: 102951, - 102952: 102952, - 102954: 102954, - 102955: 102955, - 102956: 102956, - 102962: 102962, - 102964: 102964, - 102966: 102966, - 102967: 102967, - 102968: 102968, - 102969: 102969, - 102970: 102970, - 102974: 102974, - 102975: 102975, - 102976: 102976, - 102977: 102977, - 102978: 102978, - 102979: 102979, - 102980: 102980, - 102981: 102981, - 102982: 102982, - 102984: 102984, - 100210: 100210, - 100344: 100344, - 102985: 102985, - 102992: 102992, - 102993: 102993, - 102995: 102995, - 102998: 102998, - 102999: 102999, - 103000: 103000, - 103001: 103001, - 103002: 103002, - 102887: 102887, - 102893: 102893, - 101666: 101666, - 103006: 103006, - 103008: 103008, - 103009: 103009, - 102918: 102918, - 102896: 102896, - 103011: 103011, - 102881: 102881, - 103013: 103013, - 103014: 103014, - 103015: 103015, - 103019: 103019, - 103018: 103018, - 103020: 103020, - 103022: 103022, - 102173: 102173, - 103023: 103023, - 103026: 103026, - 100699: 100699, - 100356: 100356, - 100477: 100477, - 100369: 100369, - 100351: 100351, - 100366: 100366, - 103027: 103027, - 100361: 100361, - 100350: 100350, - 103069: 103069, - 100476: 100476, - 100754: 100754, - 103028: 103028, - 103030: 103030, - 103031: 103031, - 102940: 102940, - 103037: 103037, - 103036: 103036, - 100557: 100557, - 103034: 103034, - 103040: 103040, - 103035: 103035, - 103042: 103042, - 101755: 101755, - 103048: 103048, - 102085: 102085, - 103043: 103043, - 103039: 103039, - 103029: 103029, - 103050: 103050, - 103051: 103051, - 103052: 103052, - 103054: 103054, - 103055: 103055, - 103056: 103056, - 102890: 102890, - 100363: 100363, - 103059: 103059, - 103425: 103425, - 103021: 103021, - 103062: 103062, - 101797: 101797, - 103068: 103068, - 103071: 103071, - 103097: 103097, - 103072: 103072, - 103070: 103070, - 102270: 102270, - 103057: 103057, - 103074: 103074, - 103075: 103075, - 103077: 103077, - 103078: 103078, - 103079: 103079, - 103081: 103081, - 103083: 103083, - 103076: 103076, - 103084: 103084, - 103082: 103082, - 103086: 103086, - 103088: 103088, - 103087: 103087, - 103089: 103089, - 103085: 103085, - 103090: 103090, - 103093: 103093, - 103120: 103120, - 103092: 103092, - 103094: 103094, - 103095: 103095, - 103096: 103096, - 103098: 103098, - 103099: 103099, - 102772: 102772, - 103103: 103103, - 103102: 103102, - 103104: 103104, - 103106: 103106, - 103107: 103107, - 103110: 103110, - 103114: 103114, - 103112: 103112, - 103113: 103113, - 102357: 102357, - 101956: 101956, - 103115: 103115, - 103116: 103116, - 103117: 103117, - 103121: 103121, - 103122: 103122, - 103123: 103123, - 103186: 103186, - 103125: 103125, - 103127: 103127, - 103137: 103137, - 103126: 103126, - 103128: 103128, - 103129: 103129, - 103130: 103130, - 103131: 103131, - 103132: 103132, - 103133: 103133, - 103454: 103454, - 103135: 103135, - 103136: 103136, - 103181: 103181, - 102824: 102824, - 101028: 101028, - 103141: 103141, - 103142: 103142, - 103416: 103416, - 103144: 103144, - 103146: 103146, - 103147: 103147, - 103148: 103148, - 103149: 103149, - 103150: 103150, - 103151: 103151, - 103153: 103153, - 103154: 103154, - 103157: 103157, - 103158: 103158, - 103159: 103159, - 103145: 103145, - 103160: 103160, - 103166: 103166, - 103165: 103165, - 103162: 103162, - 103167: 103167, - 103164: 103164, - 103168: 103168, - 103169: 103169, - 103119: 103119, - 103170: 103170, - 103143: 103143, - 103171: 103171, - 103161: 103161, - 100726: 100726, - 101734: 101734, - 101058: 101058, - 102264: 102264, - 103172: 103172, - 103176: 103176, - 102172: 102172, - 103177: 103177, - 103178: 103178, - 103179: 103179, - 102960: 102960, - 103183: 103183, - 103184: 103184, - 103187: 103187, - 103190: 103190, - 103192: 103192, - 103193: 103193, - 103195: 103195, - 103197: 103197, - 103199: 103199, - 103201: 103201, - 103203: 103203, - 103204: 103204, - 103349: 103349, - 103361: 103361, - 103386: 103386, } db := dao.GetDB() userName := ctx.GetUserName() From 94bce18432a0b5e499f617c4d830c23596574815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 16:08:44 +0800 Subject: [PATCH 08/27] =?UTF-8?q?=E9=A5=BF=E9=B2=9C=E8=BE=BE=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=90=8C=E6=AD=A5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 16 ++++++++----- business/jxstore/cms/sync_store_sku.go | 5 ++++ business/model/const.go | 5 ++++ business/model/sku.go | 5 ++-- business/partner/purchase/ebai/store_sku2.go | 24 ++++++++------------ 5 files changed, 33 insertions(+), 22 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 040557d08..e1921af72 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -132,9 +132,11 @@ func AddCategory(ctx *jxcontext.Context, cat *model.SkuCategory, userName string dao.Rollback(db) return nil, err } - if err = OnCreateThing(ctx, db, nil, int64(cat.ID), model.ThingTypeCategory); err != nil { - dao.Rollback(db) - return nil, err + if cat.IsExdSpec == model.NO { + if err = OnCreateThing(ctx, db, nil, int64(cat.ID), model.ThingTypeCategory); err != nil { + dao.Rollback(db) + return nil, err + } } dao.Commit(db) outCat = cat @@ -191,9 +193,11 @@ func UpdateCategory(ctx *jxcontext.Context, categoryID int, payload map[string]i dao.Rollback(db) return 0, err } - if err = OnUpdateThing(ctx, db, nil, int64(categoryID), model.ThingTypeCategory); err != nil { - dao.Rollback(db) - return 0, err + if cat.IsExdSpec == model.NO { + if err = OnUpdateThing(ctx, db, nil, int64(categoryID), model.ThingTypeCategory); err != nil { + dao.Rollback(db) + return 0, err + } } dao.Commit(db) diff --git a/business/jxstore/cms/sync_store_sku.go b/business/jxstore/cms/sync_store_sku.go index 7b7b8f82f..df46cea91 100644 --- a/business/jxstore/cms/sync_store_sku.go +++ b/business/jxstore/cms/sync_store_sku.go @@ -84,6 +84,11 @@ func SyncStoreCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo storeCatMap := &model.StoreSkuCategoryMap{} storeCatMap.ID = catInfo.MapID var failedList []*partner.StoreSkuInfoWithErr + if catInfo.IsExdSpec == model.YES { + if vendorID == model.VendorIDJD || vendorID == model.VendorIDMTWM { + return nil, err + } + } if model.IsSyncStatusDelete(catInfo.CatSyncStatus) { // 删除 if model.IsSyncStatusDelete(catInfo.CatSyncStatus) && !dao.IsVendorThingIDEmpty(catInfo.VendorCatID) { err = handler.DeleteStoreCategory(ctx, storeID, vendorStoreID, catInfo.VendorCatID, level) diff --git a/business/model/const.go b/business/model/const.go index b524bf37f..228d6eb79 100644 --- a/business/model/const.go +++ b/business/model/const.go @@ -395,6 +395,11 @@ const ( MaxVendorPricePercentage = 400 ) +const ( + YES = 1 //通用 + NO = 0 +) + func IsPurchaseVendorExist(vendorID int) bool { _, ok := VendorNames[vendorID] return ok && vendorID >= VendorIDPurchaseBegin && vendorID <= VendorIDPurchaseEnd diff --git a/business/model/sku.go b/business/model/sku.go index aeadb11d8..d323a9a38 100644 --- a/business/model/sku.go +++ b/business/model/sku.go @@ -151,8 +151,9 @@ type SkuCategory struct { Status int8 `orm:"default(1)" json:"status"` //分类状态,0表示禁用,1表示启用 Img string `orm:"size(512)" json:"img"` //分类图片 - ExdName string `json:"exdName"` //饿鲜达对应分类名 - ExdSeq int `json:"exdSeq"` + ExdName string `json:"exdName"` //饿鲜达对应分类名 + ExdSeq int `json:"exdSeq"` + IsExdSpec int `json:"isExdSpec"` //是否是饿鲜达特有新建的分类 // JdID int64 `orm:"column(jd_id);index" json:"jdID"` // 这个是指商家自己的商品类别在京东平台上的ID // JdSyncStatus int8 `orm:"default(2)" json:"jdSyncStatus"` } diff --git a/business/partner/purchase/ebai/store_sku2.go b/business/partner/purchase/ebai/store_sku2.go index dadf35cea..11645dbc5 100644 --- a/business/partner/purchase/ebai/store_sku2.go +++ b/business/partner/purchase/ebai/store_sku2.go @@ -24,8 +24,9 @@ const ( var ( sensitiveWordRegexp = regexp.MustCompile(`商品名称中含有敏感词(\[.*\])`) - categoryCheck = map[string]string{ - "赠品专区": "赠品专区", + categoryCheck = map[int]string{ + 175: "赠品专区", + 18: "烧烤吧台", } ) @@ -80,10 +81,9 @@ func getCheckExdStoreNameAndSeq(storeID int, storeCat *dao.SkuStoreCatInfo) (nam return storeCat.Name, storeCat.Seq, false } if strings.Contains(store.Name, model.ExdStoreName) { - if categoryCheck[storeCat.ExdName] != "" { + if categoryCheck[storeCat.ID] != "" { return storeCat.ExdName, storeCat.ExdSeq, true } - return storeCat.ExdName, storeCat.ExdSeq, false } else { return storeCat.Name, storeCat.Seq, false } @@ -93,11 +93,9 @@ func getCheckExdStoreNameAndSeq(storeID int, storeCat *dao.SkuStoreCatInfo) (nam func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) { var vendorCatID int64 if globals.EnableEbaiStoreWrite { - catName, catSeq, _ := getCheckExdStoreNameAndSeq(storeID, storeCat) - // if isCheck { - // return nil - // } - vendorCatID, err = api.EbaiAPI.ShopCategoryCreate(utils.Int2Str(storeID), utils.Str2Int64WithDefault(storeCat.ParentVendorCatID, 0), formatCatName(catName), jxCatSeq2Ebai(catSeq)) + if catName, catSeq, isCheck := getCheckExdStoreNameAndSeq(storeID, storeCat); !isCheck { + vendorCatID, err = api.EbaiAPI.ShopCategoryCreate(utils.Int2Str(storeID), utils.Str2Int64WithDefault(storeCat.ParentVendorCatID, 0), formatCatName(catName), jxCatSeq2Ebai(catSeq)) + } } else { vendorCatID = jxutils.GenFakeID() } @@ -107,11 +105,9 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID in func (p *PurchaseHandler) UpdateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) { if globals.EnableEbaiStoreWrite { - catName, catSeq, _ := getCheckExdStoreNameAndSeq(storeID, storeCat) - // if isCheck { - // return nil - // } - err = api.EbaiAPI.ShopCategoryUpdate(utils.Int2Str(storeID), utils.Str2Int64WithDefault(storeCat.VendorCatID, 0), formatCatName(catName), jxCatSeq2Ebai(catSeq)) + if catName, catSeq, isCheck := getCheckExdStoreNameAndSeq(storeID, storeCat); !isCheck { + err = api.EbaiAPI.ShopCategoryUpdate(utils.Int2Str(storeID), utils.Str2Int64WithDefault(storeCat.VendorCatID, 0), formatCatName(catName), jxCatSeq2Ebai(catSeq)) + } // todo, 饿百将一个分类重复改名,也会报分类名重复错,特殊处理一下,不过因为GetStoreCategory其实会拉取所有的门店分类,是比较耗时的操作 if utils.IsErrMatch(err, "1", []string{"分类名称已经存在"}) { if cat, err2 := p.GetStoreCategory(ctx, storeID, vendorStoreID, storeCat.Name); err2 == nil { From 2d5ae8ea0110117141b7bedba541fccdc57450a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 16:19:46 +0800 Subject: [PATCH 09/27] =?UTF-8?q?=E6=AF=8F=E6=97=A5=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=89=93=E6=AC=BE=E6=8F=92=E5=85=A5=E6=97=A5=E5=BF=97=E8=A1=A8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/event/event.go | 12 ++++++++---- business/partner/purchase/jx/localjx/order.go | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/business/jxstore/event/event.go b/business/jxstore/event/event.go index a9a682e93..1d464bc75 100644 --- a/business/jxstore/event/event.go +++ b/business/jxstore/event/event.go @@ -31,7 +31,7 @@ type CheckCookie struct { Status string `json:"status"` } -func AddOperateEvent(ctx *jxcontext.Context, accessUUID, jsonData string, errCode, errMsg string, useTime int) (err error) { +func AddOperateEvent(ctx *jxcontext.Context, accessUUID, jsonData string, errCode, errMsg string, useTime int, apiFunctionSpec string) (err error) { var ( apiFunction string db = dao.GetDB() @@ -39,9 +39,13 @@ func AddOperateEvent(ctx *jxcontext.Context, accessUUID, jsonData string, errCod if ctx.GetRequest() == nil { return nil } - url := ctx.GetRequest().URL.Path - if url != "" { - apiFunction = url[strings.LastIndex(url, "/")+1 : len(url)] + if apiFunctionSpec != "" { + url := ctx.GetRequest().URL.Path + if url != "" { + apiFunction = url[strings.LastIndex(url, "/")+1 : len(url)] + } + } else { + apiFunction = apiFunctionSpec } if apiFunction != "" { if apiFunction[0:3] == "Get" || NoUseEventMap[apiFunction] != "" { diff --git a/business/partner/purchase/jx/localjx/order.go b/business/partner/purchase/jx/localjx/order.go index fe2b6aa06..0bb68ed63 100644 --- a/business/partner/purchase/jx/localjx/order.go +++ b/business/partner/purchase/jx/localjx/order.go @@ -762,7 +762,7 @@ func AutoPayForPopluarMan(ctx *jxcontext.Context) (err error) { } else { errCode = model.ErrCodeSuccess } - err = event.AddOperateEvent(ctx, ctx.GetTrackInfo(), cms.BuildDiffData(mapResult), errCode, errMsg, 0) + err = event.AddOperateEvent(ctx, ctx.GetTrackInfo(), cms.BuildDiffData(mapResult), errCode, errMsg, 0, "AutoPayForPopluarMan") return err } From ec37c684485a6aa4c965109afe42d925783dbe06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 17:20:21 +0800 Subject: [PATCH 10/27] =?UTF-8?q?=E9=A5=BF=E9=B2=9C=E8=BE=BE=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/ebai/store_sku2.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/business/partner/purchase/ebai/store_sku2.go b/business/partner/purchase/ebai/store_sku2.go index 11645dbc5..29ad99a2a 100644 --- a/business/partner/purchase/ebai/store_sku2.go +++ b/business/partner/purchase/ebai/store_sku2.go @@ -83,6 +83,8 @@ func getCheckExdStoreNameAndSeq(storeID int, storeCat *dao.SkuStoreCatInfo) (nam if strings.Contains(store.Name, model.ExdStoreName) { if categoryCheck[storeCat.ID] != "" { return storeCat.ExdName, storeCat.ExdSeq, true + } else { + return storeCat.Name, storeCat.Seq, false } } else { return storeCat.Name, storeCat.Seq, false From ab2bd67d8a3a0520ee0b65b0f5609d47a8b191c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 18:23:54 +0800 Subject: [PATCH 11/27] =?UTF-8?q?=E5=88=86=E7=B1=BB=E9=87=8D=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index e1921af72..426083661 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -289,23 +289,27 @@ func ReorderCategories(ctx *jxcontext.Context, parentID int, categoryIDs []int, catsMap[v].Seq = k } catsMap[v].LastOperator = ctx.GetUserName() + globals.SugarLogger.Debugf("ReorderCategories2", err) if _, err = dao.UpdateEntity(db, catsMap[v]); err != nil { dao.Rollback(db) return err } + globals.SugarLogger.Debugf("ReorderCategories3", err) if err = OnUpdateThing(ctx, db, nil, int64(catsMap[v].ID), model.ThingTypeCategory); err != nil { dao.Rollback(db) return err } } dao.Commit(db) - + globals.SugarLogger.Debugf("ReorderCategories4", err) SetStoreCategorySyncStatus2(db, nil, categoryIDs, model.SyncFlagModifiedMask) if err == nil { + globals.SugarLogger.Debugf("ReorderCategories5", err) _, err = CurVendorSync.SyncReorderCategories(ctx, db, parentID, false, userName) CurVendorSync.SyncStoresCategory(ctx, db, nil, nil, false, true, true) } } + globals.SugarLogger.Debugf("ReorderCategories1", err) return err } From ec36c922b44721d9f52458fa8770b7a50e5ddb57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 18:28:19 +0800 Subject: [PATCH 12/27] =?UTF-8?q?=E5=88=86=E7=B1=BB=E9=87=8D=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 10 +++++----- conf/app.conf | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 426083661..98d37cd92 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -289,27 +289,27 @@ func ReorderCategories(ctx *jxcontext.Context, parentID int, categoryIDs []int, catsMap[v].Seq = k } catsMap[v].LastOperator = ctx.GetUserName() - globals.SugarLogger.Debugf("ReorderCategories2", err) + globals.SugarLogger.Debugf("ReorderCategories2,[%v]", err) if _, err = dao.UpdateEntity(db, catsMap[v]); err != nil { dao.Rollback(db) return err } - globals.SugarLogger.Debugf("ReorderCategories3", err) + globals.SugarLogger.Debugf("ReorderCategories3,[%v]", err) if err = OnUpdateThing(ctx, db, nil, int64(catsMap[v].ID), model.ThingTypeCategory); err != nil { dao.Rollback(db) return err } } dao.Commit(db) - globals.SugarLogger.Debugf("ReorderCategories4", err) + globals.SugarLogger.Debugf("ReorderCategories4,[%v]", err) SetStoreCategorySyncStatus2(db, nil, categoryIDs, model.SyncFlagModifiedMask) if err == nil { - globals.SugarLogger.Debugf("ReorderCategories5", err) + globals.SugarLogger.Debugf("ReorderCategories5,[%v]", err) _, err = CurVendorSync.SyncReorderCategories(ctx, db, parentID, false, userName) CurVendorSync.SyncStoresCategory(ctx, db, nil, nil, false, true, true) } } - globals.SugarLogger.Debugf("ReorderCategories1", err) + globals.SugarLogger.Debugf("ReorderCategories1,[%v]", err) return err } diff --git a/conf/app.conf b/conf/app.conf index c13fec8c5..331373c0c 100644 --- a/conf/app.conf +++ b/conf/app.conf @@ -1,6 +1,6 @@ appname = jx-callback httpport = 8080 -runmode = dev +runmode = alpha autorender = false copyrequestbody = true EnableDocs = true From e6c53518ff2c7e9e6be7d5c76e78017ede390bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 18:32:22 +0800 Subject: [PATCH 13/27] =?UTF-8?q?=E5=88=86=E7=B1=BB=E9=87=8D=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 98d37cd92..9c3671788 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -289,13 +289,13 @@ func ReorderCategories(ctx *jxcontext.Context, parentID int, categoryIDs []int, catsMap[v].Seq = k } catsMap[v].LastOperator = ctx.GetUserName() - globals.SugarLogger.Debugf("ReorderCategories2,[%v]", err) if _, err = dao.UpdateEntity(db, catsMap[v]); err != nil { + globals.SugarLogger.Debugf("ReorderCategories2,[%v]", err) dao.Rollback(db) return err } - globals.SugarLogger.Debugf("ReorderCategories3,[%v]", err) if err = OnUpdateThing(ctx, db, nil, int64(catsMap[v].ID), model.ThingTypeCategory); err != nil { + globals.SugarLogger.Debugf("ReorderCategories3,[%v]", err) dao.Rollback(db) return err } @@ -309,7 +309,6 @@ func ReorderCategories(ctx *jxcontext.Context, parentID int, categoryIDs []int, CurVendorSync.SyncStoresCategory(ctx, db, nil, nil, false, true, true) } } - globals.SugarLogger.Debugf("ReorderCategories1,[%v]", err) return err } From eb096742fa54668853c3c6f86ed2cf859032d5d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 18:37:33 +0800 Subject: [PATCH 14/27] =?UTF-8?q?=E5=88=86=E7=B1=BB=E9=87=8D=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 4 +--- business/jxstore/cms/sync2.go | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 9c3671788..5a7cb56ef 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -295,16 +295,14 @@ func ReorderCategories(ctx *jxcontext.Context, parentID int, categoryIDs []int, return err } if err = OnUpdateThing(ctx, db, nil, int64(catsMap[v].ID), model.ThingTypeCategory); err != nil { - globals.SugarLogger.Debugf("ReorderCategories3,[%v]", err) + globals.SugarLogger.Debugf("ReorderCategories3,[%v],[%v]", err, catsMap[v].ID) dao.Rollback(db) return err } } dao.Commit(db) - globals.SugarLogger.Debugf("ReorderCategories4,[%v]", err) SetStoreCategorySyncStatus2(db, nil, categoryIDs, model.SyncFlagModifiedMask) if err == nil { - globals.SugarLogger.Debugf("ReorderCategories5,[%v]", err) _, err = CurVendorSync.SyncReorderCategories(ctx, db, parentID, false, userName) CurVendorSync.SyncStoresCategory(ctx, db, nil, nil, false, true, true) } diff --git a/business/jxstore/cms/sync2.go b/business/jxstore/cms/sync2.go index d1ab19f03..c53df60af 100644 --- a/business/jxstore/cms/sync2.go +++ b/business/jxstore/cms/sync2.go @@ -285,6 +285,7 @@ func onUpdateThing(ctx *jxcontext.Context, db *dao.DaoDB, vendorInfoList []*Mult updateThingMapEntity(db, thingMap) } else { + globals.SugarLogger.Debugf("ReorderCategories4,[%v]", err) errList.AddErr(err2) } } From 649d4d78e43e81e97ce25bc497bbd3226a9eb808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 18 Feb 2020 08:41:31 +0800 Subject: [PATCH 15/27] =?UTF-8?q?=E5=88=86=E7=B1=BB=E9=87=8D=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E6=8E=92=E9=99=A4=E9=A5=BF=E9=B2=9C=E8=BE=BE=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E6=89=BEthingmap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 10 +++++----- business/jxstore/cms/sync2.go | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 5a7cb56ef..59b7f55f9 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -290,14 +290,14 @@ func ReorderCategories(ctx *jxcontext.Context, parentID int, categoryIDs []int, } catsMap[v].LastOperator = ctx.GetUserName() if _, err = dao.UpdateEntity(db, catsMap[v]); err != nil { - globals.SugarLogger.Debugf("ReorderCategories2,[%v]", err) dao.Rollback(db) return err } - if err = OnUpdateThing(ctx, db, nil, int64(catsMap[v].ID), model.ThingTypeCategory); err != nil { - globals.SugarLogger.Debugf("ReorderCategories3,[%v],[%v]", err, catsMap[v].ID) - dao.Rollback(db) - return err + if catsMap[v].IsExdSpec == model.NO { + if err = OnUpdateThing(ctx, db, nil, int64(catsMap[v].ID), model.ThingTypeCategory); err != nil { + dao.Rollback(db) + return err + } } } dao.Commit(db) diff --git a/business/jxstore/cms/sync2.go b/business/jxstore/cms/sync2.go index c53df60af..d1ab19f03 100644 --- a/business/jxstore/cms/sync2.go +++ b/business/jxstore/cms/sync2.go @@ -285,7 +285,6 @@ func onUpdateThing(ctx *jxcontext.Context, db *dao.DaoDB, vendorInfoList []*Mult updateThingMapEntity(db, thingMap) } else { - globals.SugarLogger.Debugf("ReorderCategories4,[%v]", err) errList.AddErr(err2) } } From fa28f3b30c252d70f46c21b4e9d3290474dea8b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 18 Feb 2020 10:57:48 +0800 Subject: [PATCH 16/27] =?UTF-8?q?=E9=A5=BF=E9=B2=9C=E8=BE=BE=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=95=86=E5=93=81=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E5=92=8C=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 31 +++++++++++++------- business/jxstore/cms/store_sku.go | 4 +-- business/model/dao/sku.go | 3 +- business/partner/purchase/ebai/store_sku2.go | 2 +- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 59b7f55f9..d975ee376 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -427,6 +427,8 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku bool, params ma } else { sql += " AND t2.exd_sku_id = ''" } + } else { + sql += " AND t2.exd_sku_id = ''" } if params["categoryID"] != nil { cat := &model.SkuCategory{} @@ -1521,22 +1523,29 @@ func CopyEbaiSkuPriceToJx(ctx *jxcontext.Context) (err error) { db := dao.GetDB() skuList, err := api.EbaiAPI.PageGetSkuList(32267350915) for _, v := range skuList { - price := int(utils.Float64TwoInt64(v["sale_price"].(float64) * 100)) - var skuNameList []*model.SkuName + sku, _ := api.EbaiAPI.PageGetSku(32267350915, utils.Str2Int64(v["sku_id"].(string))) + var skuName model.SkuName + sql2 := ` + SELECT * FROM sku_category WHERE exd_name like ? + ` + sqlParams2 := []interface{}{ + "%" + sku.CustomCatName + "%", + } + dao.GetRow(db, &skuName, sql2, sqlParams2) + price := int(utils.Float64TwoInt64(utils.Interface2Float64WithDefault(v["sale_price"], 0) * 100)) sql := ` - SELECT * - FROM sku_name - WHERE upc = ? - AND exd_sku_id <> '' + UPDATE sku_name a + JOIN sku b ON a.id = b.name_id + SET a.price = ?,a.category_id = ? + WHERE a.upc = ? + AND b.exd_sku_id = ? ` sqlParams := []interface{}{ + price, skuName.ID, v["upc"].(string), + v["sku_id"].(string), } - err = dao.GetRows(db, &skuNameList, sql, sqlParams...) - for _, vv := range skuNameList { - vv.Price = price - dao.UpdateEntity(db, vv, "Price") - } + dao.ExecuteSQL(db, sql, sqlParams) } return err } diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 41c5c1bb3..06e30d233 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -1041,8 +1041,8 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs // globals.SugarLogger.Debug(utils.Format4Output(inSkuBind, false)) var skuBind *model.StoreSkuBind if v.ID == 0 { - if v.ExdSkuID == "" { - // if !(strings.Contains(v.StoreName, model.ExdStoreName) && v.ExdSkuID == "") { + // if v.ExdSkuID == "" { + if (strings.Contains(v.StoreName, model.ExdStoreName) && v.ExdSkuID != "") || (!strings.Contains(v.StoreName, model.ExdStoreName) && v.ExdSkuID == "") { if skuBindInfo.IsFocus == 1 && v.SkuNameStatus == model.SkuStatusNormal && v.SkuStatus == model.SkuStatusNormal && isCanChangePrice { skuBind = &model.StoreSkuBind{ StoreID: storeID, diff --git a/business/model/dao/sku.go b/business/model/dao/sku.go index 35c2bf9a5..c9a970c72 100644 --- a/business/model/dao/sku.go +++ b/business/model/dao/sku.go @@ -70,7 +70,8 @@ func GetCategories(db *DaoDB, parentID, level int, catIDs []int, isExd bool) (ca if isExd { sql += " ORDER BY t1.level, t1.exd_seq" } else { - sql += " ORDER BY t1.level, t1.seq" + sql += ` AND t1.is_exd_spec = 0 + ORDER BY t1.level, t1.seq` } return cats, GetRows(db, &cats, sql, params) } diff --git a/business/partner/purchase/ebai/store_sku2.go b/business/partner/purchase/ebai/store_sku2.go index 29ad99a2a..f944995ac 100644 --- a/business/partner/purchase/ebai/store_sku2.go +++ b/business/partner/purchase/ebai/store_sku2.go @@ -84,7 +84,7 @@ func getCheckExdStoreNameAndSeq(storeID int, storeCat *dao.SkuStoreCatInfo) (nam if categoryCheck[storeCat.ID] != "" { return storeCat.ExdName, storeCat.ExdSeq, true } else { - return storeCat.Name, storeCat.Seq, false + return storeCat.ExdName, storeCat.ExdSeq, false } } else { return storeCat.Name, storeCat.Seq, false From bbc03c7ba0dc346c689563c67aaf05246b374d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 18 Feb 2020 11:12:12 +0800 Subject: [PATCH 17/27] =?UTF-8?q?=E9=A5=BF=E9=B2=9C=E8=BE=BE=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=95=86=E5=93=81=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E5=92=8C=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index d975ee376..a62a7b919 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -1538,12 +1538,10 @@ func CopyEbaiSkuPriceToJx(ctx *jxcontext.Context) (err error) { JOIN sku b ON a.id = b.name_id SET a.price = ?,a.category_id = ? WHERE a.upc = ? - AND b.exd_sku_id = ? ` sqlParams := []interface{}{ price, skuName.ID, v["upc"].(string), - v["sku_id"].(string), } dao.ExecuteSQL(db, sql, sqlParams) } From 805d0002c45b266fa66901c45b8fcf2ac9de808e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 18 Feb 2020 11:36:11 +0800 Subject: [PATCH 18/27] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E9=A5=BF=E9=B2=9C?= =?UTF-8?q?=E8=BE=BE=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB=E5=92=8C=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E5=88=B0=E4=BA=AC=E8=A5=BF=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=95=86=E5=AE=B6id=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 6 +++--- controllers/cms_sku.go | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index a62a7b919..749ca3ae0 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -1519,11 +1519,11 @@ func SumExianDaDepot(ctx *jxcontext.Context) (err error) { return err } -func CopyEbaiSkuPriceToJx(ctx *jxcontext.Context) (err error) { +func CopyEbaiSkuPriceToJx(ctx *jxcontext.Context, baiduShopID int64) (err error) { db := dao.GetDB() - skuList, err := api.EbaiAPI.PageGetSkuList(32267350915) + skuList, err := api.EbaiAPI.PageGetSkuList(baiduShopID) for _, v := range skuList { - sku, _ := api.EbaiAPI.PageGetSku(32267350915, utils.Str2Int64(v["sku_id"].(string))) + sku, _ := api.EbaiAPI.PageGetSku(baiduShopID, utils.Str2Int64(v["sku_id"].(string))) var skuName model.SkuName sql2 := ` SELECT * FROM sku_category WHERE exd_name like ? diff --git a/controllers/cms_sku.go b/controllers/cms_sku.go index 339ea9933..5522d6ec9 100644 --- a/controllers/cms_sku.go +++ b/controllers/cms_sku.go @@ -434,13 +434,14 @@ func (c *SkuController) SumExianDaDepot() { // @Title 复制一个饿百的店的商品的价格到京西饿鲜达商品 // @Description 复制一个饿百的店的商品的价格到京西饿鲜达商品 -// @Param token header string true "认证token" +// @Param token header string true "认证token" +// @Param baiduShopID formdata int true "饿百店ID" // @Success 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult // @router /CopyEbaiSkuPriceToJx [put] func (c *SkuController) CopyEbaiSkuPriceToJx() { c.callCopyEbaiSkuPriceToJx(func(params *tSkuCopyEbaiSkuPriceToJxParams) (retVal interface{}, errCode string, err error) { - err = cms.CopyEbaiSkuPriceToJx(params.Ctx) + err = cms.CopyEbaiSkuPriceToJx(params.Ctx, params.BaiduShopID) return retVal, "", err }) } From 9706b9cdfc41473e9b48cfa7ce812e56271921e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 18 Feb 2020 11:37:33 +0800 Subject: [PATCH 19/27] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E9=A5=BF=E9=B2=9C?= =?UTF-8?q?=E8=BE=BE=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB=E5=92=8C=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E5=88=B0=E4=BA=AC=E8=A5=BF=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=95=86=E5=AE=B6id=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 749ca3ae0..3cddc5489 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -1519,11 +1519,11 @@ func SumExianDaDepot(ctx *jxcontext.Context) (err error) { return err } -func CopyEbaiSkuPriceToJx(ctx *jxcontext.Context, baiduShopID int64) (err error) { +func CopyEbaiSkuPriceToJx(ctx *jxcontext.Context, baiduShopID int) (err error) { db := dao.GetDB() - skuList, err := api.EbaiAPI.PageGetSkuList(baiduShopID) + skuList, err := api.EbaiAPI.PageGetSkuList(int64(baiduShopID)) for _, v := range skuList { - sku, _ := api.EbaiAPI.PageGetSku(baiduShopID, utils.Str2Int64(v["sku_id"].(string))) + sku, _ := api.EbaiAPI.PageGetSku(int64(baiduShopID), utils.Str2Int64(v["sku_id"].(string))) var skuName model.SkuName sql2 := ` SELECT * FROM sku_category WHERE exd_name like ? From a0da1be50552473e63d18d0abe97259ce2e92a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 18 Feb 2020 11:48:33 +0800 Subject: [PATCH 20/27] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E9=A5=BF=E9=B2=9C?= =?UTF-8?q?=E8=BE=BE=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB=E5=92=8C=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E5=88=B0=E4=BA=AC=E8=A5=BF=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=95=86=E5=AE=B6id=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 6 +++--- controllers/cms_sku.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 3cddc5489..5dd45ea78 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -1519,11 +1519,11 @@ func SumExianDaDepot(ctx *jxcontext.Context) (err error) { return err } -func CopyEbaiSkuPriceToJx(ctx *jxcontext.Context, baiduShopID int) (err error) { +func CopyEbaiSkuPriceToJx(ctx *jxcontext.Context, baiduShopID string) (err error) { db := dao.GetDB() - skuList, err := api.EbaiAPI.PageGetSkuList(int64(baiduShopID)) + skuList, err := api.EbaiAPI.PageGetSkuList(utils.Str2Int64(baiduShopID)) for _, v := range skuList { - sku, _ := api.EbaiAPI.PageGetSku(int64(baiduShopID), utils.Str2Int64(v["sku_id"].(string))) + sku, _ := api.EbaiAPI.PageGetSku(utils.Str2Int64(baiduShopID), utils.Str2Int64(v["sku_id"].(string))) var skuName model.SkuName sql2 := ` SELECT * FROM sku_category WHERE exd_name like ? diff --git a/controllers/cms_sku.go b/controllers/cms_sku.go index 5522d6ec9..a2ae6899e 100644 --- a/controllers/cms_sku.go +++ b/controllers/cms_sku.go @@ -435,7 +435,7 @@ func (c *SkuController) SumExianDaDepot() { // @Title 复制一个饿百的店的商品的价格到京西饿鲜达商品 // @Description 复制一个饿百的店的商品的价格到京西饿鲜达商品 // @Param token header string true "认证token" -// @Param baiduShopID formdata int true "饿百店ID" +// @Param baiduShopID formdata string true "饿百店ID" // @Success 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult // @router /CopyEbaiSkuPriceToJx [put] From 6798752925001463efcb38c75777ceef52616021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 18 Feb 2020 11:55:36 +0800 Subject: [PATCH 21/27] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E9=A5=BF=E9=B2=9C?= =?UTF-8?q?=E8=BE=BE=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB=E5=92=8C=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E5=88=B0=E4=BA=AC=E8=A5=BF=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=95=86=E5=AE=B6id=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/cms_sku.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/cms_sku.go b/controllers/cms_sku.go index a2ae6899e..9908ede6f 100644 --- a/controllers/cms_sku.go +++ b/controllers/cms_sku.go @@ -438,7 +438,7 @@ func (c *SkuController) SumExianDaDepot() { // @Param baiduShopID formdata string true "饿百店ID" // @Success 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult -// @router /CopyEbaiSkuPriceToJx [put] +// @router /CopyEbaiSkuPriceToJx [post] func (c *SkuController) CopyEbaiSkuPriceToJx() { c.callCopyEbaiSkuPriceToJx(func(params *tSkuCopyEbaiSkuPriceToJxParams) (retVal interface{}, errCode string, err error) { err = cms.CopyEbaiSkuPriceToJx(params.Ctx, params.BaiduShopID) From 34c8dc31c5a8aed34fd64024c79aed45db3b1e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 18 Feb 2020 14:18:33 +0800 Subject: [PATCH 22/27] =?UTF-8?q?=E7=BE=8E=E5=9B=A2=E9=A5=BF=E7=99=BE?= =?UTF-8?q?=E8=B4=9F=E8=B4=A3=E4=BA=BA=E6=90=9E=E5=8F=8D=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/scheduler/defsch/defsch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/business/jxcallback/scheduler/defsch/defsch.go b/business/jxcallback/scheduler/defsch/defsch.go index 1554e5e2c..bacf1f200 100644 --- a/business/jxcallback/scheduler/defsch/defsch.go +++ b/business/jxcallback/scheduler/defsch/defsch.go @@ -1454,10 +1454,10 @@ func getOrderOperatorInfo(order *model.GoodsOrder, storeDetail *dao.StoreDetail) case model.VendorIDJD: operatorPhone = storeDetail.OperatorPhone operatorName = storeDetail.OperatorName - case model.VendorIDEBAI: + case model.VendorIDMTWM: operatorPhone = storeDetail.OperatorPhone2 operatorName = storeDetail.OperatorName2 - case model.VendorIDMTWM: + case model.VendorIDEBAI: operatorPhone = storeDetail.OperatorPhone3 operatorName = storeDetail.OperatorName3 } From 46e02d3fec5da29dcabcada7eb59a32f06bba366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 18 Feb 2020 14:27:51 +0800 Subject: [PATCH 23/27] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E9=A5=BF=E7=99=BE?= =?UTF-8?q?=E4=B8=8A=E7=9A=84=E9=97=A8=E5=BA=97=E5=95=86=E5=93=81=E5=88=B0?= =?UTF-8?q?=E4=BA=AC=E8=A5=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 26 ++++++++++++++++++++++++++ controllers/cms_sku.go | 19 +++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 5dd45ea78..e255f9ab3 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -1547,3 +1547,29 @@ func CopyEbaiSkuPriceToJx(ctx *jxcontext.Context, baiduShopID string) (err error } return err } + +func CopyEbaiStoreSkusToJx(ctx *jxcontext.Context, baiduShopID string, storeID int) (err error) { + db := dao.GetDB() + var storeSkuBindInfo []*StoreSkuBindInfo + skuList, err := api.EbaiAPI.PageGetSkuList(utils.Str2Int64(baiduShopID)) + for _, v := range skuList { + var skuName model.SkuName + sql2 := ` + SELECT * FROM sku_name WHERE upc = ? + ` + sqlParams2 := []interface{}{ + v["upc"].(string), + } + dao.GetRow(db, &skuName, sql2, sqlParams2) + skuBindInfo := &StoreSkuBindInfo{ + StoreID: storeID, + NameID: skuName.ID, + UnitPrice: skuName.Price, + IsFocus: 1, + IsSale: 1, + } + storeSkuBindInfo = append(storeSkuBindInfo, skuBindInfo) + } + UpdateStoresSkusByBind(ctx, nil, storeSkuBindInfo, true, true) + return err +} diff --git a/controllers/cms_sku.go b/controllers/cms_sku.go index 9908ede6f..eeba4f5c5 100644 --- a/controllers/cms_sku.go +++ b/controllers/cms_sku.go @@ -432,8 +432,8 @@ func (c *SkuController) SumExianDaDepot() { }) } -// @Title 复制一个饿百的店的商品的价格到京西饿鲜达商品 -// @Description 复制一个饿百的店的商品的价格到京西饿鲜达商品 +// @Title 复制一个饿百的店的商品的价格和分类到京西饿鲜达商品 +// @Description 复制一个饿百的店的商品的价格和分类到京西饿鲜达商品 // @Param token header string true "认证token" // @Param baiduShopID formdata string true "饿百店ID" // @Success 200 {object} controllers.CallResult @@ -445,3 +445,18 @@ func (c *SkuController) CopyEbaiSkuPriceToJx() { return retVal, "", err }) } + +// @Title 复制饿鲜达的门店商品到京西对应门店 +// @Description 复制饿鲜达的门店商品到京西对应门店 +// @Param token header string true "认证token" +// @Param baiduShopID formdata string true "饿百店ID" +// @Param storeID formdata int true "门店ID" +// @Success 200 {object} controllers.CallResult +// @Failure 200 {object} controllers.CallResult +// @router /CopyEbaiStoreSkusToJx [post] +func (c *SkuController) CopyEbaiStoreSkusToJx() { + c.callCopyEbaiStoreSkusToJx(func(params *tSkuCopyEbaiStoreSkusToJxParams) (retVal interface{}, errCode string, err error) { + err = cms.CopyEbaiStoreSkusToJx(params.Ctx, params.BaiduShopID, params.StoreID) + return retVal, "", err + }) +} From 86401f551b540e74be7f8bc97ff8d631779394c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 18 Feb 2020 14:34:00 +0800 Subject: [PATCH 24/27] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/commentsRouter_controllers.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/routers/commentsRouter_controllers.go b/routers/commentsRouter_controllers.go index b040b6c6e..688856bed 100644 --- a/routers/commentsRouter_controllers.go +++ b/routers/commentsRouter_controllers.go @@ -1255,7 +1255,16 @@ func init() { beego.ControllerComments{ Method: "CopyEbaiSkuPriceToJx", Router: `/CopyEbaiSkuPriceToJx`, - AllowHTTPMethods: []string{"put"}, + AllowHTTPMethods: []string{"post"}, + MethodParams: param.Make(), + Filters: nil, + Params: nil}) + + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:SkuController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:SkuController"], + beego.ControllerComments{ + Method: "CopyEbaiStoreSkusToJx", + Router: `/CopyEbaiStoreSkusToJx`, + AllowHTTPMethods: []string{"post"}, MethodParams: param.Make(), Filters: nil, Params: nil}) From dbd69213bee1f199500a0d40b8ff12567bed2d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 18 Feb 2020 15:19:47 +0800 Subject: [PATCH 25/27] =?UTF-8?q?=E9=A5=BF=E7=99=BE=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/ebai/store_sku2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/partner/purchase/ebai/store_sku2.go b/business/partner/purchase/ebai/store_sku2.go index f944995ac..be00e1a67 100644 --- a/business/partner/purchase/ebai/store_sku2.go +++ b/business/partner/purchase/ebai/store_sku2.go @@ -345,7 +345,7 @@ func genSkuParamsFromStoreSkuInfo2(storeSku *dao.StoreSkuSyncInfo, isCreate, isE params["upc"] = storeSku.Upc params["name"] = storeSku.Name params["cat3_id"] = storeSku.ExdCategoryThirdID - params["category_id"] = utils.Str2Int64(storeSku.VendorCatID) + params["category_id"] = utils.Str2Int64WithDefault(storeSku.VendorCatID, 0) } if storeSku.DescImg != "" { params["rtf"] = storeSku.DescImg From 0467eba8de32ba3d307b0618e554fc3a7ad4b053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 18 Feb 2020 15:32:34 +0800 Subject: [PATCH 26/27] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E9=A5=BF=E7=99=BE?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index e255f9ab3..fab229e5a 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -1526,10 +1526,11 @@ func CopyEbaiSkuPriceToJx(ctx *jxcontext.Context, baiduShopID string) (err error sku, _ := api.EbaiAPI.PageGetSku(utils.Str2Int64(baiduShopID), utils.Str2Int64(v["sku_id"].(string))) var skuName model.SkuName sql2 := ` - SELECT * FROM sku_category WHERE exd_name like ? + SELECT * FROM sku_category WHERE exd_name like ? AND deleted_at = ? ` sqlParams2 := []interface{}{ "%" + sku.CustomCatName + "%", + utils.DefaultTimeValue, } dao.GetRow(db, &skuName, sql2, sqlParams2) price := int(utils.Float64TwoInt64(utils.Interface2Float64WithDefault(v["sale_price"], 0) * 100)) From 1c17718ff4e13cd46617c5938464886bd8396035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 18 Feb 2020 18:14:30 +0800 Subject: [PATCH 27/27] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E6=A0=B9=E6=8D=AE=E5=9D=90=E6=A0=87=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 04509d086..a3b3f1fa4 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -2388,7 +2388,8 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDi // 为了审核用 if len(storeList2) == 0 { - sqlParams = []interface{}{ + sqlParams2 := []interface{}{ + model.VendorIDJX, utils.DefaultTimeValue, model.StoreStatusDisabled, utils.DefaultTimeValue, model.StoreStatusDisabled, jxutils.StandardCoordinate2Int(0), @@ -2396,7 +2397,7 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDi jxutils.StandardCoordinate2Int(0), jxutils.StandardCoordinate2Int(10000), } - dao.GetRows(dao.GetDB(), &storeList2, sql, sqlParams...) + dao.GetRows(dao.GetDB(), &storeList2, sql, sqlParams2...) if len(storeList2) > 1 { storeList2 = storeList2[:1] }