作者 tangxvhui

bug修复

... ... @@ -134,14 +134,14 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st
sqlslice = append(sqlslice, fmt.Sprintf(sql3, strings.Join(ids, ",")))
}
}
if _, ok := usrPermission.CheckMap[serverabc.OpportunityCheckLv4]; ok {
//指定部门
if _, ok := usrPermission.CheckMap[serverabc.OpportunityCheckLv5]; ok {
//指定部门未通过
ids := []string{}
for _, v := range usrPermission.CheckOption.Departments {
ids = append(ids, fmt.Sprint(v.Id))
}
if len(ids) > 0 {
log.Debug("命中规则:指定部门")
log.Debug("命中规则:指定部门未通过")
sqlslice = append(sqlslice, fmt.Sprintf(sql7, strings.Join(ids, ",")))
}
}
... ...
... ... @@ -223,6 +223,11 @@ func UpdateSetOpportunity(param OptionOpportunity, roleid int64, companyid int64
return protocol.NewErrWithMessage("10901")
}
}
if param.Check == OpportunityCheckLv5 {
if len(param.CheckOption.Departments) == 0 {
return protocol.NewErrWithMessage("10901")
}
}
menuinfo, err = models.GetMenuByCode(M_SYSTEM_OPPORTUNITY)
if err != nil {
... ...
... ... @@ -119,6 +119,7 @@ const (
OpportunityCheckLv2 int = 2
OpportunityCheckLv3 int = 3
OpportunityCheckLv4 int = 4
OpportunityCheckLv5 int = 5
)
var (
... ...