|
@@ -2,6 +2,9 @@ package service |
|
@@ -2,6 +2,9 @@ package service |
2
|
|
2
|
|
3
|
import (
|
3
|
import (
|
4
|
"fmt"
|
4
|
"fmt"
|
|
|
5
|
+ "strconv"
|
|
|
6
|
+ "strings"
|
|
|
7
|
+
|
5
|
"github.com/linmadan/egglib-go/core/application"
|
8
|
"github.com/linmadan/egglib-go/core/application"
|
6
|
"github.com/linmadan/egglib-go/utils/tool_funs"
|
9
|
"github.com/linmadan/egglib-go/utils/tool_funs"
|
7
|
"github.com/xuri/excelize/v2"
|
10
|
"github.com/xuri/excelize/v2"
|
|
@@ -11,31 +14,29 @@ import ( |
|
@@ -11,31 +14,29 @@ import ( |
11
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/query"
|
14
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/query"
|
12
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
15
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
13
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/infrastructure/dao"
|
16
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/infrastructure/dao"
|
14
|
- "strconv"
|
|
|
15
|
- "strings"
|
|
|
16
|
)
|
17
|
)
|
17
|
|
18
|
|
18
|
// 调试用,手动调用CreateStaffAssessTask
|
19
|
// 调试用,手动调用CreateStaffAssessTask
|
19
|
func (srv StaffAssessServeice) InvokCreateStaffAssessTask(param *command.CreateStaffAssessTask) (map[string]interface{}, error) {
|
20
|
func (srv StaffAssessServeice) InvokCreateStaffAssessTask(param *command.CreateStaffAssessTask) (map[string]interface{}, error) {
|
20
|
- transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
21
|
- if err != nil {
|
|
|
22
|
- return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
23
|
- }
|
|
|
24
|
- if err := transactionContext.StartTransaction(); err != nil {
|
|
|
25
|
- return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
26
|
- }
|
|
|
27
|
- defer func() {
|
|
|
28
|
- _ = transactionContext.RollbackTransaction()
|
|
|
29
|
- }()
|
21
|
+ // transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
22
|
+ // if err != nil {
|
|
|
23
|
+ // return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
24
|
+ // }
|
|
|
25
|
+ // if err := transactionContext.StartTransaction(); err != nil {
|
|
|
26
|
+ // return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
27
|
+ // }
|
|
|
28
|
+ // defer func() {
|
|
|
29
|
+ // _ = transactionContext.RollbackTransaction()
|
|
|
30
|
+ // }()
|
30
|
|
31
|
|
31
|
- data, err := srv.CreateStaffAssessTask(transactionContext, param)
|
|
|
32
|
- if err != nil {
|
|
|
33
|
- return nil, err
|
|
|
34
|
- }
|
|
|
35
|
- if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
36
|
- return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
37
|
- }
|
|
|
38
|
- return data, nil
|
32
|
+ // data, err := srv.CreateStaffAssessTask(transactionContext, param)
|
|
|
33
|
+ // if err != nil {
|
|
|
34
|
+ // return nil, err
|
|
|
35
|
+ // }
|
|
|
36
|
+ // if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
37
|
+ // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
38
|
+ // }
|
|
|
39
|
+ return nil, nil
|
39
|
}
|
40
|
}
|
40
|
|
41
|
|
41
|
func (srv StaffAssessServeice) QuerySummary(in *query.SummaryCommand) (map[string]interface{}, error) {
|
42
|
func (srv StaffAssessServeice) QuerySummary(in *query.SummaryCommand) (map[string]interface{}, error) {
|
|
@@ -82,7 +83,7 @@ func (srv StaffAssessServeice) QuerySummary(in *query.SummaryCommand) (map[strin |
|
@@ -82,7 +83,7 @@ func (srv StaffAssessServeice) QuerySummary(in *query.SummaryCommand) (map[strin |
82
|
if invite.EndTime == nil {
|
83
|
if invite.EndTime == nil {
|
83
|
invite.EndTime = &d.EndTime
|
84
|
invite.EndTime = &d.EndTime
|
84
|
}
|
85
|
}
|
85
|
- break
|
86
|
+
|
86
|
case domain.AssessSuper:
|
87
|
case domain.AssessSuper:
|
87
|
supper.Total++
|
88
|
supper.Total++
|
88
|
if d.Status == domain.StaffAssessCompleted {
|
89
|
if d.Status == domain.StaffAssessCompleted {
|
|
@@ -91,7 +92,7 @@ func (srv StaffAssessServeice) QuerySummary(in *query.SummaryCommand) (map[strin |
|
@@ -91,7 +92,7 @@ func (srv StaffAssessServeice) QuerySummary(in *query.SummaryCommand) (map[strin |
91
|
if supper.EndTime == nil {
|
92
|
if supper.EndTime == nil {
|
92
|
supper.EndTime = &d.EndTime
|
93
|
supper.EndTime = &d.EndTime
|
93
|
}
|
94
|
}
|
94
|
- break
|
95
|
+
|
95
|
case domain.AssessInviteDiffSuper, domain.AssessInviteSameSuper:
|
96
|
case domain.AssessInviteDiffSuper, domain.AssessInviteSameSuper:
|
96
|
inviteAssess.Total++
|
97
|
inviteAssess.Total++
|
97
|
if d.Status == domain.StaffAssessCompleted {
|
98
|
if d.Status == domain.StaffAssessCompleted {
|
|
@@ -102,7 +103,7 @@ func (srv StaffAssessServeice) QuerySummary(in *query.SummaryCommand) (map[strin |
|
@@ -102,7 +103,7 @@ func (srv StaffAssessServeice) QuerySummary(in *query.SummaryCommand) (map[strin |
102
|
}
|
103
|
}
|
103
|
|
104
|
|
104
|
inviteTargetIdMap[d.TargetUserId] = 0 // 360评估类型都是被人邀请的评估,过滤相同的目标用户后,就是完成邀请的数量
|
105
|
inviteTargetIdMap[d.TargetUserId] = 0 // 360评估类型都是被人邀请的评估,过滤相同的目标用户后,就是完成邀请的数量
|
105
|
- break
|
106
|
+
|
106
|
}
|
107
|
}
|
107
|
}
|
108
|
}
|
108
|
invite.Completed = len(inviteTargetIdMap)
|
109
|
invite.Completed = len(inviteTargetIdMap)
|