...
|
...
|
@@ -2,6 +2,9 @@ package service |
|
|
|
|
|
import (
|
|
|
"fmt"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
|
|
|
"github.com/linmadan/egglib-go/core/application"
|
|
|
"github.com/linmadan/egglib-go/utils/tool_funs"
|
|
|
"github.com/xuri/excelize/v2"
|
...
|
...
|
@@ -11,31 +14,29 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/query"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/infrastructure/dao"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
)
|
|
|
|
|
|
// 调试用,手动调用CreateStaffAssessTask
|
|
|
func (srv StaffAssessServeice) InvokCreateStaffAssessTask(param *command.CreateStaffAssessTask) (map[string]interface{}, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.StartTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
data, err := srv.CreateStaffAssessTask(transactionContext, param)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
return data, nil
|
|
|
// transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
// }
|
|
|
// if err := transactionContext.StartTransaction(); err != nil {
|
|
|
// return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
// }
|
|
|
// defer func() {
|
|
|
// _ = transactionContext.RollbackTransaction()
|
|
|
// }()
|
|
|
|
|
|
// data, err := srv.CreateStaffAssessTask(transactionContext, param)
|
|
|
// if err != nil {
|
|
|
// return nil, err
|
|
|
// }
|
|
|
// if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
return nil, nil
|
|
|
}
|
|
|
|
|
|
func (srv StaffAssessServeice) QuerySummary(in *query.SummaryCommand) (map[string]interface{}, error) {
|
...
|
...
|
@@ -82,7 +83,7 @@ func (srv StaffAssessServeice) QuerySummary(in *query.SummaryCommand) (map[strin |
|
|
if invite.EndTime == nil {
|
|
|
invite.EndTime = &d.EndTime
|
|
|
}
|
|
|
break
|
|
|
|
|
|
case domain.AssessSuper:
|
|
|
supper.Total++
|
|
|
if d.Status == domain.StaffAssessCompleted {
|
...
|
...
|
@@ -91,7 +92,7 @@ func (srv StaffAssessServeice) QuerySummary(in *query.SummaryCommand) (map[strin |
|
|
if supper.EndTime == nil {
|
|
|
supper.EndTime = &d.EndTime
|
|
|
}
|
|
|
break
|
|
|
|
|
|
case domain.AssessInviteDiffSuper, domain.AssessInviteSameSuper:
|
|
|
inviteAssess.Total++
|
|
|
if d.Status == domain.StaffAssessCompleted {
|
...
|
...
|
@@ -102,7 +103,7 @@ func (srv StaffAssessServeice) QuerySummary(in *query.SummaryCommand) (map[strin |
|
|
}
|
|
|
|
|
|
inviteTargetIdMap[d.TargetUserId] = 0 // 360评估类型都是被人邀请的评估,过滤相同的目标用户后,就是完成邀请的数量
|
|
|
break
|
|
|
|
|
|
}
|
|
|
}
|
|
|
invite.Completed = len(inviteTargetIdMap)
|
...
|
...
|
|