...
|
...
|
@@ -310,11 +310,13 @@ func GetCheckQuestionsByChanceId(header *protocol.RequestHeader, id int64) (rsp |
|
|
var tmpGroupId int64
|
|
|
var idx int = 0 //组内排序
|
|
|
var groupIdx = 0 //分组序号
|
|
|
var parentId = 0
|
|
|
for i := range selfChecks {
|
|
|
c := selfChecks[i]
|
|
|
if tmpGroupId != c.GroupId {
|
|
|
groupIdx++
|
|
|
idx = 0
|
|
|
parentId = i + 1
|
|
|
}
|
|
|
tmpGroupId = c.GroupId
|
|
|
item := protocol.NewCheckQuestion(c.CheckItem, getQuestionTitle(groupIdx, idx, c.CheckItem), c.GroupId, protocol.CheckOptionsApprove)
|
...
|
...
|
@@ -325,7 +327,7 @@ func GetCheckQuestionsByChanceId(header *protocol.RequestHeader, id int64) (rsp |
|
|
}
|
|
|
}
|
|
|
if item.Id == 0 {
|
|
|
item.Id, item.ParentId = genCustomizeQuestionId(i, idx, tmpGroupId)
|
|
|
item.Id, item.ParentId = genCustomizeQuestionId(i, idx, int64(parentId))
|
|
|
}
|
|
|
rsp = append(rsp, item)
|
|
|
idx++
|
...
|
...
|
@@ -405,7 +407,8 @@ func getQuestionTitle(groupIdx int, idx int, title string) string { |
|
|
if idx == 0 {
|
|
|
return fmt.Sprintf("%v、%v", groupIdx, title)
|
|
|
}
|
|
|
return fmt.Sprintf("%v.%v、%v", groupIdx, idx, title)
|
|
|
//return fmt.Sprintf("%v.%v、%v", groupIdx, idx, title)
|
|
|
return fmt.Sprintf("%v", title)
|
|
|
}
|
|
|
|
|
|
//自定义id
|
...
|
...
|
|