|
@@ -1091,16 +1091,26 @@ func (srv StaffAssessServeice) ListExecutorInviteAssess(param *query.ListInviteU |
|
@@ -1091,16 +1091,26 @@ func (srv StaffAssessServeice) ListExecutorInviteAssess(param *query.ListInviteU |
1091
|
assessRepo := factory.CreateStaffAssessRepository(map[string]interface{}{
|
1091
|
assessRepo := factory.CreateStaffAssessRepository(map[string]interface{}{
|
1092
|
"transactionContext": transactionContext,
|
1092
|
"transactionContext": transactionContext,
|
1093
|
})
|
1093
|
})
|
|
|
1094
|
+ assessTaskRepo := factory.CreateStaffAssessTaskRepository(map[string]interface{}{
|
|
|
1095
|
+ "transactionContext": transactionContext,
|
|
|
1096
|
+ })
|
1094
|
|
1097
|
|
1095
|
- // assessTaskkRepo := factory.CreateStaffAssessTaskRepository(map[string]interface{}{
|
|
|
1096
|
- // "transactionContext": transactionContext,
|
|
|
1097
|
- // })
|
|
|
1098
|
//获取 executorId 对应的360评估任务 用户
|
1098
|
//获取 executorId 对应的360评估任务 用户
|
1099
|
- cnt, assessList, err := assessRepo.Find(map[string]interface{}{
|
1099
|
+ condition := map[string]interface{}{
|
1100
|
"staffAssessTaskId": param.AssessTaskId,
|
1100
|
"staffAssessTaskId": param.AssessTaskId,
|
1101
|
"executorId": param.ExecutorId,
|
1101
|
"executorId": param.ExecutorId,
|
1102
|
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
1102
|
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
1103
|
- })
|
1103
|
+ "limit": 20,
|
|
|
1104
|
+ }
|
|
|
1105
|
+ if param.PageSize > 0 {
|
|
|
1106
|
+ condition["limit"] = param.PageSize
|
|
|
1107
|
+ }
|
|
|
1108
|
+ offset := (param.PageNumber - 1) * param.PageSize
|
|
|
1109
|
+ if offset > 0 {
|
|
|
1110
|
+ condition["offset"] = offset
|
|
|
1111
|
+ }
|
|
|
1112
|
+
|
|
|
1113
|
+ cnt, assessList, err := assessRepo.Find(condition)
|
1104
|
if err != nil {
|
1114
|
if err != nil {
|
1105
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1115
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1106
|
}
|
1116
|
}
|
|
@@ -1125,13 +1135,51 @@ func (srv StaffAssessServeice) ListExecutorInviteAssess(param *query.ListInviteU |
|
@@ -1125,13 +1135,51 @@ func (srv StaffAssessServeice) ListExecutorInviteAssess(param *query.ListInviteU |
1125
|
Name: name,
|
1135
|
Name: name,
|
1126
|
})
|
1136
|
})
|
1127
|
}
|
1137
|
}
|
1128
|
-
|
1138
|
+ assessContentRepo := factory.CreateStaffAssessContentRepository(map[string]interface{}{
|
|
|
1139
|
+ "transactionContext": transactionContext,
|
|
|
1140
|
+ })
|
1129
|
// 获取已经填报的内容
|
1141
|
// 获取已经填报的内容
|
|
|
1142
|
+ changeableRows := map[int]map[string]string{}
|
|
|
1143
|
+ for _, v := range assessList {
|
|
|
1144
|
+ _, contentList, err := assessContentRepo.Find(map[string]interface{}{
|
|
|
1145
|
+ "staffAssessId": v.Id,
|
|
|
1146
|
+ })
|
|
|
1147
|
+ if err != nil {
|
|
|
1148
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取评估内容"+err.Error())
|
|
|
1149
|
+ }
|
|
|
1150
|
+ row := map[string]string{}
|
|
|
1151
|
+ for _, vv := range contentList {
|
|
|
1152
|
+ name := fmt.Sprintf("%s-%s", vv.Category, vv.Name)
|
|
|
1153
|
+ if kk, ok := keyMap[name]; ok {
|
|
|
1154
|
+ row[kk] = vv.Value
|
|
|
1155
|
+ }
|
|
|
1156
|
+ }
|
|
|
1157
|
+ changeableRows[v.TargetUser.UserId] = row
|
|
|
1158
|
+ }
|
|
|
1159
|
+
|
|
|
1160
|
+ //获取360邀请评估完成情况
|
|
|
1161
|
+ //我评估别人,被邀请评估
|
|
|
1162
|
+ cnnt, _, err := assessRepo.Find(map[string]interface{}{
|
|
|
1163
|
+ "staffAssessTaskId": param.AssessTaskId,
|
|
|
1164
|
+ "executorId": param.ExecutorId,
|
|
|
1165
|
+ "typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
|
|
1166
|
+ "status": domain.StaffAssessUncompleted,
|
|
|
1167
|
+ })
|
|
|
1168
|
+ if err != nil {
|
|
|
1169
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取个人的评估环节"+err.Error())
|
|
|
1170
|
+ }
|
|
|
1171
|
+
|
|
|
1172
|
+ assessTaskData, err := assessTaskRepo.FindOne(map[string]interface{}{
|
|
|
1173
|
+ "id": param.AssessTaskId,
|
|
|
1174
|
+ })
|
|
|
1175
|
+ if err != nil {
|
|
|
1176
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取评估任务"+err.Error())
|
|
|
1177
|
+ }
|
1130
|
if err := transactionContext.CommitTransaction(); err != nil {
|
1178
|
if err := transactionContext.CommitTransaction(); err != nil {
|
1131
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1179
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1132
|
}
|
1180
|
}
|
1133
|
|
1181
|
|
1134
|
- //TODO 评估填写数据行转列
|
1182
|
+ //评估填写数据行转列
|
1135
|
tableHeader := []adapter.ListTableHeader{
|
1183
|
tableHeader := []adapter.ListTableHeader{
|
1136
|
{Key: "userName", Name: "姓名"},
|
1184
|
{Key: "userName", Name: "姓名"},
|
1137
|
{Key: "status", Name: "状态"},
|
1185
|
{Key: "status", Name: "状态"},
|
|
@@ -1143,20 +1191,35 @@ func (srv StaffAssessServeice) ListExecutorInviteAssess(param *query.ListInviteU |
|
@@ -1143,20 +1191,35 @@ func (srv StaffAssessServeice) ListExecutorInviteAssess(param *query.ListInviteU |
1143
|
for _, v := range assessList {
|
1191
|
for _, v := range assessList {
|
1144
|
m := map[string]string{
|
1192
|
m := map[string]string{
|
1145
|
"userName": v.TargetUser.UserName,
|
1193
|
"userName": v.TargetUser.UserName,
|
|
|
1194
|
+ "userId": strconv.Itoa(v.TargetUser.UserId),
|
1146
|
"status": string(v.Status),
|
1195
|
"status": string(v.Status),
|
1147
|
"types": string(v.Types),
|
1196
|
"types": string(v.Types),
|
1148
|
"endTime": v.EndTime.Local().Format("2006-01-02 15:04:05"),
|
1197
|
"endTime": v.EndTime.Local().Format("2006-01-02 15:04:05"),
|
1149
|
"assessId": strconv.Itoa(v.Id),
|
1198
|
"assessId": strconv.Itoa(v.Id),
|
1150
|
}
|
1199
|
}
|
|
|
1200
|
+ if row, ok := changeableRows[v.TargetUser.UserId]; ok {
|
|
|
1201
|
+ for k, v := range row {
|
|
|
1202
|
+ m[k] = v
|
|
|
1203
|
+ }
|
|
|
1204
|
+ } else {
|
|
|
1205
|
+ for _, v := range changeableHeader {
|
|
|
1206
|
+ m[v.Key] = ""
|
|
|
1207
|
+ }
|
|
|
1208
|
+ }
|
1151
|
listData = append(listData, m)
|
1209
|
listData = append(listData, m)
|
1152
|
}
|
1210
|
}
|
1153
|
- _ = tableHeader
|
|
|
1154
|
-
|
|
|
1155
|
result := adapter.ListInviteUserAssessResp{
|
1211
|
result := adapter.ListInviteUserAssessResp{
|
1156
|
TableHeader: tableHeader,
|
1212
|
TableHeader: tableHeader,
|
1157
|
List: listData,
|
1213
|
List: listData,
|
1158
|
Total: cnt,
|
1214
|
Total: cnt,
|
1159
|
}
|
1215
|
}
|
|
|
1216
|
+ for _, v := range assessTaskData.StepList {
|
|
|
1217
|
+ if v.LinkNodeType == domain.LinkNodeAllAssessment {
|
|
|
1218
|
+ result.LinkNodeId = v.LinkNodeId
|
|
|
1219
|
+ result.LinkNodeName = v.LinkNodeName
|
|
|
1220
|
+ result.LintNodeDesc = fmt.Sprintf("截止时间 %s 待评估%d人", v.EndTime.Local().Format("2006-01-02 15:04:05"), cnnt)
|
|
|
1221
|
+ }
|
|
|
1222
|
+ }
|
1160
|
return &result, nil
|
1223
|
return &result, nil
|
1161
|
}
|
1224
|
}
|
1162
|
|
1225
|
|
|
@@ -1251,6 +1314,7 @@ func (srv StaffAssessServeice) ListExecutorSupperAssess(param *query.ListSupperA |
|
@@ -1251,6 +1314,7 @@ func (srv StaffAssessServeice) ListExecutorSupperAssess(param *query.ListSupperA |
1251
|
UserName: v.TargetUser.UserName,
|
1314
|
UserName: v.TargetUser.UserName,
|
1252
|
EndTime: v.EndTime.Local().Format("2006-01-02 15:04:05"),
|
1315
|
EndTime: v.EndTime.Local().Format("2006-01-02 15:04:05"),
|
1253
|
InviteCompleted: 0,
|
1316
|
InviteCompleted: 0,
|
|
|
1317
|
+ Status: string(v.Status),
|
1254
|
InviteTotal: 5,
|
1318
|
InviteTotal: 5,
|
1255
|
Department: "",
|
1319
|
Department: "",
|
1256
|
Position: "",
|
1320
|
Position: "",
|