Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
kaopu-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a1c16f5b
authored
Dec 06, 2019
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加代码
parent
45593311
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
76 additions
and
4 deletions
cmd/static/Common.go
cmd/static/company_info.go
cmd/static/enterprise_credit.go
cmd/static/history_bussiness.go
cmd/static/personal_credit.go
internal/dao/model_topset.go
internal/model/model_topset.go
cmd/static/Common.go
View file @
a1c16f5b
...
@@ -71,6 +71,7 @@ func StringTurnFloat64(val string)(float64) {
...
@@ -71,6 +71,7 @@ func StringTurnFloat64(val string)(float64) {
return
floatval
return
floatval
}
}
//获取项目详情
func
getModelByProjectId
(
projectId
int64
)(
modelInfo
map
[
string
]
string
)
{
func
getModelByProjectId
(
projectId
int64
)(
modelInfo
map
[
string
]
string
)
{
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
connect
:=
dao
.
New
()
connect
:=
dao
.
New
()
...
@@ -78,6 +79,14 @@ func getModelByProjectId(projectId int64)(modelInfo map[string]string) {
...
@@ -78,6 +79,14 @@ func getModelByProjectId(projectId int64)(modelInfo map[string]string) {
return
res
return
res
}
}
//获取顶头详情
func
GetModelTopsetByProjectId
(
projectId
int64
)(
modelInfo
map
[
string
]
string
)
{
ctx
:=
context
.
Background
()
connect
:=
dao
.
New
()
res
,
_
:=
connect
.
GetModelTopsetByProjectId
(
ctx
,
projectId
)
return
res
}
//设置分数
//设置分数
func
SetScore
(
curretScoreRelace
float64
,
modelId
int64
)(
fimalScore
float64
)
{
func
SetScore
(
curretScoreRelace
float64
,
modelId
int64
)(
fimalScore
float64
)
{
...
...
cmd/static/company_info.go
View file @
a1c16f5b
...
@@ -19,7 +19,7 @@ func CompanyInfo()(finalScore float64) {
...
@@ -19,7 +19,7 @@ func CompanyInfo()(finalScore float64) {
lawsuitsInPastTwoYars
()
lawsuitsInPastTwoYars
()
NumberOfSocial
()
NumberOfSocial
()
modelInfo
:=
getModel
ByProjectId
(
1
)
modelInfo
:=
GetModelTopset
ByProjectId
(
1
)
weight
=
StringTurnFloat64
(
modelInfo
[
"weight"
])
weight
=
StringTurnFloat64
(
modelInfo
[
"weight"
])
finalScore
=
SetProjectScore
(
c_totalScore
,
weight
,
StringTurnFloat64
(
modelInfo
[
"full_score"
]))
finalScore
=
SetProjectScore
(
c_totalScore
,
weight
,
StringTurnFloat64
(
modelInfo
[
"full_score"
]))
...
...
cmd/static/enterprise_credit.go
View file @
a1c16f5b
...
@@ -13,7 +13,7 @@ func EnterPriseCredit()(finalScore float64) {
...
@@ -13,7 +13,7 @@ func EnterPriseCredit()(finalScore float64) {
IsEnterpriseOverdueWhether
()
IsEnterpriseOverdueWhether
()
IsHistoryOverdue
()
IsHistoryOverdue
()
modelInfo
:=
getModel
ByProjectId
(
2
)
modelInfo
:=
GetModelTopset
ByProjectId
(
2
)
e_weight
=
StringTurnFloat64
(
modelInfo
[
"weight"
])
e_weight
=
StringTurnFloat64
(
modelInfo
[
"weight"
])
finalScore
=
SetProjectScore
(
e_totalScore
,
e_weight
,
StringTurnFloat64
(
modelInfo
[
"full_score"
]))
finalScore
=
SetProjectScore
(
e_totalScore
,
e_weight
,
StringTurnFloat64
(
modelInfo
[
"full_score"
]))
SetInsertScoreChanFooter
(
1
,
0
,
2
)
SetInsertScoreChanFooter
(
1
,
0
,
2
)
...
...
cmd/static/history_bussiness.go
View file @
a1c16f5b
...
@@ -18,7 +18,7 @@ func HistoryBussiness()(finalScore float64) {
...
@@ -18,7 +18,7 @@ func HistoryBussiness()(finalScore float64) {
AverageMoneyThreeMonths
()
AverageMoneyThreeMonths
()
AverageMoneySixMonths
()
AverageMoneySixMonths
()
modelInfo
:=
getModel
ByProjectId
(
4
)
modelInfo
:=
GetModelTopset
ByProjectId
(
4
)
h_weight
=
StringTurnFloat64
(
modelInfo
[
"weight"
])
h_weight
=
StringTurnFloat64
(
modelInfo
[
"weight"
])
finalScore
=
SetProjectScore
(
h_totalScore
,
h_weight
,
StringTurnFloat64
(
modelInfo
[
"full_score"
]))
finalScore
=
SetProjectScore
(
h_totalScore
,
h_weight
,
StringTurnFloat64
(
modelInfo
[
"full_score"
]))
SetInsertScoreChanFooter
(
1
,
0
,
4
)
SetInsertScoreChanFooter
(
1
,
0
,
4
)
...
...
cmd/static/personal_credit.go
View file @
a1c16f5b
...
@@ -24,7 +24,7 @@ func PersonalCredit()(finalScore float64) {
...
@@ -24,7 +24,7 @@ func PersonalCredit()(finalScore float64) {
TotalCreditCardLimit
()
TotalCreditCardLimit
()
MaximumAmountOfSingleCreditCard
()
MaximumAmountOfSingleCreditCard
()
modelInfo
:=
getModel
ByProjectId
(
3
)
modelInfo
:=
GetModelTopset
ByProjectId
(
3
)
p_weight
=
StringTurnFloat64
(
modelInfo
[
"weight"
])
p_weight
=
StringTurnFloat64
(
modelInfo
[
"weight"
])
finalScore
=
SetProjectScore
(
p_totalScore
,
p_weight
,
StringTurnFloat64
(
modelInfo
[
"full_score"
]))
finalScore
=
SetProjectScore
(
p_totalScore
,
p_weight
,
StringTurnFloat64
(
modelInfo
[
"full_score"
]))
SetInsertScoreChanFooter
(
1
,
0
,
3
)
SetInsertScoreChanFooter
(
1
,
0
,
3
)
...
...
internal/dao/model_topset.go
0 → 100644
View file @
a1c16f5b
package
dao
import
(
"context"
"fmt"
"github.com/pkg/errors"
"github.com/bilibili/kratos/pkg/database/sql"
)
//通过projectId获取该项信息
func
(
d
*
dao
)
GetModelTopsetByProjectId
(
c
context
.
Context
,
projectId
int64
)
(
res
map
[
string
]
string
,
err
error
)
{
var
(
rows
*
sql
.
Rows
)
if
rows
,
err
=
d
.
db
.
Query
(
c
,
"select "
+
SqlField
+
" from lie_model_topset where project_id = ?"
,
projectId
);
err
!=
nil
{
err
=
errors
.
WithStack
(
err
)
return
}
defer
rows
.
Close
()
if
err
!=
nil
{
fmt
.
Println
(
"select fail,err:"
,
err
)
return
}
twoMap
,
err
:=
GetAllParam
(
rows
)
for
_
,
v
:=
range
twoMap
{
res
=
v
break
}
return
}
internal/model/model_topset.go
0 → 100644
View file @
a1c16f5b
package
model
//CREATE TABLE `lie_model_topset` (
//`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '模型ID',
//`type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '1静态 2动态 3银行',
//`project_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '项目ID',
//`project_name` varchar(128) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '项目名称',
//`full_score` int(5) unsigned NOT NULL DEFAULT '0' COMMENT '满分分值',
//`weight` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '权重',
//`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态,1-启用,-1-禁用',
//`creator` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '创建人',
//`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
//`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
//PRIMARY KEY (`id`),
//UNIQUE KEY `project_id` (`project_id`) USING BTREE,
//KEY `status_time` (`status`,`create_time`) USING BTREE,
//KEY `type_time` (`type`,`create_time`) USING BTREE
//) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COMMENT='模型配置表-一级分类配置';
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment