作者 Your Name

更新

package adapter
import "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
//评估内容详情
type AssessInfoResp struct {
CycleId int64 `json:"cycleId"` //周期id
CycleName string `json:"cycleName"` //周期名称
EvaluationProjectId int `json:"evaluationProjectId"` //项目id
EvaluationProjectName string `json:"evaluationProjectName"` //项目名称
BeginTime string `json:"beginTime"` //开始时间 2006-01-02 15:04:05
EndTime string `json:"endTime"` //结束时间 2006-01-02 15:04:05
Status string `json:"status"` //完成状态
TargetUserId int `json:"targetUser"` //
TargetUserName string `json:"targetUserName"` //
AssessContent []AssessContent `json:"assessContent"` //评估内容
}
type AssessContent struct {
Category string `json:"category" comment:"类别"`
Name string `json:"name" comment:"名称"`
PromptTitle string `json:"promptTitle" comment:"提示项标题"`
PromptText string `json:"promptText" comment:"提示项正文"`
EntryItems []domain.EntryItem `json:"entryItems" comment:"填写项"`
RuleId string
}
... ...
... ... @@ -5,7 +5,7 @@ type AssessTaskDescResp struct {
EvaluationProjectId int `json:"evaluationProjectId"` //项目id
EvaluationProjectName string `json:"evaluationProjectName"` //项目名称
CycleName string `json:"cycleName"` //周期名称
BeginTime string `json:"beginTime"` //开始时间 2006-01-02
BeginTime string `json:"beginTime"` //开始时间 2006-01-02 15:04:05
EndTime string `json:"endTime"` //结束时间 2006-01-02 15:04:05
StepList []AssessTaskStep `json:"stepList"` // 考评流程
}
... ...
package query
type AssessSelfInfo struct {
AssessId int `json:"assessId"` //StaffAssess 的id
UserId int `json:"userId"`
CompanyId int `json:"companyId"`
}
... ...
... ... @@ -255,17 +255,40 @@ func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) (
}
//获取用户数据
userRep := factory.CreateUserRepository(map[string]interface{}{
userRepo := factory.CreateUserRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
userData, err := userRep.FindOne(map[string]interface{}{
userData, err := userRepo.FindOne(map[string]interface{}{
"id": param.UserId,
})
if err != nil {
log.Logger.Error("获取用户信息," + err.Error())
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取用户信息,"+err.Error())
}
departmentRepo := factory.CreateDepartmentRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
var supperUserList []*domain.User
if len(userData.DepartmentId) > 0 {
_, departmentList, err := departmentRepo.Find(map[string]interface{}{
"ids": userData.DepartmentId,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取部门信息,"+err.Error())
}
var chargeUserIds []int64
for _, v := range departmentList {
chargeUserIds = append(chargeUserIds, v.ChargeUserIds...)
}
if len(chargeUserIds) > 0 {
_, supperUserList, err = userRepo.Find(map[string]interface{}{
"ids": chargeUserIds,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取员工上级信息,"+err.Error())
}
}
}
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
... ... @@ -289,6 +312,9 @@ func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) (
SupperUserName: "",
DutyTime: userData.CreateAt.Local().Format("2006-01-02 15:04:05"),
}
for _, v := range supperUserList {
userInfo.SupperUserName = userInfo.SupperUserName + v.Name + ";"
}
result := tool_funs.SimpleWrapGridMap(int64(cnt), listData)
result["userInfo"] = userInfo
return result, nil
... ... @@ -313,7 +339,7 @@ func (srv StaffAssessServeice) CreateStaffAssessTask() error {
return nil
}
func (srv StaffAssessServeice) getStaffDesc(userId int) *domain.StaffDesc {
// 获取员工自评详情
func (srv StaffAssessServeice) StaffAssessSelfInfo() {
return &domain.StaffDesc{}
}
... ...