|
@@ -44,6 +44,7 @@ func AddChartPermission(req crm.PermissionAddReq) (err error, errMsg string) {
|
|
|
err = fmt.Errorf("查询品种排序失败, Err: " + e.Error())
|
|
|
return
|
|
|
}
|
|
|
+ parentPermissionName := ""
|
|
|
if req.ParentId > 0 {
|
|
|
//查询父级是否存在
|
|
|
parent, e := ob.GetItemById(req.ParentId)
|
|
@@ -62,6 +63,7 @@ func AddChartPermission(req crm.PermissionAddReq) (err error, errMsg string) {
|
|
|
err = fmt.Errorf("只能选择一级品种作为父级品种")
|
|
|
return
|
|
|
}
|
|
|
+ parentPermissionName = parent.PermissionName
|
|
|
}
|
|
|
// 新增
|
|
|
ob.ChartPermissionName = req.PermissionName
|
|
@@ -73,6 +75,7 @@ func AddChartPermission(req crm.PermissionAddReq) (err error, errMsg string) {
|
|
|
ob.Sort = maxSort + 1
|
|
|
ob.CreatedTime = time.Now()
|
|
|
ob.LastUpdatedTime = time.Now()
|
|
|
+ ob.ClassifyName = parentPermissionName
|
|
|
if e = ob.Create(); e != nil {
|
|
|
errMsg = "操作失败"
|
|
|
err = fmt.Errorf("新增品种权限失败, Err: " + e.Error())
|