作者 tangxvhui

更新

... ... @@ -222,7 +222,7 @@ func (c *AuditController) ChanceCheckResultPassOrNo() {
}()
type Parameter struct {
ChanceId string `json:"chance_id"`
Status int `json:"status"`
Status int `json:"status"` //【1:通过】【2:不通过】
}
var param Parameter
if err := json.Unmarshal(c.Ctx.Input.RequestBody, &param); err != nil {
... ...
... ... @@ -7,7 +7,7 @@ import (
)
type ChanceCheckResult struct {
Id int `orm:"column(id);pk"`
Id int `orm:"column(id);auto"`
ChanceId int64 `orm:"column(chance_id)"`
GroupId int64 `orm:"column(group_id);null"`
CheckPid int64 `orm:"column(check_pid)"`
... ...
... ... @@ -306,6 +306,7 @@ type ChanceCheckResultData struct {
CheckPid int64 `json:"check_pid"`
CheckId int64 `json:"check_id"`
CheckItem string `json:"check_item"`
CheckItemTwo string `json:"check_item_two"`
CustomItemData map[string]string `json:"custom_item_data"`
AnswerYes int `json:"-"`
AnswerNo int `json:"-"`
... ...
... ... @@ -105,13 +105,14 @@ func buildChanceCheckResultData(checkResultData []models.ChanceCheckResult) (pro
}
}
checkReusltSlice[i].CustomItemData = customItemsData
if checkReusltSlice[i].CheckPid == 0 {
checkReusltSlice[i].Total = fmt.Sprintf("是:%d 否:%d 不清楚:%d",
checkReusltSlice[i].AnswerYes, checkReusltSlice[i].AnswerNo, checkReusltSlice[i].AnswerAny)
}
if checkReusltSlice[i].CheckPid > 0 {
//子集归并到父级
pid := checkReusltSlice[i].CheckPid
checkReusltSlice[i].CheckItemTwo = checkReusltSlice[i].CheckItem
checkReusltSlice[i].CheckItem = checkResultMap[pid].CheckItem
checkResultMap[pid].Child = append(checkResultMap[pid].Child, checkReusltSlice[i])
}
}
... ...