|
@@ -294,7 +294,7 @@ func (srv *SummaryEvaluationServeice) GetEvaluationSelf(param *command.QueryEval |
|
@@ -294,7 +294,7 @@ func (srv *SummaryEvaluationServeice) GetEvaluationSelf(param *command.QueryEval |
294
|
evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{
|
294
|
evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{
|
295
|
"transactionContext": transactionContext,
|
295
|
"transactionContext": transactionContext,
|
296
|
})
|
296
|
})
|
297
|
- itemValueRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{
|
297
|
+ itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{
|
298
|
"transactionContext": transactionContext,
|
298
|
"transactionContext": transactionContext,
|
299
|
})
|
299
|
})
|
300
|
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
|
300
|
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
|
|
@@ -313,20 +313,42 @@ func (srv *SummaryEvaluationServeice) GetEvaluationSelf(param *command.QueryEval |
|
@@ -313,20 +313,42 @@ func (srv *SummaryEvaluationServeice) GetEvaluationSelf(param *command.QueryEval |
313
|
_, itemList, err := evaluationItemRepo.Find(map[string]interface{}{
|
313
|
_, itemList, err := evaluationItemRepo.Find(map[string]interface{}{
|
314
|
"evaluationProjectId": evaluationData.EvaluationProjectId,
|
314
|
"evaluationProjectId": evaluationData.EvaluationProjectId,
|
315
|
"nodeType": int(domain.LinkNodeSelfAssessment),
|
315
|
"nodeType": int(domain.LinkNodeSelfAssessment),
|
|
|
316
|
+ "limit": 300,
|
316
|
})
|
317
|
})
|
317
|
if err != nil {
|
318
|
if err != nil {
|
318
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
319
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
319
|
}
|
320
|
}
|
|
|
321
|
+
|
|
|
322
|
+ _, itemValues, err := itemValueRepo.Find(map[string]interface{}{
|
|
|
323
|
+ "summaryEvaluationId": evaluationData.Id,
|
|
|
324
|
+ })
|
|
|
325
|
+
|
|
|
326
|
+ if err != nil {
|
|
|
327
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
328
|
+ }
|
|
|
329
|
+
|
320
|
if err := transactionContext.CommitTransaction(); err != nil {
|
330
|
if err := transactionContext.CommitTransaction(); err != nil {
|
321
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
331
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
322
|
}
|
332
|
}
|
323
|
- _ = itemList
|
|
|
324
|
- _ = itemValueRepo
|
|
|
325
|
- return nil, nil
|
333
|
+
|
|
|
334
|
+ itemValuesAdapter := srv.buildSummaryItemValue(itemList, itemValues)
|
|
|
335
|
+ result := adapter.EvaluationInfoAdapter{
|
|
|
336
|
+ SummaryEvaluationId: evaluationData.Id,
|
|
|
337
|
+ CycleId: int(evaluationData.CycleId),
|
|
|
338
|
+ CycleName: evaluationData.CycleName,
|
|
|
339
|
+ EvaluationProjectId: evaluationData.EvaluationProjectId,
|
|
|
340
|
+ EvaluationProjectName: evaluationData.EvaluationProjectName,
|
|
|
341
|
+ LinkNodeId: evaluationData.NodeId,
|
|
|
342
|
+ BeginTime: evaluationData.BeginTime.Format("2006-01-02 15:04:05"),
|
|
|
343
|
+ EndTime: evaluationData.EndTime.Format("2006-01-02 15:04:05"),
|
|
|
344
|
+ Status: string(evaluationData.Status),
|
|
|
345
|
+ EvaluationItems: itemValuesAdapter,
|
|
|
346
|
+ }
|
|
|
347
|
+ return &result, nil
|
326
|
}
|
348
|
}
|
327
|
|
349
|
|
328
|
// 编辑综合自评详情
|
350
|
// 编辑综合自评详情
|
329
|
-func (srv *SummaryEvaluationServeice) EditEvaluationSelf() (map[string][]adapter.EvaluationItemAdapter, error) {
|
351
|
+func (srv *SummaryEvaluationServeice) EditEvaluationSelf(param *command.EditEvaluationValue) (map[string][]adapter.EvaluationItemAdapter, error) {
|
330
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
352
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
331
|
if err != nil {
|
353
|
if err != nil {
|
332
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
354
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
@@ -337,7 +359,33 @@ func (srv *SummaryEvaluationServeice) EditEvaluationSelf() (map[string][]adapter |
|
@@ -337,7 +359,33 @@ func (srv *SummaryEvaluationServeice) EditEvaluationSelf() (map[string][]adapter |
337
|
defer func() {
|
359
|
defer func() {
|
338
|
_ = transactionContext.RollbackTransaction()
|
360
|
_ = transactionContext.RollbackTransaction()
|
339
|
}()
|
361
|
}()
|
|
|
362
|
+ evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{
|
|
|
363
|
+ "transactionContext": transactionContext,
|
|
|
364
|
+ })
|
|
|
365
|
+ itemUsedRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{
|
|
|
366
|
+ "transactionContext": transactionContext,
|
|
|
367
|
+ })
|
|
|
368
|
+
|
|
|
369
|
+ itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{
|
|
|
370
|
+ "transactionContext": transactionContext,
|
|
|
371
|
+ })
|
|
|
372
|
+ evaluationData, err := evaluationRepo.FindOne(map[string]interface{}{
|
|
|
373
|
+ "id": param.SummaryEvaluationId,
|
|
|
374
|
+ })
|
|
|
375
|
+ if err != nil {
|
|
|
376
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
377
|
+ }
|
340
|
|
378
|
|
|
|
379
|
+ _, itemList, err := itemUsedRepo.Find(map[string]interface{}{
|
|
|
380
|
+ "evaluationProjectId": int(domain.LinkNodeSelfAssessment),
|
|
|
381
|
+ "limit": 300,
|
|
|
382
|
+ })
|
|
|
383
|
+ if err != nil {
|
|
|
384
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
385
|
+ }
|
|
|
386
|
+ _ = itemValueRepo
|
|
|
387
|
+ _ = evaluationData
|
|
|
388
|
+ _ = itemList
|
341
|
if err := transactionContext.CommitTransaction(); err != nil {
|
389
|
if err := transactionContext.CommitTransaction(); err != nil {
|
342
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
390
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
343
|
}
|
391
|
}
|