切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
郑周
2 years ago
提交
9d4a97b07f57caa04a358bebd5cc2860501b02f0
1 个父辈
f54c653b
1.修复输出时间 为本地时间格式
隐藏空白字符变更
内嵌
并排对比
正在显示
12 个修改的文件
包含
35 行增加
和
55 行删除
pkg/application/evaluation_project/project_service.go
pkg/application/node_task/node_task_service.go
pkg/domain/evaluation_template.go
pkg/infrastructure/repository/pg_evaluation_cycle_repository.go
pkg/infrastructure/repository/pg_evaluation_cycle_template_repository.go
pkg/infrastructure/repository/pg_evaluation_project_repository.go
pkg/infrastructure/repository/pg_evaluation_rule_repository.go
pkg/infrastructure/repository/pg_evaluation_template_repository.go
pkg/infrastructure/repository/pg_node_task_repository.go
pkg/infrastructure/repository/pg_role_repository.go
pkg/infrastructure/repository/pg_role_user_repository.go
pkg/utils/common.go
pkg/application/evaluation_project/project_service.go
查看文件 @
9d4a97b
...
...
@@ -185,18 +185,18 @@ func (rs *EvaluationProjectService) UpdateTemplate(in *command.UpdateProjectTemp
// 重新计算
if
task
.
NextSentAt
==
nil
{
// 环节起始和截止本地时间
startLocal
:=
task
.
TimeStart
.
Local
()
endLocal
:=
task
.
TimeEnd
.
Local
()
startLocal
:=
task
.
TimeStart
endLocal
:=
task
.
TimeEnd
// 在当前时间之前,则计算下一个周期时间
if
startLocal
.
Before
(
now
)
{
nextTime
:=
utils
.
NextTime
(
nowO
,
startLocal
,
task
.
KpiCycle
)
task
.
NextSentAt
=
&
nextTime
}
else
{
task
.
NextSentAt
=
&
startLocal
task
.
NextSentAt
=
startLocal
}
// 如果超出截至时间,则周期置空
if
task
.
NextSentAt
.
After
(
endLocal
)
{
if
task
.
NextSentAt
.
After
(
endLocal
.
Local
()
)
{
task
.
NextSentAt
=
nil
}
}
else
{
...
...
@@ -468,18 +468,18 @@ func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand)
}
// 环节起始和截止本地时间
startLocal
:=
node
.
TimeStart
.
Local
()
endLocal
:=
node
.
TimeEnd
.
Local
()
startLocal
:=
node
.
TimeStart
endLocal
:=
node
.
TimeEnd
// 在当前时间之前,则计算下一个周期时间
if
startLocal
.
Before
(
now
)
{
nextTime
:=
utils
.
NextTime
(
nowO
,
startLocal
,
node
.
KpiCycle
)
task
.
NextSentAt
=
&
nextTime
}
else
{
task
.
NextSentAt
=
&
startLocal
task
.
NextSentAt
=
startLocal
}
// 如果超出截至时间,则周期置空
if
task
.
NextSentAt
.
After
(
endLocal
)
{
if
task
.
NextSentAt
.
After
(
endLocal
.
Local
()
)
{
task
.
NextSentAt
=
nil
}
...
...
pkg/application/node_task/node_task_service.go
查看文件 @
9d4a97b
...
...
@@ -87,7 +87,7 @@ func (rs *NodeTaskService) SendEvaluationNode() error {
maxTime
:=
task
.
TimeEnd
.
Local
()
// 当前周起始时间和截止时间
var
cycleTimeStart
=
task
.
NextSentAt
.
Local
()
var
cycleTimeStart
=
task
.
NextSentAt
var
cycleTimeEnd
time
.
Time
// 下个周期起始时间
...
...
pkg/domain/evaluation_template.go
查看文件 @
9d4a97b
...
...
@@ -17,11 +17,6 @@ const (
LinkNodeAllAssessment
int
=
3
// 环节-360°评估
LinkNodeSuperiorAssessment
int
=
4
// 环节-上级评估
LinkNodeViewResult
int
=
5
// 环节-绩效结果查看
//LinkNodeAssessment int = 1 // 环节-评估(自评、360°评估、上级评估)
//LinkNodeAllInvite int = 2 // 环节-360°邀请
//LinkNodeViewResult int = 3 // 环节-绩效结果查看
)
type
EntryItem
struct
{
...
...
@@ -42,17 +37,7 @@ type NodeContent struct {
EntryItems
[]
*
EntryItem
`json:"entryItems" comment:"填写项"`
}
//// NodeAllInvite 360°邀请
//type NodeAllInvite struct {
// ParentDifferentIds []string `json:"parentDifferentIds" comment:"不同上级同事ID"`
// ParentSameIds []string `json:"parentSameIds" comment:"相同上级同事ID"`
//}
//// NodeKpiResult 绩效结果查看
//type NodeKpiResult struct {
//}
// 评估流程、环节
// LinkNode 评估流程、环节
type
LinkNode
struct
{
Id
int64
`json:"id,string" comment:"环节ID"`
Type
int
`json:"type" comment:"环节类型"`
...
...
@@ -64,7 +49,7 @@ type LinkNode struct {
KpiCycle
int
`json:"kpiCycle" comment:"考核周期(1日、2周、3月)"`
}
// 评估模板
//
EvaluationTemplate
评估模板
type
EvaluationTemplate
struct
{
Id
int64
`json:"id,string" comment:"ID"`
Name
string
`json:"name" comment:"名称"`
...
...
@@ -78,14 +63,6 @@ type EvaluationTemplate struct {
DeletedAt
*
time
.
Time
`json:"deletedAt" comment:"删除时间"`
}
//type EvaluationLink struct {
// NodeSelfAssessment *LinkNode `json:"nodeSelfAssessment" comment:"填写反馈自评"`
// NodeAllInvite *LinkNode `json:"nodeAllInvite" comment:"360°邀请"`
// NodeAllAssessment *LinkNode `json:"nodeAllAssessment" comment:"360°评估"`
// NodeSuperiorAssessment *LinkNode `json:"nodeSuperiorAssessment" comment:"上级评估"`
// NodeViewResult *LinkNode `json:"nodeViewResult" comment:"绩效结果查看"`
//}
type
EvaluationTemplateRepository
interface
{
Insert
(
template
*
EvaluationTemplate
)
(
*
EvaluationTemplate
,
error
)
Remove
(
template
*
EvaluationTemplate
)
(
*
EvaluationTemplate
,
error
)
...
...
pkg/infrastructure/repository/pg_evaluation_cycle_repository.go
查看文件 @
9d4a97b
...
...
@@ -30,8 +30,8 @@ func (repo *EvaluationCycleRepository) TransformToDomain(m *models.EvaluationCyc
CompanyId
:
m
.
CompanyId
,
CreatorId
:
m
.
CreatorId
,
KpiCycle
:
m
.
KpiCycle
,
CreatedAt
:
m
.
CreatedAt
,
UpdatedAt
:
m
.
UpdatedAt
,
CreatedAt
:
m
.
CreatedAt
.
Local
(),
UpdatedAt
:
m
.
UpdatedAt
.
Local
(),
DeletedAt
:
m
.
DeletedAt
,
}
}
...
...
pkg/infrastructure/repository/pg_evaluation_cycle_template_repository.go
查看文件 @
9d4a97b
...
...
@@ -27,8 +27,8 @@ func (repo *EvaluationCycleTemplateRepository) TransformToDomain(m *models.Evalu
TemplateCreatedAt
:
m
.
TemplateCreatedAt
,
Template
:
m
.
Template
,
CycleId
:
m
.
CycleId
,
CreatedAt
:
m
.
CreatedAt
,
UpdatedAt
:
m
.
UpdatedAt
,
CreatedAt
:
m
.
CreatedAt
.
Local
(),
UpdatedAt
:
m
.
UpdatedAt
.
Local
(),
DeletedAt
:
m
.
DeletedAt
,
}
}
...
...
pkg/infrastructure/repository/pg_evaluation_project_repository.go
查看文件 @
9d4a97b
...
...
@@ -36,8 +36,8 @@ func (repo *EvaluationProjectRepository) TransformToDomain(m *models.EvaluationP
Template
:
m
.
Template
,
BeginTime
:
m
.
BeginTime
,
EndTime
:
m
.
EndTime
,
CreatedAt
:
m
.
CreatedAt
,
UpdatedAt
:
m
.
UpdatedAt
,
CreatedAt
:
m
.
CreatedAt
.
Local
(),
UpdatedAt
:
m
.
UpdatedAt
.
Local
(),
DeletedAt
:
m
.
DeletedAt
,
}
}
...
...
pkg/infrastructure/repository/pg_evaluation_rule_repository.go
查看文件 @
9d4a97b
...
...
@@ -31,8 +31,8 @@ func (repo *EvaluationRuleRepository) TransformToDomain(m *models.EvaluationRule
SysType
:
m
.
SysType
,
Rating
:
m
.
Rating
,
Score
:
m
.
Score
,
CreatedAt
:
m
.
CreatedAt
,
UpdatedAt
:
m
.
UpdatedAt
,
CreatedAt
:
m
.
CreatedAt
.
Local
(),
// PG库为UTC需要转成本地时间
UpdatedAt
:
m
.
UpdatedAt
.
Local
(),
DeletedAt
:
m
.
DeletedAt
,
}
}
...
...
pkg/infrastructure/repository/pg_evaluation_template_repository.go
查看文件 @
9d4a97b
...
...
@@ -29,8 +29,8 @@ func (repo *EvaluationTemplateRepository) TransformToDomain(m *models.Evaluation
CreatorId
:
m
.
CreatorId
,
State
:
m
.
State
,
LinkNodes
:
m
.
LinkNodes
,
CreatedAt
:
m
.
CreatedAt
,
UpdatedAt
:
m
.
UpdatedAt
,
CreatedAt
:
m
.
CreatedAt
.
Local
(),
UpdatedAt
:
m
.
UpdatedAt
.
Local
(),
DeletedAt
:
m
.
DeletedAt
,
}
}
...
...
pkg/infrastructure/repository/pg_node_task_repository.go
查看文件 @
9d4a97b
...
...
@@ -21,6 +21,9 @@ func NewNodeTaskRepository(transactionContext *pgTransaction.TransactionContext)
}
func
(
repo
*
NodeTaskRepository
)
TransformToDomain
(
m
*
models
.
NodeTask
)
domain
.
NodeTask
{
timeStart
:=
m
.
TimeStart
.
Local
()
timeEnd
:=
m
.
TimeEnd
.
Local
()
nextSentAt
:=
m
.
NextSentAt
.
Local
()
return
domain
.
NodeTask
{
Id
:
m
.
Id
,
CompanyId
:
m
.
CompanyId
,
...
...
@@ -31,12 +34,12 @@ func (repo *NodeTaskRepository) TransformToDomain(m *models.NodeTask) domain.Nod
NodeName
:
m
.
NodeName
,
NodeDescribe
:
m
.
NodeDescribe
,
NodeSort
:
m
.
NodeSort
,
TimeStart
:
m
.
TimeStart
,
TimeEnd
:
m
.
TimeEnd
,
TimeStart
:
&
timeStart
,
TimeEnd
:
&
timeEnd
,
KpiCycle
:
m
.
KpiCycle
,
NextSentAt
:
m
.
NextSentAt
,
CreatedAt
:
m
.
CreatedAt
,
UpdatedAt
:
m
.
UpdatedAt
,
NextSentAt
:
&
nextSentAt
,
CreatedAt
:
m
.
CreatedAt
.
Local
(),
UpdatedAt
:
m
.
UpdatedAt
.
Local
(),
DeletedAt
:
m
.
DeletedAt
,
}
}
...
...
pkg/infrastructure/repository/pg_role_repository.go
查看文件 @
9d4a97b
...
...
@@ -27,8 +27,8 @@ func (repo *RoleRepository) TransformToDomain(m *models.Role) domain.Role {
Type
:
m
.
Type
,
Description
:
m
.
Description
,
CompanyId
:
m
.
CompanyId
,
CreatedAt
:
m
.
CreatedAt
,
UpdatedAt
:
m
.
UpdatedAt
,
CreatedAt
:
m
.
CreatedAt
.
Local
(),
UpdatedAt
:
m
.
UpdatedAt
.
Local
(),
DeletedAt
:
m
.
DeletedAt
,
}
}
...
...
pkg/infrastructure/repository/pg_role_user_repository.go
查看文件 @
9d4a97b
...
...
@@ -26,8 +26,8 @@ func (repo *RoleUserRepository) TransformToDomain(m *models.RoleUser) domain.Rol
RoleId
:
m
.
RoleId
,
UserId
:
m
.
UserId
,
CompanyId
:
m
.
CompanyId
,
CreatedAt
:
m
.
CreatedAt
,
UpdatedAt
:
m
.
UpdatedAt
,
CreatedAt
:
m
.
CreatedAt
.
Local
(),
UpdatedAt
:
m
.
UpdatedAt
.
Local
(),
DeletedAt
:
m
.
DeletedAt
,
}
}
...
...
pkg/utils/common.go
查看文件 @
9d4a97b
...
...
@@ -37,7 +37,7 @@ func ValidateCommand(commandType interface{}) error {
}
// NextTime 0点时刻为标准计算
func
NextTime
(
now0
time
.
Time
,
start
time
.
Time
,
kpiCycle
int
)
time
.
Time
{
func
NextTime
(
now0
time
.
Time
,
start
*
time
.
Time
,
kpiCycle
int
)
time
.
Time
{
year
,
month
,
day
:=
start
.
Date
()
// 起始时间0点时刻
start0
:=
time
.
Date
(
year
,
month
,
day
,
0
,
0
,
0
,
0
,
time
.
Local
)
...
...
@@ -141,7 +141,7 @@ func SubMonth(t1, t2 time.Time) (month int) {
}
// NextTimeInc 0点时刻为标准计算
func
NextTimeInc
(
start
time
.
Time
,
kpiCycle
int
)
time
.
Time
{
func
NextTimeInc
(
start
*
time
.
Time
,
kpiCycle
int
)
time
.
Time
{
year
,
month
,
day
:=
start
.
Date
()
// 起始时间0点时刻
start0
:=
time
.
Date
(
year
,
month
,
day
,
0
,
0
,
0
,
0
,
time
.
Local
)
...
...
请
注册
或
登录
后发表评论