切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
a9ac68a4d7006e2229608d11082b73415fedb67e
1 个父辈
3e1aca11
修正评估总分计算
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
81 行增加
和
5 行删除
pkg/application/notify/sms_staff_assess.go
pkg/application/notify/sms_summary_evaluation.go
pkg/application/summary_evaluation/service/service.go
sql/2023-02-13.sql
pkg/application/notify/sms_staff_assess.go
查看文件 @
a9ac68a
...
...
@@ -37,7 +37,7 @@ func (notices notifyStaffAssess) makeNotify(param *domain.StaffAssess) *domain.L
return
&
newSms
}
// ifSend
Sms
确认是否发送通知
// ifSend 确认是否发送通知
func
(
notices
notifyStaffAssess
)
ifSend
(
index
int
)
(
bool
,
error
)
{
transactionContext
,
err
:=
factory
.
CreateTransactionContext
(
nil
)
if
err
!=
nil
{
...
...
pkg/application/notify/sms_summary_evaluation.go
查看文件 @
a9ac68a
...
...
@@ -38,7 +38,7 @@ func (notices notifySummaryEvaluation) makeNotify(param *domain.SummaryEvaluatio
return
&
newSms
}
// ifSend
Sms
确认是否发送通知
// ifSend 确认是否发送通知
func
(
notices
notifySummaryEvaluation
)
ifSend
(
index
int
)
(
bool
,
error
)
{
transactionContext
,
err
:=
factory
.
CreateTransactionContext
(
nil
)
if
err
!=
nil
{
...
...
pkg/application/summary_evaluation/service/service.go
查看文件 @
a9ac68a
...
...
@@ -1410,7 +1410,7 @@ func (srv *SummaryEvaluationService) editEvaluationValue(
*
itemValueList
=
append
(
*
itemValueList
,
v
)
}
// 计算总得分
err
:=
evaluationData
.
EvaluationTotalScore
(
nil
)
err
:=
evaluationData
.
EvaluationTotalScore
(
*
itemValueList
)
if
err
!=
nil
{
return
err
}
...
...
sql/2023-02-13.sql
查看文件 @
a9ac68a
ALTER
TABLE
"public"
.
"user"
ADD
COLUMN
"parent_id"
int8
DEFAULT
0
;
COMMENT
ON
COLUMN
"public"
.
"user"
.
"parent_id"
IS
'上级ID'
;
\ No newline at end of file
-- 变更user表字段
ALTER
TABLE
"public"
.
"user"
ADD
COLUMN
"parent_id"
int8
DEFAULT
0
;
COMMENT
ON
COLUMN
"public"
.
"user"
.
"parent_id"
IS
'上级ID'
;
-- 抽取旧数据到evaluation_item_used
WITH
t1
AS
(
SELECT
evaluation_project
.
company_id
,
evaluation_project
.
id
AS
project_id
,
jsonb_array_elements
(
evaluation_project
.
"template"
#>
'{linkNodes}'
)
AS
nodes
FROM
evaluation_project
ORDER
BY
id
),
t2
AS
(
SELECT
t1
.
company_id
,
t1
.
project_id
,
t1
.
nodes
->>
'id'
AS
node_id
,
t1
.
nodes
->>
'type'
AS
node_type
,
jsonb_array_elements
(
t1
.
nodes
#>
'{nodeContents}'
)
AS
node_contents
FROM
t1
)
INSERT
INTO
public
.
evaluation_item_used
(
company_id
,
evaluation_project_id
,
node_id
,
node_type
,
sort_by
,
category
,
"name"
,
prompt_title
,
prompt_text
,
entry_items
,
rule_type
,
"rule"
,
weight
,
required
,
created_at
,
updated_at
,
evaluator_id
)
SELECT
t2
.
company_id
,
t2
.
project_id
,
cast
(
t2
.
node_id
AS
int8
)
AS
node_id
,
cast
(
t2
.
node_type
AS
int8
)
AS
node_type
,
0
,
t2
.
node_contents
->>
'category'
AS
"category"
,
t2
.
node_contents
->>
'name'
AS
"name"
,
t2
.
node_contents
->>
'promptTitle'
AS
"prompt_title"
,
t2
.
node_contents
->>
'promptText'
AS
"prompt_text"
,
t2
.
node_contents
->
'entryItems'
AS
"entry_items"
,
cast
(
t2
.
node_contents
#>>
'{rule,type}'
AS
int8
)
AS
rule_type
,
t2
.
node_contents
->
'rule'
AS
"rule"
,
cast
(
t2
.
node_contents
->>
'weight'
AS
decimal
)
AS
"weight"
,
cast
(
t2
.
node_contents
->>
'required'
AS
int8
)
AS
"required"
,
now
(),
now
(),
cast
(
t2
.
node_contents
->>
'evaluatorId'
AS
int8
)
AS
"evaluator_id"
FROM
t2
;
-- evaluation_item_used 初始赋值 sort_by
UPDATE
evaluation_item_used
SET
sort_by
=
evaluation_item_used
.
id
;
-- evaluation_item_used 修正required 的值
UPDATE
evaluation_item_used
SET
required
=
1
WHERE
required
=
0
OR
required
ISNULL
;
-- evaluation_item_used修正weight的 值
UPDATE
evaluation_item_used
SET
weight
=
0
WHERE
weight
ISNULL
;
-- evaluation_item_used 修正rule的值
UPDATE
evaluation_item_used
SET
"rule"
=
'{}'
WHERE
"rule"
=
'null'
...
...
请
注册
或
登录
后发表评论