切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
郑周
2 years ago
提交
db7885e2c66f5d5e784efea02d7cdd99d6a8d403
1 个父辈
2dccf98b
1. 添加系统默认规则
显示空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
17 行增加
和
24 行删除
pkg/application/evaluation_project/project_service.go
pkg/application/evaluation_rule/rule_service.go
pkg/domain/evaluation_rule.go
pkg/application/evaluation_project/project_service.go
查看文件 @
db7885e
...
...
@@ -416,6 +416,11 @@ func (rs *EvaluationProjectService) List(in *command.QueryProjectCommand) (inter
_
,
users
,
_
:=
userRepository
.
Find
(
map
[
string
]
interface
{}{
"ids"
:
pmpUserIds
,
"limit"
:
len
(
pmpUserIds
)})
pmpUsers
=
users
}
if
err
:=
transactionContext
.
CommitTransaction
();
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
projectAdapters
:=
adapter
.
TransformProjectListAdapter
(
projects
,
pmpUsers
)
return
tool_funs
.
SimpleWrapGridMap
(
total
,
projectAdapters
),
nil
}
...
...
@@ -568,13 +573,7 @@ func (rs *EvaluationProjectService) CheckRecipients(in *command.CheckRecipientCo
repeatNum
++
}
}
//if repeatNum > 0 {
// return nil, application.ThrowError(application.BUSINESS_ERROR, fmt.Sprintf("有%d人已经在本周期其他项目内,需要将他们移除", repeatNum))
//}
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
if
err
:=
transactionContext
.
CommitTransaction
();
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
...
...
pkg/application/evaluation_rule/rule_service.go
查看文件 @
db7885e
...
...
@@ -162,23 +162,6 @@ func (rs *EvaluationRuleService) Remove(in *command.DeleteRuleCommand) (interfac
return
rule
,
nil
}
//func (rs *EvaluationRuleService) List(in *command.QueryRuleCommand) (interface{}, error) {
// transactionContext, err := factory.StartTransaction()
// if err != nil {
// return nil, err
// }
// defer func() {
// transactionContext.RollbackTransaction()
// }()
// ruleRepository := factory.CreateEvaluationRuleRepository(map[string]interface{}{"transactionContext": transactionContext})
//
// total, rules, err := ruleRepository.Find(tool_funs.SimpleStructToMap(in))
// if err != nil {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
// }
// return tool_funs.SimpleWrapGridMap(total, rules), nil
//}
func
(
rs
*
EvaluationRuleService
)
ListRelCreator
(
in
*
command
.
QueryRuleCommand
)
(
interface
{},
error
)
{
transactionContext
,
err
:=
factory
.
ValidateStartTransaction
(
in
)
if
err
!=
nil
{
...
...
@@ -220,6 +203,8 @@ func (rs *EvaluationRuleService) ListRelCreator(in *command.QueryRuleCommand) (i
ra
:=
&
adapter
.
RuleAdapter
{}
ra
.
EvaluationRule
=
rule
ras
=
append
(
ras
,
ra
)
total
+=
1
}
_
,
users
,
_
:=
userRepository
.
Find
(
map
[
string
]
interface
{}{
"ids"
:
creatorIds
,
"limit"
:
len
(
creatorIds
)})
...
...
@@ -234,6 +219,11 @@ func (rs *EvaluationRuleService) ListRelCreator(in *command.QueryRuleCommand) (i
ras
[
i
]
.
CreatorName
=
v
}
}
if
err
:=
transactionContext
.
CommitTransaction
();
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
return
tool_funs
.
SimpleWrapGridMap
(
total
,
ras
),
nil
}
...
...
@@ -271,5 +261,9 @@ func (rs *EvaluationRuleService) ListCreator(in *command.QueryCreatorCommand) (i
}
cas
=
append
(
cas
,
ca
)
}
if
err
:=
transactionContext
.
CommitTransaction
();
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
return
map
[
string
]
interface
{}{
"list"
:
cas
},
nil
}
...
...
pkg/domain/evaluation_rule.go
查看文件 @
db7885e
...
...
@@ -145,7 +145,7 @@ func GenerateSysRule(companyId int64) *EvaluationRule {
newRule
:=
&
EvaluationRule
{
Id
:
0
,
Name
:
"评级
(默认)
"
,
Name
:
"评级"
,
Remark
:
""
,
CompanyId
:
companyId
,
CreatorId
:
0
,
...
...
请
注册
或
登录
后发表评论