This commit is contained in:
2026-03-21 19:10:50 +08:00
parent 3775101081
commit 2fcf55deee
20 changed files with 60704 additions and 436 deletions

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"context"
"fmt"
"sort"
"strings"
"github.com/jung-kurt/gofpdf/v2"
@@ -106,15 +107,15 @@ func GenerateQYGLReportPDF(_ context.Context, logger *zap.Logger, report map[str
{"riskOverview", "风险情况(综合分析)"},
{"basic", "一、主体概览(企业基础信息)"},
{"branches", "二、分支机构"},
{"shareholding", "三、股权与控制"},
{"shareholding", "三、股权与控制(持股结构;认缴与实缴公示见第十六节)"},
{"controller", "四、实际控制人"},
{"beneficiaries", "五、最终受益人"},
{"investments", "六、对外投资"},
{"guarantees", "七、对外担保"},
{"management", "八、人员与组织"},
{"assets", "九、资产与经营(年报"},
{"guarantees", "七、对外担保(全量年报披露摘要;公示年报详版见第十六节)"},
{"management", "八、人员与组织(高管与任职;年报从业与社保见第十六节)"},
{"assets", "九、资产与经营(全量年报财务摘要;公示年报详版见第十六节"},
{"licenses", "十、行政许可与资质"},
{"activities", "十一、经营活动"},
{"activities", "十一、经营活动(招投标;网站或网店公示见第十六节)"},
{"inspections", "十二、抽查检查"},
{"risks", "十三、风险与合规"},
{"timeline", "十四、发展时间线"},
@@ -246,8 +247,8 @@ func writeKeyValue(pdf *gofpdf.Fpdf, fontName, label, value string) {
// 使用黑色描边,左侧标签单元格填充标题蓝色背景
pdf.SetDrawColor(0, 0, 0)
pdf.SetFillColor(91, 155, 213)
pdf.Rect(x, y, labelW, rowH, "FD") // 标签:填充+描边
pdf.Rect(x+labelW, y, valueW, rowH, "D") // 值:仅描边
pdf.Rect(x, y, labelW, rowH, "FD") // 标签:填充+描边
pdf.Rect(x+labelW, y, valueW, rowH, "D") // 值:仅描边
// 写入标签单元格
pdf.SetXY(x, y)
@@ -891,7 +892,9 @@ func renderPDFManagement(pdf *gofpdf.Fpdf, fontName, title string, v map[string]
// 从业与社保
employeeCount := getString(v, "employeeCount")
femaleEmployeeCount := getString(v, "femaleEmployeeCount")
if employeeCount != "" || femaleEmployeeCount != "" {
ssMap, _ := v["socialSecurity"].(map[string]interface{})
hasSS := len(ssMap) > 0
if employeeCount != "" || femaleEmployeeCount != "" || hasSS {
pdf.Ln(2)
pdf.SetFont(fontName, "B", 12)
pdf.MultiCell(0, 6, "从业与社保", "", "L", false)
@@ -902,6 +905,35 @@ func renderPDFManagement(pdf *gofpdf.Fpdf, fontName, title string, v map[string]
if femaleEmployeeCount != "" {
writeKeyValue(pdf, fontName, "女性从业人数", femaleEmployeeCount)
}
if hasSS {
pdf.Ln(1)
pdf.SetFont(fontName, "B", 11)
pdf.MultiCell(0, 5, "社会保险参保人数", "", "L", false)
pdf.SetFont(fontName, "", 11)
socialLabels := map[string]string{
"endowmentInsuranceEmployeeCnt": "城镇职工基本养老保险参保人数",
"unemploymentInsuranceEmployeeCnt": "失业保险参保人数",
"medicalInsuranceEmployeeCnt": "职工基本医疗保险参保人数",
"injuryInsuranceEmployeeCnt": "工伤保险参保人数",
"maternityInsuranceEmployeeCnt": "生育保险参保人数",
}
keys := make([]string, 0, len(ssMap))
for k := range ssMap {
keys = append(keys, k)
}
sort.Strings(keys)
for _, k := range keys {
val := ssMap[k]
if val == nil {
continue
}
lbl := socialLabels[k]
if lbl == "" {
lbl = k
}
writeKeyValue(pdf, fontName, lbl, fmt.Sprint(val))
}
}
}
// 法定代表人其他任职
@@ -1808,4 +1840,3 @@ func boolToCN(s string) string {
return s
}
}