切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
7b67e4f258153114219c982686b333ac9b99960d
1 个父辈
b98fad0e
周期评估 查看限制
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
40 行增加
和
8 行删除
pkg/application/summary_evaluation/command/query_evaluation_list.go
pkg/application/summary_evaluation/service/export.go
pkg/application/summary_evaluation/service/service.go
pkg/infrastructure/repository/pg_summary_evaluation_repository.go
pkg/infrastructure/repository/pg_summary_evaluation_value_repository.go
pkg/port/beego/controllers/summary_evaluation_controller.go
pkg/application/summary_evaluation/command/query_evaluation_list.go
查看文件 @
7b67e4f
...
...
@@ -12,9 +12,11 @@ type QueryExecutorEvaluationList struct {
// 查询上级评估列表
type
QueryEvaluationList
struct
{
PageNumber
int
`json:"pageNumber"`
PageSize
int
`json:"pageSize"`
CycleId
int
`json:"cycleId,string"`
CompanyId
int
`json:"-"`
TargetUserName
string
`json:"targetUserName"`
PageNumber
int
`json:"pageNumber"`
PageSize
int
`json:"pageSize"`
CycleId
int
`json:"cycleId,string"`
CompanyId
int
`json:"-"`
//当前公司
UserId
int
`json:"-"`
//当前操作的员工id
TargetUserName
string
`json:"targetUserName"`
//按照目标员工的名称搜索
SummaryEvaluationId
[]
string
`json:"summaryEvaluationId"`
//按照id 获取数据
}
...
...
pkg/application/summary_evaluation/service/export.go
查看文件 @
7b67e4f
...
...
@@ -2,10 +2,12 @@ package service
import
(
"fmt"
"strconv"
"github.com/linmadan/egglib-go/core/application"
"github.com/xuri/excelize/v2"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
roleService
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/role"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/command"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
)
...
...
@@ -23,6 +25,13 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationSuper(param *command.Que
defer
func
()
{
_
=
transactionContext
.
RollbackTransaction
()
}()
flagHrbp
,
err
:=
roleService
.
GetHRBP
(
transactionContext
,
param
.
CompanyId
,
param
.
UserId
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
if
flagHrbp
!=
1
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
"没有操作权限"
)
}
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
...
...
@@ -47,6 +56,16 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationSuper(param *command.Que
if
len
(
param
.
TargetUserName
)
>
0
{
condition1
[
"targetUserName"
]
=
"%"
+
param
.
TargetUserName
+
"%"
}
if
len
(
param
.
SummaryEvaluationId
)
>
0
{
summaryEvaluationIds
:=
[]
int
{}
for
_
,
v
:=
range
param
.
SummaryEvaluationId
{
id
,
_
:=
strconv
.
Atoi
(
v
)
summaryEvaluationIds
=
append
(
summaryEvaluationIds
,
id
)
}
if
len
(
summaryEvaluationIds
)
>
0
{
condition1
[
"id"
]
=
summaryEvaluationIds
}
}
//获取评估列表信息
_
,
evaluationList
,
err
:=
evaluationRepo
.
Find
(
condition1
)
if
err
!=
nil
{
...
...
@@ -61,7 +80,6 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationSuper(param *command.Que
}
userMap
[
int64
(
v
.
TargetUser
.
UserId
)]
=
nil
targetUserIds
=
append
(
targetUserIds
,
v
.
TargetUser
.
UserId
)
}
if
len
(
targetUserIds
)
>
0
{
_
,
userList
,
err
:=
userRepo
.
Find
(
map
[
string
]
interface
{}{
...
...
pkg/application/summary_evaluation/service/service.go
查看文件 @
7b67e4f
...
...
@@ -1458,6 +1458,7 @@ func (srv *SummaryEvaluationService) GetTargetUserEvaluationSuper(param *command
// 获取周期综合评估下,周期评估列表
func
(
srv
*
SummaryEvaluationService
)
ListAllEvaluationSuper
(
param
*
command
.
QueryEvaluationList
)
(
map
[
string
]
interface
{},
error
)
{
transactionContext
,
err
:=
factory
.
CreateTransactionContext
(
nil
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
...
...
@@ -1468,6 +1469,13 @@ func (srv *SummaryEvaluationService) ListAllEvaluationSuper(param *command.Query
defer
func
()
{
_
=
transactionContext
.
RollbackTransaction
()
}()
flagHrbp
,
err
:=
roleService
.
GetHRBP
(
transactionContext
,
param
.
CompanyId
,
param
.
UserId
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
if
flagHrbp
!=
1
{
return
map
[
string
]
interface
{}{},
nil
}
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
...
...
pkg/infrastructure/repository/pg_summary_evaluation_repository.go
查看文件 @
7b67e4f
...
...
@@ -171,6 +171,9 @@ func (repo *SummaryEvaluationRepository) Find(queryOptions map[string]interface{
t
:=
v
.
(
time
.
Time
)
query
.
Where
(
`summary_evaluation.end_time>=?`
,
t
)
}
if
v
,
ok
:=
queryOptions
[
"id"
];
ok
{
query
.
Where
(
`summary_evaluation.id in (?)`
,
pg
.
In
(
v
))
}
query
.
Order
(
"id desc"
)
count
,
err
:=
query
.
SelectAndCount
()
...
...
pkg/infrastructure/repository/pg_summary_evaluation_value_repository.go
查看文件 @
7b67e4f
...
...
@@ -34,7 +34,6 @@ func (repo *SummaryEvaluationValueRepository) TransformToDomain(d *models.Summar
Rating
:
d
.
Rating
,
CreatedAt
:
d
.
CreatedAt
,
UpdatedAt
:
d
.
UpdatedAt
,
// IsTemporary: d.IsTemporary,
}
}
...
...
@@ -51,7 +50,6 @@ func (repo *SummaryEvaluationValueRepository) Save(param *domain.SummaryEvaluati
Remark
:
param
.
Remark
,
CreatedAt
:
param
.
CreatedAt
,
UpdatedAt
:
param
.
UpdatedAt
,
// IsTemporary: param.IsTemporary,
}
db
:=
repo
.
transactionContext
.
PgTx
if
m
.
Id
==
0
{
...
...
@@ -64,6 +62,7 @@ func (repo *SummaryEvaluationValueRepository) Save(param *domain.SummaryEvaluati
}
else
{
m
.
UpdatedAt
=
time
.
Now
()
_
,
err
:=
db
.
Model
(
&
m
)
.
WherePK
()
.
Update
()
if
err
!=
nil
{
return
err
}
...
...
pkg/port/beego/controllers/summary_evaluation_controller.go
查看文件 @
7b67e4f
...
...
@@ -332,6 +332,7 @@ func (c *SummaryEvaluationController) ListAllEvaluationSuper() {
}
userReq
:=
middlewares
.
GetUser
(
c
.
Ctx
)
param
.
CompanyId
=
int
(
userReq
.
CompanyId
)
param
.
UserId
=
int
(
userReq
.
UserId
)
data
,
err
:=
srv
.
ListAllEvaluationSuper
(
param
)
c
.
Response
(
data
,
err
)
}
...
...
@@ -347,6 +348,7 @@ func (c *SummaryEvaluationController) ExportAllEvaluationSuper() {
return
}
userReq
:=
middlewares
.
GetUser
(
c
.
Ctx
)
param
.
UserId
=
int
(
userReq
.
UserId
)
param
.
CompanyId
=
int
(
userReq
.
CompanyId
)
data
,
err
:=
srv
.
ExportAllEvaluationSuper
(
param
)
if
err
!=
nil
{
...
...
请
注册
或
登录
后发表评论