This commit is contained in:
邹宗楠
2024-01-12 11:44:21 +08:00
parent e4608f3106
commit fa4a730529
4 changed files with 11 additions and 11 deletions

View File

@@ -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 {