作者 tangxvhui

更新

@@ -165,6 +165,13 @@ func (srv StaffAssessServeice) ListUserAssessContentCycleDay(param *query.ListAs @@ -165,6 +165,13 @@ func (srv StaffAssessServeice) ListUserAssessContentCycleDay(param *query.ListAs
165 changeableRows := map[string]map[string]string{} 165 changeableRows := map[string]map[string]string{}
166 tableSort := []string{} //确定列表行数据的顺序 166 tableSort := []string{} //确定列表行数据的顺序
167 for i, v := range contentList { 167 for i, v := range contentList {
  168 + if _, ok := changeableRows[v.TargetUserId]; !ok {
  169 + changeableRows[v.TargetUserId] = map[string]string{}
  170 + tableSort = append(tableSort, v.TargetUserId)
  171 + }
  172 + changeableRows[v.TargetUserId]["targetUserName"] = v.TargetUserName
  173 + changeableRows[v.TargetUserId]["targetUserId"] = v.TargetUserId
  174 + if v.ContentId > 0 {
168 name := fmt.Sprintf("%s-%s", v.Category, v.ContentName) 175 name := fmt.Sprintf("%s-%s", v.Category, v.ContentName)
169 key := fmt.Sprintf("k%d", i) 176 key := fmt.Sprintf("k%d", i)
170 if _, ok := headerMap[name]; !ok { 177 if _, ok := headerMap[name]; !ok {
@@ -173,14 +180,9 @@ func (srv StaffAssessServeice) ListUserAssessContentCycleDay(param *query.ListAs @@ -173,14 +180,9 @@ func (srv StaffAssessServeice) ListUserAssessContentCycleDay(param *query.ListAs
173 }) 180 })
174 headerMap[name] = key 181 headerMap[name] = key
175 } 182 }
176 - if _, ok := changeableRows[v.TargetUserId]; !ok {  
177 - changeableRows[v.TargetUserId] = map[string]string{}  
178 - tableSort = append(tableSort, v.TargetUserId)  
179 - }  
180 key = headerMap[name] 183 key = headerMap[name]
181 changeableRows[v.TargetUserId][key] = v.Value 184 changeableRows[v.TargetUserId][key] = v.Value
182 - changeableRows[v.TargetUserId]["targetUserName"] = v.TargetUserName  
183 - changeableRows[v.TargetUserId]["targetUserId"] = v.TargetUserId 185 + }
184 } 186 }
185 list := []map[string]string{} 187 list := []map[string]string{}
186 for _, v := range tableSort { 188 for _, v := range tableSort {
@@ -156,6 +156,7 @@ func (d *StaffAssessDao) AllAssessCycleDayList(companyId int, cycleId int) ([]As @@ -156,6 +156,7 @@ func (d *StaffAssessDao) AllAssessCycleDayList(companyId int, cycleId int) ([]As
156 //获取员工填写评估内容 156 //获取员工填写评估内容
157 type UserAssessContent struct { 157 type UserAssessContent struct {
158 AssessId string `json:"assessId"` 158 AssessId string `json:"assessId"`
  159 + ContentId int `json:"contentId"`
159 TargetUserId string `json:"targetUserId"` //被评估人的id 160 TargetUserId string `json:"targetUserId"` //被评估人的id
160 TargetUserName string `json:"targetUserName"` //被评估人的名称 161 TargetUserName string `json:"targetUserName"` //被评估人的名称
161 BeginDay string `json:"beginDay"` //评估的日期 162 BeginDay string `json:"beginDay"` //评估的日期
@@ -196,7 +197,7 @@ func (d *StaffAssessDao) SearchUserAssessContent(param SearchConditin1) ([]UserA @@ -196,7 +197,7 @@ func (d *StaffAssessDao) SearchUserAssessContent(param SearchConditin1) ([]UserA
196 } 197 }
197 sqlStr := ` select 198 sqlStr := ` select
198 t_staff_assess_1.target_user_id,t_staff_assess_1.target_user_name,t_staff_assess_1.begin_day, 199 t_staff_assess_1.target_user_id,t_staff_assess_1.target_user_name,t_staff_assess_1.begin_day,
199 - t_staff_assess_1.assess_id, 200 + t_staff_assess_1.assess_id,staff_assess_content.id as content_id,
200 staff_assess_content.value ,staff_assess_content.sort_by , 201 staff_assess_content.value ,staff_assess_content.sort_by ,
201 staff_assess_content.category ,staff_assess_content."name" as content_name , 202 staff_assess_content.category ,staff_assess_content."name" as content_name ,
202 staff_assess_content.weight 203 staff_assess_content.weight
@@ -348,7 +349,7 @@ func (d *StaffAssessDao) ExportDataUserAssess(param SearchConditin1) ([]ExportDa @@ -348,7 +349,7 @@ func (d *StaffAssessDao) ExportDataUserAssess(param SearchConditin1) ([]ExportDa
348 } 349 }
349 sqlStr := ` select 350 sqlStr := ` select
350 t_staff_assess_1.target_user_id,t_staff_assess_1.target_user_name,t_staff_assess_1.begin_day, 351 t_staff_assess_1.target_user_id,t_staff_assess_1.target_user_name,t_staff_assess_1.begin_day,
351 - t_staff_assess_1.assess_id, 352 + t_staff_assess_1.assess_id,staff_assess_content.id as content_id,
352 staff_assess_content.value ,staff_assess_content.sort_by , 353 staff_assess_content.value ,staff_assess_content.sort_by ,
353 staff_assess_content.category ,staff_assess_content."name" as content_name , 354 staff_assess_content.category ,staff_assess_content."name" as content_name ,
354 staff_assess_content.weight,staff_assess_content.prompt_text ,staff_assess_content.remark 355 staff_assess_content.weight,staff_assess_content.prompt_text ,staff_assess_content.remark