作者 tangxvhui

更新

... ... @@ -36,6 +36,7 @@ func TaskSendSummaryEvaluationV2() error {
return nil
}
func getPrepareEvaluationCycle() {}
func getPrepareSummaryEvaluation() ([]*domain.EvaluationProject, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
... ...
... ... @@ -28,6 +28,7 @@ type EvaluationCycle struct {
CompanyId int64 `json:"companyId,string" comment:"公司ID"`
CreatorId int64 `json:"creatorId,string" comment:"创建人ID"`
KpiCycle int `json:"kpiCycle" comment:"考核周期(1日、2周、3月)"`
SummaryState ProjectSummaryState `json:"summaryState" comment:"周期评估是否下发"`
CreatedAt time.Time `json:"createdAt" comment:"创建时间"`
UpdatedAt time.Time `json:"updatedAt" comment:"更新时间"`
DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"`
... ...
... ... @@ -33,6 +33,7 @@ type EvaluationProject struct {
DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"`
}
// 周期评估的下发状态
type ProjectSummaryState int
const (
... ...
... ... @@ -13,6 +13,7 @@ type EvaluationCycle struct {
CompanyId int64 `comment:"公司ID"`
CreatorId int64 `comment:"创建人ID"`
KpiCycle int `comment:"考核周期(1日、2周、3月)"`
SummaryState int `comment:"周期评估是否下发" pg:",use_zero"`
CreatedAt time.Time `comment:"创建时间"`
UpdatedAt time.Time `comment:"更新时间"`
DeletedAt *time.Time `comment:"删除时间"`
... ...
... ... @@ -30,6 +30,7 @@ func (repo *EvaluationCycleRepository) TransformToDomain(m *models.EvaluationCyc
CompanyId: m.CompanyId,
CreatorId: m.CreatorId,
KpiCycle: m.KpiCycle,
SummaryState: domain.ProjectSummaryState(m.SummaryState),
CreatedAt: m.CreatedAt.Local(),
UpdatedAt: m.UpdatedAt.Local(),
DeletedAt: m.DeletedAt,
... ... @@ -45,6 +46,7 @@ func (repo *EvaluationCycleRepository) TransformToModel(d *domain.EvaluationCycl
CompanyId: d.CompanyId,
CreatorId: d.CreatorId,
KpiCycle: d.KpiCycle,
SummaryState: int(d.SummaryState),
CreatedAt: d.CreatedAt,
UpdatedAt: d.UpdatedAt,
DeletedAt: d.DeletedAt,
... ...
... ... @@ -341,3 +341,19 @@ func (c *StaffAssessController) ListTargetUserSelfCycle() {
data, err := srv.ListTargetUserSelfCycle(paramReq)
c.Response(data, err)
}
// ListTargetUserSelfCycle 按照周期获取员工的每日自评小结
func (c *StaffAssessController) GetStaffAsessSelfCountLevel() {
srv := service.NewStaffAssessServeice()
paramReq := &query.StaffAsessSelfCountLevel{}
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)
data, err := srv.GetStaffAsessSelfCountLevel(paramReq)
c.Response(data, err)
}
... ...
... ... @@ -36,6 +36,7 @@ func init() {
web.NSCtrlPost("/summary/users-indicator", (*controllers.StaffAssessController).QueryMemberPerformanceIndicator), //员工绩效-综合管理-绩效导出指标
web.NSCtrlPost("/summary/export-indicator", (*controllers.StaffAssessController).ExportPerformanceIndicator), //员工绩效-综合管理-绩效导出指标
web.NSCtrlPost("/target_user/self/cycle", (*controllers.StaffAssessController).ListTargetUserSelfCycle), //获取员工自评的周期下拉列表
web.NSCtrlPost("/target_user/self/summary", (*controllers.StaffAssessController).GetStaffAsessSelfCountLevel), //获取员工每日自评小结
)
//v2 改版
assessTaskV2NS := web.NewNamespace("/v2/staff-assess-task",
... ...