作者 tangxvhui

bug 修复

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