作者 tangxvhui

更新

... ... @@ -2,7 +2,7 @@ package query
type AssessSelfListQuery struct {
UserId int `json:"userId"` //用户id
CompanyId int `json:"companyId"` //公司Id
CompanyId int `json:"-"` //公司Id
PageSize int `json:"pageSize"` //每页的记录数
PageNumber int `json:"pageNumber"` //页码
}
... ...
... ... @@ -46,12 +46,12 @@ func (srv *SummaryEvaluationService) GetExecutorCycleList(param *command.QueryCy
offset = (param.PageNumber - 1) * param.PageSize
}
cycleData, err := evaluationDao.GetExecutorCycleList(param.UserId, offset, limit, 0)
cycleData, err := evaluationDao.GetExecutorCycleList(param.UserId, offset, limit, domain.EvaluationSelf)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取周期列表"+err.Error())
}
cnt, err := evaluationDao.CountExecutorCycleList(param.UserId, 0)
cnt, err := evaluationDao.CountExecutorCycleList(param.UserId, domain.EvaluationSelf)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
... ... @@ -1311,5 +1311,6 @@ func (srv *SummaryEvaluationService) GetTargetUserEvaluationSuper(param *command
// 获取周期综合评估下,周期评估列表
func (srv *SummaryEvaluationService) ListEvalationSuper() (map[int]interface{}, error) {
return nil, nil
}
... ...
... ... @@ -3,6 +3,7 @@ package dao
import (
"github.com/go-pg/pg/v10"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
)
type SummaryEvaluationDao struct {
... ... @@ -27,7 +28,7 @@ type PersonalCycle struct {
// GetExecutorCycleList 获取执行人拥有的周期列表
// executorId 执行人id
// offset,limit 分页
func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, limit int, evaluationType int) ([]PersonalCycle, error) {
func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, limit int, evaluationType domain.EvaluationType) ([]PersonalCycle, error) {
sqlStr := `select
distinct
summary_evaluation.cycle_id ,
... ... @@ -43,7 +44,7 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int,
if evaluationType > 0 {
sqlStr += ` and summary_evaluation."types"=? `
condition = append(condition, evaluationType)
condition = append(condition, int(evaluationType))
}
condition = append(condition, offset, limit)
... ... @@ -54,7 +55,7 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int,
}
// CountExecutorCycleList 统计执行人拥有的周期列表
func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluationType int) (int, error) {
func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluationType domain.EvaluationType) (int, error) {
sqlStr := `select count(
distinct summary_evaluation.cycle_id
) as cnt
... ... @@ -67,7 +68,7 @@ func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluation
}
if evaluationType > 0 {
sqlStr += ` and summary_evaluation."types"=? `
condition = append(condition, evaluationType)
condition = append(condition, int(evaluationType))
}
var cnt int
... ...
... ... @@ -60,7 +60,6 @@ func (c *StaffAssessController) AssessSelfMeList() {
}
userReq := middlewares.GetUser(c.Ctx)
paramReq.CompanyId = int(userReq.CompanyId)
paramReq.UserId = int(userReq.UserId)
data, err := srv.AssessSelfList(paramReq)
c.Response(data, err)
}
... ...