...
|
...
|
@@ -60,7 +60,7 @@ func (srv StaffAssessServeice) SearchAssessCycelMe(param *query.SearchAssessMeQu |
|
|
}
|
|
|
|
|
|
//获取我的项目周期进度描述
|
|
|
func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQuery) (*adapter.AssessTaskDescResp, error) {
|
|
|
func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQuery) (*adapter.AssessCycleDescResp, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
...
|
...
|
@@ -79,24 +79,32 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
|
|
staffAssessRepo := factory.CreateStaffAssessRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
assessTaskData, err := staffAssessTaskRepo.FindOne(map[string]interface{}{
|
|
|
// "id": param.AssessTaskId,
|
|
|
assessTaskDataAny, err := staffAssessTaskRepo.FindOne(map[string]interface{}{
|
|
|
"cycleId": param.CycleId,
|
|
|
"beginDay": param.BeginDay,
|
|
|
"limit": 1,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "评估任务不存在,"+err.Error())
|
|
|
}
|
|
|
_, myAssessTask, err := staffAssessTaskRepo.Find(map[string]interface{}{
|
|
|
"cycleId": param.CycleId,
|
|
|
"beginDay": param.BeginDay,
|
|
|
"executorId": param.UserId,
|
|
|
"limit": 1,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "我的评估任务不存在,"+err.Error())
|
|
|
}
|
|
|
//返回的数据结果
|
|
|
result := adapter.AssessTaskDescResp{
|
|
|
AssessTaskId: assessTaskData.Id,
|
|
|
EvaluationProjectId: assessTaskData.EvaluationProjectId,
|
|
|
EvaluationProjectName: assessTaskData.EvaluationProjectName,
|
|
|
CycleName: assessTaskData.CycleName,
|
|
|
BeginTime: assessTaskData.BeginTime.Local().Format("2006-01-02 15:04-05"),
|
|
|
EndTime: assessTaskData.EndTime.Local().Format("2006-01-02 15:04-05"),
|
|
|
result := adapter.AssessCycleDescResp{
|
|
|
CycleId: int(assessTaskDataAny.CycleId),
|
|
|
CycleName: assessTaskDataAny.CycleName,
|
|
|
BeginDay: assessTaskDataAny.BeginDay,
|
|
|
StepList: []adapter.AssessTaskStep{},
|
|
|
}
|
|
|
|
|
|
for _, v := range assessTaskData.StepList {
|
|
|
for _, v := range assessTaskDataAny.StepList {
|
|
|
stepItem := adapter.AssessTaskStep{
|
|
|
SortBy: v.SortBy,
|
|
|
LinkNodeName: v.LinkNodeName,
|
...
|
...
|
@@ -109,9 +117,10 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
|
|
}
|
|
|
switch v.LinkNodeType {
|
|
|
case domain.LinkNodeSelfAssessment:
|
|
|
if len(myAssessTask) > 0 {
|
|
|
//个人自评完成情况
|
|
|
_, assessSelfData, err := staffAssessRepo.Find(map[string]interface{}{
|
|
|
"staffAssessTaskId": assessTaskData.Id,
|
|
|
"staffAssessTaskId": myAssessTask[0].Id,
|
|
|
"executorId": param.UserId,
|
|
|
"typesList": []string{string(domain.AssessSelf)},
|
|
|
})
|
...
|
...
|
@@ -122,10 +131,14 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
|
|
stepItem.Status = string(assessSelfData[0].Status)
|
|
|
}
|
|
|
stepItem.Desc = fmt.Sprintf("截止日期:%s", stepItem.EndTime)
|
|
|
}
|
|
|
case domain.LinkNodeAllInvite:
|
|
|
if len(myAssessTask) > 0 {
|
|
|
|
|
|
}
|
|
|
//邀请别人评估自己
|
|
|
_, assessInviteData, err := staffAssessRepo.Find(map[string]interface{}{
|
|
|
"staffAssessTaskId": assessTaskData.Id,
|
|
|
// "staffAssessTaskId": assessTaskData.Id,
|
|
|
"targetUserId": param.UserId,
|
|
|
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
|
|
"limit": 5,
|
...
|
...
|
@@ -147,7 +160,7 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
|
|
case domain.LinkNodeAllAssessment:
|
|
|
//我评估别人,被邀请评估
|
|
|
_, assessInviteList, err := staffAssessRepo.Find(map[string]interface{}{
|
|
|
"staffAssessTaskId": assessTaskData.Id,
|
|
|
// "staffAssessTaskId": assessTaskData.Id,
|
|
|
"executorId": param.UserId,
|
|
|
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
|
|
})
|
...
|
...
|
@@ -168,7 +181,7 @@ func (srv StaffAssessServeice) AssessCycleMeDesc(param *query.AssessCycleDescQue |
|
|
case domain.LinkNodeSuperiorAssessment:
|
|
|
//我评估别人,上级评估
|
|
|
_, assessSupperList, err := staffAssessRepo.Find(map[string]interface{}{
|
|
|
"staffAssessTaskId": assessTaskData.Id,
|
|
|
// "staffAssessTaskId": assessTaskData.Id,
|
|
|
"executorId": param.UserId,
|
|
|
"typesList": []string{string(domain.AssessSuper)},
|
|
|
})
|
...
|
...
|
|