作者 tangxvhui

日常保存

@@ -32,29 +32,29 @@ func (h *HeaderLevel) addChild(name string) (child *HeaderLevel) { @@ -32,29 +32,29 @@ func (h *HeaderLevel) addChild(name string) (child *HeaderLevel) {
32 } 32 }
33 33
34 // 获取表头的所有列表名 34 // 获取表头的所有列表名
35 -func (h *HeaderLevel) collectAllColumn(all *[][]string) {  
36 - for _, v := range h.Child {  
37 - v.collectColumn(&v, all, nil)  
38 - }  
39 -}  
40 -  
41 -func (h *HeaderLevel) collectColumn(child *HeaderLevel, columns *[][]string, column *[]string) {  
42 - if column == nil {  
43 - column = &[]string{}  
44 - }  
45 - *column = append(*column, h.Name)  
46 - for _, v := range child.Child {  
47 - if len(v.Child) > 0 {  
48 - v.collectColumn(&v, columns, column)  
49 - }  
50 - if len(v.Child) == 0 {  
51 - item := make([]string, len(*column))  
52 - copy(item, *column)  
53 - item = append(item, v.Name)  
54 - *columns = append(*columns, item)  
55 - }  
56 - }  
57 -} 35 +// func (h *HeaderLevel) collectAllColumn(all *[][]string) {
  36 +// for _, v := range h.Child {
  37 +// v.collectColumn(&v, all, nil)
  38 +// }
  39 +// }
  40 +
  41 +// func (h *HeaderLevel) collectColumn(child *HeaderLevel, columns *[][]string, column *[]string) {
  42 +// if column == nil {
  43 +// column = &[]string{}
  44 +// }
  45 +// *column = append(*column, h.Name)
  46 +// for _, v := range child.Child {
  47 +// if len(v.Child) > 0 {
  48 +// v.collectColumn(&v, columns, column)
  49 +// }
  50 +// if len(v.Child) == 0 {
  51 +// item := make([]string, len(*column))
  52 +// copy(item, *column)
  53 +// item = append(item, v.Name)
  54 +// *columns = append(*columns, item)
  55 +// }
  56 +// }
  57 +// }
58 58
59 type exportData struct { 59 type exportData struct {
60 userName []string //员工的名称列表 ,对应excel文件的多个sheet 60 userName []string //员工的名称列表 ,对应excel文件的多个sheet
@@ -156,9 +156,9 @@ func (e *exportData) weightDesc(weight float64) string { @@ -156,9 +156,9 @@ func (e *exportData) weightDesc(weight float64) string {
156 } 156 }
157 } 157 }
158 158
159 -func (e *exportData) userDayKey(userName string) string {  
160 - return userName  
161 -} 159 +// func (e *exportData) userDayKey(userName string) string {
  160 +// return userName
  161 +// }
162 162
163 type exportData2 struct { 163 type exportData2 struct {
164 tableHeader HeaderLevel //数据表格对应表头 164 tableHeader HeaderLevel //数据表格对应表头
@@ -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 - }()  
30 -  
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 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 + // }()
  31 +
  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)
@@ -329,4 +329,4 @@ func sendSmsEvalation(param []domain.SummaryEvaluation) error { @@ -329,4 +329,4 @@ func sendSmsEvalation(param []domain.SummaryEvaluation) error {
329 return nil 329 return nil
330 } 330 }
331 331
332 -// 332 +//周期自评 短信提醒