正在显示
2 个修改的文件
包含
25 行增加
和
22 行删除
@@ -286,7 +286,7 @@ func (this *ChanceController) ChanceSubmit() { | @@ -286,7 +286,7 @@ func (this *ChanceController) ChanceSubmit() { | ||
286 | msg = m | 286 | msg = m |
287 | return | 287 | return |
288 | } | 288 | } |
289 | - if e := request.SelfChecks.Valid(); e != nil { | 289 | + if e := request.SelfChecks.SetSelfChecksLevel1ByRule(); e != nil { |
290 | log.Error(e) | 290 | log.Error(e) |
291 | msg = protocol.NewReturnResponse(nil, e) | 291 | msg = protocol.NewReturnResponse(nil, e) |
292 | return | 292 | return |
@@ -312,7 +312,7 @@ func (this *ChanceController) ChanceUpdate() { | @@ -312,7 +312,7 @@ func (this *ChanceController) ChanceUpdate() { | ||
312 | msg = m | 312 | msg = m |
313 | return | 313 | return |
314 | } | 314 | } |
315 | - if e := request.SelfChecks.Valid(); e != nil { | 315 | + if e := request.SelfChecks.SetSelfChecksLevel1ByRule(); e != nil { |
316 | log.Error(e) | 316 | log.Error(e) |
317 | msg = protocol.NewReturnResponse(nil, e) | 317 | msg = protocol.NewReturnResponse(nil, e) |
318 | return | 318 | return |
@@ -449,7 +449,7 @@ func (this *ChanceController) ChanceApprove() { | @@ -449,7 +449,7 @@ func (this *ChanceController) ChanceApprove() { | ||
449 | return | 449 | return |
450 | } | 450 | } |
451 | } | 451 | } |
452 | - if e := request.SelfChecks.Valid(); e != nil { | 452 | + if e := request.SelfChecks.SetSelfChecksLevel1ByRule(); e != nil { |
453 | log.Error(e) | 453 | log.Error(e) |
454 | msg = protocol.NewReturnResponse(nil, e) | 454 | msg = protocol.NewReturnResponse(nil, e) |
455 | return | 455 | return |
@@ -374,26 +374,29 @@ func setQuestionRequire(list []*protocol.CheckQuestion) { | @@ -374,26 +374,29 @@ func setQuestionRequire(list []*protocol.CheckQuestion) { | ||
374 | if len(list) == 0 { | 374 | if len(list) == 0 { |
375 | return | 375 | return |
376 | } | 376 | } |
377 | - var gIdx = -1 | 377 | + //var gIdx = -1 |
378 | for i := 0; i < len(list); i++ { | 378 | for i := 0; i < len(list); i++ { |
379 | - if gIdx < 0 || list[gIdx].GroupId != list[i].GroupId { | ||
380 | - gIdx = i | ||
381 | - } else { | ||
382 | - continue | ||
383 | - } | ||
384 | - hasSub := false | ||
385 | - for j := i + 1; j < len(list); j++ { | ||
386 | - if list[i].GroupId == list[j].GroupId { | ||
387 | - if !hasSub { | ||
388 | - hasSub = true | ||
389 | - } | ||
390 | - } else { | ||
391 | - break | ||
392 | - } | ||
393 | - } | ||
394 | - //只有一级维度的必须填写 | ||
395 | - if !hasSub { | ||
396 | - list[gIdx].Required = true | 379 | + //if gIdx < 0 || list[gIdx].GroupId != list[i].GroupId { |
380 | + // gIdx = i | ||
381 | + //} else { | ||
382 | + // continue | ||
383 | + //} | ||
384 | + //hasSub := false | ||
385 | + //for j := i + 1; j < len(list); j++ { | ||
386 | + // if list[i].GroupId == list[j].GroupId { | ||
387 | + // if !hasSub { | ||
388 | + // hasSub = true | ||
389 | + // } | ||
390 | + // } else { | ||
391 | + // break | ||
392 | + // } | ||
393 | + //} | ||
394 | + ////只有一级维度的必须填写 | ||
395 | + //if !hasSub { | ||
396 | + // list[gIdx].Required = true | ||
397 | + //} | ||
398 | + if list[i].ParentId == 0 { //一级都默认true | ||
399 | + list[i].Required = true | ||
397 | } | 400 | } |
398 | } | 401 | } |
399 | } | 402 | } |
-
请 注册 或 登录 后发表评论