切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
38284cbe95160b5343f016234833f503ae00b8af
1 个父辈
8cabd81d
更新
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
69 行增加
和
1 行删除
pkg/application/notify/service/message_personal.go
pkg/infrastructure/repository/pg_summary_evaluation_repository.go
pkg/port/beego/controllers/message_personal_controller.go
pkg/port/beego/routers/message_personal_router.go
pkg/application/notify/service/message_personal.go
查看文件 @
38284cb
...
...
@@ -569,3 +569,58 @@ func (srv *MessagePersonalService) TodayMessageTaskAnomaly(param *command.GetUse
}
return
resp
,
nil
}
// 提醒人员去确认周期评估的成绩
func
(
srv
*
MessagePersonalService
)
SummaartEvaluationScore
(
userId
int
)
(
msg
map
[
string
]
interface
{},
err
error
)
{
msg
=
map
[
string
]
interface
{}{
"needNotify"
:
false
,
"cycleId"
:
"0"
,
"cycleName"
:
""
,
"targetUserId"
:
"0"
,
"targetUserName"
:
""
,
}
transactionContext
,
err
:=
factory
.
CreateTransactionContext
(
nil
)
if
err
!=
nil
{
return
msg
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
if
err
:=
transactionContext
.
StartTransaction
();
err
!=
nil
{
return
msg
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
defer
func
()
{
_
=
transactionContext
.
RollbackTransaction
()
}()
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
_
,
evaluationList
,
err
:=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"targetUserId"
:
userId
,
"checkResult"
:
domain
.
EvaluationCheckUncompleted
,
"types"
:
5
,
})
if
err
!=
nil
{
return
msg
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
if
len
(
evaluationList
)
==
0
{
return
msg
,
nil
}
nowTime
:=
time
.
Now
()
for
_
,
val
:=
range
evaluationList
{
if
nowTime
.
After
(
val
.
EndTime
)
{
msg
=
map
[
string
]
interface
{}{
"needNotify"
:
true
,
"cycleId"
:
strconv
.
FormatInt
(
val
.
CycleId
,
10
),
"cycleName"
:
val
.
CycleName
,
"targetUserId"
:
strconv
.
Itoa
(
val
.
TargetUser
.
UserId
),
"targetUserName"
:
val
.
TargetUser
.
UserName
,
}
break
}
}
if
err
:=
transactionContext
.
CommitTransaction
();
err
!=
nil
{
return
msg
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
return
msg
,
nil
}
...
...
pkg/infrastructure/repository/pg_summary_evaluation_repository.go
查看文件 @
38284cb
...
...
@@ -151,6 +151,11 @@ func (repo *SummaryEvaluationRepository) Find(queryOptions map[string]interface{
if
v
,
ok
:=
queryOptions
[
"status"
];
ok
{
query
.
Where
(
"status=?"
,
v
)
}
if
v
,
ok
:=
queryOptions
[
"checkResult"
];
ok
{
query
.
Where
(
"check_result=?"
,
v
)
}
if
v
,
ok
:=
queryOptions
[
"targetUserId"
];
ok
{
query
.
Where
(
`summary_evaluation.target_user->>'userId'='?'`
,
v
)
}
...
...
pkg/port/beego/controllers/message_personal_controller.go
查看文件 @
38284cb
...
...
@@ -49,3 +49,11 @@ func (c *MessagePersonalController) TodayMessageTaskStageModify() {
data
,
err
:=
srv
.
TodayMessageTaskStageModifyV2
(
&
param
)
c
.
Response
(
data
,
err
)
}
func
(
c
*
MessagePersonalController
)
TodayMessageSummaryEvaluationFinishScore
()
{
srv
:=
service
.
NewMessagePersonalService
()
userReq
:=
middlewares
.
GetUser
(
c
.
Ctx
)
userId
:=
int
(
userReq
.
UserId
)
data
,
err
:=
srv
.
SummaartEvaluationScore
(
userId
)
c
.
Response
(
data
,
err
)
}
...
...
pkg/port/beego/routers/message_personal_router.go
查看文件 @
38284cb
...
...
@@ -14,7 +14,7 @@ func init() {
web
.
NSCtrlGet
(
"/summary-evaluation/task_stage/today"
,
(
*
controllers
.
MessagePersonalController
)
.
TodayMessageTaskStageAnomaly
),
web
.
NSCtrlGet
(
"/summary-evaluation/task_record/today"
,
(
*
controllers
.
MessagePersonalController
)
.
TodayMessageTaskRecordAnomaly
),
web
.
NSCtrlGet
(
"/summary-evaluation/task_modify/today"
,
(
*
controllers
.
MessagePersonalController
)
.
TodayMessageTaskStageModify
),
//
web
.
NSCtrlGet
(
"/summary-evaluation-finish/confim-score"
,
(
*
controllers
.
MessagePersonalController
)
.
TodayMessageSummaryEvaluationFinishScore
),
)
web
.
AddNamespace
(
ns
)
}
...
...
请
注册
或
登录
后发表评论