This commit is contained in:
2026-07-08 21:28:08 +08:00
parent 352ee9eaf2
commit 9f985ea8c7
12 changed files with 2504 additions and 39 deletions

View File

@@ -0,0 +1,338 @@
package dwbg
import "tyapi-server/internal/domains/api/dto"
var rentalBehaviorFieldNames = []string{
"rentalApplicationInstitutionsLast3Days",
"rentalApplicationCountLast3Days",
"rentalApplicationInstitutionsLast3DaysWeekend",
"rentalApplicationCountLast3DaysWeekend",
"rentalApplicationInstitutionsLast3DaysNight",
"rentalApplicationCountLast3DaysNight",
"rentalApplicationInstitutionsLast7Days",
"rentalApplicationCountLast7Days",
"rentalApplicationInstitutionsLast7DaysWeekend",
"rentalApplicationCountLast7DaysWeekend",
"rentalApplicationInstitutionsLast7DaysNight",
"rentalApplicationCountLast7DaysNight",
"rentalApplicationInstitutionsLast14Days",
"rentalApplicationCountLast14Days",
"rentalApplicationInstitutionsLast14DaysWeekend",
"rentalApplicationCountLast14DaysWeekend",
"rentalApplicationInstitutionsLast14DaysNight",
"rentalApplicationCountLast14DaysNight",
"rentalApplicationInstitutionsLast1Month",
"rentalApplicationCountLast1Month",
"rentalApplicationInstitutionsLast1MonthWeekend",
"rentalApplicationCountLast1MonthWeekend",
"rentalApplicationInstitutionsLast1MonthNight",
"rentalApplicationCountLast1MonthNight",
"rentalApplicationInstitutionsLast3Months",
"rentalApplicationCountLast3Months",
"rentalApplicationInstitutionsLast3MonthsWeekend",
"rentalApplicationCountLast3MonthsWeekend",
"rentalApplicationInstitutionsLast3MonthsNight",
"rentalApplicationCountLast3MonthsNight",
"rentalApplicationInstitutionsLast6Months",
"rentalApplicationCountLast6Months",
"rentalApplicationInstitutionsLast6MonthsWeekend",
"rentalApplicationCountLast6MonthsWeekend",
"rentalApplicationInstitutionsLast6MonthsNight",
"rentalApplicationCountLast6MonthsNight",
"rentalApplicationInstitutionsLast12Months",
"rentalApplicationCountLast12Months",
"rentalApplicationInstitutionsLast12MonthsWeekend",
"rentalApplicationCountLast12MonthsWeekend",
"rentalApplicationInstitutionsLast12MonthsNight",
"rentalApplicationCountLast12MonthsNight",
}
var judicialCaseCountsKeys = []string{
"caseCounts",
"civilCaseCounts",
"criminalCaseCounts",
"administrativeCaseCounts",
"preservationCaseCounts",
"enforcementCaseCounts",
"supervisionCaseCounts",
"compensationCaseCounts",
"bankruptcyCaseCounts",
}
// emptyCaseCounts 返回司法统计 object 默认骨架(值均为 String
func emptyCaseCounts() map[string]interface{} {
return map[string]interface{}{
"beigaoTotalCaseAmounts": "0",
"beigaoTotalCasesCounts": "0",
"beigaoTotalJieAmountCases": "0",
"beigaoTotalJieCaseCounts": "0",
"beigaoTotalWeiAmountCases": "0",
"beigaoTotalWeiCaseCounts": "0",
"caseActionDistribution": "-",
"caseCloselDistribution": "-",
"localDistribution": "-",
"otherTotalCaseAmounts": "0",
"otherTotalCasesCounts": "0",
"otherTotalJieAmountCases": "0",
"otherTotalJieCaseCounts": "0",
"otherTotalWeiAmountCases": "0",
"otherTotalWeiCaseCounts": "0",
"timeDistribution": "-",
"totalCaseAmounts": "0",
"totalCasesCounts": "0",
"totalJieAmountCases": "0",
"totalJieCaseCounts": "0",
"totalWeiAmountCases": "0",
"totalWeiCaseCounts": "0",
"yuangaoTotalCaseAmounts": "0",
"yuangaoTotalCasesCounts": "0",
"yuangaoTotalJieAmountCases": "0",
"yuangaoTotalJieCaseCounts": "0",
"yuangaoTotalWeiAmountCases": "0",
"yuangaoTotalWeiCaseCounts": "0",
}
}
func emptyNewMultCourtInfo() map[string]interface{} {
info := make(map[string]interface{}, len(judicialCaseCountsKeys))
for _, key := range judicialCaseCountsKeys {
info[key] = emptyCaseCounts()
}
return info
}
func emptyCaseOverviewInfo() map[string]interface{} {
return map[string]interface{}{
"disinCaseCounts": 0,
"limitCaseCounts": 0,
"beigaoTotalCasesCounts": 0,
"beigaoTotalWeiCaseCounts": 0,
"executionCaseCounts": 0,
"beigaoTotalCaseAmounts": 0,
"affiliateCompany": 0,
"leastCaseTime": "",
}
}
// emptyJudicialLeaseReport 返回司法模块默认骨架。
func emptyJudicialLeaseReport() map[string]interface{} {
return map[string]interface{}{
"courtInfo": map[string]interface{}{
"civilCasesCount": 0,
"criminalCasesCount": 0,
"administrativeCasesCount": 0,
"preservationCasesCount": 0,
"enforcementCasesCount": 0,
"supervisionCasesCount": 0,
"compensationCasesCount": 0,
"bankruptcyCasesCount": 0,
"newMultCourtInfo": emptyNewMultCourtInfo(),
},
"caseOverviewInfo": emptyCaseOverviewInfo(),
}
}
func emptyRentalBehavior() map[string]interface{} {
behavior := make(map[string]interface{}, len(rentalBehaviorFieldNames))
for _, field := range rentalBehaviorFieldNames {
behavior[field] = "0/0"
}
return behavior
}
func emptyBaseInfo(params dto.DWBG6A2CReq) map[string]interface{} {
return map[string]interface{}{
"name": maskName(params.Name),
"idCard": maskIDCard(params.IDCard),
"phone": maskMobile(params.MobileNo),
"age": 0,
"sex": "",
"location": "",
"phoneArea": "",
"channel": "",
"status": -1,
}
}
func emptyStandLiveInfo() map[string]interface{} {
return map[string]interface{}{
"finalAuthResult": "1",
"verification": "-1",
"inTime": "-1",
}
}
func emptySecurityInfo() map[string]interface{} {
return map[string]interface{}{
"front": 0,
"drug": 0,
"takeDrug": 0,
"escape": 0,
"icase": 0,
"ikey": 0,
"itrancase": 0,
}
}
func emptyAntiFraudInfo() map[string]interface{} {
return map[string]interface{}{
"moneyLaundering": "0",
"deceiver": "0",
"gamblerPlayer": "0",
"gamblerBanker": "0",
}
}
func emptyRiskList() map[string]interface{} {
return map[string]interface{}{
"creditLeaseRisk": 0,
"bankOverdueRecord": 0,
"riskPhoneNumber": 0,
"highRiskArea": 0,
"creditOverdueRecord": 0,
"vehicleLeaseViolation": 0,
"courtViolator": 0,
"industryBlacklist": 0,
"identityFake": 0,
"groupFraud": 0,
"taxDebt": 0,
"mediumRelationRisk": 0,
"phoneNumberStatus": 0,
}
}
func emptyRiskPoint() map[string]interface{} {
return map[string]interface{}{
"multiQuery": 0,
"riskList": 0,
"newRiskFeature": 0,
"deductFail": 0,
"judicialRisk": 0,
"hitPreservationReview": 0,
"legalCasesFlag": 0,
"executionCasesFlag": 0,
"disinCasesFlag": 0,
"limitCasesFlag": 0,
"securityRisk": 0,
"antiFraudRisk": 0,
"registerRisk": 0,
"relationRisk": 0,
"judicialCase": 0,
}
}
func emptyApplicationStatistics() map[string]interface{} {
return map[string]interface{}{
"totalApplicationCount": 0,
"consumptionInstallmentApplicationCount": 0,
"onlineLoanApplicationCount": 0,
"otherApplicationCount": 0,
"lastApplicationDate": "-",
"daysSinceLastApplication": "-",
"applicationCountLastMonth": 0,
"applicationCountLast3Months": 0,
"applicationCountLast6Months": 0,
"applicationCountLast12Months": 0,
}
}
func emptyLendingStatistics() map[string]interface{} {
return map[string]interface{}{
"totalLendingInstitutionCount": 0,
"installmentLendingInstitutionCount": 0,
"onlineLendingInstitutionCount": 0,
"lastLendingDate": "-",
"daysSinceLastLending": "-",
"lendingCountLastMonth": 0,
"lendingAmountLastMonth": "0",
"lendingCountLast3Months": 0,
"lendingAmountLast3Months": "0",
"lendingCountLast6Months": 0,
"lendingAmountLast6Months": "0",
"lendingCountLast12Months": 0,
"lendingAmountLast12Months": "0",
"lendingCountLast24Months": 0,
"lendingAmountLast24Months": "0",
}
}
func emptyPerformanceStatistics() map[string]interface{} {
return map[string]interface{}{
"normalRepaymentRatio": "0",
"creditLoanDuration": 0,
"settledLoanOrderCount": 0,
"daysSinceLastPerformance": "-",
"performanceCountLastMonth": 0,
"performanceAmountLastMonth": "0",
"repaymentExceptionCountLastMonth": 0,
"performanceCountLast3Months": 0,
"performanceAmountLast3Months": "0",
"repaymentExceptionCountLast3Months": 0,
"performanceCountLast6Months": 0,
"performanceAmountLast6Months": "0",
"repaymentExceptionCountLast6Months": 0,
"performanceCountLast12Months": 0,
"performanceAmountLast12Months": "0",
"repaymentExceptionCountLast12Months": 0,
"performanceCountLast24Months": 0,
"performanceAmountLast24Months": "0",
"repaymentExceptionCountLast24Months": 0,
"serialVersionUID": 1,
}
}
func emptyOverdueRecord() map[string]interface{} {
return map[string]interface{}{
"currentOverdueInstitution": "-",
"currentOverdueCount": 0,
"totalOverdueAmount": "0",
"lastOverdueDate": "-",
"m0PlusCountLast6Months": 0,
"m1PlusCountLast6Months": 0,
"totalAmountLast6Months": "0",
"m0PlusCountLast12Months": 0,
"m1PlusCountLast12Months": 0,
"totalAmountLast12Months": "0",
"m0PlusCountLast24Months": 0,
"m1PlusCountLast24Months": 0,
"totalAmountLast24Months": "0",
}
}
func emptyCreditDetail() map[string]interface{} {
return map[string]interface{}{
"maxOnlineLoanCredit": "0",
"avgOnlineLoanCredit": "0",
"maxConsumptionInstallmentCredit": "0",
"avgConsumptionInstallmentCredit": "0",
}
}
func emptyRiskSupervision() map[string]interface{} {
return map[string]interface{}{
"leastApplicationTime": "",
"rentalRiskListIdCardRelationsPhones": 0,
"rentalRiskListPhoneRelationsIdCards": 0,
"details": "无",
}
}
// emptySinanReport 返回司南报告全字段默认骨架。
func emptySinanReport(params dto.DWBG6A2CReq) map[string]interface{} {
return map[string]interface{}{
"baseInfo": emptyBaseInfo(params),
"standLiveInfo": emptyStandLiveInfo(),
"riskPoint": emptyRiskPoint(),
"securityInfo": emptySecurityInfo(),
"antiFraudInfo": emptyAntiFraudInfo(),
"riskList": emptyRiskList(),
"applicationStatistics": emptyApplicationStatistics(),
"lendingStatistics": emptyLendingStatistics(),
"performanceStatistics": emptyPerformanceStatistics(),
"overdueRecord": emptyOverdueRecord(),
"creditDetail": emptyCreditDetail(),
"rentalBehavior": emptyRentalBehavior(),
"riskSupervision": emptyRiskSupervision(),
"judicialLeaseReport": emptyJudicialLeaseReport(),
}
}