f
This commit is contained in:
@@ -48,6 +48,7 @@ type baseProductData struct {
|
||||
RiskWarning riskWarning `json:"riskWarning"`
|
||||
StandLiveInfo standLiveInfo `json:"standLiveInfo"`
|
||||
VerifyRule string `json:"verifyRule"`
|
||||
MultCourtInfo multCourtInfo `json:"multCourtInfo"`
|
||||
}
|
||||
|
||||
// baseInfo 存放被查询人的基础身份信息
|
||||
@@ -171,6 +172,34 @@ type standLiveInfo struct {
|
||||
FinalAuthResult string `json:"finalAuthResult"`
|
||||
}
|
||||
|
||||
// multCourtInfo 司法风险核验产品,统一承载涉案/执行/失信/限高四类公告
|
||||
type multCourtInfo struct {
|
||||
LegalCasesFlag int `json:"legalCasesFlag"`
|
||||
LegalCases []multCaseItem `json:"legalCases"`
|
||||
ExecutionCasesFlag int `json:"executionCasesFlag"`
|
||||
ExecutionCases []multCaseItem `json:"executionCases"`
|
||||
DisinCasesFlag int `json:"disinCasesFlag"`
|
||||
DisinCases []multCaseItem `json:"disinCases"`
|
||||
LimitCasesFlag int `json:"limitCasesFlag"`
|
||||
LimitCases []multCaseItem `json:"limitCases"`
|
||||
}
|
||||
|
||||
// multCaseItem 司法各类公告的通用记录结构
|
||||
type multCaseItem struct {
|
||||
CaseNumber string `json:"caseNumber"`
|
||||
CaseType string `json:"caseType"`
|
||||
Court string `json:"court"`
|
||||
LitigantType string `json:"litigantType"`
|
||||
FilingTime string `json:"filingTime"`
|
||||
DisposalTime string `json:"disposalTime"`
|
||||
CaseStatus string `json:"caseStatus"`
|
||||
ExecutionAmount string `json:"executionAmount"`
|
||||
RepaidAmount string `json:"repaidAmount"`
|
||||
CaseReason string `json:"caseReason"`
|
||||
DisposalMethod string `json:"disposalMethod"`
|
||||
JudgmentResult string `json:"judgmentResult"`
|
||||
}
|
||||
|
||||
// --- FLXG7E8F ---
|
||||
|
||||
// judicialProductData 对应 FLXG7E8F 司法产品数据
|
||||
@@ -702,52 +731,60 @@ func buildBasicInfo(ctx context.Context, sourceCtx *sourceContext) reportBasicIn
|
||||
Details: carrierDetails,
|
||||
})
|
||||
|
||||
// 兼容处理:安全访问JudicialData
|
||||
var stat *lawsuitStat
|
||||
if sourceCtx != nil && sourceCtx.JudicialData != nil {
|
||||
stat = &sourceCtx.JudicialData.JudicialData.LawsuitStat
|
||||
}
|
||||
|
||||
totalCaseCount := 0
|
||||
totalCriminal := 0
|
||||
// 兼容处理:从DWBG8B4D.multCourtInfo获取司法记录条数,并按案件类型拆分
|
||||
totalExecution := 0
|
||||
if stat != nil {
|
||||
// 兼容处理:安全访问Cases数组
|
||||
totalCriminal = safeLen(stat.Criminal.Cases)
|
||||
totalCaseCount = totalCriminal + safeLen(stat.Civil.Cases) + safeLen(stat.Administrative.Cases) + safeLen(stat.Preservation.Cases) + safeLen(stat.Bankrupt.Cases)
|
||||
totalExecution = safeLen(stat.Implement.Cases)
|
||||
}
|
||||
|
||||
totalDishonest := 0
|
||||
totalRestriction := 0
|
||||
if sourceCtx != nil && sourceCtx.JudicialData != nil {
|
||||
totalDishonest = safeLen(sourceCtx.JudicialData.JudicialData.BreachCaseList)
|
||||
totalRestriction = safeLen(sourceCtx.JudicialData.JudicialData.ConsumptionRestrictionList)
|
||||
criminalCount := 0
|
||||
civilCount := 0
|
||||
administrativeCount := 0
|
||||
preservationCount := 0
|
||||
bankruptCount := 0
|
||||
|
||||
if sourceCtx != nil && sourceCtx.BaseData != nil {
|
||||
mc := sourceCtx.BaseData.MultCourtInfo
|
||||
totalExecution = safeLen(mc.ExecutionCases)
|
||||
totalDishonest = safeLen(mc.DisinCases)
|
||||
totalRestriction = safeLen(mc.LimitCases)
|
||||
|
||||
for _, c := range mc.LegalCases {
|
||||
switch strings.TrimSpace(c.CaseType) {
|
||||
case "刑事案件":
|
||||
criminalCount++
|
||||
case "民事案件":
|
||||
civilCount++
|
||||
case "行政案件":
|
||||
administrativeCount++
|
||||
case "保全审查":
|
||||
preservationCount++
|
||||
case "破产清算":
|
||||
bankruptCount++
|
||||
default:
|
||||
// 其它类型暂不单独展示,只参与是否有司法记录的判断
|
||||
civilCount++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if totalCaseCount > 0 || totalExecution > 0 || totalDishonest > 0 || totalRestriction > 0 {
|
||||
detailParts := make([]string, 0, 5)
|
||||
if stat != nil {
|
||||
addCaseDetail := func(label string, count int) {
|
||||
if count > 0 {
|
||||
detailParts = append(detailParts, fmt.Sprintf("%s%d条", label, count))
|
||||
}
|
||||
totalLegal := criminalCount + civilCount + administrativeCount + preservationCount + bankruptCount
|
||||
|
||||
if totalLegal > 0 || totalExecution > 0 || totalDishonest > 0 || totalRestriction > 0 {
|
||||
detailParts := make([]string, 0, 8)
|
||||
addCaseDetail := func(label string, count int) {
|
||||
if count > 0 {
|
||||
detailParts = append(detailParts, fmt.Sprintf("%s%d条", label, count))
|
||||
}
|
||||
addCaseDetail("刑事案件", safeLen(stat.Criminal.Cases))
|
||||
addCaseDetail("民事案件", safeLen(stat.Civil.Cases))
|
||||
addCaseDetail("行政案件", safeLen(stat.Administrative.Cases))
|
||||
addCaseDetail("非诉保全审查案件", safeLen(stat.Preservation.Cases))
|
||||
addCaseDetail("强制清算与破产案件", safeLen(stat.Bankrupt.Cases))
|
||||
}
|
||||
if totalExecution > 0 {
|
||||
detailParts = append(detailParts, fmt.Sprintf("执行案件%d条", totalExecution))
|
||||
}
|
||||
if totalDishonest > 0 {
|
||||
detailParts = append(detailParts, fmt.Sprintf("失信案件%d条", totalDishonest))
|
||||
}
|
||||
if totalRestriction > 0 {
|
||||
detailParts = append(detailParts, fmt.Sprintf("限高案件%d条", totalRestriction))
|
||||
}
|
||||
|
||||
addCaseDetail("刑事案件", criminalCount)
|
||||
addCaseDetail("民事案件", civilCount)
|
||||
addCaseDetail("行政案件", administrativeCount)
|
||||
addCaseDetail("保全审查案件", preservationCount)
|
||||
addCaseDetail("强制清算与破产案件", bankruptCount)
|
||||
addCaseDetail("执行案件", totalExecution)
|
||||
addCaseDetail("失信案件", totalDishonest)
|
||||
addCaseDetail("限高案件", totalRestriction)
|
||||
|
||||
details := buildCaseDetails(detailParts)
|
||||
verifications = append(verifications, verificationItem{
|
||||
Item: "法院信息",
|
||||
@@ -821,50 +858,78 @@ func buildRiskIdentification(ctx context.Context, sourceCtx *sourceContext) risk
|
||||
},
|
||||
}
|
||||
|
||||
// 兼容处理:安全访问JudicialData
|
||||
if sourceCtx == nil || sourceCtx.JudicialData == nil {
|
||||
log.Debug("JudicialData为空,返回空的风险识别数据",
|
||||
// 兼容处理:从DWBG8B4D.multCourtInfo获取司法信息
|
||||
if sourceCtx == nil || sourceCtx.BaseData == nil {
|
||||
log.Debug("BaseData为空,返回空的风险识别数据",
|
||||
zap.String("api_code", "COMBHZY2"),
|
||||
)
|
||||
return identification
|
||||
}
|
||||
|
||||
stat := sourceCtx.JudicialData.JudicialData.LawsuitStat
|
||||
mc := sourceCtx.BaseData.MultCourtInfo
|
||||
baseName := ""
|
||||
baseID := ""
|
||||
if sourceCtx.BaseData != nil {
|
||||
baseName = sourceCtx.BaseData.BaseInfo.Name
|
||||
baseID = sourceCtx.BaseData.BaseInfo.IdCard
|
||||
}
|
||||
baseName = sourceCtx.BaseData.BaseInfo.Name
|
||||
baseID = sourceCtx.BaseData.BaseInfo.IdCard
|
||||
|
||||
// 兼容处理:安全访问Cases数组
|
||||
// 涉案公告列表:直接使用multCourtInfo.legalCases
|
||||
caseRecords := make([]caseAnnouncementRecord, 0)
|
||||
if stat.Civil.Cases != nil {
|
||||
caseRecords = append(caseRecords, convertCaseAnnouncements(stat.Civil.Cases, "民事案件")...)
|
||||
}
|
||||
if stat.Criminal.Cases != nil {
|
||||
caseRecords = append(caseRecords, convertCaseAnnouncements(stat.Criminal.Cases, "刑事案件")...)
|
||||
}
|
||||
if stat.Administrative.Cases != nil {
|
||||
caseRecords = append(caseRecords, convertCaseAnnouncements(stat.Administrative.Cases, "行政案件")...)
|
||||
}
|
||||
if stat.Preservation.Cases != nil {
|
||||
caseRecords = append(caseRecords, convertCaseAnnouncements(stat.Preservation.Cases, "非诉保全审查")...)
|
||||
}
|
||||
if stat.Bankrupt.Cases != nil {
|
||||
caseRecords = append(caseRecords, convertCaseAnnouncements(stat.Bankrupt.Cases, "强制清算与破产")...)
|
||||
for _, c := range mc.LegalCases {
|
||||
record := caseAnnouncementRecord{
|
||||
CaseNumber: defaultIfEmpty(c.CaseNumber, "-"),
|
||||
CaseType: defaultIfEmpty(c.CaseType, "-"),
|
||||
FilingDate: defaultIfEmpty(c.FilingTime, ""),
|
||||
Authority: defaultIfEmpty(c.Court, ""),
|
||||
}
|
||||
caseRecords = append(caseRecords, record)
|
||||
}
|
||||
identification.CaseAnnouncements.Records = caseRecords
|
||||
|
||||
if stat.Implement.Cases != nil {
|
||||
identification.EnforcementAnnouncements.Records = convertEnforcementAnnouncements(stat.Implement.Cases)
|
||||
// 执行公告列表:multCourtInfo.executionCases
|
||||
enfRecords := make([]enforcementAnnouncementRecord, 0, len(mc.ExecutionCases))
|
||||
for _, c := range mc.ExecutionCases {
|
||||
amountStr := strings.TrimSpace(c.ExecutionAmount)
|
||||
targetAmount := "-"
|
||||
if amountStr != "" && amountStr != "-" {
|
||||
targetAmount = formatCurrencyYuan(parseFloatSafe(amountStr))
|
||||
}
|
||||
record := enforcementAnnouncementRecord{
|
||||
CaseNumber: defaultIfEmpty(c.CaseNumber, "-"),
|
||||
TargetAmount: targetAmount,
|
||||
FilingDate: defaultIfEmpty(c.FilingTime, ""),
|
||||
Court: defaultIfEmpty(c.Court, ""),
|
||||
Status: defaultIfEmpty(c.CaseStatus, "-"),
|
||||
}
|
||||
enfRecords = append(enfRecords, record)
|
||||
}
|
||||
if sourceCtx.JudicialData.JudicialData.BreachCaseList != nil {
|
||||
identification.DishonestAnnouncements.Records = convertDishonestAnnouncements(sourceCtx.JudicialData.JudicialData.BreachCaseList, baseName, baseID)
|
||||
identification.EnforcementAnnouncements.Records = enfRecords
|
||||
|
||||
// 失信公告列表:multCourtInfo.disinCases
|
||||
dishonestRecords := make([]dishonestAnnouncementRecord, 0, len(mc.DisinCases))
|
||||
for _, item := range mc.DisinCases {
|
||||
record := dishonestAnnouncementRecord{
|
||||
DishonestPerson: defaultIfEmpty(baseName, "-"),
|
||||
IdCard: defaultIfEmpty(baseID, "-"),
|
||||
Court: defaultIfEmpty(item.Court, ""),
|
||||
FilingDate: defaultIfEmpty(item.FilingTime, item.DisposalTime),
|
||||
PerformanceStatus: defaultIfEmpty(item.JudgmentResult, defaultIfEmpty(item.CaseStatus, "-")),
|
||||
}
|
||||
dishonestRecords = append(dishonestRecords, record)
|
||||
}
|
||||
if sourceCtx.JudicialData.JudicialData.ConsumptionRestrictionList != nil {
|
||||
identification.HighConsumptionRestrictionAnn.Records = convertConsumptionRestrictions(sourceCtx.JudicialData.JudicialData.ConsumptionRestrictionList, baseName, baseID)
|
||||
identification.DishonestAnnouncements.Records = dishonestRecords
|
||||
|
||||
// 限高公告列表:multCourtInfo.limitCases
|
||||
limitRecords := make([]highRestrictionAnnouncementRecord, 0, len(mc.LimitCases))
|
||||
for _, item := range mc.LimitCases {
|
||||
record := highRestrictionAnnouncementRecord{
|
||||
RestrictedPerson: defaultIfEmpty(baseName, "-"),
|
||||
IdCard: defaultIfEmpty(baseID, "-"),
|
||||
Court: defaultIfEmpty(item.Court, ""),
|
||||
StartDate: defaultIfEmpty(item.FilingTime, item.DisposalTime),
|
||||
Measure: "限制高消费",
|
||||
}
|
||||
limitRecords = append(limitRecords, record)
|
||||
}
|
||||
identification.HighConsumptionRestrictionAnn.Records = limitRecords
|
||||
|
||||
return identification
|
||||
}
|
||||
@@ -1299,13 +1364,13 @@ func gatherOtherRiskDetails(sourceCtx *sourceContext) string {
|
||||
if risk.VeryFrequentRentalApplications > 0 {
|
||||
hits = append(hits, "租赁机构申请次数极多")
|
||||
}
|
||||
// 兼容处理:安全访问JudicialData
|
||||
if sourceCtx != nil && sourceCtx.JudicialData != nil {
|
||||
stat := sourceCtx.JudicialData.JudicialData.LawsuitStat
|
||||
totalCase := safeLen(stat.Civil.Cases) + safeLen(stat.Criminal.Cases) + safeLen(stat.Administrative.Cases) + safeLen(stat.Preservation.Cases) + safeLen(stat.Bankrupt.Cases)
|
||||
totalExecution := safeLen(stat.Implement.Cases)
|
||||
totalDishonest := safeLen(sourceCtx.JudicialData.JudicialData.BreachCaseList)
|
||||
totalRestriction := safeLen(sourceCtx.JudicialData.JudicialData.ConsumptionRestrictionList)
|
||||
// 兼容处理:根据DWBG8B4D.multCourtInfo判断是否存在司法记录
|
||||
if sourceCtx != nil && sourceCtx.BaseData != nil {
|
||||
mc := sourceCtx.BaseData.MultCourtInfo
|
||||
totalCase := safeLen(mc.LegalCases)
|
||||
totalExecution := safeLen(mc.ExecutionCases)
|
||||
totalDishonest := safeLen(mc.DisinCases)
|
||||
totalRestriction := safeLen(mc.LimitCases)
|
||||
if totalCase > 0 || totalExecution > 0 || totalDishonest > 0 || totalRestriction > 0 {
|
||||
hits = append(hits, "存在司法风险记录")
|
||||
}
|
||||
@@ -1393,11 +1458,10 @@ func buildRuleHitBullet(summary reportSummary) (string, bool, bool) {
|
||||
}
|
||||
|
||||
func buildJudicialBullet(ctx *sourceContext) (string, bool, bool) {
|
||||
if ctx.JudicialData == nil {
|
||||
if ctx == nil || ctx.BaseData == nil {
|
||||
return "", false, false
|
||||
}
|
||||
|
||||
stat := ctx.JudicialData.JudicialData.LawsuitStat
|
||||
mc := ctx.BaseData.MultCourtInfo
|
||||
parts := make([]string, 0, 6)
|
||||
|
||||
addPart := func(label string, count int) {
|
||||
@@ -1406,12 +1470,10 @@ func buildJudicialBullet(ctx *sourceContext) (string, bool, bool) {
|
||||
}
|
||||
}
|
||||
|
||||
addPart("刑事案件", len(stat.Criminal.Cases))
|
||||
addPart("民事案件", len(stat.Civil.Cases))
|
||||
addPart("行政案件", len(stat.Administrative.Cases))
|
||||
addPart("执行案件", len(stat.Implement.Cases))
|
||||
addPart("失信记录", len(ctx.JudicialData.JudicialData.BreachCaseList))
|
||||
addPart("限高记录", len(ctx.JudicialData.JudicialData.ConsumptionRestrictionList))
|
||||
addPart("涉案公告", len(mc.LegalCases))
|
||||
addPart("执行案件", len(mc.ExecutionCases))
|
||||
addPart("失信记录", len(mc.DisinCases))
|
||||
addPart("限高记录", len(mc.LimitCases))
|
||||
|
||||
if len(parts) == 0 {
|
||||
return "", false, false
|
||||
|
||||
@@ -133,15 +133,6 @@ func collectAPIData(ctx context.Context, params dto.DWBG8B4DReq, deps *processor
|
||||
"authorized": "1",
|
||||
},
|
||||
},
|
||||
// 个人司法涉诉查询 (FLXG7E8FReq: name, id_card, mobile_no)
|
||||
{
|
||||
apiCode: "FLXG7E8F",
|
||||
params: map[string]interface{}{
|
||||
"name": params.Name,
|
||||
"id_card": params.IDCard,
|
||||
"mobile_no": params.MobileNo,
|
||||
},
|
||||
},
|
||||
// 借贷意向验证A (JRZQ6F2AReq: name, id_card, mobile_no)
|
||||
{
|
||||
apiCode: "JRZQ6F2A",
|
||||
|
||||
Reference in New Issue
Block a user