1
This commit is contained in:
@@ -1856,6 +1856,9 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
|
||||
valid["address"] = payload["address"].(string)
|
||||
syncStatus |= model.SyncFlagStoreName
|
||||
address = payload["address"].(string)
|
||||
// 这个字段暂存美团门店地址
|
||||
storeMap.YbStorePrefix = address
|
||||
dao.UpdateEntity(db, storeMap, "YbStorePrefix")
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
@@ -1920,7 +1923,7 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
|
||||
}
|
||||
|
||||
if isUpdateStoreNeedSync(valid) { // 同步修改门店已经配送门店
|
||||
_, err = CurVendorSync.SyncStore(ctx, db, vendorID, storeID, false, userName)
|
||||
_, err = CurVendorSync.SyncStore(ctx, db, vendorID, storeID, false, userName) // address原来的userName 因为storeMap无法保存address,所以美团暂时使用该参数代替
|
||||
//updateCourierStores(ctx, storeID)
|
||||
}
|
||||
|
||||
|
||||
@@ -237,11 +237,8 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
||||
var failedList []*partner.StoreSkuInfoWithErr
|
||||
handler := v.GetStoreHandler(loopMapInfo.VendorID)
|
||||
globals.SugarLogger.Debugf("==============handler %d", loopMapInfo.VendorID)
|
||||
if handler != nil {
|
||||
globals.SugarLogger.Debugf("==============handler %s", "11111111111")
|
||||
if len(loopMapInfo.StoreMapList) > 1 {
|
||||
globals.SugarLogger.Debugf("==============handler2 %s", "11111111111")
|
||||
loopStoreTask := tasksch.NewParallelTask(fmt.Sprintf("处理平台%s", model.VendorChineseNames[loopMapInfo.VendorID]), tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
var resultList []interface{}
|
||||
@@ -251,9 +248,7 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
if len(loopMapInfo.StoreMapList) > 1 {
|
||||
db2 = dao.GetDB()
|
||||
}
|
||||
globals.SugarLogger.Debugf("==============storeMap %s", utils.Format4Output(storeMap, false))
|
||||
if model.IsSyncStatusNew(storeMap.SyncStatus) {
|
||||
globals.SugarLogger.Debugf("==============storeMap.SyncStatus1 %d", storeMap.SyncStatus)
|
||||
storeDetail, _ := dao.GetStoreDetail(db, storeMap.StoreID, storeMap.VendorID, storeMap.VendorOrgCode)
|
||||
if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil, storeDetail); err == nil {
|
||||
resultList = append(resultList, 1)
|
||||
@@ -261,14 +256,12 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
failedList = putils.GetErrMsg2FailedSingleList(nil, err, storeMap.StoreID, model.VendorChineseNames[storeMap.VendorID], "创建门店")
|
||||
}
|
||||
} else if model.IsSyncStatusDelete(storeMap.SyncStatus) {
|
||||
globals.SugarLogger.Debugf("==============storeMap.SyncStatus2 %d", storeMap.SyncStatus)
|
||||
if err = handler.DeleteStore(db2, storeMap.StoreID, userName); err == nil {
|
||||
resultList = append(resultList, 1)
|
||||
} else {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(nil, err, storeMap.StoreID, model.VendorChineseNames[storeMap.VendorID], "删除门店")
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("==============storeMap.SyncStatus3 %d", storeMap.SyncStatus)
|
||||
if err = handler.UpdateStore(db2, storeMap.StoreID, userName); err == nil {
|
||||
resultList = append(resultList, 1)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user