作者 tangxvhui

修改 设置15自评完成状态

... ... @@ -30,6 +30,7 @@ func (srv *SummaryEvaluationService) ListEvaluationShow1(param command.QueryEval
staffAssessDaoRepo := dao.NewStaffAssessDao(map[string]interface{}{"transactionContext": transactionContext})
userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext})
positionRepo := factory.CreatePositionRepository(map[string]interface{}{"transactionContext": transactionContext})
staffAssessRepo := factory.CreateStaffAssessRepository(map[string]interface{}{"transactionContext": transactionContext})
limit := param.PageSize
offset := limit * (param.PageNumber - 1)
... ... @@ -98,14 +99,18 @@ func (srv *SummaryEvaluationService) ListEvaluationShow1(param command.QueryEval
for i := range list {
v := list[i]
endTime := v.EndTime.Local()
// 状态
statusVal := ""
if v.HrCheckResult == domain.EvaluationCheckCompleted {
// 检查15日自评 完成情况状态
statusVal := "未完成"
_, assessList, err := staffAssessRepo.Find(map[string]interface{}{
"cycleId": v.CycleId,
"targetUserId": v.TargetUser.UserId,
"beginDayNumber": 15,
})
if err == nil && len(assessList) > 0 {
if assessList[0].Status == domain.StaffAssessCompleted {
statusVal = "已完成"
} else {
statusVal = "待完成"
}
}
// 部门拼接
var departmentBuild strings.Builder
departmentBuild.WriteString("")
... ...
... ... @@ -167,6 +167,11 @@ func (repo *StaffAssessRepository) Find(queryOptions map[string]interface{}) (in
if v, ok := queryOptions["evaluationProjectId"]; ok {
query.Where("staff_assess.evaluation_project_id=?", v)
}
//查询第几号日期的数据
if v, ok := queryOptions["beginDayNumber"]; ok {
query.Where("date_part('day',staff_assess.begin_time) = ?", v)
}
query.Order("staff_assess.id DESC")
count, err := query.SelectAndCount()
if err != nil {
... ...