作者 郑周

1. 里程碑记录

... ... @@ -7,6 +7,7 @@ import (
"time"
service "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/role"
taskService "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/task/service"
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/utils/tool_funs"
... ... @@ -1222,7 +1223,7 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand)
}
}
// TODO 还差调用绪旭辉接口,更新里程碑状态
// 更新里程碑数据
if len(in.AssessTaskStages) > 0 {
projectRepository := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext})
project, err := projectRepository.FindOne(map[string]interface{}{"id": assessData.EvaluationProjectId})
... ... @@ -1263,10 +1264,17 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand)
}
_, err := taskRecordRepository.Insert(it)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "更新里程碑数据:"+err.Error())
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "更新里程碑记录:"+err.Error())
}
}
}
if len(taskRecords) > 0 {
err := taskService.NewTaskService().ReplyTaskStage(transactionContext, taskRecords)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "更新里程碑数据:"+err.Error())
}
}
}
}
... ...
... ... @@ -560,12 +560,12 @@ func (srv TaskService) ListTask(param *command.ListTaskCommand) (map[string]inte
return result, nil
}
func (t TaskService) canUpdateTask(taskData *domain.Task, stageList []*domain.TaskStage) (bool, error) {
func (srv TaskService) canUpdateTask(taskData *domain.Task, stageList []*domain.TaskStage) (bool, error) {
return true, nil
}
// CancelAttention 用户取消关注某个任务
func (t TaskService) CancelAttention(param *command.CancelAttentionCommand) error {
func (srv TaskService) CancelAttention(param *command.CancelAttentionCommand) error {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ... @@ -596,7 +596,7 @@ func (t TaskService) CancelAttention(param *command.CancelAttentionCommand) erro
}
// 员工绩效-任务管理-列表
func (t TaskService) ListTask2(param *command.SearchTaskCommand) (map[string]interface{}, error) {
func (srv TaskService) ListTask2(param *command.SearchTaskCommand) (map[string]interface{}, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ... @@ -612,7 +612,7 @@ func (t TaskService) ListTask2(param *command.SearchTaskCommand) (map[string]int
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取用户的角色信息"+err.Error())
}
if hrbpFlag == domain.RoleTypeSystem {
listData, err := t.listTask2ForHrbp(param)
listData, err := srv.listTask2ForHrbp(param)
return listData, err
}
var limit = 20
... ... @@ -699,7 +699,7 @@ func (t TaskService) ListTask2(param *command.SearchTaskCommand) (map[string]int
}
// 以hrbp角色权限获取任务列表
func (t TaskService) listTask2ForHrbp(param *command.SearchTaskCommand) (map[string]interface{}, error) {
func (srv TaskService) listTask2ForHrbp(param *command.SearchTaskCommand) (map[string]interface{}, error) {
var limit = 20
var offset = 0
if param.PageSize > 0 {
... ... @@ -793,7 +793,7 @@ func (t TaskService) listTask2ForHrbp(param *command.SearchTaskCommand) (map[str
}
// ReplyTaskStage 根据每日的任务反馈 ,更新任务里程碑
func (t TaskService) ReplyTaskStage(transactionContext application.TransactionContext, param []*domain.TaskRecord) error {
func (srv TaskService) ReplyTaskStage(transactionContext application.TransactionContext, param []*domain.TaskRecord) error {
taskRepo := factory.CreateTaskRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
... ...