切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
713c81eaf6d135ff6e23e2878f215683f91dd8a7
1 个父辈
70d6228e
日常保存
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
71 行增加
和
11 行删除
pkg/application/summary_evaluation/adapter/evaluation_info.go
pkg/application/summary_evaluation/command/edit_evaluation_value.go
pkg/application/summary_evaluation/service/service.go
pkg/domain/summary_evaluation.go
pkg/application/summary_evaluation/adapter/evaluation_info.go
查看文件 @
713c81e
...
...
@@ -9,7 +9,6 @@ type EvaluationInfoAdapter struct {
EvaluationProjectId
int
`json:"evaluationProjectId"`
//项目id
EvaluationProjectName
string
`json:"evaluationProjectName"`
//项目名称
LinkNodeId
int
`json:"linkNodeId,string"`
//评估环节id
LinkNodeName
string
`json:"linkNodeName"`
//评估环节名称
BeginTime
string
`json:"beginTime"`
//开始时间 2006-01-02 15:04:05
EndTime
string
`json:"endTime"`
//结束时间 2006-01-02 15:04:05
Status
string
`json:"status"`
//完成状态
...
...
pkg/application/summary_evaluation/command/edit_evaluation_value.go
0 → 100644
查看文件 @
713c81e
package
command
type
EditEvaluationValue
struct
{
SummaryEvaluationId
int
`json:"summaryEvaluationId,string"`
ExecutorId
int
`json:"-"`
//执行人id
CompanyId
int
`json:"-"`
//公司id
EvaluationItems
[]
struct
{
Value
string
`json:"value"`
Remark
string
`json:"remark"`
EvaluationItemId
string
`json:"evaluationItemId"`
}
`json:"evaluationItems"`
}
...
...
pkg/application/summary_evaluation/service/service.go
查看文件 @
713c81e
...
...
@@ -294,7 +294,7 @@ func (srv *SummaryEvaluationServeice) GetEvaluationSelf(param *command.QueryEval
evaluationItemRepo
:=
factory
.
CreateEvaluationItemUsedRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
itemValueRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
itemValueRepo
:=
factory
.
CreateSummaryEvaluation
Value
Repository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
_
,
evaluationList
,
err
:=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
...
...
@@ -313,20 +313,42 @@ func (srv *SummaryEvaluationServeice) GetEvaluationSelf(param *command.QueryEval
_
,
itemList
,
err
:=
evaluationItemRepo
.
Find
(
map
[
string
]
interface
{}{
"evaluationProjectId"
:
evaluationData
.
EvaluationProjectId
,
"nodeType"
:
int
(
domain
.
LinkNodeSelfAssessment
),
"limit"
:
300
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
_
,
itemValues
,
err
:=
itemValueRepo
.
Find
(
map
[
string
]
interface
{}{
"summaryEvaluationId"
:
evaluationData
.
Id
,
})
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
())
}
_
=
itemList
_
=
itemValueRepo
return
nil
,
nil
itemValuesAdapter
:=
srv
.
buildSummaryItemValue
(
itemList
,
itemValues
)
result
:=
adapter
.
EvaluationInfoAdapter
{
SummaryEvaluationId
:
evaluationData
.
Id
,
CycleId
:
int
(
evaluationData
.
CycleId
),
CycleName
:
evaluationData
.
CycleName
,
EvaluationProjectId
:
evaluationData
.
EvaluationProjectId
,
EvaluationProjectName
:
evaluationData
.
EvaluationProjectName
,
LinkNodeId
:
evaluationData
.
NodeId
,
BeginTime
:
evaluationData
.
BeginTime
.
Format
(
"2006-01-02 15:04:05"
),
EndTime
:
evaluationData
.
EndTime
.
Format
(
"2006-01-02 15:04:05"
),
Status
:
string
(
evaluationData
.
Status
),
EvaluationItems
:
itemValuesAdapter
,
}
return
&
result
,
nil
}
// 编辑综合自评详情
func
(
srv
*
SummaryEvaluationServeice
)
EditEvaluationSelf
()
(
map
[
string
][]
adapter
.
EvaluationItemAdapter
,
error
)
{
func
(
srv
*
SummaryEvaluationServeice
)
EditEvaluationSelf
(
param
*
command
.
EditEvaluationValue
)
(
map
[
string
][]
adapter
.
EvaluationItemAdapter
,
error
)
{
transactionContext
,
err
:=
factory
.
CreateTransactionContext
(
nil
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
...
...
@@ -337,7 +359,33 @@ func (srv *SummaryEvaluationServeice) EditEvaluationSelf() (map[string][]adapter
defer
func
()
{
_
=
transactionContext
.
RollbackTransaction
()
}()
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
itemUsedRepo
:=
factory
.
CreateEvaluationItemUsedRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
itemValueRepo
:=
factory
.
CreateSummaryEvaluationValueRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
evaluationData
,
err
:=
evaluationRepo
.
FindOne
(
map
[
string
]
interface
{}{
"id"
:
param
.
SummaryEvaluationId
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
_
,
itemList
,
err
:=
itemUsedRepo
.
Find
(
map
[
string
]
interface
{}{
"evaluationProjectId"
:
int
(
domain
.
LinkNodeSelfAssessment
),
"limit"
:
300
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
_
=
itemValueRepo
_
=
evaluationData
_
=
itemList
if
err
:=
transactionContext
.
CommitTransaction
();
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
...
...
pkg/domain/summary_evaluation.go
查看文件 @
713c81e
...
...
@@ -5,11 +5,12 @@ import "time"
// 周综合评估
type
SummaryEvaluation
struct
{
Id
int
CompanyId
int
//公司id
EvaluationProjectId
int
//对应的项目id
EvaluationProjectName
string
//对应的项目名称
CycleId
int64
//对应的周期id
CycleName
string
//对应的周期名称
CompanyId
int
//公司id
EvaluationProjectId
int
//对应的项目id
EvaluationProjectName
string
//对应的项目名称
CycleId
int64
//对应的周期id
CycleName
string
//对应的周期名称
NodeId
int
TargetUser
StaffDesc
//被评估的目标用户,被执行的
TargetDepartment
[]
StaffDepartment
//被评估的目标用户所在的部门
Executor
StaffDesc
//填写评估的用户,执行人
...
...
请
注册
或
登录
后发表评论