Commit c8b6345a by Joneq

修改任务不正确

parent c67b8c9c
......@@ -74,17 +74,26 @@ func StringTurnFloat64(val string)(float64) {
func getModelByProjectId(projectId int64)(modelInfo map[string]string) {
ctx := context.Background()
connect := dao.New()
res,_ := connect.GetCompanyModelByProjectid(ctx,1)
res,_ := connect.GetCompanyModelByProjectid(ctx,projectId)
return res
}
//设置分数
func setScore(curretScoreRelace float64,weightReplace float64) {
func SetScore(curretScoreRelace float64,modelId int64)(fimalScore float64) {
modelInfo := getModelByProjectId(modelId)
weightReplace := StringTurnFloat64(modelInfo["weight"])
if curretScoreRelace > StringTurnFloat64(modelInfo["full_score"]) {
curretScoreRelace = StringTurnFloat64(modelInfo["full_score"])
}
insertScoreMsg.TotalScore = curretScoreRelace
//设置分数
insertScoreMsg.FinalScore ,insertScoreMsg.CurrentScore = curretScoreRelace * weightReplace,curretScoreRelace * weightReplace
insertScoreMsg.Weight = weightReplace
return insertScoreMsg.FinalScore
}
//设置project总分
......@@ -98,15 +107,15 @@ func SetProjectScore(totalScoreReplace [20]float64, weightReplace float64, fullS
for i :=0;i < len(totalScoreReplace) ; i++ {
if totalScoreReplace[i] > 0 {
joinNum += 1
sumScore += totalScoreReplace[i] * weightReplace
sumScore += totalScoreReplace[i]
}
}
insertScoreMsg.CurrentScore = sumScore
insertScoreMsg.CurrentScore,insertScoreMsg.TotalScore = sumScore,sumScore
//如果是0则不判断了
if sumScore == 0 {
insertScoreMsg.TotalScore,insertScoreMsg.FinalScore = 0,0
insertScoreMsg.FinalScore = 0
}else{
//如果最后金额大于满分,则算为最满分
if sumScore > fullScore {
......@@ -115,7 +124,7 @@ func SetProjectScore(totalScoreReplace [20]float64, weightReplace float64, fullS
insertScoreMsg.TotalScore = sumScore
}
//经过权重计算之后的总分值
insertScoreMsg.FinalScore = sumScore / joinNum
insertScoreMsg.FinalScore = sumScore * weightReplace
}
insertScoreMsg.Weight = weightReplace
......
......@@ -11,9 +11,6 @@ var(
//公司信息计算
func CompanyInfo()(finalScore float64) {
modelInfo := getModelByProjectId(1)
weight = StringTurnFloat64(modelInfo["weight"])
EstablishmentTime()
CompanyNature()
ChangeslegalInFiveYears()
......@@ -22,6 +19,9 @@ func CompanyInfo()(finalScore float64) {
lawsuitsInPastTwoYars()
NumberOfSocial()
modelInfo := getModelByProjectId(1)
weight = StringTurnFloat64(modelInfo["weight"])
finalScore = SetProjectScore(c_totalScore,weight,StringTurnFloat64(modelInfo["full_score"]))
SetInsertScoreChanFooter(1,0,1)
return finalScore
......@@ -41,9 +41,7 @@ func EstablishmentTime() {
c_currentScore = 0
}
c_totalScore[0]= c_currentScore
setScore(c_currentScore,weight)
c_totalScore[0]= SetScore(c_currentScore,8)
SetInsertScoreChanFooter(1,1,8)
}
......@@ -59,9 +57,8 @@ func CompanyNature() {
c_currentScore = 1
}
c_totalScore[1]= c_currentScore
c_totalScore[1]= SetScore(c_currentScore,9)
setScore(c_currentScore,weight)
SetInsertScoreChanFooter(1,1,9)
}
......@@ -77,9 +74,7 @@ func ChangeslegalInFiveYears() {
c_currentScore = 0
}
c_totalScore[2]= c_currentScore
setScore(c_currentScore,weight)
c_totalScore[2]= SetScore(c_currentScore,10)
SetInsertScoreChanFooter(1,1,10)
}
......@@ -96,9 +91,7 @@ func RegisteredCapital() {
c_currentScore = 1
}
c_totalScore[3]= c_currentScore
setScore(c_currentScore,weight)
c_totalScore[3]= SetScore(c_currentScore,11)
SetInsertScoreChanFooter(1,1,11)
}
......@@ -114,9 +107,7 @@ func AnnualTaxRate() {
c_currentScore = 1
}
c_totalScore[4]= c_currentScore
setScore(c_currentScore,weight)
c_totalScore[4]= SetScore(c_currentScore,12)
SetInsertScoreChanFooter(1,1,12)
}
......@@ -130,9 +121,7 @@ func lawsuitsInPastTwoYars() {
c_currentScore = 2
}
c_totalScore[5]= c_currentScore
setScore(c_currentScore,weight)
c_totalScore[5]= SetScore(c_currentScore,13)
SetInsertScoreChanFooter(1,1,13)
}
......@@ -147,9 +136,7 @@ func NumberOfSocial() {
c_currentScore = 0
}
c_totalScore[6]= c_currentScore
setScore(c_currentScore,weight)
c_totalScore[6]= SetScore(c_currentScore,14)
SetInsertScoreChanFooter(1,1,14)
}
......
......@@ -10,12 +10,11 @@ var(
//企业征信(10分)
func EnterPriseCredit()(finalScore float64) {
modelInfo := getModelByProjectId(2)
e_weight = StringTurnFloat64(modelInfo["weight"])
IsEnterpriseOverdueWhether()
IsHistoryOverdue()
modelInfo := getModelByProjectId(2)
e_weight = StringTurnFloat64(modelInfo["weight"])
finalScore = SetProjectScore(e_totalScore,e_weight,StringTurnFloat64(modelInfo["full_score"]))
SetInsertScoreChanFooter(1,0,2)
return finalScore
......@@ -32,8 +31,7 @@ func IsEnterpriseOverdueWhether() {
e_currentScore = 5
}
e_totalScore[0]= e_currentScore
setScore(e_currentScore,e_weight)
e_totalScore[0]= SetScore(c_currentScore,15)
SetInsertScoreChanFooter(1,2,15)
}
......@@ -49,9 +47,7 @@ func IsHistoryOverdue() {
e_currentScore = 5
}
e_totalScore[1]= e_currentScore
setScore(e_currentScore,e_weight)
e_totalScore[1]= SetScore(c_currentScore,16)
SetInsertScoreChanFooter(1,2,16)
}
\ No newline at end of file
......@@ -9,8 +9,7 @@ var(
//历史交易情况(50分)
func HistoryBussiness()(finalScore float64) {
modelInfo := getModelByProjectId(4)
h_weight = StringTurnFloat64(modelInfo["weight"])
CooperationTime()
AccumulatedAmountOfCooperation()
......@@ -19,6 +18,8 @@ func HistoryBussiness()(finalScore float64) {
AverageMoneyThreeMonths()
AverageMoneySixMonths()
modelInfo := getModelByProjectId(4)
h_weight = StringTurnFloat64(modelInfo["weight"])
finalScore = SetProjectScore(h_totalScore,h_weight,StringTurnFloat64(modelInfo["full_score"]))
SetInsertScoreChanFooter(1,0,4)
return finalScore
......@@ -42,10 +43,7 @@ func CooperationTime() {
h_currentScore = 0
}
h_totalScore[0]= h_currentScore
//设置分数
setScore(h_currentScore,h_weight)
h_totalScore[0]= SetScore(h_currentScore,29)
SetInsertScoreChanFooter(1,4,29)
}
......@@ -71,10 +69,7 @@ func AccumulatedAmountOfCooperation() {
h_currentScore = 0
}
h_totalScore[1]= h_currentScore
//设置分数
setScore(h_currentScore,h_weight)
h_totalScore[1]= SetScore(h_currentScore,30)
SetInsertScoreChanFooter(1,4,30)
}
......@@ -99,10 +94,7 @@ func AccumulatedGrossProfit() {
h_currentScore = 0
}
h_totalScore[2]= h_currentScore
//设置分数
setScore(h_currentScore,h_weight)
h_totalScore[2]= SetScore(h_currentScore,31)
SetInsertScoreChanFooter(1,4,31)
}
......@@ -120,11 +112,7 @@ func HistoricalOverdueTimes() {
h_currentScore = 0
}
h_totalScore[3]= h_currentScore
//设置分数
setScore(h_currentScore,h_weight)
h_totalScore[3]= SetScore(h_currentScore,32)
SetInsertScoreChanFooter(1,4,32)
}
......@@ -149,10 +137,7 @@ func AverageMoneyThreeMonths() {
h_currentScore = 0
}
h_totalScore[4]= h_currentScore
//设置分数
setScore(h_currentScore,h_weight)
h_totalScore[4]= SetScore(h_currentScore,33)
SetInsertScoreChanFooter(1,4,33)
}
......@@ -178,10 +163,7 @@ func AverageMoneySixMonths() {
h_currentScore = 0
}
h_totalScore[5]= h_currentScore
//设置分数
setScore(h_currentScore,h_weight)
h_totalScore[5]= SetScore(h_currentScore,34)
SetInsertScoreChanFooter(1,4,33)
SetInsertScoreChanFooter(1,4,34)
}
......@@ -10,8 +10,7 @@ var(
//个人征信(30分)
func PersonalCredit()(finalScore float64) {
modelInfo := getModelByProjectId(3)
p_weight = StringTurnFloat64(modelInfo["weight"])
Age()
MaritalStatus()
......@@ -25,6 +24,8 @@ func PersonalCredit()(finalScore float64) {
TotalCreditCardLimit()
MaximumAmountOfSingleCreditCard()
modelInfo := getModelByProjectId(3)
p_weight = StringTurnFloat64(modelInfo["weight"])
finalScore = SetProjectScore(p_totalScore,p_weight,StringTurnFloat64(modelInfo["full_score"]))
SetInsertScoreChanFooter(1,0,3)
return finalScore
......@@ -41,10 +42,7 @@ func Age() {
p_currentScore = 0
}
p_totalScore[0]= p_currentScore
setScore(p_currentScore,p_weight)
p_totalScore[0]= SetScore(p_currentScore,17)
SetInsertScoreChanFooter(1,3,17)
}
......@@ -59,10 +57,7 @@ func MaritalStatus() {
p_currentScore = 0
}
p_totalScore[1]= p_currentScore
//设置分数
setScore(p_currentScore,p_weight)
p_totalScore[1]= SetScore(p_currentScore,18)
SetInsertScoreChanFooter(1,3,18)
}
......@@ -78,10 +73,7 @@ func DefaultAccountRatio() {
p_currentScore = 0
}
p_totalScore[2]= p_currentScore
//设置分数
setScore(p_currentScore,p_weight)
p_totalScore[2]= SetScore(p_currentScore,19)
SetInsertScoreChanFooter(1,3,19)
}
......@@ -97,10 +89,7 @@ func ExternalGuarantee() {
p_currentScore = 5
}
p_totalScore[3]= p_currentScore
//设置分数
setScore(p_currentScore,p_weight)
p_totalScore[3]= SetScore(p_currentScore,20)
SetInsertScoreChanFooter(1,3,20)
}
......@@ -116,11 +105,7 @@ func SumBeOverdueMonthTwoYesar() {
p_currentScore = 0
}
p_totalScore[4]= p_currentScore
//设置分数
setScore(p_currentScore,p_weight)
p_totalScore[4]= SetScore(p_currentScore,22)
SetInsertScoreChanFooter(1,3,22)
}
......@@ -139,10 +124,7 @@ func MaxBeOverdueTwoYears() {
p_currentScore = 3
}
p_totalScore[5]= p_currentScore
//设置分数
setScore(p_currentScore,p_weight)
p_totalScore[5]= SetScore(p_currentScore,23)
SetInsertScoreChanFooter(1,3,23)
}
......@@ -160,10 +142,7 @@ func IsBeOverdue() {
}
p_totalScore[6]= p_currentScore
//设置分数
setScore(p_currentScore,p_weight)
p_totalScore[6]= SetScore(p_currentScore,24)
SetInsertScoreChanFooter(1,3,24)
}
......@@ -180,10 +159,7 @@ func IsMortgage() {
p_currentScore = 1
}
p_totalScore[7]= p_currentScore
//设置分数
setScore(p_currentScore,p_weight)
p_totalScore[7]= SetScore(p_currentScore,25)
SetInsertScoreChanFooter(1,3,25)
}
......@@ -207,10 +183,7 @@ func NumberOfCreditInquiryInThePastTwoMonths() {
p_currentScore = 0
}
p_totalScore[8]= p_currentScore
//设置分数
setScore(p_currentScore,p_weight)
p_totalScore[8]= SetScore(p_currentScore,26)
SetInsertScoreChanFooter(1,3,26)
}
......@@ -226,10 +199,7 @@ func TotalCreditCardLimit() {
p_currentScore = 0
}
p_totalScore[9]= p_currentScore
//设置分数
setScore(p_currentScore,p_weight)
p_totalScore[9]= SetScore(p_currentScore,27)
SetInsertScoreChanFooter(1,3,27)
}
......@@ -245,10 +215,7 @@ func MaximumAmountOfSingleCreditCard() {
p_currentScore = 0
}
p_totalScore[10]= p_currentScore
//设置分数
setScore(p_currentScore,p_weight)
p_totalScore[10]= SetScore(p_currentScore,28)
SetInsertScoreChanFooter(1,3,28)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment