alpha环境启用isUseThingMap
This commit is contained in:
@@ -129,7 +129,7 @@ func (v *VendorSync) syncCategories(ctx *jxcontext.Context, parentTask tasksch.I
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *VendorSync) SyncCategory(ctx *jxcontext.Context, db *dao.DaoDB, categoryID int, isAsync bool, userName string) (hint string, err error) {
|
func (v *VendorSync) SyncCategory(ctx *jxcontext.Context, db *dao.DaoDB, categoryID int, isAsync bool, userName string) (hint string, err error) {
|
||||||
if !model.IsUseThingMap {
|
if !globals.IsUseThingMap {
|
||||||
return v.oldSyncCategory(ctx, db, categoryID, isAsync, userName)
|
return v.oldSyncCategory(ctx, db, categoryID, isAsync, userName)
|
||||||
}
|
}
|
||||||
return SyncCategories(ctx, nil, nil, nil, []int{categoryID}, isAsync)
|
return SyncCategories(ctx, nil, nil, nil, []int{categoryID}, isAsync)
|
||||||
@@ -165,7 +165,7 @@ func (v *VendorSync) oldSyncCategory(ctx *jxcontext.Context, db *dao.DaoDB, cate
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *VendorSync) SyncReorderCategories(ctx *jxcontext.Context, db *dao.DaoDB, categoryID int, isAsync bool, userName string) (hint string, err error) {
|
func (v *VendorSync) SyncReorderCategories(ctx *jxcontext.Context, db *dao.DaoDB, categoryID int, isAsync bool, userName string) (hint string, err error) {
|
||||||
if !model.IsUseThingMap {
|
if !globals.IsUseThingMap {
|
||||||
return v.oldSyncReorderCategories(ctx, db, categoryID, isAsync, userName)
|
return v.oldSyncReorderCategories(ctx, db, categoryID, isAsync, userName)
|
||||||
}
|
}
|
||||||
return SyncReorderCategories(ctx, -1, isAsync)
|
return SyncReorderCategories(ctx, -1, isAsync)
|
||||||
@@ -248,7 +248,7 @@ func (v *VendorSync) SyncSku(ctx *jxcontext.Context, db *dao.DaoDB, nameID, skuI
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *VendorSync) SyncSkus(ctx *jxcontext.Context, db *dao.DaoDB, nameIDs []int, skuIDs []int, isAsync, isContinueWhenError bool, userName string) (hint string, err error) {
|
func (v *VendorSync) SyncSkus(ctx *jxcontext.Context, db *dao.DaoDB, nameIDs []int, skuIDs []int, isAsync, isContinueWhenError bool, userName string) (hint string, err error) {
|
||||||
if !model.IsUseThingMap {
|
if !globals.IsUseThingMap {
|
||||||
return v.oldSyncSkus(ctx, db, nameIDs, skuIDs, isAsync, isContinueWhenError, userName)
|
return v.oldSyncSkus(ctx, db, nameIDs, skuIDs, isAsync, isContinueWhenError, userName)
|
||||||
}
|
}
|
||||||
return SyncSkus(ctx, nil, nil, nil, nameIDs, skuIDs, isAsync)
|
return SyncSkus(ctx, nil, nil, nil, nameIDs, skuIDs, isAsync)
|
||||||
@@ -563,7 +563,7 @@ func (v *VendorSync) LoopStoresMap2(ctx *jxcontext.Context, db *dao.DaoDB, taskN
|
|||||||
if len(loopInfoList) == 1 {
|
if len(loopInfoList) == 1 {
|
||||||
taskName = fmt.Sprintf("%s,处理平台%s", taskName, model.VendorChineseNames[loopInfoList[0].VendorID])
|
taskName = fmt.Sprintf("%s,处理平台%s", taskName, model.VendorChineseNames[loopInfoList[0].VendorID])
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("LoopStoresMap2 loopInfoList:%s", utils.Format4Output(loopInfoList, false))
|
// globals.SugarLogger.Debugf("LoopStoresMap2 loopInfoList:%s", utils.Format4Output(loopInfoList, false))
|
||||||
task = tasksch.NewParallelTask(taskName, tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx, handler, loopInfoList)
|
task = tasksch.NewParallelTask(taskName, tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx, handler, loopInfoList)
|
||||||
tasksch.HandleTask(task, nil, isManageIt).Run()
|
tasksch.HandleTask(task, nil, isManageIt).Run()
|
||||||
if !isAsync {
|
if !isAsync {
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ func OnCreateThing(ctx *jxcontext.Context, db *dao.DaoDB, thingID int64, thingTy
|
|||||||
dao.WrapAddIDCULDEntity(thingMap, ctx.GetUserName())
|
dao.WrapAddIDCULDEntity(thingMap, ctx.GetUserName())
|
||||||
errList.AddErr(dao.CreateEntity(db, thingMap))
|
errList.AddErr(dao.CreateEntity(db, thingMap))
|
||||||
}
|
}
|
||||||
if model.IsUseThingMap {
|
if globals.IsUseThingMap {
|
||||||
err = errList.GetErrListAsOne()
|
err = errList.GetErrListAsOne()
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
@@ -196,7 +196,7 @@ func OnUpdateThing(ctx *jxcontext.Context, db *dao.DaoDB, thingID int64, thingTy
|
|||||||
errList.AddErr(err2)
|
errList.AddErr(err2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if model.IsUseThingMap {
|
if globals.IsUseThingMap {
|
||||||
err = errList.GetErrListAsOne()
|
err = errList.GetErrListAsOne()
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
@@ -229,7 +229,7 @@ func OnDeleteThing(ctx *jxcontext.Context, db *dao.DaoDB, thingID int64, thingTy
|
|||||||
errList.AddErr(err2)
|
errList.AddErr(err2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if model.IsUseThingMap {
|
if globals.IsUseThingMap {
|
||||||
err = errList.GetErrListAsOne()
|
err = errList.GetErrListAsOne()
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ func GetDirtyStoreCategories(db *DaoDB, vendorID, storeID int, level int) (cats
|
|||||||
// 以store_sku_bind为基础来做同步,正常情况下使用
|
// 以store_sku_bind为基础来做同步,正常情况下使用
|
||||||
// 单多门店模式厂商通用
|
// 单多门店模式厂商通用
|
||||||
func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty bool) (skus []*StoreSkuSyncInfo, err error) {
|
func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty bool) (skus []*StoreSkuSyncInfo, err error) {
|
||||||
if !model.IsUseThingMap {
|
if !globals.IsUseThingMap {
|
||||||
return oldGetStoreSkus2(db, vendorID, storeID, skuIDs, mustDirty)
|
return oldGetStoreSkus2(db, vendorID, storeID, skuIDs, mustDirty)
|
||||||
}
|
}
|
||||||
return newGetStoreSkus2(db, vendorID, storeID, skuIDs, mustDirty)
|
return newGetStoreSkus2(db, vendorID, storeID, skuIDs, mustDirty)
|
||||||
@@ -495,7 +495,7 @@ func GetStoreSkus(db *DaoDB, vendorID, storeID int, skuIDs []int) (skus []*Store
|
|||||||
// 以sku为基础来做全同步,
|
// 以sku为基础来做全同步,
|
||||||
// 多门店模式厂商适用
|
// 多门店模式厂商适用
|
||||||
func GetFullStoreSkus(db *DaoDB, vendorID, storeID int) (skus []*StoreSkuSyncInfo, err error) {
|
func GetFullStoreSkus(db *DaoDB, vendorID, storeID int) (skus []*StoreSkuSyncInfo, err error) {
|
||||||
if !model.IsUseThingMap {
|
if !globals.IsUseThingMap {
|
||||||
return oldGetFullStoreSkus(db, vendorID, storeID)
|
return oldGetFullStoreSkus(db, vendorID, storeID)
|
||||||
}
|
}
|
||||||
return newGetFullStoreSkus(db, vendorID, storeID)
|
return newGetFullStoreSkus(db, vendorID, storeID)
|
||||||
@@ -1061,7 +1061,7 @@ func GetStoreSkuNamePrice(db *DaoDB) (storeSkuNamePriceList []*model.StoreSkuNam
|
|||||||
}
|
}
|
||||||
err = GetRows(db, &storeSkuNamePriceList, sql, sqlParams...)
|
err = GetRows(db, &storeSkuNamePriceList, sql, sqlParams...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil,err
|
return nil, err
|
||||||
}
|
}
|
||||||
return storeSkuNamePriceList, err
|
return storeSkuNamePriceList, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,6 @@ const (
|
|||||||
ThingTypeSku = 3
|
ThingTypeSku = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
IsUseThingMap = false
|
|
||||||
)
|
|
||||||
|
|
||||||
type ThingMap struct {
|
type ThingMap struct {
|
||||||
ModelIDCULD
|
ModelIDCULD
|
||||||
|
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ zhongwuAppSecret = "29435497822f52f3cf659c65da548a79"
|
|||||||
getWeixinTokenKey = "c928ed0d-87a3-441a-8517-f92f0167296f"
|
getWeixinTokenKey = "c928ed0d-87a3-441a-8517-f92f0167296f"
|
||||||
storeName = "京西菜市"
|
storeName = "京西菜市"
|
||||||
|
|
||||||
|
useThingMap = false
|
||||||
|
|
||||||
[dev]
|
[dev]
|
||||||
jdOrgCode = "320406"
|
jdOrgCode = "320406"
|
||||||
jdToken = "77e703b7-7997-441b-a12a-2e522efb117a"
|
jdToken = "77e703b7-7997-441b-a12a-2e522efb117a"
|
||||||
@@ -292,6 +294,8 @@ enableEbaiStoreWrite = true
|
|||||||
enableMtwmStoreWrite = true
|
enableMtwmStoreWrite = true
|
||||||
enableWscStoreWrite = false
|
enableWscStoreWrite = false
|
||||||
|
|
||||||
|
useThingMap = true
|
||||||
|
|
||||||
[beta]
|
[beta]
|
||||||
enableStoreWrite = false
|
enableStoreWrite = false
|
||||||
enableJdStoreWrite = false
|
enableJdStoreWrite = false
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ var (
|
|||||||
WxpayNotifyURL string
|
WxpayNotifyURL string
|
||||||
|
|
||||||
JdOrgCode string
|
JdOrgCode string
|
||||||
|
|
||||||
|
IsUseThingMap bool
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -99,6 +101,8 @@ func Init() {
|
|||||||
|
|
||||||
WxpayNotifyURL = beego.AppConfig.DefaultString("wxpayNotifyURL", "")
|
WxpayNotifyURL = beego.AppConfig.DefaultString("wxpayNotifyURL", "")
|
||||||
JdOrgCode = beego.AppConfig.DefaultString("jdOrgCode", "")
|
JdOrgCode = beego.AppConfig.DefaultString("jdOrgCode", "")
|
||||||
|
|
||||||
|
IsUseThingMap = beego.AppConfig.DefaultBool("useThingMap", false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsCallbackAlwaysReturnSuccess() bool {
|
func IsCallbackAlwaysReturnSuccess() bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user