作者 tangxvhui

暂存

package adapter
type AssessCycleDayResp struct {
CycleId int `json:"cycleId"`
CycleName string `json:"cycleName"`
BeginDay string `json:"beginDay"`
AssessTaskId []int `json:"assessTaskId"`
CycleId int `json:"cycleId"`
CycleName string `json:"cycleName"`
BeginDay string `json:"beginDay"`
}
... ...
package adapter
type ListSupperAssessResp struct {
AssessId int `json:"assessId"` //
UsrId int `json:"userId,string"`
AssessId int `json:"assessId"` //
CycleId int `json:"cycleId"` //周期id
BeginDay string `json:"beginDay"` //开始的日期
UserId int `json:"userId,string"` //用户id
UserName string `json:"userName"` //用户名称
EndTime string `json:"endTime"` //截止时间
InviteTotal int `json:"inviteTota"` //邀请总数
... ...
... ... @@ -8,7 +8,7 @@ type AssessTaskDescQuery struct {
//获取我的项目周期进度描述
type AssessTaskDescV2Query struct {
CycleId int `json:"cycle"`
CycleId int `json:"cycleId"`
BeginDay string `json:"beginDay"`
UserId int `json:"userId"` //当前登录人的id
CompanyId int `json:"companyId"` //当前登录的公司
... ...
... ... @@ -2,8 +2,8 @@ package query
// 根据周期和日期,获取员工的自评内容
type GetExecutorSelfAssessQuery struct {
CompanyId int `json:"companyId"` //
ExecutorId int `json:"executorId,string"` //评估的执行人,必填
CycleId int `json:"cycleId"` //评估周期id 必填
BeginDay string `json:"beginDay"` //评估任务的开始日期 2006-01-02
CompanyId int `json:"companyId"` //
TargetUserId int `json:"targetUserId,string"` //评估的执行人,必填
CycleId int `json:"cycleId"` //评估周期id 必填
BeginDay string `json:"beginDay"` //评估任务的开始日期 2006-01-02
}
... ...
... ... @@ -2,8 +2,8 @@ package query
//根据周期和日期,获取员工邀请评估的人员
type ListInviteUserQuery struct {
CompanyId int `json:"companyId"` //对公司
TargetUserId int `json:"userId,string"` //被评估的员工id
CycleId int `json:"CycleId"` //评估任务的周期id
BeginDay string `json:"beginDay"` //日期
CompanyId int `json:"companyId"` //对公司
TargetUserId int `json:"targetUserId,string"` //被评估的员工id
CycleId int `json:"CycleId"` //评估任务的周期id
BeginDay string `json:"beginDay"` //日期
}
... ...
... ... @@ -1454,7 +1454,7 @@ func (srv StaffAssessServeice) ListExecutorSupperAssess(param *query.ListSupperA
for _, v := range assessList {
item := adapter.ListSupperAssessResp{
AssessId: v.Id,
UsrId: v.TargetUser.UserId,
UserId: v.TargetUser.UserId,
UserName: v.TargetUser.UserName,
EndTime: v.EndTime.Local().Format("2006-01-02 15:04:05"),
InviteCompleted: 0,
... ...
... ... @@ -52,10 +52,9 @@ func (srv StaffAssessServeice) SearchAssessTaskMeV2(param *query.SearchAssessMeQ
var temp adapter.AssessCycleDayResp
for _, v := range assessCycleList {
temp = adapter.AssessCycleDayResp{
CycleId: v.CycleId,
CycleName: v.CycleName,
BeginDay: v.BeginDay,
AssessTaskId: v.AssessTaskId,
CycleId: v.CycleId,
CycleName: v.CycleName,
BeginDay: v.BeginDay,
}
listData = append(listData, temp)
}
... ... @@ -416,6 +415,8 @@ func (srv StaffAssessServeice) ListExecutorInviteAssessV2(param *query.ListExecu
"userName": v.TargetUser.UserName,
"userId": strconv.Itoa(v.TargetUser.UserId),
"status": string(v.Status),
"cycleId": strconv.FormatInt(v.CycleId, 10),
"beginDay": v.BeginTime.Local().Format("2006-01-02"),
"types": string(v.Types),
"endTime": v.EndTime.Local().Format("2006-01-02 15:04:05"),
"assessId": strconv.Itoa(v.Id),
... ... @@ -560,7 +561,9 @@ func (srv StaffAssessServeice) ListExecutorSupperAssessV2(param *query.ListExecu
for _, v := range assessList {
item := adapter.ListSupperAssessResp{
AssessId: v.Id,
UsrId: v.TargetUser.UserId,
CycleId: int(v.CycleId),
BeginDay: v.BeginTime.Local().Format("2006-01-02"),
UserId: v.TargetUser.UserId,
UserName: v.TargetUser.UserName,
EndTime: v.EndTime.Local().Format("2006-01-02 15:04:05"),
InviteCompleted: 0,
... ... @@ -624,7 +627,7 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA
// 获取员工的评估
_, assessList, err := assessReps.Find(map[string]interface{}{
"companyId": param.CompanyId,
"executorId": param.ExecutorId,
"executorId": param.TargetUserId,
"cycleId": param.CycleId,
"beginDay": param.BeginDay,
"typesList": []string{string(domain.AssessSelf)},
... ... @@ -634,7 +637,7 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取员工的评估"+err.Error())
}
if len(assessList) == 0 {
return &adapter.AssessInfoResp{}, nil
return nil, application.ThrowError(application.BUSINESS_ERROR, "不存在员工的自评内容")
}
assessData := assessList[0]
... ... @@ -659,7 +662,7 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA
}
//获取员工描述
staffDesc, _ := srv.getStaffDescrip(transactionContext, int64(param.ExecutorId))
staffDesc, _ := srv.getStaffDescrip(transactionContext, int64(param.TargetUserId))
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
... ...
... ... @@ -410,10 +410,9 @@ func (d *StaffAssessDao) ExportDataUserAssess(param SearchConditin1) ([]ExportDa
}
type AssessCycleDayMe struct {
BeginDay string `json:"beginDay"`
CycleId int `json:"cycleId"`
CycleName string `json:"cycleName"`
AssessTaskId []int `json:"assessTaskId"`
BeginDay string `json:"beginDay"`
CycleId int `json:"cycleId"`
CycleName string `json:"cycleName"`
}
// 根据评估的人执行人id,搜索 executorId参与的评估周期
... ... @@ -426,7 +425,6 @@ func (d *StaffAssessDao) SearchAssessCycleMe(executorId int, companyId int, limi
}
sqlStr := `
SELECT
jsonb_agg (staff_assess_task.id) as assess_task_id,
staff_assess_task.cycle_id ,staff_assess_task.cycle_name ,staff_assess_task.begin_day
FROM staff_assess_task
JOIN staff_assess ON staff_assess_task."id" = staff_assess."staff_assess_task_id"
... ...
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/query"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/service"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/middlewares"
)
type StaffAssessControllerV2 struct {
beego.BaseController
}
// 获取我的绩效任务列表
func (c *StaffAssessControllerV2) 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
}
userReq := middlewares.GetUser(c.Ctx)
paramReq.CompanyId = int(userReq.CompanyId)
paramReq.UserId = int(userReq.UserId)
data, err := srv.SearchAssessTaskMeV2(paramReq)
c.Response(data, err)
}
// 获取我的绩效任务各环节完成情况
func (c *StaffAssessControllerV2) AssessTaskMeDesc() {
srv := service.NewStaffAssessServeice()
paramReq := &query.AssessTaskDescV2Query{}
err := c.BindJSON(paramReq)
if err != nil {
e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
c.Response(nil, e)
return
}
userReq := middlewares.GetUser(c.Ctx)
paramReq.CompanyId = int(userReq.CompanyId)
paramReq.UserId = int(userReq.UserId)
data, err := srv.AssessTaskDescV2(paramReq)
c.Response(data, err)
}
// 获取我要执行360评估,用户列表和评估填写的值
func (c *StaffAssessControllerV2) ListMeInviteUserAssess() {
srv := service.NewStaffAssessServeice()
paramReq := &query.ListInviteUserAssessQuery{}
err := c.BindJSON(paramReq)
if err != nil {
e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
c.Response(nil, e)
return
}
//获取当前用户信息
userReq := middlewares.GetUser(c.Ctx)
paramReq.CompanyId = int(userReq.CompanyId)
paramReq.ExecutorId = int(userReq.UserId)
data, err := srv.ListExecutorInviteAssess(paramReq)
c.Response(data, err)
}
// 获取我要执行的上级评估成员列表
func (c *StaffAssessControllerV2) ListMeSupperAssess() {
srv := service.NewStaffAssessServeice()
paramReq := &query.ListSupperAssessQuery{}
err := c.BindJSON(paramReq)
if err != nil {
e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
c.Response(nil, e)
return
}
// 获取当前用户信息
userReq := middlewares.GetUser(c.Ctx)
paramReq.CompanyId = int(userReq.CompanyId)
paramReq.ExecutorId = int(userReq.UserId)
data, err := srv.ListExecutorSupperAssess(paramReq)
c.Response(data, err)
}
... ...