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
7e369f05
authored
Dec 16, 2019
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加代码
parent
dbf99228
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
26 deletions
cmd/static/detail/Common.go
internal/service/service.go
cmd/static/detail/Common.go
View file @
7e369f05
...
...
@@ -81,27 +81,28 @@ func GetCompanyModelItemsByProjectidWitchString(project_id int64 , stringVal str
func
GetScore
(
projectId
int64
,
stringVal
string
)
(
fianlscore
float64
)
{
var
score
float64
modelTypeInfo
,
_
:=
Svclient
.
GetCompanyModelByProjectid
(
Conclient
,
projectId
)
modelInfo
:=
make
(
map
[
string
]
string
)
//如果是四,就用文本类型查询
if
StringTurnInt64
(
modelTypeInfo
[
"numeric_type"
])
==
4
{
if
modelTypeInfo
[
"numeric_type"
]
==
"4"
{
modelInfo
=
GetCompanyModelItemsByProjectidWitchString
(
projectId
,
stringVal
)
}
else
{
modelInfo
=
GetCompanyModelItemsByProjectid
(
projectId
,
StringTurnFloat64
(
stringVal
))
}
switch
modelInfo
[
"unit"
]
{
case
"万元"
:
score
=
StringTurnFloat64
(
modelInfo
[
"score"
])
/
10000
break
default
:
score
=
StringTurnFloat64
(
modelInfo
[
"score"
])
/
1
var
score
float64
switch
modelTypeInfo
[
"unit"
]
{
case
"5"
:
score
=
StringTurnFloat64
(
stringVal
)
/
10000
break
default
:
score
=
StringTurnFloat64
(
stringVal
)
/
1
}
modelInfo
=
GetCompanyModelItemsByProjectid
(
projectId
,
score
)
}
return
score
return
StringTurnFloat64
(
modelInfo
[
"score"
])
}
//设置分数
...
...
internal/service/service.go
View file @
7e369f05
...
...
@@ -2,12 +2,10 @@ package service
import
(
"context"
"fmt"
"kaopu-server/internal/dao"
"kaopu-server/internal/model"
"github.com/bilibili/kratos/pkg/conf/paladin"
"github.com/pkg/errors"
"kaopu-server/internal/dao"
"kaopu-server/internal/model"
)
// Service service.
...
...
@@ -53,7 +51,7 @@ func (s *Service) GetUserList(ctx context.Context) (res []*model.Users, err erro
//调用DB方法,获取会员数据
res
,
_
=
s
.
dao
.
GetUserList
(
ctx
)
fmt
.
Println
(
res
)
//
fmt.Println(res)
return
}
...
...
@@ -66,7 +64,7 @@ func (s *Service) GetCompanyCresitsList(c context.Context) (res []map[string]str
//调用DB方法,获取会员数据
res
,
err
=
s
.
dao
.
GetCompanyCresitsList
(
c
)
fmt
.
Print
(
err
)
//
fmt.Print(err)
return
}
...
...
@@ -75,7 +73,7 @@ func (s *Service) GetCompanyBaseInfoByCid(c context.Context, companyId int64) (r
//调用DB方法,获取会员数据
res
,
err
=
s
.
dao
.
GetCompanyBaseInfoByCid
(
c
,
companyId
)
fmt
.
Print
(
err
)
//
fmt.Print(err)
return
}
...
...
@@ -84,7 +82,7 @@ func (s *Service) GetCompanyScoreFieldsByCid(c context.Context, companyId int64)
//调用DB方法,获取会员数据
res
,
err
=
s
.
dao
.
GetCompanyScoreFieldsByCid
(
c
,
companyId
)
fmt
.
Print
(
err
)
//
fmt.Print(err)
return
}
...
...
@@ -93,7 +91,7 @@ func (s *Service) GetBasicInfoByCid(c context.Context, erpCompanyCode string) (r
//调用DB方法,获取会员数据
res
,
err
=
s
.
dao
.
GetBasicInfoByCid
(
c
,
erpCompanyCode
)
fmt
.
Print
(
err
)
//
fmt.Print(err)
return
}
...
...
@@ -102,7 +100,7 @@ func (s *Service) GetCompanyModelByProjectid(c context.Context, projectId int64)
//调用DB方法,获取会员数据
res
,
err
=
s
.
dao
.
GetCompanyModelByProjectid
(
c
,
projectId
)
fmt
.
Print
(
err
)
//
fmt.Print(err)
return
}
...
...
@@ -112,7 +110,7 @@ func (s *Service) GetCompanyAddSore(c context.Context, companyId int64) (res []m
//调用DB方法,获取会员数据
res
,
err
=
s
.
dao
.
GetCompanyAddSoreByCid
(
c
,
companyId
)
fmt
.
Print
(
err
)
//
fmt.Print(err)
return
}
...
...
@@ -140,7 +138,7 @@ func (s *Service) UpdateStaticSumScores(c context.Context,com_credits model.ComC
//调用DB方法,获取会员数据
res
,
err
=
s
.
dao
.
UpdateStaticSumScores
(
c
,
com_credits
)
fmt
.
Print
(
err
)
//
fmt.Print(err)
return
}
...
...
@@ -149,7 +147,7 @@ func (s *Service) InsertScores(c context.Context,score model.Scores) (res int64,
//调用DB方法,获取会员数据
res
,
err
=
s
.
dao
.
InsertScores
(
c
,
score
)
fmt
.
Print
(
err
)
//
fmt.Print(err)
return
}
...
...
@@ -157,7 +155,7 @@ func (s *Service) InsertScores(c context.Context,score model.Scores) (res int64,
func
(
s
*
Service
)
GetCompanyAddSoreByCid
(
c
context
.
Context
,
companyId
int64
)
(
res
[]
map
[
string
]
string
,
err
error
){
//调用DB方法,获取会员数据
res
,
err
=
s
.
dao
.
GetCompanyAddSoreByCid
(
c
,
companyId
)
fmt
.
Print
(
err
)
//
fmt.Print(err)
return
}
...
...
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