作者 郑周

Merge remote-tracking branch 'origin/test' into test

... ... @@ -691,12 +691,17 @@ func (srv StaffAssessServeice) GetAssessInviteUser(param *query.GetAssessInviteU
// 保存某个员工360邀请的人员
func (srv StaffAssessServeice) SaveAssessInviteUser(param *command.SaveAssessInvite) (map[string]interface{}, error) {
inviteSameSuperId := []int{}
userIdMap := map[int]struct{}{} //过滤重复的id
InviteDiffSuperId := []int{}
for _, v := range param.InviteDiffSuper {
id, err := strconv.Atoi(v)
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "用户填写错误")
}
if _, ok := userIdMap[id]; ok {
continue
}
userIdMap[id] = struct{}{}
InviteDiffSuperId = append(InviteDiffSuperId, id)
}
for _, v := range param.InviteSameSuper {
... ... @@ -704,6 +709,10 @@ func (srv StaffAssessServeice) SaveAssessInviteUser(param *command.SaveAssessInv
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "用户填写错误")
}
if _, ok := userIdMap[id]; ok {
continue
}
userIdMap[id] = struct{}{}
inviteSameSuperId = append(inviteSameSuperId, id)
}
transactionContext, err := factory.CreateTransactionContext(nil)
... ...
package service
//员工绩效-项目管理
//获取已被执行的周期列表
func (srv StaffAssessServeice) GetAllAssessCycleName() {
}
//获取周期内的考核日期
... ...
... ... @@ -99,5 +99,57 @@ func (d *StaffAssessDao) CountAssessTaskMe(executorId int, companyId int) (int,
result := 0
_, err := tx.QueryOne(pg.Scan(&result), sqlStr, condition...)
return result, err
}
//获取所以已经执行的评估周期
type AssessCycle struct {
CycleId string `json:"cycleId"` //周期id
CompanyId string `json:"companyId"`
CycleName string `json:"cycleName"` //周期名称
}
//获取所以已经执行的评估周期
func (d *StaffAssessDao) AllAssessCycleList(companyId int) ([]AssessCycle, error) {
sqlStr := `select
distinct
staff_assess_task.cycle_id ,
staff_assess_task.company_id ,
staff_assess_task.cycle_name
from staff_assess_task
where staff_assess_task.company_id = ?`
tx := d.transactionContext.PgTx
condition := []interface{}{
companyId,
}
result := []AssessCycle{}
_, err := tx.QueryOne(&result, sqlStr, condition...)
return result, err
}
//获取评估周期中的绩效考核日期
type AssessCycleDay struct {
BeginDay string `json:"beginDay"`
CycleId string `json:"cycleId"`
CompanyId string `json:"companyId"`
}
//获取评估周期中的绩效考核日期
func (d *StaffAssessDao) AllAssessCycleDayList(companyId int, cycleId int) ([]AssessCycleDay, error) {
sqlStr := `select distinct staff_assess_task.begin_day ,
staff_assess_task.cycle_id ,
staff_assess_task.company_id
from staff_assess_task
where staff_assess_task.cycle_id = ?
and company_id =? `
tx := d.transactionContext.PgTx
condition := []interface{}{
cycleId, companyId,
}
result := []AssessCycleDay{}
_, err := tx.QueryOne(&result, sqlStr, condition...)
return result, err
}
//根据周期的id和日期获取员工填写的评估内容
... ...