...
|
...
|
@@ -63,6 +63,7 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st |
|
|
//获取权限
|
|
|
if ok := redisdata.ExistUserPermission(userid); !ok {
|
|
|
//尝试重数据库获取
|
|
|
log.Debug("从数据库读取权限")
|
|
|
permissionMap, err := serverabc.GetUserPermission(usercompanyid, serverabc.M_SYSTEM_OPPORTUNITY)
|
|
|
if err != nil {
|
|
|
log.Debug("从数据库未获得对应权限 :%s", err)
|
...
|
...
|
@@ -77,6 +78,7 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st |
|
|
}
|
|
|
} else {
|
|
|
//使用缓存
|
|
|
log.Debug("从缓存读取权限")
|
|
|
permissionObject, err = redisdata.GetUserPermission(userid, serverabc.M_SYSTEM_OPPORTUNITY)
|
|
|
if err != nil {
|
|
|
log.Debug("从缓存未获得对应权限 :%s", err)
|
...
|
...
|
@@ -132,8 +134,10 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st |
|
|
sqlslice = append(sqlslice, fmt.Sprintf(sql3, strings.Join(ids, ",")))
|
|
|
}
|
|
|
}
|
|
|
if len(usrPermission.CheckMap) > 0 {
|
|
|
sqlslice = append(sqlslice, sql5)
|
|
|
}
|
|
|
|
|
|
sqlslice = append(sqlslice, sql5)
|
|
|
return fmt.Sprintf(allsql, strings.Join(sqlslice, " UNION "))
|
|
|
}
|
|
|
|
...
|
...
|
|