|
@@ -887,6 +887,8 @@ func (srv StaffAssessServeice) GetAssessSelfInfo(param *query.AssessSelfInfoQuer |
|
@@ -887,6 +887,8 @@ func (srv StaffAssessServeice) GetAssessSelfInfo(param *query.AssessSelfInfoQuer |
887
|
AssessId: assessData.Id,
|
887
|
AssessId: assessData.Id,
|
888
|
CycleId: assessData.CycleId,
|
888
|
CycleId: assessData.CycleId,
|
889
|
CycleName: assessData.CycleName,
|
889
|
CycleName: assessData.CycleName,
|
|
|
890
|
+ LinkNodeId: assessData.LinkNodeId,
|
|
|
891
|
+ LinkNodeName: assessData.LinkNodeName,
|
890
|
EvaluationProjectId: assessData.EvaluationProjectId,
|
892
|
EvaluationProjectId: assessData.EvaluationProjectId,
|
891
|
EvaluationProjectName: assessData.EvaluationProjectName,
|
893
|
EvaluationProjectName: assessData.EvaluationProjectName,
|
892
|
BeginTime: assessData.BeginTime.Local().Format("2006-01-02 15:04:05"),
|
894
|
BeginTime: assessData.BeginTime.Local().Format("2006-01-02 15:04:05"),
|
|
@@ -1089,45 +1091,135 @@ func (srv StaffAssessServeice) ListExecutorInviteAssess(param *query.ListInviteU |
|
@@ -1089,45 +1091,135 @@ func (srv StaffAssessServeice) ListExecutorInviteAssess(param *query.ListInviteU |
1089
|
assessRepo := factory.CreateStaffAssessRepository(map[string]interface{}{
|
1091
|
assessRepo := factory.CreateStaffAssessRepository(map[string]interface{}{
|
1090
|
"transactionContext": transactionContext,
|
1092
|
"transactionContext": transactionContext,
|
1091
|
})
|
1093
|
})
|
|
|
1094
|
+ assessTaskRepo := factory.CreateStaffAssessTaskRepository(map[string]interface{}{
|
|
|
1095
|
+ "transactionContext": transactionContext,
|
|
|
1096
|
+ })
|
|
|
1097
|
+
|
1092
|
//获取 executorId 对应的360评估任务 用户
|
1098
|
//获取 executorId 对应的360评估任务 用户
|
1093
|
- cnt, assessList, err := assessRepo.Find(map[string]interface{}{
|
|
|
1094
|
- "staffAssessTaskId": param.AssessTaskkId,
|
1099
|
+ condition := map[string]interface{}{
|
|
|
1100
|
+ "staffAssessTaskId": param.AssessTaskId,
|
1095
|
"executorId": param.ExecutorId,
|
1101
|
"executorId": param.ExecutorId,
|
1096
|
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
1102
|
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
1097
|
- })
|
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)
|
1098
|
if err != nil {
|
1114
|
if err != nil {
|
1099
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1115
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1100
|
}
|
1116
|
}
|
|
|
1117
|
+ var assessContentList []*domain.StaffAssessContent
|
|
|
1118
|
+ if len(assessList) > 0 {
|
|
|
1119
|
+ //获取评估用的所有评估项
|
|
|
1120
|
+ assessContentList, err = srv.getAssessSelfInfoUncompleted(transactionContext, assessList[0])
|
|
|
1121
|
+ if err != nil {
|
|
|
1122
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取评估任务"+err.Error())
|
|
|
1123
|
+ }
|
|
|
1124
|
+ }
|
|
|
1125
|
+ //可变的表格列
|
|
|
1126
|
+ changeableHeader := []adapter.ListTableHeader{}
|
|
|
1127
|
+ //列名与字段对应
|
|
|
1128
|
+ keyMap := map[string]string{}
|
|
|
1129
|
+ for i, v := range assessContentList {
|
|
|
1130
|
+ name := fmt.Sprintf("%s-%s", v.Category, v.Name)
|
|
|
1131
|
+ key := fmt.Sprintf("k%d", i)
|
|
|
1132
|
+ keyMap[name] = key
|
|
|
1133
|
+ changeableHeader = append(changeableHeader, adapter.ListTableHeader{
|
|
|
1134
|
+ Key: key,
|
|
|
1135
|
+ Name: name,
|
|
|
1136
|
+ })
|
|
|
1137
|
+ }
|
|
|
1138
|
+ assessContentRepo := factory.CreateStaffAssessContentRepository(map[string]interface{}{
|
|
|
1139
|
+ "transactionContext": transactionContext,
|
|
|
1140
|
+ })
|
1101
|
// 获取已经填报的内容
|
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
|
+ }
|
1102
|
if err := transactionContext.CommitTransaction(); err != nil {
|
1178
|
if err := transactionContext.CommitTransaction(); err != nil {
|
1103
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1179
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1104
|
}
|
1180
|
}
|
1105
|
|
1181
|
|
1106
|
- //TODO 评估填写数据行转列
|
1182
|
+ //评估填写数据行转列
|
1107
|
tableHeader := []adapter.ListTableHeader{
|
1183
|
tableHeader := []adapter.ListTableHeader{
|
1108
|
{Key: "userName", Name: "姓名"},
|
1184
|
{Key: "userName", Name: "姓名"},
|
1109
|
{Key: "status", Name: "状态"},
|
1185
|
{Key: "status", Name: "状态"},
|
1110
|
{Key: "types", Name: "360°评估关系"},
|
1186
|
{Key: "types", Name: "360°评估关系"},
|
1111
|
{Key: "endTime", Name: "360°评估截止日期"},
|
1187
|
{Key: "endTime", Name: "360°评估截止日期"},
|
1112
|
}
|
1188
|
}
|
|
|
1189
|
+ tableHeader = append(tableHeader, changeableHeader...)
|
1113
|
listData := []map[string]string{}
|
1190
|
listData := []map[string]string{}
|
1114
|
for _, v := range assessList {
|
1191
|
for _, v := range assessList {
|
1115
|
m := map[string]string{
|
1192
|
m := map[string]string{
|
1116
|
"userName": v.TargetUser.UserName,
|
1193
|
"userName": v.TargetUser.UserName,
|
|
|
1194
|
+ "userId": strconv.Itoa(v.TargetUser.UserId),
|
1117
|
"status": string(v.Status),
|
1195
|
"status": string(v.Status),
|
1118
|
"types": string(v.Types),
|
1196
|
"types": string(v.Types),
|
1119
|
"endTime": v.EndTime.Local().Format("2006-01-02 15:04:05"),
|
1197
|
"endTime": v.EndTime.Local().Format("2006-01-02 15:04:05"),
|
1120
|
"assessId": strconv.Itoa(v.Id),
|
1198
|
"assessId": strconv.Itoa(v.Id),
|
1121
|
}
|
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
|
+ }
|
1122
|
listData = append(listData, m)
|
1209
|
listData = append(listData, m)
|
1123
|
}
|
1210
|
}
|
1124
|
- _ = tableHeader
|
|
|
1125
|
-
|
|
|
1126
|
result := adapter.ListInviteUserAssessResp{
|
1211
|
result := adapter.ListInviteUserAssessResp{
|
1127
|
TableHeader: tableHeader,
|
1212
|
TableHeader: tableHeader,
|
1128
|
List: listData,
|
1213
|
List: listData,
|
1129
|
Total: cnt,
|
1214
|
Total: cnt,
|
1130
|
}
|
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
|
+ }
|
1131
|
return &result, nil
|
1223
|
return &result, nil
|
1132
|
}
|
1224
|
}
|
1133
|
|
1225
|
|
|
@@ -1222,6 +1314,7 @@ func (srv StaffAssessServeice) ListExecutorSupperAssess(param *query.ListSupperA |
|
@@ -1222,6 +1314,7 @@ func (srv StaffAssessServeice) ListExecutorSupperAssess(param *query.ListSupperA |
1222
|
UserName: v.TargetUser.UserName,
|
1314
|
UserName: v.TargetUser.UserName,
|
1223
|
EndTime: v.EndTime.Local().Format("2006-01-02 15:04:05"),
|
1315
|
EndTime: v.EndTime.Local().Format("2006-01-02 15:04:05"),
|
1224
|
InviteCompleted: 0,
|
1316
|
InviteCompleted: 0,
|
|
|
1317
|
+ Status: string(v.Status),
|
1225
|
InviteTotal: 5,
|
1318
|
InviteTotal: 5,
|
1226
|
Department: "",
|
1319
|
Department: "",
|
1227
|
Position: "",
|
1320
|
Position: "",
|
|
@@ -1315,6 +1408,8 @@ func (srv StaffAssessServeice) GetAssessInfo(param *query.AssessInfoQuery) (*ada |
|
@@ -1315,6 +1408,8 @@ func (srv StaffAssessServeice) GetAssessInfo(param *query.AssessInfoQuery) (*ada |
1315
|
AssessId: assessData.Id,
|
1408
|
AssessId: assessData.Id,
|
1316
|
CycleId: assessData.CycleId,
|
1409
|
CycleId: assessData.CycleId,
|
1317
|
CycleName: assessData.CycleName,
|
1410
|
CycleName: assessData.CycleName,
|
|
|
1411
|
+ LinkNodeId: assessData.LinkNodeId,
|
|
|
1412
|
+ LinkNodeName: assessData.LinkNodeName,
|
1318
|
EvaluationProjectId: assessData.EvaluationProjectId,
|
1413
|
EvaluationProjectId: assessData.EvaluationProjectId,
|
1319
|
EvaluationProjectName: assessData.EvaluationProjectName,
|
1414
|
EvaluationProjectName: assessData.EvaluationProjectName,
|
1320
|
BeginTime: assessData.BeginTime.Local().Format("2006-01-02 15:04:05"),
|
1415
|
BeginTime: assessData.BeginTime.Local().Format("2006-01-02 15:04:05"),
|
|
@@ -1481,7 +1576,7 @@ func (srv StaffAssessServeice) SaveAssessInfo(param *command.SaveAssessInfoComma |
|
@@ -1481,7 +1576,7 @@ func (srv StaffAssessServeice) SaveAssessInfo(param *command.SaveAssessInfoComma |
1481
|
}, nil
|
1576
|
}, nil
|
1482
|
}
|
1577
|
}
|
1483
|
|
1578
|
|
1484
|
-// 获取员工被评估的列表 ,类型是360邀请的
|
1579
|
+// 获取员工被评估的列表
|
1485
|
func (srv StaffAssessServeice) ListTargetUserAssess(param *query.ListTargetUserAssessQuery) (map[string]interface{}, error) {
|
1580
|
func (srv StaffAssessServeice) ListTargetUserAssess(param *query.ListTargetUserAssessQuery) (map[string]interface{}, error) {
|
1486
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
1581
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
1487
|
if err != nil {
|
1582
|
if err != nil {
|
|
@@ -1508,5 +1603,6 @@ func (srv StaffAssessServeice) ListTargetUserAssess(param *query.ListTargetUserA |
|
@@ -1508,5 +1603,6 @@ func (srv StaffAssessServeice) ListTargetUserAssess(param *query.ListTargetUserA |
1508
|
if err := transactionContext.CommitTransaction(); err != nil {
|
1603
|
if err := transactionContext.CommitTransaction(); err != nil {
|
1509
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1604
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1510
|
}
|
1605
|
}
|
|
|
1606
|
+
|
1511
|
return tool_funs.SimpleWrapGridMap(int64(cnt), assessList), nil
|
1607
|
return tool_funs.SimpleWrapGridMap(int64(cnt), assessList), nil
|
1512
|
} |
1608
|
} |