作者 郑周

1. 命名优化

... ... @@ -74,7 +74,7 @@ func (rs *PermissionService) Update(in *command.UpdatePermissionCommand) (interf
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "截止时间:[查看我的绩效]不能小于[上级评估]")
}
permission.OptConfirmPerf = in.OptConfirmPerf
permission.CycleDeadLine = in.CycleDeadLine
permission.CycleDeadline = in.CycleDeadLine
}
permission, err = permissionRepository.Insert(permission)
... ... @@ -88,6 +88,8 @@ func (rs *PermissionService) Update(in *command.UpdatePermissionCommand) (interf
}
func (rs *PermissionService) Get(in *command.GetPermissionCommand) (*domain.Permission, error) {
in.CompanyId = 8
transactionContext, err := factory.ValidateStartTransaction(in)
if err != nil {
return nil, err
... ... @@ -110,7 +112,7 @@ func (rs *PermissionService) Get(in *command.GetPermissionCommand) (*domain.Perm
OptHrScore: domain.PermissionOff,
OptEvalScore: domain.PermissionOff,
OptConfirmPerf: domain.PermissionOff,
CycleDeadLine: rs.defaultCycleDeadline(),
CycleDeadline: rs.defaultCycleDeadline(),
}
permission, err = permissionRepository.Insert(value)
if err != nil {
... ... @@ -132,9 +134,9 @@ func (rs *PermissionService) Get(in *command.GetPermissionCommand) (*domain.Perm
isChange = true
permission.OptConfirmPerf = domain.PermissionOff
}
if permission.CycleDeadLine == nil {
if permission.CycleDeadline == nil {
isChange = true
permission.CycleDeadLine = rs.defaultCycleDeadline()
permission.CycleDeadline = rs.defaultCycleDeadline()
}
if isChange {
permission, err = permissionRepository.Insert(permission)
... ...
... ... @@ -169,26 +169,26 @@ func (se *summaryEvaluationPublisher) sendSummaryEvaluationV2(
beginTimeSelf := *cycleData.TimeEnd //
beginDay := dayEndTime(beginTimeSelf)
//修改 周期结束时间那天的第二天开始计算
endTimeSelf := beginDay.Add(time.Duration(permissioData.CycleDeadLine.AssessmentSelf.Hour) * time.Hour).
Add(time.Duration(permissioData.CycleDeadLine.AssessmentSelf.Minute) * time.Minute)
endTimeSelf := beginDay.Add(time.Duration(permissioData.CycleDeadline.AssessmentSelf.Hour) * time.Hour).
Add(time.Duration(permissioData.CycleDeadline.AssessmentSelf.Minute) * time.Minute)
//人资、360评估的时间范围
beginTime360 := endTimeSelf
endTime360 := beginDay.Add(time.Duration(permissioData.CycleDeadLine.AssessmentAll.Hour) * time.Hour).
Add(time.Duration(permissioData.CycleDeadLine.AssessmentAll.Minute) * time.Minute)
endTime360 := beginDay.Add(time.Duration(permissioData.CycleDeadline.AssessmentAll.Hour) * time.Hour).
Add(time.Duration(permissioData.CycleDeadline.AssessmentAll.Minute) * time.Minute)
//人资评估的时间范围
beginTimeHr := endTimeSelf
endTimeHr := beginDay.Add(time.Duration(permissioData.CycleDeadLine.AssessmentHr.Hour) * time.Hour).
Add(time.Duration(permissioData.CycleDeadLine.AssessmentHr.Minute) * time.Minute)
endTimeHr := beginDay.Add(time.Duration(permissioData.CycleDeadline.AssessmentHr.Hour) * time.Hour).
Add(time.Duration(permissioData.CycleDeadline.AssessmentHr.Minute) * time.Minute)
//上级评估的是时间范围
beginTimeSuper := endTimeHr
endTimeSuper := beginDay.Add(time.Duration(permissioData.CycleDeadLine.AssessmentSuperior.Hour) * time.Hour).
Add(time.Duration(permissioData.CycleDeadLine.AssessmentSuperior.Minute) * time.Minute)
endTimeSuper := beginDay.Add(time.Duration(permissioData.CycleDeadline.AssessmentSuperior.Hour) * time.Hour).
Add(time.Duration(permissioData.CycleDeadline.AssessmentSuperior.Minute) * time.Minute)
//考核结果的时间范围
beginTimeFinish := endTimeSuper
endTimeFinish := beginDay.Add(time.Duration(permissioData.CycleDeadLine.ViewMyPerf.Hour) * time.Hour).
Add(time.Duration(permissioData.CycleDeadLine.ViewMyPerf.Minute) * time.Minute)
endTimeFinish := beginDay.Add(time.Duration(permissioData.CycleDeadline.ViewMyPerf.Hour) * time.Hour).
Add(time.Duration(permissioData.CycleDeadline.ViewMyPerf.Minute) * time.Minute)
// 创建周期评估任务
var newEvaluationList []domain.SummaryEvaluation
evaluationTemp := domain.SummaryEvaluation{
... ...
... ... @@ -13,7 +13,7 @@ type Permission struct {
OptHrScore int `json:"optHrScore" comment:"上级是否可以修改人资综评分数"`
OptEvalScore int `json:"optEvalScore" comment:"上级是否可以修改360°综评分数"`
OptConfirmPerf int `json:"optConfirmPerf " comment:"是否需要员工确认绩效"`
CycleDeadLine *CycleDeadline `json:"cycleDeadline" comment:"周期评估各业务截止时间"`
CycleDeadline *CycleDeadline `json:"cycleDeadline" comment:"周期评估各业务截止时间"`
CreatedAt time.Time `json:"createdAt" comment:"创建时间"`
UpdatedAt time.Time `json:"updatedAt" comment:"更新时间"`
DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"`
... ...
... ... @@ -12,7 +12,7 @@ type Permission struct {
OptHrScore int `comment:"上级是否可以修改人资综评分数"`
OptEvalScore int `comment:"上级是否可以修改360°综评分数"`
OptConfirmPerf int `comment:"是否需要员工确认绩效"`
CycleDeadLine *domain.CycleDeadline `comment:"周期评估各业务截止时间"`
CycleDeadline *domain.CycleDeadline `comment:"周期评估各业务截止时间"`
CreatedAt time.Time `comment:"创建时间"`
UpdatedAt time.Time `comment:"更新时间"`
DeletedAt *time.Time `comment:"删除时间"`
... ...
... ... @@ -27,7 +27,7 @@ func (repo *PermissionRepository) TransformToDomain(m *models.Permission) domain
OptHrScore: m.OptHrScore,
OptEvalScore: m.OptEvalScore,
OptConfirmPerf: m.OptConfirmPerf,
CycleDeadLine: m.CycleDeadLine,
CycleDeadline: m.CycleDeadline,
CreatedAt: m.CreatedAt.Local(),
UpdatedAt: m.UpdatedAt.Local(),
DeletedAt: m.DeletedAt,
... ... @@ -41,7 +41,7 @@ func (repo *PermissionRepository) TransformToModel(d *domain.Permission) models.
OptHrScore: d.OptHrScore,
OptEvalScore: d.OptEvalScore,
OptConfirmPerf: d.OptConfirmPerf,
CycleDeadLine: d.CycleDeadLine,
CycleDeadline: d.CycleDeadline,
CreatedAt: d.CreatedAt,
UpdatedAt: d.UpdatedAt,
DeletedAt: d.DeletedAt,
... ...