|
@@ -60,7 +60,7 @@ func (srv StaffAssessServeice) SearchAssessCycelMe(param *query.SearchAssessMeQu |
|
@@ -60,7 +60,7 @@ func (srv StaffAssessServeice) SearchAssessCycelMe(param *query.SearchAssessMeQu |
60
|
}
|
60
|
}
|
61
|
|
61
|
|
62
|
//获取我的项目周期进度描述
|
62
|
//获取我的项目周期进度描述
|
63
|
-func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQuery) (*adapter.AssessTaskDescResp, error) {
|
63
|
+func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQuery) (*adapter.AssessCycleDescResp, error) {
|
64
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
64
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
65
|
if err != nil {
|
65
|
if err != nil {
|
66
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
66
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
@@ -79,24 +79,32 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
|
@@ -79,24 +79,32 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
79
|
staffAssessRepo := factory.CreateStaffAssessRepository(map[string]interface{}{
|
79
|
staffAssessRepo := factory.CreateStaffAssessRepository(map[string]interface{}{
|
80
|
"transactionContext": transactionContext,
|
80
|
"transactionContext": transactionContext,
|
81
|
})
|
81
|
})
|
82
|
- assessTaskData, err := staffAssessTaskRepo.FindOne(map[string]interface{}{
|
|
|
83
|
- // "id": param.AssessTaskId,
|
82
|
+ assessTaskDataAny, err := staffAssessTaskRepo.FindOne(map[string]interface{}{
|
|
|
83
|
+ "cycleId": param.CycleId,
|
|
|
84
|
+ "beginDay": param.BeginDay,
|
|
|
85
|
+ "limit": 1,
|
84
|
})
|
86
|
})
|
85
|
if err != nil {
|
87
|
if err != nil {
|
86
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "评估任务不存在,"+err.Error())
|
88
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "评估任务不存在,"+err.Error())
|
87
|
}
|
89
|
}
|
|
|
90
|
+ _, myAssessTask, err := staffAssessTaskRepo.Find(map[string]interface{}{
|
|
|
91
|
+ "cycleId": param.CycleId,
|
|
|
92
|
+ "beginDay": param.BeginDay,
|
|
|
93
|
+ "executorId": param.UserId,
|
|
|
94
|
+ "limit": 1,
|
|
|
95
|
+ })
|
|
|
96
|
+ if err != nil {
|
|
|
97
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, "我的评估任务不存在,"+err.Error())
|
|
|
98
|
+ }
|
88
|
//返回的数据结果
|
99
|
//返回的数据结果
|
89
|
- result := adapter.AssessTaskDescResp{
|
|
|
90
|
- AssessTaskId: assessTaskData.Id,
|
|
|
91
|
- EvaluationProjectId: assessTaskData.EvaluationProjectId,
|
|
|
92
|
- EvaluationProjectName: assessTaskData.EvaluationProjectName,
|
|
|
93
|
- CycleName: assessTaskData.CycleName,
|
|
|
94
|
- BeginTime: assessTaskData.BeginTime.Local().Format("2006-01-02 15:04-05"),
|
|
|
95
|
- EndTime: assessTaskData.EndTime.Local().Format("2006-01-02 15:04-05"),
|
|
|
96
|
- StepList: []adapter.AssessTaskStep{},
|
100
|
+ result := adapter.AssessCycleDescResp{
|
|
|
101
|
+ CycleId: int(assessTaskDataAny.CycleId),
|
|
|
102
|
+ CycleName: assessTaskDataAny.CycleName,
|
|
|
103
|
+ BeginDay: assessTaskDataAny.BeginDay,
|
|
|
104
|
+ StepList: []adapter.AssessTaskStep{},
|
97
|
}
|
105
|
}
|
98
|
|
106
|
|
99
|
- for _, v := range assessTaskData.StepList {
|
107
|
+ for _, v := range assessTaskDataAny.StepList {
|
100
|
stepItem := adapter.AssessTaskStep{
|
108
|
stepItem := adapter.AssessTaskStep{
|
101
|
SortBy: v.SortBy,
|
109
|
SortBy: v.SortBy,
|
102
|
LinkNodeName: v.LinkNodeName,
|
110
|
LinkNodeName: v.LinkNodeName,
|
|
@@ -109,26 +117,31 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
|
@@ -109,26 +117,31 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
109
|
}
|
117
|
}
|
110
|
switch v.LinkNodeType {
|
118
|
switch v.LinkNodeType {
|
111
|
case domain.LinkNodeSelfAssessment:
|
119
|
case domain.LinkNodeSelfAssessment:
|
112
|
- //个人自评完成情况
|
|
|
113
|
- _, assessSelfData, err := staffAssessRepo.Find(map[string]interface{}{
|
|
|
114
|
- "staffAssessTaskId": assessTaskData.Id,
|
|
|
115
|
- "executorId": param.UserId,
|
|
|
116
|
- "typesList": []string{string(domain.AssessSelf)},
|
|
|
117
|
- })
|
|
|
118
|
- if err != nil {
|
|
|
119
|
- return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取个人的评估环节"+err.Error())
|
|
|
120
|
- }
|
|
|
121
|
- if len(assessSelfData) > 0 {
|
|
|
122
|
- stepItem.Status = string(assessSelfData[0].Status)
|
120
|
+ if len(myAssessTask) > 0 {
|
|
|
121
|
+ //个人自评完成情况
|
|
|
122
|
+ _, assessSelfData, err := staffAssessRepo.Find(map[string]interface{}{
|
|
|
123
|
+ "staffAssessTaskId": myAssessTask[0].Id,
|
|
|
124
|
+ "executorId": param.UserId,
|
|
|
125
|
+ "typesList": []string{string(domain.AssessSelf)},
|
|
|
126
|
+ })
|
|
|
127
|
+ if err != nil {
|
|
|
128
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取个人的评估环节"+err.Error())
|
|
|
129
|
+ }
|
|
|
130
|
+ if len(assessSelfData) > 0 {
|
|
|
131
|
+ stepItem.Status = string(assessSelfData[0].Status)
|
|
|
132
|
+ }
|
|
|
133
|
+ stepItem.Desc = fmt.Sprintf("截止日期:%s", stepItem.EndTime)
|
123
|
}
|
134
|
}
|
124
|
- stepItem.Desc = fmt.Sprintf("截止日期:%s", stepItem.EndTime)
|
|
|
125
|
case domain.LinkNodeAllInvite:
|
135
|
case domain.LinkNodeAllInvite:
|
|
|
136
|
+ if len(myAssessTask) > 0 {
|
|
|
137
|
+
|
|
|
138
|
+ }
|
126
|
//邀请别人评估自己
|
139
|
//邀请别人评估自己
|
127
|
_, assessInviteData, err := staffAssessRepo.Find(map[string]interface{}{
|
140
|
_, assessInviteData, err := staffAssessRepo.Find(map[string]interface{}{
|
128
|
- "staffAssessTaskId": assessTaskData.Id,
|
|
|
129
|
- "targetUserId": param.UserId,
|
|
|
130
|
- "typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
|
|
131
|
- "limit": 5,
|
141
|
+ // "staffAssessTaskId": assessTaskData.Id,
|
|
|
142
|
+ "targetUserId": param.UserId,
|
|
|
143
|
+ "typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
|
|
144
|
+ "limit": 5,
|
132
|
})
|
145
|
})
|
133
|
if err != nil {
|
146
|
if err != nil {
|
134
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取个人的评估环节"+err.Error())
|
147
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取个人的评估环节"+err.Error())
|
|
@@ -147,9 +160,9 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
|
@@ -147,9 +160,9 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
147
|
case domain.LinkNodeAllAssessment:
|
160
|
case domain.LinkNodeAllAssessment:
|
148
|
//我评估别人,被邀请评估
|
161
|
//我评估别人,被邀请评估
|
149
|
_, assessInviteList, err := staffAssessRepo.Find(map[string]interface{}{
|
162
|
_, assessInviteList, err := staffAssessRepo.Find(map[string]interface{}{
|
150
|
- "staffAssessTaskId": assessTaskData.Id,
|
|
|
151
|
- "executorId": param.UserId,
|
|
|
152
|
- "typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
163
|
+ // "staffAssessTaskId": assessTaskData.Id,
|
|
|
164
|
+ "executorId": param.UserId,
|
|
|
165
|
+ "typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
153
|
})
|
166
|
})
|
154
|
if err != nil {
|
167
|
if err != nil {
|
155
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取个人的评估环节"+err.Error())
|
168
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取个人的评估环节"+err.Error())
|
|
@@ -168,9 +181,9 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
|
@@ -168,9 +181,9 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
168
|
case domain.LinkNodeSuperiorAssessment:
|
181
|
case domain.LinkNodeSuperiorAssessment:
|
169
|
//我评估别人,上级评估
|
182
|
//我评估别人,上级评估
|
170
|
_, assessSupperList, err := staffAssessRepo.Find(map[string]interface{}{
|
183
|
_, assessSupperList, err := staffAssessRepo.Find(map[string]interface{}{
|
171
|
- "staffAssessTaskId": assessTaskData.Id,
|
|
|
172
|
- "executorId": param.UserId,
|
|
|
173
|
- "typesList": []string{string(domain.AssessSuper)},
|
184
|
+ // "staffAssessTaskId": assessTaskData.Id,
|
|
|
185
|
+ "executorId": param.UserId,
|
|
|
186
|
+ "typesList": []string{string(domain.AssessSuper)},
|
174
|
})
|
187
|
})
|
175
|
if err != nil {
|
188
|
if err != nil {
|
176
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取个人的评估环节"+err.Error())
|
189
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取个人的评估环节"+err.Error())
|