|
@@ -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"),
|
100
|
+ result := adapter.AssessCycleDescResp{
|
|
|
101
|
+ CycleId: int(assessTaskDataAny.CycleId),
|
|
|
102
|
+ CycleName: assessTaskDataAny.CycleName,
|
|
|
103
|
+ BeginDay: assessTaskDataAny.BeginDay,
|
96
|
StepList: []adapter.AssessTaskStep{},
|
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,9 +117,10 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
|
@@ -109,9 +117,10 @@ 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:
|
|
|
120
|
+ if len(myAssessTask) > 0 {
|
112
|
//个人自评完成情况
|
121
|
//个人自评完成情况
|
113
|
_, assessSelfData, err := staffAssessRepo.Find(map[string]interface{}{
|
122
|
_, assessSelfData, err := staffAssessRepo.Find(map[string]interface{}{
|
114
|
- "staffAssessTaskId": assessTaskData.Id,
|
123
|
+ "staffAssessTaskId": myAssessTask[0].Id,
|
115
|
"executorId": param.UserId,
|
124
|
"executorId": param.UserId,
|
116
|
"typesList": []string{string(domain.AssessSelf)},
|
125
|
"typesList": []string{string(domain.AssessSelf)},
|
117
|
})
|
126
|
})
|
|
@@ -122,10 +131,14 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
|
@@ -122,10 +131,14 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
122
|
stepItem.Status = string(assessSelfData[0].Status)
|
131
|
stepItem.Status = string(assessSelfData[0].Status)
|
123
|
}
|
132
|
}
|
124
|
stepItem.Desc = fmt.Sprintf("截止日期:%s", stepItem.EndTime)
|
133
|
stepItem.Desc = fmt.Sprintf("截止日期:%s", stepItem.EndTime)
|
|
|
134
|
+ }
|
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,
|
141
|
+ // "staffAssessTaskId": assessTaskData.Id,
|
129
|
"targetUserId": param.UserId,
|
142
|
"targetUserId": param.UserId,
|
130
|
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
143
|
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
131
|
"limit": 5,
|
144
|
"limit": 5,
|
|
@@ -147,7 +160,7 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
|
@@ -147,7 +160,7 @@ 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,
|
163
|
+ // "staffAssessTaskId": assessTaskData.Id,
|
151
|
"executorId": param.UserId,
|
164
|
"executorId": param.UserId,
|
152
|
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
165
|
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
153
|
})
|
166
|
})
|
|
@@ -168,7 +181,7 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
|
@@ -168,7 +181,7 @@ 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,
|
184
|
+ // "staffAssessTaskId": assessTaskData.Id,
|
172
|
"executorId": param.UserId,
|
185
|
"executorId": param.UserId,
|
173
|
"typesList": []string{string(domain.AssessSuper)},
|
186
|
"typesList": []string{string(domain.AssessSuper)},
|
174
|
})
|
187
|
})
|