切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
郑周
2 years ago
提交
6b0c13b83c085363dacff3fca837e2fd062ef93a
1 个父辈
fd29756c
1.任务记录 新增反馈内容字段
显示空白字符变更
内嵌
并排对比
正在显示
7 个修改的文件
包含
46 行增加
和
24 行删除
pkg/application/staff_assess/service/service.go
pkg/application/task/adapter/task_record_list.go
pkg/application/task/service/service.go
pkg/domain/task_record.go
pkg/infrastructure/pg/models/task_record.go
pkg/infrastructure/repository/pg_task_record_repository.go
sql/2.0.0.sql
pkg/application/staff_assess/service/service.go
查看文件 @
6b0c13b
...
...
@@ -1285,10 +1285,13 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand)
if
v
,
ok
:=
recordMap
[
it
.
Id
];
ok
{
it
.
AssistLevel
=
v
.
AssistLevel
// 更新上级辅导情况
it
.
AssistContent
=
v
.
AssistContent
// 更新上级辅导内容
it
.
RemarkContent
=
make
([]
domain
.
RemarkText
,
0
)
// 更新填写反馈内容
var
anomalyState
=
domain
.
AnomalyState0
key
:=
fmt
.
Sprintf
(
"%s-%s"
,
v
.
Category
,
v
.
Name
)
if
item
,
ok
:=
contentCategoryMap
[
key
];
ok
{
it
.
RemarkContent
=
append
(
it
.
RemarkContent
,
item
.
Remark
...
)
for
_
,
remark
:=
range
item
.
Remark
{
trimSpace
:=
strings
.
TrimLeft
(
remark
.
RemarkText
,
"
\n
"
)
// 去掉前换行符
trimSpace
=
strings
.
TrimRight
(
trimSpace
,
"
\n
"
)
// 去掉后换行符
...
...
pkg/application/task/adapter/task_record_list.go
查看文件 @
6b0c13b
package
adapter
import
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
type
TaskRecordAdapter
struct
{
Id
int
`json:"id,string" `
//comment:"记录ID"
StaffAssessId
int
`json:"staffAssessId,string" `
//comment:"每日评估的ID"
...
...
@@ -8,7 +10,9 @@ type TaskRecordAdapter struct {
TaskName
string
`json:"taskName" `
//comment:"任务名称"
TaskAlias
string
`json:"taskAlias" `
//comment:"任务别名"
TaskLeader
string
`json:"taskLeader"`
//comment:"任务负责人"
AssistContent
string
`json:"assistContent" `
//comment:"反馈内容"
RemarkContent
[]
domain
.
RemarkText
`json:"remarkContent" `
//comment:"任务填写反馈"
AssistLevel
int
`json:"assistLevel"`
//comment:"上级辅导情况"
AssistContent
string
`json:"assistContent" `
//comment:"上级辅导内容"
TaskStageCheck
TaskStage
`json:"taskStageCheck" `
//comment:"提交的里程碑"
CreatedAt
string
`json:"createdAt" `
//格式2006-01-02comment:"创建时间"
AnomalyState
int
`json:"anomalyState"`
//
...
...
pkg/application/task/service/service.go
查看文件 @
6b0c13b
...
...
@@ -801,12 +801,10 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map
defer
func
()
{
_
=
transactionContext
.
RollbackTransaction
()
}()
taskRecordRepo
:=
factory
.
CreateTaskRecordRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
assessContentRepo
:=
factory
.
CreateStaffAssessContentRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
taskRecordRepo
:=
factory
.
CreateTaskRecordRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
//assessContentRepo := factory.CreateStaffAssessContentRepository(map[string]interface{}{
// "transactionContext": transactionContext,
//})
cnt
,
taskRecordList
,
err
:=
taskRecordRepo
.
Find
(
map
[
string
]
interface
{}{
"companyId"
:
param
.
CompanyId
,
"taskId"
:
param
.
TaskId
,
...
...
@@ -814,6 +812,9 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map
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
())
}
resultList
:=
[]
adapter
.
TaskRecordAdapter
{}
nowDay
:=
time
.
Now
()
.
Format
(
"2006-01-02"
)
...
...
@@ -831,7 +832,9 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map
TaskName
:
val
.
TaskName
,
TaskAlias
:
val
.
TaskAlias
,
TaskLeader
:
val
.
TaskLeader
.
Name
,
AssistContent
:
""
,
RemarkContent
:
val
.
RemarkContent
,
// 填写反馈内容
AssistLevel
:
val
.
AssistLevel
,
// 上级辅助等级
AssistContent
:
val
.
AssistContent
,
// 上级辅助内容
AnomalyState
:
val
.
AnomalyState
,
TaskStageCheck
:
adapter
.
TaskStage
{
Id
:
val
.
Id
,
...
...
@@ -852,24 +855,24 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map
t2
:=
time
.
Unix
(
val
.
TaskStageCheck
.
RealCompletedAt
,
0
)
.
Local
()
.
Format
(
"2006-01-02"
)
item
.
TaskStageCheck
.
RealCompletedAt
=
t2
}
_
,
contentList
,
err
:=
assessContentRepo
.
Find
(
map
[
string
]
interface
{}{
"staffAssessId"
:
val
.
StaffAssessId
,
"category"
:
val
.
TaskCategory
,
"name"
:
val
.
TaskName
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"获取评估反馈数据"
+
err
.
Error
())
}
if
len
(
contentList
)
>
0
{
for
_
,
val2
:=
range
contentList
[
0
]
.
Remark
{
item
.
AssistContent
+=
val2
.
RemarkText
+
"
\n
"
}
}
//_, contentList, err := assessContentRepo.Find(map[string]interface{}{
// "staffAssessId": val.StaffAssessId,
// "category": val.TaskCategory,
// "name": val.TaskName,
//})
//if err != nil {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取评估反馈数据"+err.Error())
//}
//if len(contentList) > 0 {
// for _, val2 := range contentList[0].Remark {
// item.AssistContent += val2.RemarkText + "\n"
// }
//}
resultList
=
append
(
resultList
,
item
)
}
if
err
:=
transactionContext
.
CommitTransaction
();
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())
//}
result
:=
tool_funs
.
SimpleWrapGridMap
(
int64
(
cnt
),
resultList
)
return
result
,
nil
}
...
...
pkg/domain/task_record.go
查看文件 @
6b0c13b
...
...
@@ -29,6 +29,7 @@ type TaskRecord struct {
TaskLeader
TaskLeader
`json:"taskLeader" comment:"任务负责人"`
AssistLevel
int
`json:"assistLevel" comment:"上级辅导情况"`
AssistContent
string
`json:"assistContent" comment:"上级辅导内容"`
RemarkContent
[]
RemarkText
`json:"remarkContent" comment:"填写反馈"`
AnomalyState
int
`json:"anomalyState" comment:"异常是否反馈状态(-1初始状态、0异常、1正常)"`
TaskStages
[]
TaskStage
`json:"taskStages" comment:"里程碑列表"`
TaskStageCheck
TaskStage
`json:"taskStageCheck" comment:"提交的里程碑"`
...
...
pkg/infrastructure/pg/models/task_record.go
查看文件 @
6b0c13b
...
...
@@ -18,6 +18,7 @@ type TaskRecord struct {
TaskLeader
domain
.
TaskLeader
`comment:"任务负责人"`
AssistLevel
int
`comment:"上级辅导情况" pg:",use_zero"`
AssistContent
string
`comment:"上级辅导内容"`
RemarkContent
[]
domain
.
RemarkText
`comment:"填写反馈进度"`
AnomalyState
int
`comment:"异常反馈状态" pg:",use_zero"`
TaskStages
[]
domain
.
TaskStage
`comment:"里程碑列表"`
TaskStageCheck
domain
.
TaskStage
`comment:"提交的里程碑"`
...
...
pkg/infrastructure/repository/pg_task_record_repository.go
查看文件 @
6b0c13b
...
...
@@ -32,6 +32,7 @@ func (repo *TaskRecordRepository) TransformToDomain(m *models.TaskRecord) domain
TaskLeader
:
m
.
TaskLeader
,
AssistLevel
:
m
.
AssistLevel
,
AssistContent
:
m
.
AssistContent
,
RemarkContent
:
m
.
RemarkContent
,
AnomalyState
:
m
.
AnomalyState
,
TaskStages
:
m
.
TaskStages
,
TaskStageCheck
:
m
.
TaskStageCheck
,
...
...
@@ -53,6 +54,7 @@ func (repo *TaskRecordRepository) TransformToModel(d *domain.TaskRecord) models.
TaskLeader
:
d
.
TaskLeader
,
AssistLevel
:
d
.
AssistLevel
,
AssistContent
:
d
.
AssistContent
,
RemarkContent
:
d
.
RemarkContent
,
AnomalyState
:
d
.
AnomalyState
,
TaskStages
:
d
.
TaskStages
,
TaskStageCheck
:
d
.
TaskStageCheck
,
...
...
sql/2.0.0.sql
0 → 100644
查看文件 @
6b0c13b
-- 增加任务记录字段-填写反馈进度
ALTER
TABLE
public
.
task_record
ADD
remark_content
jsonb
NULL
;
COMMENT
ON
COLUMN
public
.
task_record
.
remark_content
IS
'填写反馈进度'
;
...
...
请
注册
或
登录
后发表评论