This commit is contained in:
苏尹岚
2021-01-26 15:03:33 +08:00
parent ffbc982804
commit 6238b359d7

View File

@@ -2776,7 +2776,8 @@ func AddVendorCategoryMap(ctx *jxcontext.Context, vendorCategoryMap *model.Vendo
dao.Commit(db)
result = vendorCategoryMap
if vendorCategoryMap.CategoryID != 0 {
_, err = CurVendorSync.SyncCategory(ctx, nil, vendorCategoryMap.CategoryID, false, ctx.GetUserName())
SyncCategories(ctx, nil, []int{vendorCategoryMap.VendorID}, []string{vendorCategoryMap.VendorOrgCode}, []int{vendorCategoryMap.CategoryID}, true)
// _, err = CurVendorSync.SyncCategory(ctx, nil, vendorCategoryMap.CategoryID, false, ctx.GetUserName())
}
return result, err
}
@@ -2797,8 +2798,10 @@ func UpdateVendorCategoryMap(ctx *jxcontext.Context, ID int, vendorCategoryMap *
}
if vendorCategoryMap.CategoryID != 0 {
valid["categoryID"] = vendorCategoryMap.CategoryID
fmt.Println("111111", utils.Format4Output(vendorCategoryMap, false))
if !isDelete {
storeCatMaps, _ := dao.GetVendorCategoryMap(db, -1, 0, vendorCategoryMap2.VendorID, vendorCategoryMap2.VendorOrgCode, vendorCategoryMap.CategoryID)
fmt.Println("2222222", utils.Format4Output(storeCatMaps, false))
if len(storeCatMaps) > 0 {
for _, v := range storeCatMaps {
if v.ID != ID {
@@ -2857,7 +2860,7 @@ func UpdateVendorCategoryMap(ctx *jxcontext.Context, ID int, vendorCategoryMap *
return 0, err
}
dao.Commit(db)
_, err = CurVendorSync.SyncCategory(ctx, nil, vendorCategoryID, false, ctx.GetUserName())
SyncCategories(ctx, nil, []int{vendorCategoryMap.VendorID}, []string{vendorCategoryMap.VendorOrgCode}, []int{vendorCategoryID}, true)
return num, err
}