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
8538905f
authored
Dec 17, 2019
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加相应的代码
parent
7ded209b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
65 additions
and
61 deletions
cmd/static/detail/Common.go
cmd/static/main.go
internal/dao/basic_info.go
internal/dao/com_basicinfos.go
internal/dao/model_items.go
internal/dao/scores.go
internal/logic/mobile_message.go
internal/logic/tianyancha.go
cmd/static/detail/Common.go
View file @
8538905f
...
...
@@ -132,7 +132,6 @@ func SetProjectScore(totalScoreReplace [20]float64, weightReplace float64, fullS
sumScore
float64
=
0
joinNum
float64
=
0
)
fmt
.
Print
(
"totalScoreReplace"
,
totalScoreReplace
)
//查找出所有不是0的分值
for
i
:=
0
;
i
<
len
(
totalScoreReplace
)
;
i
++
{
...
...
@@ -159,7 +158,6 @@ func SetProjectScore(totalScoreReplace [20]float64, weightReplace float64, fullS
}
fmt
.
Print
(
"InsertScoreMsg.FinalScore"
,
InsertScoreMsg
.
FinalScore
)
InsertScoreMsg
.
Weight
=
weightReplace
...
...
cmd/static/main.go
View file @
8538905f
...
...
@@ -15,6 +15,47 @@ import (
"time"
)
type
RecvPro
struct
{
}
type
Rabitmq
struct
{
Dsn
string
//rabitmq 配置1
}
func
(
t
*
RecvPro
)
FailAction
([]
byte
)
error
{
fmt
.
Print
(
1
)
panic
(
"implement me"
)
}
type
RabbitMsg
struct
{
ComCreditsId
string
`json:"com_credits_id"`
ErpCompanyCode
string
`json:"erp_company_code"`
}
//获取配置参数
func
GetConfig
()
{
//获取输入参数
flag
.
Parse
()
if
err
:=
paladin
.
Init
();
err
!=
nil
{
panic
(
err
)
}
//初始化日志目录
SetLog
(
"kaopuserver start"
,
0
)
}
func
SetLog
(
k
string
,
v
interface
{}){
//初始化日志目录
log
.
Init
(
&
log
.
Config
{
Dir
:
"logs"
})
defer
log
.
Close
()
log
.
Info
(
k
,
v
)
}
func
main
()
{
//获取config
...
...
@@ -89,7 +130,7 @@ func (t *RecvPro) Consumer(dataByte []byte) error {
var
rbm
RabbitMsg
json
.
Unmarshal
(
dataByte
,
&
rbm
)
fmt
.
Print
(
rbm
)
fmt
.
Print
(
rbm
.
ErpCompanyCode
)
detail
.
SocreRecordChan
=
make
(
chan
model
.
Scores
)
//设置协程数量
...
...
@@ -113,45 +154,7 @@ func (t *RecvPro) Consumer(dataByte []byte) error {
type
RecvPro
struct
{
}
type
Rabitmq
struct
{
Dsn
string
//rabitmq 配置1
}
func
(
t
*
RecvPro
)
FailAction
([]
byte
)
error
{
fmt
.
Print
(
1
)
panic
(
"implement me"
)
}
type
RabbitMsg
struct
{
ComCreditsId
string
`json:"com_credits_id"`
ErpCompanyCode
string
`json:"erp_company_code"`
}
//获取配置参数
func
GetConfig
()
{
//获取输入参数
flag
.
Parse
()
if
err
:=
paladin
.
Init
();
err
!=
nil
{
panic
(
err
)
}
//初始化日志目录
SetLog
(
"kaopuserver start"
,
0
)
}
func
SetLog
(
k
string
,
v
interface
{}){
//初始化日志目录
log
.
Init
(
&
log
.
Config
{
Dir
:
"logs"
})
defer
log
.
Close
()
log
.
Info
(
k
,
v
)
}
...
...
internal/dao/basic_info.go
View file @
8538905f
...
...
@@ -32,6 +32,6 @@ func (d *dao) GetBasicInfoByCid(c context.Context, erp_company_code string) (res
break
}
fmt
.
Print
(
res
)
//
fmt.Print(res)
return
}
\ No newline at end of file
internal/dao/com_basicinfos.go
View file @
8538905f
...
...
@@ -41,6 +41,7 @@ func (d *dao) GetCompanyBaseInfoByCid(c context.Context, companyId int64) (res m
tycInfo
[
"com_credits_id"
]
=
res
[
"com_credits_id"
]
tycInfo
[
"tyc_select_num"
]
=
"1"
d
.
UpdateCompanyBaseInfoForTyc
(
c
,
tycInfo
)
logic
.
SendMessage
(
logic
.
StringTurnInt64
(
res
[
"legal_mobile_phone"
]),
""
)
}
return
...
...
internal/dao/model_items.go
View file @
8538905f
...
...
@@ -63,7 +63,7 @@ func (d *dao) GetCompanyModelItemsByProjectidWitchString(c context.Context, proj
break
}
fmt
.
Print
(
res
)
//
fmt.Print(res)
return
}
\ No newline at end of file
internal/dao/scores.go
View file @
8538905f
...
...
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"github.com/bilibili/kratos/pkg/log"
"kaopu-server/internal/logic"
"kaopu-server/internal/model"
"time"
"github.com/bilibili/kratos/pkg/database/sql"
...
...
@@ -13,7 +14,7 @@ import (
func
(
d
*
dao
)
InsertScores
(
ctx
context
.
Context
,
score
model
.
Scores
)
(
insertId
int64
,
err
error
)
{
//defer d.db.Close()
var
(
exitId
int
exitId
int
64
execSql
string
affectNum
int64
rows
*
sql
.
Rows
...
...
@@ -32,8 +33,7 @@ func (d *dao) InsertScores(ctx context.Context,score model.Scores) (insertId int
exitId
=
0
for
_
,
v
:=
range
twoMap
{
fmt
.
Print
(
v
)
exitId
=
1
exitId
=
logic
.
StringTurnInt64
(
v
[
"id"
])
break
}
...
...
internal/logic/mobile_message.go
View file @
8538905f
...
...
@@ -21,7 +21,7 @@ func SendMessage(mobile int64 , content string){
resp
,
err
:=
http
.
PostForm
(
APIDOMAIN
,
url
.
Values
{
"data"
:
{
string
(
requestContent
)},
"touser"
:
{
string
(
requestTel
)},
"keyword"
:
{
"
crm_notify_kefu
"
},
"keyword"
:
{
"
user_credit_apply_check
"
},
"k1"
:
{
Int64TurnString
(
int64
(
timeNow
))},
"k2"
:
{
Md5
(
Md5
(
Int64TurnString
(
int64
(
timeNow
)))
+
APIMD5STR
)},
"is_ignore"
:
{},
...
...
internal/logic/tianyancha.go
View file @
8538905f
...
...
@@ -38,7 +38,7 @@ type ChangeInfo struct {
ChangeItem
int64
`json:"changeItem"`
}
const
TIANYANCHATOKEN
=
"
ba7fd1d1-8ebd-4d4a-844a-d44d75815ad3
"
const
TIANYANCHATOKEN
=
"
4920e638-52c6-43c5-bdec-78affa06bdbe
"
//公司信息
const
COMPANYINFOURL
=
"http://open.api.tianyancha.com/services/open/ic/baseinfoV2/2.0"
//法律诉讼
...
...
@@ -63,17 +63,17 @@ func HttpGet(companyName string)(returnDatas map[string]string) {
returnData
[
"com_organization"
]
=
companyTycInfo
.
Result
.
OrgNumber
returnData
[
"tianyancha_json"
]
=
string
(
respBody
)
//公司性质
var
companyOrgType
string
if
strings
.
Contains
(
companyTycInfo
.
Result
.
CompanyOrgType
,
"上市"
)
{
companyOrgType
=
"1"
}
else
if
strings
.
Contains
(
companyTycInfo
.
Result
.
CompanyOrgType
,
"国企"
){
companyOrgType
=
"2"
}
else
if
strings
.
Contains
(
companyTycInfo
.
Result
.
CompanyOrgType
,
"央企"
){
companyOrgType
=
"3"
}
else
{
companyOrgType
=
"0"
}
returnData
[
"customer_property"
]
=
companyOrgType
//
var companyOrgType string
//
if strings.Contains(companyTycInfo.Result.CompanyOrgType,"上市") {
//
companyOrgType = "1"
//
}else if strings.Contains(companyTycInfo.Result.CompanyOrgType,"国企"){
//
companyOrgType = "2"
//
}else if strings.Contains(companyTycInfo.Result.CompanyOrgType,"央企"){
//
companyOrgType = "3"
//
}else{
//
companyOrgType = "0"
//
}
returnData
[
"customer_property"
]
=
"0"
//参保人数
returnData
[
"social_security_participants"
]
=
strconv
.
FormatFloat
(
companyTycInfo
.
Result
.
SocialStaffNum
,
'f'
,
-
1
,
64
)
...
...
@@ -94,9 +94,9 @@ func HttpGet(companyName string)(returnDatas map[string]string) {
json
.
Unmarshal
(
respBody
,
&
totalNum
)
returnData
[
"tianyancha_json"
]
+=
"||||"
+
string
(
respBody
)
if
totalNum
.
Result
.
Total
>
0
{
returnData
[
"two_years_no_lawsuit"
]
=
"
1
"
returnData
[
"two_years_no_lawsuit"
]
=
"
有
"
}
else
{
returnData
[
"two_years_no_lawsuit"
]
=
"
0
"
returnData
[
"two_years_no_lawsuit"
]
=
"
无
"
}
//------------------------------------两年内是否有法律诉讼---------------------------------------//
...
...
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