作者 tangxvhui

bug 修复

... ... @@ -149,7 +149,8 @@ func GetAuditListSql(param protocol.RequestAuditList, companyid int64, userid in
s1 := `SELECT a.id,a.department_id,a.audit_template_id,a.chance_type_id
,a.publish_status,a.create_at,a.review_status,a.status
,a.discovery_score,a.comment_total ,a.code,d.nick_name,d.id as user_id
,a.type,a.reserve_type_id,a.source_content,a.approve_time
,a.type,a.reserve_type_id,a.source_content,a.approve_time,a.check_result
,a.self_checks,a.check_result_status
FROM chance AS a
JOIN user_company AS c ON c.id = a.user_id
JOIN user AS d ON c.user_id = d.id
... ...
... ... @@ -115,7 +115,11 @@ func GetAuditListForExcel(param protocol.RequestAuditList, companyid int64, user
err := json.Unmarshal([]byte(soureContentJson), &soureContentData)
if err == nil {
for ii := range soureContentData {
soureContentText.WriteString(soureContentData[ii].Label + ":" + soureContentData[ii].CurrentValue + ",")
valueString := strings.TrimSpace(soureContentData[ii].CurrentValue)
if len(valueString) == 0 {
continue
}
soureContentText.WriteString(soureContentData[ii].Label + ":" + valueString + ",")
}
}
soureData[i]["source_content"] = soureContentText.String()
... ... @@ -127,9 +131,26 @@ func GetAuditListForExcel(param protocol.RequestAuditList, companyid int64, user
frontHost = "http://mmm-web-open-test.fjmaimaimai.com/#/ability/opportunity/export-detail"
}
soureData[i]["media"] = fmt.Sprintf("%s?chance_id=%v&check_sum=%s", frontHost, soureData[i]["id"], signString)
if soureData[i]["review_status"] == "0" || soureData[i]["review_status"] == "1" {
if int8(reviewStatus) != models.ChanceReviewStatusYes {
soureData[i]["approve_time"] = ""
}
//整合自查内容列数据
checkResultJson := fmt.Sprint(soureData[i]["check_result"])
selfChecksJson := fmt.Sprint(soureData[i]["self_checks"])
checkResultStatusS := fmt.Sprint(soureData[i]["check_result_status"])
checkResultStatus, _ := strconv.Atoi(checkResultStatusS)
chanceM := &models.Chance{
CheckResult: checkResultJson,
SelfChecks: selfChecksJson,
CheckResultStatus: int8(checkResultStatus),
}
selfCheckData := getChanceSelfChecks(chanceM)
var selfCheckString strings.Builder
for ii := range selfCheckData {
selfCheckString.WriteString(selfCheckData[ii].Title + ":" + selfCheckData[ii].Result + ";")
}
soureData[i]["self_checks"] = selfCheckString.String()
}
excelhead := []exceltool.ExcelHead{
exceltool.ExcelHead{Key: "type", Name: "类型"},
... ... @@ -147,6 +168,7 @@ func GetAuditListForExcel(param protocol.RequestAuditList, companyid int64, user
exceltool.ExcelHead{Key: "source_content", Name: "内容"},
exceltool.ExcelHead{Key: "media", Name: "视频/图片/语音"},
exceltool.ExcelHead{Key: "discovery_score", Name: "发现得分"},
exceltool.ExcelHead{Key: "self_checks", Name: "自查内容"},
}
return soureData, excelhead
}
... ...