作者 Your Name

日常保存

package adapter
import "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
type AssessInviteUserResp struct {
LinkNodeId int `json:"linkNodeId"`
LinkNodeName string `json:"linkNodeName"`
BeginTime string `json:"beginTime"`
EndTime string `json:"endTime"`
AssessTaskId int `json:"assessTaskId"`
InviteSameSuper []domain.StaffDesc `json:"inviteSameSuper"`
InviteDiffSuper []domain.StaffDesc `json:"inviteDiffSuper"`
}
... ...
package command
type CreateStaffAssessTask struct {
CompanyId int `json:"companyId"` //公司id
EvaluationProjectId int `json:"evaluationProjectId"` //项目id
EvaluationProjectName string `json:"evaluationProjectName"` //项目名称
CycleId int64 `json:"cycleId"` //对应的周期id
CycleName string `json:"cycleName"` //对应周期的名称
BeginTime string `json:"beginTime"` //绩效考核开始时间
EndTime string `json:"endTime"` //绩效考核截止时间
StepList []AssessTaskStep `json:"steps"` //考评的流程
ExecutorId []int `json:"executorId"` //参与此次考评的人
}
type AssessTaskStep struct {
SortBy int `json:"sortBy"` //排序
LinkNodeId int `json:"linkNodeId"` //考评的流程id
LinkNodeName string `json:"linkNodeName"` //流程名称
LinkNodeType int `json:"linkNodeType"` //流程类型 同evaluation_template.go->LinkNode.Type
BeginTime string `json:"beginTime"` //绩效考核开始时间
EndTime string `json:"endTime"` //绩效考核截止时间
}
... ...
package command
type SaveAssessInvite struct {
InviteSameSuper []string `json:"inviteSameSuper"` //相同上级同事
InviteDiffSuper []string `json:"inviteDiffSuper"` //不同上级同事
AssessTaskId int `json:"assessTaskId"` //评估任务id
TargetUserId int `json:"targetUserId"` //被评估的员工id
}
... ...
package query
type GetAssessInviteUserQuery struct {
CompanyId int `json:"companyId"` //对公司
UsrId int `json:"usrId"` //被评估的员工id
AssessTaskId int `json:"assessTaskId"` //评估任务的id
}
... ...
... ... @@ -2,11 +2,14 @@ package service
import (
"fmt"
"strconv"
"time"
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/utils/tool_funs"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/adapter"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/command"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/query"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/log"
... ... @@ -16,6 +19,11 @@ import (
type StaffAssessServeice struct {
}
func NewStaffAssessServeice() *StaffAssessServeice {
newService := &StaffAssessServeice{}
return newService
}
// 获取我参与过的评估任务列表
func (srv StaffAssessServeice) SearchAssessTaskMe(param *query.SearchAssessMeQuery) (map[string]interface{}, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
... ... @@ -70,7 +78,7 @@ func (srv StaffAssessServeice) SearchAssessTaskMe(param *query.SearchAssessMeQue
}
// 获取项目评估进度描述
func (srv StaffAssessServeice) AssessTaskDesc(param query.AssessTaskDescQuery) (*adapter.AssessTaskDescResp, error) {
func (srv StaffAssessServeice) AssessTaskDesc(param *query.AssessTaskDescQuery) (*adapter.AssessTaskDescResp, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ... @@ -204,7 +212,7 @@ func (srv StaffAssessServeice) AssessTaskDesc(param query.AssessTaskDescQuery) (
}
// 获取个人的自评反馈历史记录列表
func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) (map[string]interface{}, error) {
func (srv StaffAssessServeice) AssessSelfList(param *query.AssessSelfListQuery) (map[string]interface{}, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ... @@ -321,25 +329,419 @@ func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) (
}
// 更具项目评估的配置,创建员工的评估任务
func (srv StaffAssessServeice) CreateStaffAssessTask() error {
func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffAssessTask) (map[string]interface{}, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if err := transactionContext.StartTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
defer func() {
_ = transactionContext.RollbackTransaction()
}()
taskBeginTime, err := time.ParseInLocation("2006-01-02 15:04:05", param.BeginTime, time.Local)
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "任务开始时间填写错误,"+param.BeginTime)
}
taskEndTime, err := time.ParseInLocation("2006-01-02 15:04:05", param.EndTime, time.Local)
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "任务结束时间填写错误,"+param.EndTime)
}
nowTime := time.Now()
//建立评估任务
assessTask := domain.StaffAssessTask{
Id: 0,
CompanyId: param.CompanyId,
EvaluationProjectId: param.EvaluationProjectId,
EvaluationProjectName: param.EvaluationProjectName,
CycleId: param.CycleId,
CycleName: param.CycleName,
BeginTime: taskBeginTime,
EndTime: taskEndTime,
StepList: []domain.AssessTaskStep{},
ExecutorId: nil,
CreatedAt: nowTime,
UpdatedAt: nowTime,
DeletedAt: nil,
}
//填充评估环节
for _, v := range param.StepList {
stepBeginTime, err := time.ParseInLocation("2006-01-02 15:04:05", param.BeginTime, time.Local)
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "评估环节开始时间填写错误,"+param.BeginTime)
}
stepEndTime, err := time.ParseInLocation("2006-01-02 15:04:05", param.EndTime, time.Local)
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "评估环节结束时间填写错误,"+param.EndTime)
}
step := domain.AssessTaskStep{
SortBy: v.SortBy,
LinkNodeId: v.LinkNodeId,
LinkNodeName: v.LinkNodeName,
LinkNodeType: v.LinkNodeType,
BeginTime: stepBeginTime,
EndTime: stepEndTime,
}
assessTask.StepList = append(assessTask.StepList, step)
}
assessTaskRepo := factory.CreateStaffAssessTaskRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
_, err = assessTaskRepo.Save(&assessTask)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存评估任务"+err.Error())
}
assessList, err := srv.createStaffAssess(transactionContext, &assessTask)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "生成个人评估项"+err.Error())
}
assessRepo := factory.CreateStaffAssessRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
for i := range assessList {
_, err = assessRepo.Save(&assessList[i])
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存个人评估项"+err.Error())
}
}
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
return map[string]interface{}{
"assessTaskId": assessTask.Id,
}, nil
}
// 添加自评节点任务
func (srv StaffAssessServeice) createStaffAssess(transactionContext application.TransactionContext, param *domain.StaffAssessTask) ([]domain.StaffAssess, error) {
//评估的参与人
selfUserId := []int{}
userIdMap := map[int]struct{}{} //过滤重复的用户
for _, v := range param.ExecutorId {
if _, ok := userIdMap[v]; ok {
continue
}
selfUserId = append(selfUserId, v)
}
// 获取用户的信息
if len(selfUserId) == 0 {
return nil, application.ThrowError(application.ARG_ERROR, "未填写评估任务的执行人")
}
userRepo := factory.CreateUserRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
//获取员工信息
_, userList, err := userRepo.Find(map[string]interface{}{
"ids": selfUserId,
})
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "获取员工信息"+err.Error())
}
departmentRepo := factory.CreateDepartmentRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
//获取用户的部门
userDepartmentMap := map[int64][]*domain.Department{}
for _, v := range userList {
_, departmemtList, err := departmentRepo.Find(map[string]interface{}{
"ids": v.DepartmentId,
})
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "获取员工的部门信息"+err.Error())
}
userDepartmentMap[v.Id] = departmemtList
}
assessList := []domain.StaffAssess{}
//数据样板
stepSelfTemp := domain.StaffAssess{
Id: 0,
CompanyId: param.CompanyId,
EvaluationProjectId: param.EvaluationProjectId,
EvaluationProjectName: param.EvaluationProjectName,
CycleId: param.CycleId,
CycleName: param.CycleName,
StaffAssessTaskId: param.Id,
// TargetUser: domain.StaffDesc{},
// TargetDepartment: nil,
// Executor: domain.StaffDesc{},
Types: domain.AssessSelf,
// LinkNodeId: v.LinkNodeId,
Status: domain.StaffAssessUncompleted,
// BeginTime: time.Time{},
// EndTime: time.Time{},
CreatedAt: param.CreatedAt,
UpdatedAt: param.UpdatedAt,
DeletedAt: nil,
}
for _, v := range param.StepList {
if v.LinkNodeType == domain.LinkNodeSelfAssessment {
//员工自评
stepSelfTemp.BeginTime = v.BeginTime
stepSelfTemp.EndTime = v.EndTime
stepSelfTemp.LinkNodeId = v.LinkNodeId
stepSelfTemp.LinkNodeName = v.LinkNodeName
assessListTemp := srv.createStaffAssessSelf(stepSelfTemp, userList, userDepartmentMap)
assessList = append(assessList, assessListTemp...)
}
if v.LinkNodeType == domain.LinkNodeSuperiorAssessment {
// TODO
stepSelfTemp.BeginTime = v.BeginTime
stepSelfTemp.EndTime = v.EndTime
stepSelfTemp.LinkNodeId = v.LinkNodeId
stepSelfTemp.LinkNodeName = v.LinkNodeName
assessListTemp, err := srv.createStaffAssessSupper(transactionContext, stepSelfTemp, userList, userDepartmentMap)
if err != nil {
return nil, err
}
assessList = append(assessList, assessListTemp...)
}
}
return assessList, nil
}
// 构建员工自评
func (srv StaffAssessServeice) createStaffAssessSelf(assessTemp domain.StaffAssess,
userList []*domain.User, userDepartmentMap map[int64][]*domain.Department) []domain.StaffAssess {
result := []domain.StaffAssess{}
for _, usr := range userList {
assessTemp.TargetUser = domain.StaffDesc{
UserId: int(usr.Id),
Account: usr.Account,
UserName: usr.Account,
}
assessTemp.Executor = domain.StaffDesc{
UserId: int(usr.Id),
Account: usr.Account,
UserName: usr.Account,
}
if depList, ok := userDepartmentMap[usr.Id]; ok {
for _, dep := range depList {
assessTemp.TargetDepartment = append(assessTemp.TargetDepartment, domain.StaffDepartment{
DepartmentId: int(dep.Id),
DepartmentName: dep.Name,
})
}
}
result = append(result, assessTemp)
}
return result
}
// 构建员工上级评估
func (srv StaffAssessServeice) createStaffAssessSupper(
transactionContext application.TransactionContext,
assessTemp domain.StaffAssess,
userList []*domain.User, userDepartmentMap map[int64][]*domain.Department,
) ([]domain.StaffAssess, error) {
// 获取员工的上级用户
return nil, nil
}
// 获取某个员工360邀请的人员
func (srv StaffAssessServeice) GetAssessInviteUser(param *query.GetAssessInviteUserQuery) (*adapter.AssessInviteUserResp, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if err := transactionContext.StartTransaction(); err != nil {
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
defer func() {
_ = transactionContext.RollbackTransaction()
}()
assessReps := factory.CreateStaffAssessRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
assessTaskReps := factory.CreateStaffAssessTaskRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
assessTaskData, err := assessTaskReps.FindOne(map[string]interface{}{
"id": param.AssessTaskId,
})
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "获取评估任务"+err.Error())
}
_, assessList, err := assessReps.Find(map[string]interface{}{
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
"staffAssessTaskId": param.AssessTaskId,
"targetUserId": param.UsrId,
})
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "获取个人评估任务"+err.Error())
}
if err := transactionContext.CommitTransaction(); err != nil {
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
result := adapter.AssessInviteUserResp{
AssessTaskId: assessTaskData.Id,
}
for _, v := range assessTaskData.StepList {
if v.LinkNodeType != domain.LinkNodeAllInvite {
continue
}
result.LinkNodeId = v.LinkNodeId
result.LinkNodeName = v.LinkNodeName
result.BeginTime = v.BeginTime.Local().Format("2006-01-02 15:04:05")
result.EndTime = v.EndTime.Local().Format("2006-01-02 15:04:05")
break
}
for _, v := range assessList {
if v.Types == domain.AssessInviteDiffSuper {
result.InviteDiffSuper = append(result.InviteDiffSuper, v.Executor)
}
if v.Types == domain.AssessInviteSameSuper {
result.InviteSameSuper = append(result.InviteDiffSuper, v.Executor)
}
}
return nil
return &result, nil
}
// 获取员工自评详情
func (srv StaffAssessServeice) StaffAssessSelfInfo() {
// 获取某个员工360邀请的人员
func (srv StaffAssessServeice) SaveAssessInviteUser(param *command.SaveAssessInvite) (*adapter.AssessInviteUserResp, error) {
inviteSameSuperId := []int{}
InviteDiffSuperId := []int{}
for _, v := range param.InviteDiffSuper {
id, err := strconv.Atoi(v)
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "用户填写错误")
}
InviteDiffSuperId = append(InviteDiffSuperId, id)
}
for _, v := range param.InviteSameSuper {
id, err := strconv.Atoi(v)
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "用户填写错误")
}
inviteSameSuperId = append(inviteSameSuperId, id)
}
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if err := transactionContext.StartTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
defer func() {
_ = transactionContext.RollbackTransaction()
}()
assessReps := factory.CreateStaffAssessRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
userRepo := factory.CreateUserRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
departmentRepo := factory.CreateDepartmentRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
assessTaskReps := factory.CreateStaffAssessTaskRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
assessTaskData, err := assessTaskReps.FindOne(map[string]interface{}{
"id": param.AssessTaskId,
})
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "获取评估任务"+err.Error())
}
targetUser, err := userRepo.FindOne(map[string]interface{}{
"id": param.TargetUserId,
})
//被评估人的部门
var targetUserDepartment []domain.StaffDepartment
if len(targetUser.DepartmentId) > 0 {
_, departmentList, err := departmentRepo.Find(map[string]interface{}{
"ids": targetUser.DepartmentId,
})
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "获取部门信息"+err.Error())
}
for _, v := range departmentList {
targetUserDepartment = append(targetUserDepartment, domain.StaffDepartment{
DepartmentId: int(v.Id),
DepartmentName: v.Name,
})
}
}
//相同上级的员工
var inviteSameSuper []domain.StaffDesc
if len(inviteSameSuperId) > 0 {
_, userList, err := userRepo.Find(map[string]interface{}{
"ids": inviteSameSuperId,
})
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "获取用户信息"+err.Error())
}
for _, v := range userList {
inviteSameSuper = append(inviteSameSuper, domain.StaffDesc{
UserId: int(v.Id),
UserName: v.Name,
Account: v.Account,
})
}
}
var inviteDiffSuper []domain.StaffDesc
if len(InviteDiffSuperId) > 0 {
_, userList, err := userRepo.Find(map[string]interface{}{
"ids": inviteSameSuperId,
})
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "获取用户信息"+err.Error())
}
for _, v := range userList {
inviteSameSuper = append(inviteSameSuper, domain.StaffDesc{
UserId: int(v.Id),
UserName: v.Name,
Account: v.Account,
})
}
}
// _, assessList, err := assessReps.Find(map[string]interface{}{
// "typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
// "staffAssessTaskId": param.AssessTaskId,
// "targetUserId": param.TargetUserId,
// })
// if err != nil {
// return nil, application.ThrowError(application.ARG_ERROR, "获取个人评估任务"+err.Error())
// }
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
result := adapter.AssessInviteUserResp{
AssessTaskId: assessTaskData.Id,
}
// for _, v := range assessTaskData.StepList {
// if v.LinkNodeType != domain.LinkNodeAllInvite {
// continue
// }
// result.LinkNodeId = v.LinkNodeId
// result.LinkNodeName = v.LinkNodeName
// result.BeginTime = v.BeginTime.Local().Format("2006-01-02 15:04:05")
// result.EndTime = v.EndTime.Local().Format("2006-01-02 15:04:05")
// break
// }
// for _, v := range assessList {
// if v.Types == domain.AssessInviteDiffSuper {
// result.InviteDiffSuper = append(result.InviteDiffSuper, v.Executor)
// }
// if v.Types == domain.AssessInviteSameSuper {
// result.InviteSameSuper = append(result.InviteDiffSuper, v.Executor)
// }
// }
return &result, nil
}
... ...
... ... @@ -35,6 +35,7 @@ type StaffAssess struct {
Executor StaffDesc `json:"executor"` //填写评估的用户
Types StaffAssessType `json:"types"` //填写评估对应的类型
LinkNodeId int `json:"linkNodeId"` //评估环节对应的id,用于调取评估模板
LinkNodeName string `json:"linkNodeName"` //评估环节对应的id,用于调取评估模板
Status StaffAssessStatus `json:"status"` //评估的填写状态
BeginTime time.Time `json:"beginTime"` //开始时间
EndTime time.Time `json:"endTime"` //截止时间
... ...
... ... @@ -29,7 +29,7 @@ type StaffAssessTask struct {
ExecutorId []int `json:"executorId"` //参与此次考评的人
CreatedAt time.Time `json:"createdAt"` //数据创建时间
UpdatedAt time.Time `json:"updatedAt"` //数据更新时间
DeletedAt time.Time `json:"deletedAt"` //数据删除时间
DeletedAt *time.Time `json:"deletedAt"` //数据删除时间
}
//考评的流程
... ...
... ... @@ -21,5 +21,5 @@ type StaffAssessTask struct {
EndTime time.Time //截止时间
CreatedAt time.Time //数据创建时间
UpdatedAt time.Time //数据更新时间
DeletedAt time.Time //数据删除时间
DeletedAt *time.Time //数据删除时间
}
... ...
... ... @@ -96,8 +96,7 @@ func (repo *DepartmentRepository) FindOne(queryOptions map[string]interface{}) (
func (repo *DepartmentRepository) Find(queryOptions map[string]interface{}) (int, []*domain.Department, error) {
tx := repo.transactionContext.PgTx
dparmentModel := []models.Department{}
query := tx.Model(&dparmentModel).
Limit(20)
query := tx.Model(&dparmentModel).Where("delete_at isnull")
if v, ok := queryOptions["id"]; ok {
query.Where("id=?", v)
}
... ...
... ... @@ -79,7 +79,7 @@ func (repo *UserRepository) Remove(userId []int64) error {
func (repo *UserRepository) FindOne(queryOptions map[string]interface{}) (*domain.User, error) {
tx := repo.transactionContext.PgTx
userModel := models.User{}
query := tx.Model(&userModel)
query := tx.Model(&userModel).Where("delete_at isnull")
if v, ok := queryOptions["id"]; ok {
query.Where("id=?", v)
}
... ...
package controllers
import (
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/web/beego"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/command"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/query"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/service"
)
type StaffAssessController struct {
beego.BaseController
}
// 获取我的绩效任务列表
func (c *StaffAssessController) SearchAssessTaskMe() {
srv := service.NewStaffAssessServeice()
paramReq := &query.SearchAssessMeQuery{}
err := c.BindJSON(paramReq)
if err != nil {
e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
c.Response(nil, e)
return
}
//TODO 获取当前用户信息
data, err := srv.SearchAssessTaskMe(paramReq)
c.Response(data, err)
}
// 获取我的绩效任务各环节完成情况
func (c *StaffAssessController) AssessTaskMeDesc() {
srv := service.NewStaffAssessServeice()
paramReq := &query.AssessTaskDescQuery{}
err := c.BindJSON(paramReq)
if err != nil {
e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
c.Response(nil, e)
return
}
//TODO 获取当前用户信息
data, err := srv.AssessTaskDesc(paramReq)
c.Response(data, err)
}
// 获取个人的自评反馈历史记录列表
func (c *StaffAssessController) AssessSelfMeList() {
srv := service.NewStaffAssessServeice()
paramReq := &query.AssessSelfListQuery{}
err := c.BindJSON(paramReq)
if err != nil {
e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
c.Response(nil, e)
return
}
//TODO 获取当前用户信息
data, err := srv.AssessSelfList(paramReq)
c.Response(data, err)
}
// 更具项目评估的配置,创建员工的评估任务,(调试用)
func (c *StaffAssessController) CreateStaffAssessTask() {
srv := service.NewStaffAssessServeice()
paramReq := &command.CreateStaffAssessTask{}
err := c.BindJSON(paramReq)
if err != nil {
e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
c.Response(nil, e)
return
}
//服务调用,实际由定时任务触发
data, err := srv.CreateStaffAssessTask(paramReq)
c.Response(data, err)
}
... ...