This commit is contained in:
苏尹岚
2021-03-12 09:25:54 +08:00
parent 656e679140
commit 795893424d
3 changed files with 32 additions and 1 deletions

View File

@@ -271,3 +271,19 @@ func UpdateVendorOrgCode(ctx *jxcontext.Context, ID int, payload map[string]inte
}
return err
}
func AddVendorOrgCode(ctx *jxcontext.Context, vendorOrgCode *model.VendorOrgCode) (err error) {
var (
db = dao.GetDB()
)
list, err := dao.GetVendorOrgCode(db, vendorOrgCode.VendorID, vendorOrgCode.VendorOrgCode, model.VendorOrgTypePlatform)
if err != nil {
return err
}
if len(list) > 0 {
return fmt.Errorf("库里有这个账号了,[%v]", vendorOrgCode.VendorOrgCode)
}
dao.WrapAddIDCULDEntity(vendorOrgCode, ctx.GetUserName())
dao.CreateEntity(db, vendorOrgCode)
return err
}