正在显示
4 个修改的文件
包含
9 行增加
和
8 行删除
@@ -2,7 +2,7 @@ package query | @@ -2,7 +2,7 @@ package query | ||
2 | 2 | ||
3 | type AssessSelfListQuery struct { | 3 | type AssessSelfListQuery struct { |
4 | UserId int `json:"userId"` //用户id | 4 | UserId int `json:"userId"` //用户id |
5 | - CompanyId int `json:"companyId"` //公司Id | 5 | + CompanyId int `json:"-"` //公司Id |
6 | PageSize int `json:"pageSize"` //每页的记录数 | 6 | PageSize int `json:"pageSize"` //每页的记录数 |
7 | PageNumber int `json:"pageNumber"` //页码 | 7 | PageNumber int `json:"pageNumber"` //页码 |
8 | } | 8 | } |
@@ -46,12 +46,12 @@ func (srv *SummaryEvaluationService) GetExecutorCycleList(param *command.QueryCy | @@ -46,12 +46,12 @@ func (srv *SummaryEvaluationService) GetExecutorCycleList(param *command.QueryCy | ||
46 | offset = (param.PageNumber - 1) * param.PageSize | 46 | offset = (param.PageNumber - 1) * param.PageSize |
47 | } | 47 | } |
48 | 48 | ||
49 | - cycleData, err := evaluationDao.GetExecutorCycleList(param.UserId, offset, limit, 0) | 49 | + cycleData, err := evaluationDao.GetExecutorCycleList(param.UserId, offset, limit, domain.EvaluationSelf) |
50 | if err != nil { | 50 | if err != nil { |
51 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取周期列表"+err.Error()) | 51 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取周期列表"+err.Error()) |
52 | } | 52 | } |
53 | 53 | ||
54 | - cnt, err := evaluationDao.CountExecutorCycleList(param.UserId, 0) | 54 | + cnt, err := evaluationDao.CountExecutorCycleList(param.UserId, domain.EvaluationSelf) |
55 | if err != nil { | 55 | if err != nil { |
56 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 56 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
57 | } | 57 | } |
@@ -1311,5 +1311,6 @@ func (srv *SummaryEvaluationService) GetTargetUserEvaluationSuper(param *command | @@ -1311,5 +1311,6 @@ func (srv *SummaryEvaluationService) GetTargetUserEvaluationSuper(param *command | ||
1311 | 1311 | ||
1312 | // 获取周期综合评估下,周期评估列表 | 1312 | // 获取周期综合评估下,周期评估列表 |
1313 | func (srv *SummaryEvaluationService) ListEvalationSuper() (map[int]interface{}, error) { | 1313 | func (srv *SummaryEvaluationService) ListEvalationSuper() (map[int]interface{}, error) { |
1314 | + | ||
1314 | return nil, nil | 1315 | return nil, nil |
1315 | } | 1316 | } |
@@ -3,6 +3,7 @@ package dao | @@ -3,6 +3,7 @@ package dao | ||
3 | import ( | 3 | import ( |
4 | "github.com/go-pg/pg/v10" | 4 | "github.com/go-pg/pg/v10" |
5 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | 5 | pgTransaction "github.com/linmadan/egglib-go/transaction/pg" |
6 | + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain" | ||
6 | ) | 7 | ) |
7 | 8 | ||
8 | type SummaryEvaluationDao struct { | 9 | type SummaryEvaluationDao struct { |
@@ -27,7 +28,7 @@ type PersonalCycle struct { | @@ -27,7 +28,7 @@ type PersonalCycle struct { | ||
27 | // GetExecutorCycleList 获取执行人拥有的周期列表 | 28 | // GetExecutorCycleList 获取执行人拥有的周期列表 |
28 | // executorId 执行人id | 29 | // executorId 执行人id |
29 | // offset,limit 分页 | 30 | // offset,limit 分页 |
30 | -func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, limit int, evaluationType int) ([]PersonalCycle, error) { | 31 | +func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, limit int, evaluationType domain.EvaluationType) ([]PersonalCycle, error) { |
31 | sqlStr := `select | 32 | sqlStr := `select |
32 | distinct | 33 | distinct |
33 | summary_evaluation.cycle_id , | 34 | summary_evaluation.cycle_id , |
@@ -43,7 +44,7 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, | @@ -43,7 +44,7 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, | ||
43 | 44 | ||
44 | if evaluationType > 0 { | 45 | if evaluationType > 0 { |
45 | sqlStr += ` and summary_evaluation."types"=? ` | 46 | sqlStr += ` and summary_evaluation."types"=? ` |
46 | - condition = append(condition, evaluationType) | 47 | + condition = append(condition, int(evaluationType)) |
47 | } | 48 | } |
48 | 49 | ||
49 | condition = append(condition, offset, limit) | 50 | condition = append(condition, offset, limit) |
@@ -54,7 +55,7 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, | @@ -54,7 +55,7 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, | ||
54 | } | 55 | } |
55 | 56 | ||
56 | // CountExecutorCycleList 统计执行人拥有的周期列表 | 57 | // CountExecutorCycleList 统计执行人拥有的周期列表 |
57 | -func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluationType int) (int, error) { | 58 | +func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluationType domain.EvaluationType) (int, error) { |
58 | sqlStr := `select count( | 59 | sqlStr := `select count( |
59 | distinct summary_evaluation.cycle_id | 60 | distinct summary_evaluation.cycle_id |
60 | ) as cnt | 61 | ) as cnt |
@@ -67,7 +68,7 @@ func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluation | @@ -67,7 +68,7 @@ func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluation | ||
67 | } | 68 | } |
68 | if evaluationType > 0 { | 69 | if evaluationType > 0 { |
69 | sqlStr += ` and summary_evaluation."types"=? ` | 70 | sqlStr += ` and summary_evaluation."types"=? ` |
70 | - condition = append(condition, evaluationType) | 71 | + condition = append(condition, int(evaluationType)) |
71 | } | 72 | } |
72 | 73 | ||
73 | var cnt int | 74 | var cnt int |
@@ -60,7 +60,6 @@ func (c *StaffAssessController) AssessSelfMeList() { | @@ -60,7 +60,6 @@ func (c *StaffAssessController) AssessSelfMeList() { | ||
60 | } | 60 | } |
61 | userReq := middlewares.GetUser(c.Ctx) | 61 | userReq := middlewares.GetUser(c.Ctx) |
62 | paramReq.CompanyId = int(userReq.CompanyId) | 62 | paramReq.CompanyId = int(userReq.CompanyId) |
63 | - paramReq.UserId = int(userReq.UserId) | ||
64 | data, err := srv.AssessSelfList(paramReq) | 63 | data, err := srv.AssessSelfList(paramReq) |
65 | c.Response(data, err) | 64 | c.Response(data, err) |
66 | } | 65 | } |
-
请 注册 或 登录 后发表评论