作者 tangxvhui

更新

... ... @@ -165,22 +165,24 @@ func (srv StaffAssessServeice) ListUserAssessContentCycleDay(param *query.ListAs
changeableRows := map[string]map[string]string{}
tableSort := []string{} //确定列表行数据的顺序
for i, v := range contentList {
name := fmt.Sprintf("%s-%s", v.Category, v.ContentName)
key := fmt.Sprintf("k%d", i)
if _, ok := headerMap[name]; !ok {
changeableHeader = append(changeableHeader, adapter.ListTableHeader{
Key: key, Name: name,
})
headerMap[name] = key
}
if _, ok := changeableRows[v.TargetUserId]; !ok {
changeableRows[v.TargetUserId] = map[string]string{}
tableSort = append(tableSort, v.TargetUserId)
}
key = headerMap[name]
changeableRows[v.TargetUserId][key] = v.Value
changeableRows[v.TargetUserId]["targetUserName"] = v.TargetUserName
changeableRows[v.TargetUserId]["targetUserId"] = v.TargetUserId
if v.ContentId > 0 {
name := fmt.Sprintf("%s-%s", v.Category, v.ContentName)
key := fmt.Sprintf("k%d", i)
if _, ok := headerMap[name]; !ok {
changeableHeader = append(changeableHeader, adapter.ListTableHeader{
Key: key, Name: name,
})
headerMap[name] = key
}
key = headerMap[name]
changeableRows[v.TargetUserId][key] = v.Value
}
}
list := []map[string]string{}
for _, v := range tableSort {
... ...
... ... @@ -156,6 +156,7 @@ func (d *StaffAssessDao) AllAssessCycleDayList(companyId int, cycleId int) ([]As
//获取员工填写评估内容
type UserAssessContent struct {
AssessId string `json:"assessId"`
ContentId int `json:"contentId"`
TargetUserId string `json:"targetUserId"` //被评估人的id
TargetUserName string `json:"targetUserName"` //被评估人的名称
BeginDay string `json:"beginDay"` //评估的日期
... ... @@ -196,7 +197,7 @@ func (d *StaffAssessDao) SearchUserAssessContent(param SearchConditin1) ([]UserA
}
sqlStr := ` select
t_staff_assess_1.target_user_id,t_staff_assess_1.target_user_name,t_staff_assess_1.begin_day,
t_staff_assess_1.assess_id,
t_staff_assess_1.assess_id,staff_assess_content.id as content_id,
staff_assess_content.value ,staff_assess_content.sort_by ,
staff_assess_content.category ,staff_assess_content."name" as content_name ,
staff_assess_content.weight
... ... @@ -348,7 +349,7 @@ func (d *StaffAssessDao) ExportDataUserAssess(param SearchConditin1) ([]ExportDa
}
sqlStr := ` select
t_staff_assess_1.target_user_id,t_staff_assess_1.target_user_name,t_staff_assess_1.begin_day,
t_staff_assess_1.assess_id,
t_staff_assess_1.assess_id,staff_assess_content.id as content_id,
staff_assess_content.value ,staff_assess_content.sort_by ,
staff_assess_content.category ,staff_assess_content."name" as content_name ,
staff_assess_content.weight,staff_assess_content.prompt_text ,staff_assess_content.remark
... ...