f
This commit is contained in:
@@ -48,6 +48,7 @@ type baseProductData struct {
|
|||||||
RiskWarning riskWarning `json:"riskWarning"`
|
RiskWarning riskWarning `json:"riskWarning"`
|
||||||
StandLiveInfo standLiveInfo `json:"standLiveInfo"`
|
StandLiveInfo standLiveInfo `json:"standLiveInfo"`
|
||||||
VerifyRule string `json:"verifyRule"`
|
VerifyRule string `json:"verifyRule"`
|
||||||
|
MultCourtInfo multCourtInfo `json:"multCourtInfo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// baseInfo 存放被查询人的基础身份信息
|
// baseInfo 存放被查询人的基础身份信息
|
||||||
@@ -171,6 +172,34 @@ type standLiveInfo struct {
|
|||||||
FinalAuthResult string `json:"finalAuthResult"`
|
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 ---
|
// --- FLXG7E8F ---
|
||||||
|
|
||||||
// judicialProductData 对应 FLXG7E8F 司法产品数据
|
// judicialProductData 对应 FLXG7E8F 司法产品数据
|
||||||
@@ -702,52 +731,60 @@ func buildBasicInfo(ctx context.Context, sourceCtx *sourceContext) reportBasicIn
|
|||||||
Details: carrierDetails,
|
Details: carrierDetails,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 兼容处理:安全访问JudicialData
|
// 兼容处理:从DWBG8B4D.multCourtInfo获取司法记录条数,并按案件类型拆分
|
||||||
var stat *lawsuitStat
|
|
||||||
if sourceCtx != nil && sourceCtx.JudicialData != nil {
|
|
||||||
stat = &sourceCtx.JudicialData.JudicialData.LawsuitStat
|
|
||||||
}
|
|
||||||
|
|
||||||
totalCaseCount := 0
|
|
||||||
totalCriminal := 0
|
|
||||||
totalExecution := 0
|
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
|
totalDishonest := 0
|
||||||
totalRestriction := 0
|
totalRestriction := 0
|
||||||
if sourceCtx != nil && sourceCtx.JudicialData != nil {
|
criminalCount := 0
|
||||||
totalDishonest = safeLen(sourceCtx.JudicialData.JudicialData.BreachCaseList)
|
civilCount := 0
|
||||||
totalRestriction = safeLen(sourceCtx.JudicialData.JudicialData.ConsumptionRestrictionList)
|
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 {
|
totalLegal := criminalCount + civilCount + administrativeCount + preservationCount + bankruptCount
|
||||||
detailParts := make([]string, 0, 5)
|
|
||||||
if stat != nil {
|
if totalLegal > 0 || totalExecution > 0 || totalDishonest > 0 || totalRestriction > 0 {
|
||||||
addCaseDetail := func(label string, count int) {
|
detailParts := make([]string, 0, 8)
|
||||||
if count > 0 {
|
addCaseDetail := func(label string, count int) {
|
||||||
detailParts = append(detailParts, fmt.Sprintf("%s%d条", label, count))
|
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)
|
details := buildCaseDetails(detailParts)
|
||||||
verifications = append(verifications, verificationItem{
|
verifications = append(verifications, verificationItem{
|
||||||
Item: "法院信息",
|
Item: "法院信息",
|
||||||
@@ -821,50 +858,78 @@ func buildRiskIdentification(ctx context.Context, sourceCtx *sourceContext) risk
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// 兼容处理:安全访问JudicialData
|
// 兼容处理:从DWBG8B4D.multCourtInfo获取司法信息
|
||||||
if sourceCtx == nil || sourceCtx.JudicialData == nil {
|
if sourceCtx == nil || sourceCtx.BaseData == nil {
|
||||||
log.Debug("JudicialData为空,返回空的风险识别数据",
|
log.Debug("BaseData为空,返回空的风险识别数据",
|
||||||
zap.String("api_code", "COMBHZY2"),
|
zap.String("api_code", "COMBHZY2"),
|
||||||
)
|
)
|
||||||
return identification
|
return identification
|
||||||
}
|
}
|
||||||
|
mc := sourceCtx.BaseData.MultCourtInfo
|
||||||
stat := sourceCtx.JudicialData.JudicialData.LawsuitStat
|
|
||||||
baseName := ""
|
baseName := ""
|
||||||
baseID := ""
|
baseID := ""
|
||||||
if sourceCtx.BaseData != nil {
|
baseName = sourceCtx.BaseData.BaseInfo.Name
|
||||||
baseName = sourceCtx.BaseData.BaseInfo.Name
|
baseID = sourceCtx.BaseData.BaseInfo.IdCard
|
||||||
baseID = sourceCtx.BaseData.BaseInfo.IdCard
|
|
||||||
}
|
|
||||||
|
|
||||||
// 兼容处理:安全访问Cases数组
|
// 涉案公告列表:直接使用multCourtInfo.legalCases
|
||||||
caseRecords := make([]caseAnnouncementRecord, 0)
|
caseRecords := make([]caseAnnouncementRecord, 0)
|
||||||
if stat.Civil.Cases != nil {
|
for _, c := range mc.LegalCases {
|
||||||
caseRecords = append(caseRecords, convertCaseAnnouncements(stat.Civil.Cases, "民事案件")...)
|
record := caseAnnouncementRecord{
|
||||||
}
|
CaseNumber: defaultIfEmpty(c.CaseNumber, "-"),
|
||||||
if stat.Criminal.Cases != nil {
|
CaseType: defaultIfEmpty(c.CaseType, "-"),
|
||||||
caseRecords = append(caseRecords, convertCaseAnnouncements(stat.Criminal.Cases, "刑事案件")...)
|
FilingDate: defaultIfEmpty(c.FilingTime, ""),
|
||||||
}
|
Authority: defaultIfEmpty(c.Court, ""),
|
||||||
if stat.Administrative.Cases != nil {
|
}
|
||||||
caseRecords = append(caseRecords, convertCaseAnnouncements(stat.Administrative.Cases, "行政案件")...)
|
caseRecords = append(caseRecords, record)
|
||||||
}
|
|
||||||
if stat.Preservation.Cases != nil {
|
|
||||||
caseRecords = append(caseRecords, convertCaseAnnouncements(stat.Preservation.Cases, "非诉保全审查")...)
|
|
||||||
}
|
|
||||||
if stat.Bankrupt.Cases != nil {
|
|
||||||
caseRecords = append(caseRecords, convertCaseAnnouncements(stat.Bankrupt.Cases, "强制清算与破产")...)
|
|
||||||
}
|
}
|
||||||
identification.CaseAnnouncements.Records = caseRecords
|
identification.CaseAnnouncements.Records = caseRecords
|
||||||
|
|
||||||
if stat.Implement.Cases != nil {
|
// 执行公告列表:multCourtInfo.executionCases
|
||||||
identification.EnforcementAnnouncements.Records = convertEnforcementAnnouncements(stat.Implement.Cases)
|
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.EnforcementAnnouncements.Records = enfRecords
|
||||||
identification.DishonestAnnouncements.Records = convertDishonestAnnouncements(sourceCtx.JudicialData.JudicialData.BreachCaseList, baseName, baseID)
|
|
||||||
|
// 失信公告列表: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.DishonestAnnouncements.Records = dishonestRecords
|
||||||
identification.HighConsumptionRestrictionAnn.Records = convertConsumptionRestrictions(sourceCtx.JudicialData.JudicialData.ConsumptionRestrictionList, baseName, baseID)
|
|
||||||
|
// 限高公告列表: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
|
return identification
|
||||||
}
|
}
|
||||||
@@ -1299,13 +1364,13 @@ func gatherOtherRiskDetails(sourceCtx *sourceContext) string {
|
|||||||
if risk.VeryFrequentRentalApplications > 0 {
|
if risk.VeryFrequentRentalApplications > 0 {
|
||||||
hits = append(hits, "租赁机构申请次数极多")
|
hits = append(hits, "租赁机构申请次数极多")
|
||||||
}
|
}
|
||||||
// 兼容处理:安全访问JudicialData
|
// 兼容处理:根据DWBG8B4D.multCourtInfo判断是否存在司法记录
|
||||||
if sourceCtx != nil && sourceCtx.JudicialData != nil {
|
if sourceCtx != nil && sourceCtx.BaseData != nil {
|
||||||
stat := sourceCtx.JudicialData.JudicialData.LawsuitStat
|
mc := sourceCtx.BaseData.MultCourtInfo
|
||||||
totalCase := safeLen(stat.Civil.Cases) + safeLen(stat.Criminal.Cases) + safeLen(stat.Administrative.Cases) + safeLen(stat.Preservation.Cases) + safeLen(stat.Bankrupt.Cases)
|
totalCase := safeLen(mc.LegalCases)
|
||||||
totalExecution := safeLen(stat.Implement.Cases)
|
totalExecution := safeLen(mc.ExecutionCases)
|
||||||
totalDishonest := safeLen(sourceCtx.JudicialData.JudicialData.BreachCaseList)
|
totalDishonest := safeLen(mc.DisinCases)
|
||||||
totalRestriction := safeLen(sourceCtx.JudicialData.JudicialData.ConsumptionRestrictionList)
|
totalRestriction := safeLen(mc.LimitCases)
|
||||||
if totalCase > 0 || totalExecution > 0 || totalDishonest > 0 || totalRestriction > 0 {
|
if totalCase > 0 || totalExecution > 0 || totalDishonest > 0 || totalRestriction > 0 {
|
||||||
hits = append(hits, "存在司法风险记录")
|
hits = append(hits, "存在司法风险记录")
|
||||||
}
|
}
|
||||||
@@ -1393,11 +1458,10 @@ func buildRuleHitBullet(summary reportSummary) (string, bool, bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func buildJudicialBullet(ctx *sourceContext) (string, bool, bool) {
|
func buildJudicialBullet(ctx *sourceContext) (string, bool, bool) {
|
||||||
if ctx.JudicialData == nil {
|
if ctx == nil || ctx.BaseData == nil {
|
||||||
return "", false, false
|
return "", false, false
|
||||||
}
|
}
|
||||||
|
mc := ctx.BaseData.MultCourtInfo
|
||||||
stat := ctx.JudicialData.JudicialData.LawsuitStat
|
|
||||||
parts := make([]string, 0, 6)
|
parts := make([]string, 0, 6)
|
||||||
|
|
||||||
addPart := func(label string, count int) {
|
addPart := func(label string, count int) {
|
||||||
@@ -1406,12 +1470,10 @@ func buildJudicialBullet(ctx *sourceContext) (string, bool, bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addPart("刑事案件", len(stat.Criminal.Cases))
|
addPart("涉案公告", len(mc.LegalCases))
|
||||||
addPart("民事案件", len(stat.Civil.Cases))
|
addPart("执行案件", len(mc.ExecutionCases))
|
||||||
addPart("行政案件", len(stat.Administrative.Cases))
|
addPart("失信记录", len(mc.DisinCases))
|
||||||
addPart("执行案件", len(stat.Implement.Cases))
|
addPart("限高记录", len(mc.LimitCases))
|
||||||
addPart("失信记录", len(ctx.JudicialData.JudicialData.BreachCaseList))
|
|
||||||
addPart("限高记录", len(ctx.JudicialData.JudicialData.ConsumptionRestrictionList))
|
|
||||||
|
|
||||||
if len(parts) == 0 {
|
if len(parts) == 0 {
|
||||||
return "", false, false
|
return "", false, false
|
||||||
|
|||||||
@@ -133,15 +133,6 @@ func collectAPIData(ctx context.Context, params dto.DWBG8B4DReq, deps *processor
|
|||||||
"authorized": "1",
|
"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)
|
// 借贷意向验证A (JRZQ6F2AReq: name, id_card, mobile_no)
|
||||||
{
|
{
|
||||||
apiCode: "JRZQ6F2A",
|
apiCode: "JRZQ6F2A",
|
||||||
|
|||||||
Reference in New Issue
Block a user