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
a02143e8
authored
Nov 29, 2019
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加参数方式
parent
f3bfe591
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
47 deletions
cmd/static/company_info.go
cmd/static/enterprise_credit.go
cmd/static/main.go
cmd/static/company_info.go
View file @
a02143e8
package
main
var
(
currentScore
float64
totalScore
[
20
]
float64
c
_c
urrentScore
float64
c_
totalScore
[
20
]
float64
weight
float64
)
...
...
@@ -23,7 +23,7 @@ func CompanyInfo() {
NumberOfSocial
()
setProjectScore
(
totalScore
,
weight
,
stringTurnFloat64
(
modelInfo
[
"full_score"
]))
setProjectScore
(
c_
totalScore
,
weight
,
stringTurnFloat64
(
modelInfo
[
"full_score"
]))
setInsertScoreChanFooter
(
1
,
0
,
1
)
}
...
...
@@ -37,14 +37,14 @@ func EstablishmentTime() {
//五年以上有分
if
diffTime
>
(
3600
*
24
*
365
*
5
)
{
currentScore
=
1
c
_c
urrentScore
=
1
}
else
{
currentScore
=
0
c
_c
urrentScore
=
0
}
totalScore
[
0
]
=
currentScore
c_totalScore
[
0
]
=
c_
currentScore
setScore
(
currentScore
,
weight
)
setScore
(
c
_c
urrentScore
,
weight
)
setInsertScoreChanFooter
(
1
,
1
,
8
)
}
...
...
@@ -55,14 +55,14 @@ func CompanyNature() {
customer_property
:=
stringTurnInt64
(
companyBasicInfo
[
"customer_property"
])
if
customer_property
==
0
{
currentScore
=
0
c
_c
urrentScore
=
0
}
else
{
currentScore
=
1
c
_c
urrentScore
=
1
}
totalScore
[
1
]
=
currentScore
c_totalScore
[
1
]
=
c_
currentScore
setScore
(
currentScore
,
weight
)
setScore
(
c
_c
urrentScore
,
weight
)
setInsertScoreChanFooter
(
1
,
1
,
9
)
}
...
...
@@ -73,14 +73,14 @@ func ChangeslegalInFiveYears() {
//两次以上0分,以下一分
if
five_legal_change
<
2
{
currentScore
=
1
c
_c
urrentScore
=
1
}
else
{
currentScore
=
0
c
_c
urrentScore
=
0
}
totalScore
[
2
]
=
currentScore
c_totalScore
[
2
]
=
c_
currentScore
setScore
(
currentScore
,
weight
)
setScore
(
c
_c
urrentScore
,
weight
)
setInsertScoreChanFooter
(
1
,
1
,
10
)
}
...
...
@@ -90,16 +90,16 @@ func RegisteredCapital() {
registered_capital
:=
stringTurnInt64
(
companyBasicInfo
[
"registered_capital"
])
if
registered_capital
<
500000
{
currentScore
=
0
c
_c
urrentScore
=
0
}
else
if
registered_capital
>
2000000
{
currentScore
=
2
c
_c
urrentScore
=
2
}
else
{
currentScore
=
1
c
_c
urrentScore
=
1
}
totalScore
[
3
]
=
currentScore
c_totalScore
[
3
]
=
c_
currentScore
setScore
(
currentScore
,
weight
)
setScore
(
c
_c
urrentScore
,
weight
)
setInsertScoreChanFooter
(
1
,
1
,
11
)
}
...
...
@@ -108,16 +108,16 @@ func AnnualTaxRate() {
year_tax_payable
:=
stringTurnFloat64
(
companyBasicInfo
[
"year_tax_payable"
])
if
year_tax_payable
<
20000
{
currentScore
=
0
c
_c
urrentScore
=
0
}
else
if
year_tax_payable
>
50000
{
currentScore
=
2
c
_c
urrentScore
=
2
}
else
{
currentScore
=
1
c
_c
urrentScore
=
1
}
totalScore
[
4
]
=
currentScore
c_totalScore
[
4
]
=
c_
currentScore
setScore
(
currentScore
,
weight
)
setScore
(
c
_c
urrentScore
,
weight
)
setInsertScoreChanFooter
(
1
,
1
,
12
)
}
...
...
@@ -126,14 +126,14 @@ func lawsuitsInPastTwoYars() {
two_years_no_lawsuit
:=
stringTurnInt64
(
companyBasicInfo
[
"two_years_no_lawsuit"
])
if
two_years_no_lawsuit
==
1
{
currentScore
=
0
c
_c
urrentScore
=
0
}
else
{
currentScore
=
2
c
_c
urrentScore
=
2
}
totalScore
[
5
]
=
currentScore
c_totalScore
[
5
]
=
c_
currentScore
setScore
(
currentScore
,
weight
)
setScore
(
c
_c
urrentScore
,
weight
)
setInsertScoreChanFooter
(
1
,
1
,
13
)
}
...
...
@@ -143,14 +143,14 @@ func NumberOfSocial() {
social_security_participants
:=
stringTurnInt64
(
companyBasicInfo
[
"social_security_participants"
])
if
social_security_participants
>
5
{
currentScore
=
1
c
_c
urrentScore
=
1
}
else
{
currentScore
=
0
c
_c
urrentScore
=
0
}
totalScore
[
6
]
=
currentScore
c_totalScore
[
6
]
=
c_
currentScore
setScore
(
currentScore
,
weight
)
setScore
(
c
_c
urrentScore
,
weight
)
setInsertScoreChanFooter
(
1
,
1
,
14
)
}
...
...
cmd/static/enterprise_credit.go
View file @
a02143e8
package
main
var
(
e_currentScore
float64
e_totalScore
[
20
]
float64
e_currentScore
float64
e_weight
float64
)
...
...
cmd/static/main.go
View file @
a02143e8
...
...
@@ -32,6 +32,8 @@ var (
companyAddScore
[]
map
[
string
]
string
//设置等待
wg
sync
.
WaitGroup
//运行方式
runtype
string
)
...
...
@@ -44,25 +46,27 @@ func main() {
//设置协程数量
wg
.
Add
(
1
)
flag
.
StringVar
(
&
runtype
,
"runtype"
,
"one"
,
"default config path"
)
go
insertRecord
()
svc
:=
service
.
New
()
c
:=
context
.
Background
()
//调用服务获取公司信息,然后进行全局赋值
companyData
,
_
=
svc
.
GetCompanyCresitsList
(
c
)
if
runtype
==
"one"
{
//调用服务获取公司信息,然后进行全局赋值
companyData
,
_
=
svc
.
GetCompanyCresitsList
(
c
)
setLog
(
"companyData"
,
companyData
)
for
_
,
v
:=
range
companyData
{
insertScoreMsg
.
ComCreditsId
=
stringTurnInt64
(
v
[
"id"
])
getCompanyRunInfo
(
c
)
CompanyInfo
()
AddScore
()
HistoryBussiness
()
EnterPriseCredit
()
PersonalCredit
()
for
_
,
v
:=
range
companyData
{
insertScoreMsg
.
ComCreditsId
=
stringTurnInt64
(
v
[
"id"
])
getCompanyRunInfo
(
c
)
setSumScore
()
}
}
else
{
fmt
.
Print
(
"待补充rabbitmq"
)
}
//赋值完关闭通道
close
(
socreRecordChan
)
...
...
@@ -88,6 +92,15 @@ func setLog(k string,v interface{}){
log
.
Info
(
k
,
v
)
}
//计算单一项总的静态分
func
setSumScore
()
{
CompanyInfo
()
AddScore
()
HistoryBussiness
()
EnterPriseCredit
()
PersonalCredit
()
}
//协程增加分值记录
func
insertRecord
()
{
...
...
@@ -100,7 +113,6 @@ func insertRecord() {
//CurrentScore64 := float64(insertScoreMsgRecord.CurrentScore)
//插入数据
//if !math.IsNaN(CurrentScore64) && CurrentScore64 != 0 {
//
//}
insertId
,
err
:=
connect
.
InsertScores
(
ctx
,
insertScoreMsgRecord
)
fmt
.
Print
(
err
)
...
...
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