切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
a46e26da88a5f19694da4e40a05a95bd7c0b6399
1 个父辈
7b67e4f2
修复一些问题
隐藏空白字符变更
内嵌
并排对比
正在显示
8 个修改的文件
包含
48 行增加
和
15 行删除
pkg/application/notify/sms.go
pkg/application/notify/sms_staff_assess.go
pkg/application/notify/sms_summary_evaluation.go
pkg/application/summary_evaluation/service/export.go
pkg/application/summary_evaluation/service/service.go
pkg/domain/summary_evaluation.go
pkg/infrastructure/redis/redis_lock.go
pkg/infrastructure/repository/pg_user_repository.go
pkg/application/notify/sms.go
查看文件 @
a46e26d
...
...
@@ -174,7 +174,7 @@ func (notices *notifySms) sendSms(param *domain.LogSms) error {
}
func
dayZeroTime
(
t
time
.
Time
)
time
.
Time
{
y
,
m
,
d
:=
t
.
UTC
()
.
Date
()
t2
:=
time
.
Date
(
y
,
m
,
d
,
0
,
0
,
0
,
0
,
time
.
UTC
)
y
,
m
,
d
:=
t
.
Local
()
.
Date
()
t2
:=
time
.
Date
(
y
,
m
,
d
,
0
,
0
,
0
,
0
,
time
.
Local
)
return
t2
}
...
...
pkg/application/notify/sms_staff_assess.go
查看文件 @
a46e26d
...
...
@@ -33,7 +33,11 @@ func (notices notifyStaffAssess) makeNotify(param *domain.StaffAssess) *domain.L
CreatedAt
:
time
.
Now
(),
}
// 每日自评 结束前30 分钟
newSms
.
ExecuteAt
=
param
.
EndTime
.
Add
(
-
1800
*
time
.
Second
)
// newSms.ExecuteAt = param.EndTime.Add(-1800 * time.Second)
//改为 固定在截止时间 那天的 前一天晚上10
y
,
m
,
d
:=
param
.
EndTime
.
Local
()
.
Date
()
dayTime
:=
time
.
Date
(
y
,
m
,
d
,
0
,
0
,
0
,
0
,
time
.
Local
)
newSms
.
ExecuteAt
=
dayTime
.
Add
(
-
2
*
time
.
Hour
)
return
&
newSms
}
...
...
pkg/application/notify/sms_summary_evaluation.go
查看文件 @
a46e26d
...
...
@@ -34,7 +34,11 @@ func (notices notifySummaryEvaluation) makeNotify(param *domain.SummaryEvaluatio
CreatedAt
:
time
.
Now
(),
}
// 周期自评结束前4个小时,
newSms
.
ExecuteAt
=
param
.
EndTime
.
Add
(
-
4
*
time
.
Hour
)
// newSms.ExecuteAt = param.EndTime.Add(-4 * time.Hour)
//改为 固定在截止时间 那天的 前一天晚上10
y
,
m
,
d
:=
param
.
EndTime
.
Local
()
.
Date
()
dayTime
:=
time
.
Date
(
y
,
m
,
d
,
0
,
0
,
0
,
0
,
time
.
Local
)
newSms
.
ExecuteAt
=
dayTime
.
Add
(
-
2
*
time
.
Hour
)
return
&
newSms
}
...
...
pkg/application/summary_evaluation/service/export.go
查看文件 @
a46e26d
...
...
@@ -25,17 +25,26 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationSuper(param *command.Que
defer
func
()
{
_
=
transactionContext
.
RollbackTransaction
()
}()
//判断是否是hrbp
flagHrbp
,
err
:=
roleService
.
GetHRBP
(
transactionContext
,
param
.
CompanyId
,
param
.
UserId
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
if
flagHrbp
!=
1
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
"没有操作权限
"
)
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
"暂无数据
"
)
}
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
//判断是否是上级
userRepo
:=
factory
.
CreateUserRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
userRepo
:=
factory
.
CreateUserRepository
(
map
[
string
]
interface
{}{
_
,
parentUser
,
_
:=
userRepo
.
Find
(
map
[
string
]
interface
{}{
"parentId"
:
param
.
UserId
,
"limit"
:
1
,
})
if
len
(
parentUser
)
==
0
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
"暂无数据"
)
}
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
positionRepo
:=
factory
.
CreatePositionRepository
(
map
[
string
]
interface
{}{
...
...
pkg/application/summary_evaluation/service/service.go
查看文件 @
a46e26d
...
...
@@ -1458,7 +1458,6 @@ func (srv *SummaryEvaluationService) GetTargetUserEvaluationSuper(param *command
// 获取周期综合评估下,周期评估列表
func
(
srv
*
SummaryEvaluationService
)
ListAllEvaluationSuper
(
param
*
command
.
QueryEvaluationList
)
(
map
[
string
]
interface
{},
error
)
{
transactionContext
,
err
:=
factory
.
CreateTransactionContext
(
nil
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
...
...
@@ -1469,19 +1468,30 @@ func (srv *SummaryEvaluationService) ListAllEvaluationSuper(param *command.Query
defer
func
()
{
_
=
transactionContext
.
RollbackTransaction
()
}()
//判断是否是hrbp
flagHrbp
,
err
:=
roleService
.
GetHRBP
(
transactionContext
,
param
.
CompanyId
,
param
.
UserId
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
if
flagHrbp
!=
1
{
return
map
[
string
]
interface
{}{}
,
nil
return
tool_funs
.
SimpleWrapGridMap
(
0
,
[]
string
{})
,
nil
}
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
//判断是否是上级
userRepo
:=
factory
.
CreateUserRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
userRepo
:=
factory
.
CreateUserRepository
(
map
[
string
]
interface
{}{
_
,
parentUser
,
_
:=
userRepo
.
Find
(
map
[
string
]
interface
{}{
"parentId"
:
param
.
UserId
,
"limit"
:
1
,
})
if
len
(
parentUser
)
==
0
{
return
tool_funs
.
SimpleWrapGridMap
(
0
,
[]
string
{}),
nil
}
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
positionRepo
:=
factory
.
CreatePositionRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
...
...
pkg/domain/summary_evaluation.go
查看文件 @
a46e26d
...
...
@@ -39,10 +39,11 @@ type RatingCodeNumber struct {
type
EvaluationType
int
//综合评估类型
const
(
EvaluationSelf
EvaluationType
=
1
//自评
Evaluation360
EvaluationType
=
2
//360评估
EvaluationSuper
EvaluationType
=
3
//上级评估
EvaluationHrbp
EvaluationType
=
4
//人资评估
EvaluationSelf
EvaluationType
=
1
//自评
Evaluation360
EvaluationType
=
2
//360评估
EvaluationSuper
EvaluationType
=
3
//上级评估
EvaluationHrbp
EvaluationType
=
4
//人资评估
EvaluationFinish
EvaluationType
=
5
//评估考核结果 TODO
)
// 评估的填写状态
...
...
pkg/infrastructure/redis/redis_lock.go
0 → 100644
查看文件 @
a46e26d
package
redis
...
...
pkg/infrastructure/repository/pg_user_repository.go
查看文件 @
a46e26d
...
...
@@ -141,6 +141,10 @@ func (repo *UserRepository) Find(queryOptions map[string]interface{}) (int, []*d
query
.
Where
(
"name in(?)"
,
pg
.
In
(
v
))
}
if
v
,
ok
:=
queryOptions
[
"parentId"
];
ok
{
query
.
Where
(
"parent_id=?"
,
v
)
}
if
v
,
ok
:=
queryOptions
[
"offset"
];
ok
{
if
value
,
ok
:=
v
.
(
int
);
ok
{
query
.
Offset
(
value
)
...
...
请
注册
或
登录
后发表评论