作者 yangfu

修改 机会提交/审核/更新 自查

... ... @@ -286,7 +286,7 @@ func (this *ChanceController) ChanceSubmit() {
msg = m
return
}
if e := request.SelfChecks.Valid(); e != nil {
if e := request.SelfChecks.SetSelfChecksLevel1ByRule(); e != nil {
log.Error(e)
msg = protocol.NewReturnResponse(nil, e)
return
... ... @@ -312,7 +312,7 @@ func (this *ChanceController) ChanceUpdate() {
msg = m
return
}
if e := request.SelfChecks.Valid(); e != nil {
if e := request.SelfChecks.SetSelfChecksLevel1ByRule(); e != nil {
log.Error(e)
msg = protocol.NewReturnResponse(nil, e)
return
... ... @@ -449,7 +449,7 @@ func (this *ChanceController) ChanceApprove() {
return
}
}
if e := request.SelfChecks.Valid(); e != nil {
if e := request.SelfChecks.SetSelfChecksLevel1ByRule(); e != nil {
log.Error(e)
msg = protocol.NewReturnResponse(nil, e)
return
... ...
... ... @@ -374,26 +374,29 @@ func setQuestionRequire(list []*protocol.CheckQuestion) {
if len(list) == 0 {
return
}
var gIdx = -1
//var gIdx = -1
for i := 0; i < len(list); i++ {
if gIdx < 0 || list[gIdx].GroupId != list[i].GroupId {
gIdx = i
} else {
continue
}
hasSub := false
for j := i + 1; j < len(list); j++ {
if list[i].GroupId == list[j].GroupId {
if !hasSub {
hasSub = true
}
} else {
break
}
}
//只有一级维度的必须填写
if !hasSub {
list[gIdx].Required = true
//if gIdx < 0 || list[gIdx].GroupId != list[i].GroupId {
// gIdx = i
//} else {
// continue
//}
//hasSub := false
//for j := i + 1; j < len(list); j++ {
// if list[i].GroupId == list[j].GroupId {
// if !hasSub {
// hasSub = true
// }
// } else {
// break
// }
//}
////只有一级维度的必须填写
//if !hasSub {
// list[gIdx].Required = true
//}
if list[i].ParentId == 0 { //一级都默认true
list[i].Required = true
}
}
}
... ...