切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
a5c15f6e7c3e71458774d5f9b3e6e139e509862e
1 个父辈
812a6438
更新
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
13 行增加
和
24 行删除
pkg/application/staff_assess/service/service.go
pkg/application/task/service/service.go
pkg/infrastructure/dao/task_dao.go
pkg/port/beego/controllers/task_controller.go
pkg/application/staff_assess/service/service.go
查看文件 @
a5c15f6
...
...
@@ -1256,7 +1256,7 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand)
if
v
.
Check
==
domain
.
TaskStageUncompleted
{
it
.
TaskStageCheck
.
RealCompletedAt
=
0
}
else
{
it
.
TaskStageCheck
.
RealCompletedAt
=
time
.
Now
()
.
Unix
(
)
it
.
TaskStageCheck
.
SetRealCompleted
(
time
.
Now
()
)
}
}
for
j
:=
range
it
.
TaskStages
{
...
...
@@ -1264,7 +1264,7 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand)
if
v
.
Check
==
domain
.
TaskStageUncompleted
{
it
.
TaskStages
[
j
]
.
RealCompletedAt
=
0
}
else
{
it
.
TaskStages
[
j
]
.
RealCompletedAt
=
time
.
Now
()
.
Unix
(
)
it
.
TaskStages
[
j
]
.
SetRealCompleted
(
time
.
Now
()
)
}
}
}
...
...
pkg/application/task/service/service.go
查看文件 @
a5c15f6
...
...
@@ -151,7 +151,6 @@ func (srv TaskService) CreateTask(transactionContext application.TransactionCont
}
// 更新任务
// TODO 检查是否可以修改,和通知
func
(
srv
TaskService
)
UpdateTask
(
param
*
command
.
UpdateTaskCommand
)
(
map
[
string
]
interface
{},
error
)
{
transactionContext
,
err
:=
factory
.
CreateTransactionContext
(
nil
)
if
err
!=
nil
{
...
...
@@ -209,13 +208,6 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string]
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"获取任务的相关人员"
+
err
.
Error
())
}
}
ok
,
err
:=
srv
.
canUpdateTask
(
taskData
,
stageList
)
if
err
!=
nil
{
return
nil
,
err
}
if
!
ok
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"日评数据已生成,任务不能再被编辑"
)
}
//更新相关人员
taskData
.
RelatedUser
=
[]
int
{}
for
_
,
val
:=
range
relatedUser
{
...
...
@@ -622,10 +614,6 @@ func (srv TaskService) ListTask(param *command.ListTaskCommand) (map[string]inte
return
result
,
nil
}
func
(
srv
TaskService
)
canUpdateTask
(
taskData
*
domain
.
Task
,
stageList
[]
*
domain
.
TaskStage
)
(
bool
,
error
)
{
return
true
,
nil
}
// CancelAttention 用户取消关注某个任务
func
(
srv
TaskService
)
CancelAttention
(
param
*
command
.
CancelAttentionCommand
)
error
{
transactionContext
,
err
:=
factory
.
CreateTransactionContext
(
nil
)
...
...
pkg/infrastructure/dao/task_dao.go
查看文件 @
a5c15f6
...
...
@@ -155,7 +155,7 @@ func (d *TaskDao) ListTaskStageNotHrbp(param ListTaskCondition) ([]ListTaskStage
if
param
.
OnlyMy
{
condition
=
append
(
condition
,
param
.
UserId
)
whereSql
+=
` and t_task_tage_1.leader_id = '?' `
}
else
if
param
.
LeaderId
!=
""
{
}
else
if
param
.
LeaderId
!=
""
&&
param
.
LeaderId
!=
"0"
{
condition
=
append
(
condition
,
param
.
LeaderId
)
whereSql
+=
` and t_task_tage_1.leader_id = ? `
}
...
...
@@ -186,7 +186,7 @@ func (d *TaskDao) CountTaskStageNotHrbp(param ListTaskCondition) (int, error) {
if
param
.
OnlyMy
{
condition
=
append
(
condition
,
param
.
UserId
)
whereSql
+=
` and task.leader ->>'id' = '?' `
}
else
if
param
.
LeaderId
!=
""
{
}
else
if
param
.
LeaderId
!=
""
&&
param
.
LeaderId
!=
"0"
{
condition
=
append
(
condition
,
param
.
LeaderId
)
whereSql
+=
` and task.leader ->>'id' = ? `
}
...
...
@@ -274,18 +274,18 @@ func (d *TaskDao) ListTaskStageByHrbp(param ListTaskCondition) ([]ListTaskStage,
whereSql
:=
``
if
param
.
OnlyMy
{
condition
=
append
(
condition
,
param
.
UserId
)
whereSql
+=
` and task.leader ->>'id' = '?' `
}
else
if
param
.
LeaderId
!=
""
{
whereSql
+=
` and t_task_tage_1.leader_id = '?' `
}
else
if
param
.
LeaderId
!=
""
&&
param
.
LeaderId
!=
"0"
{
condition
=
append
(
condition
,
param
.
LeaderId
)
whereSql
+=
` and t
ask.leader ->>'id'
= ? `
whereSql
+=
` and t
_task_tage_1.leader_id
= ? `
}
if
len
(
param
.
TaskName
)
>
0
{
condition
=
append
(
condition
,
param
.
TaskName
)
whereSql
+=
` and t
ask.
name like ? `
whereSql
+=
` and t
_task_tage_1.task_
name like ? `
}
if
len
(
param
.
LevelName
)
>
0
{
condition
=
append
(
condition
,
param
.
LevelName
)
whereSql
+=
` and t
ask
.level_name like ? `
whereSql
+=
` and t
_task_tage_1
.level_name like ? `
}
condition
=
append
(
condition
,
param
.
Limit
,
param
.
Offset
)
sqlStr
:=
fmt
.
Sprintf
(
withSql
,
whereSql
)
...
...
@@ -309,7 +309,7 @@ func (d *TaskDao) CountTaskStageByHrbp(param ListTaskCondition) (int, error) {
if
param
.
OnlyMy
{
condition
=
append
(
condition
,
param
.
UserId
)
whereSql
+=
` and task.leader ->>'id' = '?' `
}
else
if
param
.
LeaderId
!=
""
{
}
else
if
param
.
LeaderId
!=
""
&&
param
.
LeaderId
!=
"0"
{
condition
=
append
(
condition
,
param
.
LeaderId
)
whereSql
+=
` and task.leader ->>'id' = ? `
}
...
...
@@ -346,7 +346,7 @@ func (d *TaskDao) CountTaskStageAnomalyNotHrbp(param ListTaskCondition) (int, er
if
param
.
OnlyMy
{
condition
=
append
(
condition
,
param
.
UserId
)
whereSql
+=
` and task.leader ->>'id' = '?' `
}
else
if
param
.
LeaderId
!=
""
{
}
else
if
param
.
LeaderId
!=
""
&&
param
.
LeaderId
!=
"0"
{
condition
=
append
(
condition
,
param
.
LeaderId
)
whereSql
+=
` and task.leader ->>'id' = ? `
}
...
...
@@ -385,7 +385,7 @@ func (d *TaskDao) CountTaskStageAnomalyByHrbp(param ListTaskCondition) (int, err
if
param
.
OnlyMy
{
condition
=
append
(
condition
,
param
.
UserId
)
whereSql
+=
` and task.leader ->>'id' = '?' `
}
else
if
param
.
LeaderId
!=
""
{
}
else
if
param
.
LeaderId
!=
""
&&
param
.
LeaderId
!=
"0"
{
condition
=
append
(
condition
,
param
.
LeaderId
)
whereSql
+=
` and task.leader ->>'id' = ? `
}
...
...
pkg/port/beego/controllers/task_controller.go
查看文件 @
a5c15f6
...
...
@@ -118,6 +118,7 @@ func (c *TaskController) CancelAttention() {
return
}
userReq
:=
middlewares
.
GetUser
(
c
.
Ctx
)
paramReq
.
UserId
=
int
(
userReq
.
UserId
)
paramReq
.
CompanyId
=
int
(
userReq
.
CompanyId
)
err
=
srv
.
CancelAttention
(
paramReq
)
c
.
Response
(
nil
,
err
)
...
...
请
注册
或
登录
后发表评论