作者 tangxvhui

bug修复

@@ -134,14 +134,14 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st @@ -134,14 +134,14 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st
134 sqlslice = append(sqlslice, fmt.Sprintf(sql3, strings.Join(ids, ","))) 134 sqlslice = append(sqlslice, fmt.Sprintf(sql3, strings.Join(ids, ",")))
135 } 135 }
136 } 136 }
137 - if _, ok := usrPermission.CheckMap[serverabc.OpportunityCheckLv4]; ok {  
138 - //指定部门 137 + if _, ok := usrPermission.CheckMap[serverabc.OpportunityCheckLv5]; ok {
  138 + //指定部门未通过
139 ids := []string{} 139 ids := []string{}
140 for _, v := range usrPermission.CheckOption.Departments { 140 for _, v := range usrPermission.CheckOption.Departments {
141 ids = append(ids, fmt.Sprint(v.Id)) 141 ids = append(ids, fmt.Sprint(v.Id))
142 } 142 }
143 if len(ids) > 0 { 143 if len(ids) > 0 {
144 - log.Debug("命中规则:指定部门") 144 + log.Debug("命中规则:指定部门未通过")
145 sqlslice = append(sqlslice, fmt.Sprintf(sql7, strings.Join(ids, ","))) 145 sqlslice = append(sqlslice, fmt.Sprintf(sql7, strings.Join(ids, ",")))
146 } 146 }
147 } 147 }
@@ -223,6 +223,11 @@ func UpdateSetOpportunity(param OptionOpportunity, roleid int64, companyid int64 @@ -223,6 +223,11 @@ func UpdateSetOpportunity(param OptionOpportunity, roleid int64, companyid int64
223 return protocol.NewErrWithMessage("10901") 223 return protocol.NewErrWithMessage("10901")
224 } 224 }
225 } 225 }
  226 + if param.Check == OpportunityCheckLv5 {
  227 + if len(param.CheckOption.Departments) == 0 {
  228 + return protocol.NewErrWithMessage("10901")
  229 + }
  230 + }
226 231
227 menuinfo, err = models.GetMenuByCode(M_SYSTEM_OPPORTUNITY) 232 menuinfo, err = models.GetMenuByCode(M_SYSTEM_OPPORTUNITY)
228 if err != nil { 233 if err != nil {
@@ -119,6 +119,7 @@ const ( @@ -119,6 +119,7 @@ const (
119 OpportunityCheckLv2 int = 2 119 OpportunityCheckLv2 int = 2
120 OpportunityCheckLv3 int = 3 120 OpportunityCheckLv3 int = 3
121 OpportunityCheckLv4 int = 4 121 OpportunityCheckLv4 int = 4
  122 + OpportunityCheckLv5 int = 5
122 ) 123 )
123 124
124 var ( 125 var (