切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
b786d75529e87729516998dd4e2fa20f5fde5f8f
2 个父辈
9a2aa1d9
284513ab
Merge branch 'test' of
http://gitlab.fjmaimaimai.com/allied-creation/performance
into test
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
59 行增加
和
0 行删除
pkg/application/summary_evaluation/service/service2.go
pkg/infrastructure/dao/summary_evaluation_dao.go
pkg/port/beego/controllers/summary_evaluation_controller.go
pkg/port/beego/routers/summary_evaluation_router.go
pkg/application/summary_evaluation/service/service2.go
查看文件 @
b786d75
...
...
@@ -871,3 +871,31 @@ func (srv *SummaryEvaluationService) ModifyFinishScore(param *command.ModifyFini
}
return
nil
}
// GetUnconfirmedCycleList 获取未确认绩效成绩的周期列表
func
(
srv
*
SummaryEvaluationService
)
GetUnconfirmedCycleList
(
companyId
int
,
userId
int
)
(
map
[
string
]
interface
{},
error
)
{
transactionContext
,
err
:=
factory
.
StartTransaction
()
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
defer
func
()
{
_
=
transactionContext
.
RollbackTransaction
()
}()
evaluationDao
:=
dao
.
NewSummaryEvaluationDao
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
cycles
,
err
:=
evaluationDao
.
TargetUnconfirmedCycleList
(
companyId
,
userId
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"获取周期列表"
+
err
.
Error
())
}
if
err
:=
transactionContext
.
CommitTransaction
();
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
var
cycleList
[]
adapter
.
CycleListAdapter
for
_
,
v
:=
range
cycles
{
cycleList
=
append
(
cycleList
,
adapter
.
CycleListAdapter
{
CycleId
:
v
.
CycleId
,
CycleName
:
v
.
CycleName
,
})
}
return
tool_funs
.
SimpleWrapGridMap
(
int64
(
len
(
cycleList
)),
cycleList
),
nil
}
...
...
pkg/infrastructure/dao/summary_evaluation_dao.go
查看文件 @
b786d75
package
dao
import
(
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
"time"
"github.com/go-pg/pg/v10"
...
...
@@ -138,6 +139,28 @@ func (d *SummaryEvaluationDao) CountTargetUserCycleList(executorId int, evaluati
return
cnt
,
err
}
// TargetUnconfirmedCycleList 用户【未确认绩效成绩】的周期列表
func
(
d
*
SummaryEvaluationDao
)
TargetUnconfirmedCycleList
(
companyId
int
,
executorId
int
)
([]
TargetUserCycle
,
error
)
{
sqlStr
:=
`select
summary_evaluation.cycle_id,
summary_evaluation.begin_time,
summary_evaluation.cycle_name
from summary_evaluation
where summary_evaluation.deleted_at isnull
and summary_evaluation.company_id='?'
and summary_evaluation.target_user ->>'userId'='?'
and summary_evaluation.types='?'
and summary_evaluation.status='?'
and summary_evaluation.check_result='?'
`
tx
:=
d
.
transactionContext
.
PgTx
condition
:=
[]
interface
{}{
companyId
,
executorId
,
domain
.
EvaluationFinish
,
domain
.
EvaluationCompleted
,
domain
.
EvaluationCheckUncompleted
}
sqlStr
+=
` order by summary_evaluation.begin_time desc `
result
:=
make
([]
TargetUserCycle
,
0
)
_
,
err
:=
tx
.
Query
(
&
result
,
sqlStr
,
condition
...
)
return
result
,
err
}
func
(
d
*
SummaryEvaluationDao
)
UpdateBeginTime
(
ids
[]
int
,
beginTime
time
.
Time
)
error
{
if
len
(
ids
)
==
0
{
return
nil
...
...
pkg/port/beego/controllers/summary_evaluation_controller.go
查看文件 @
b786d75
...
...
@@ -28,6 +28,13 @@ func (c *SummaryEvaluationController) GetExecutorCycleList() {
c
.
Response
(
data
,
err
)
}
func
(
c
*
SummaryEvaluationController
)
GetUnconfirmedScoreCycleList
()
{
srv
:=
service
.
NewSummaryEvaluationService
()
userReq
:=
middlewares
.
GetUser
(
c
.
Ctx
)
data
,
err
:=
srv
.
GetUnconfirmedCycleList
(
int
(
userReq
.
CompanyId
),
int
(
userReq
.
UserId
))
c
.
Response
(
data
,
err
)
}
func
(
c
*
SummaryEvaluationController
)
GetMenu
()
{
srv
:=
service
.
NewSummaryEvaluationService
()
paramReq
:=
&
command
.
QueryMenu
{}
...
...
pkg/port/beego/routers/summary_evaluation_router.go
查看文件 @
b786d75
...
...
@@ -11,6 +11,7 @@ func init() {
summaryNS
:=
web
.
NewNamespace
(
"/v1/summary-evaluation"
,
web
.
NSBefore
(
filters
.
AllowCors
(),
middlewares
.
CheckFontToken
()),
web
.
NSCtrlPost
(
"/executor/cycle/list"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetExecutorCycleList
),
web
.
NSCtrlPost
(
"/executor/cycle/unconfirmed-score"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetUnconfirmedScoreCycleList
),
web
.
NSCtrlPost
(
"/target_user/cycle/list"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetTargetUserCycleList
),
web
.
NSCtrlPost
(
"/cycle/menu"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetMenu
),
web
.
NSCtrlPost
(
"/evaluation-self"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetEvaluationSelf
),
...
...
请
注册
或
登录
后发表评论