作者 tangxvhui

权限功能调整

... ... @@ -131,7 +131,9 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st
//指定部门
ids := []string{}
for _, v := range usrPermission.CheckOption.Departments {
ids = append(ids, fmt.Sprint(v.Id))
if v.OpenAll == 1 && v.OpenDepart == 1 && v.Wait == 1 {
ids = append(ids, fmt.Sprint(v.Id))
}
}
if len(ids) > 0 {
log.Debug("命中规则:指定部门")
... ...
... ... @@ -165,6 +165,21 @@ func (p *OptionOpportunity) MergeObject(jsonString string) error {
if err != nil {
return err
}
//-- 进行新旧数据兼容处理 ---
if obj.Check == OpportunityCheckLv3 {
for i := range obj.CheckOption.Departments {
obj.CheckOption.Departments[i].OpenAll = 1
obj.CheckOption.Departments[i].OpenDepart = 1
obj.CheckOption.Departments[i].Wait = 1
}
}
if obj.Check == OpportunityCheckLv5 {
for i := range obj.CheckOption.Departments {
obj.CheckOption.Departments[i].NotPass = 1
}
}
//--- 进行新旧数据兼容处理 结束--
if p.CheckMap == nil {
p.CheckMap = make(map[int]int)
}
... ...