作者 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 {
... ...
... ... @@ -21,16 +21,17 @@ type TemplateSimple struct {
}
type EvaluationCycle struct {
Id int64 `json:"id,string" comment:"ID"`
Name string `json:"name" comment:"名称"`
TimeStart *time.Time `json:"timeStart" comment:"起始时间"`
TimeEnd *time.Time `json:"timeEnd" comment:"截至时间"`
CompanyId int64 `json:"companyId,string" comment:"公司ID"`
CreatorId int64 `json:"creatorId,string" comment:"创建人ID"`
KpiCycle int `json:"kpiCycle" comment:"考核周期(1日、2周、3月)"`
CreatedAt time.Time `json:"createdAt" comment:"创建时间"`
UpdatedAt time.Time `json:"updatedAt" comment:"更新时间"`
DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"`
Id int64 `json:"id,string" comment:"ID"`
Name string `json:"name" comment:"名称"`
TimeStart *time.Time `json:"timeStart" comment:"起始时间"`
TimeEnd *time.Time `json:"timeEnd" comment:"截至时间"`
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:"删除时间"`
}
type EvaluationCycleRepository interface {
... ...
... ... @@ -33,6 +33,7 @@ type EvaluationProject struct {
DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"`
}
// 周期评估的下发状态
type ProjectSummaryState int
const (
... ...
... ... @@ -5,15 +5,16 @@ import (
)
type EvaluationCycle struct {
tableName struct{} `comment:"评估周期" pg:"evaluation_cycle"`
Id int64 `comment:"周期ID" pg:"pk:id"`
Name string `comment:"名称"`
TimeStart *time.Time `comment:"起始时间"`
TimeEnd *time.Time `comment:"截至时间"`
CompanyId int64 `comment:"公司ID"`
CreatorId int64 `comment:"创建人ID"`
KpiCycle int `comment:"考核周期(1日、2周、3月)"`
CreatedAt time.Time `comment:"创建时间"`
UpdatedAt time.Time `comment:"更新时间"`
DeletedAt *time.Time `comment:"删除时间"`
tableName struct{} `comment:"评估周期" pg:"evaluation_cycle"`
Id int64 `comment:"周期ID" pg:"pk:id"`
Name string `comment:"名称"`
TimeStart *time.Time `comment:"起始时间"`
TimeEnd *time.Time `comment:"截至时间"`
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:"删除时间"`
}
... ...
... ... @@ -23,31 +23,33 @@ func NewEvaluationCycleRepository(transactionContext *pgTransaction.TransactionC
func (repo *EvaluationCycleRepository) TransformToDomain(m *models.EvaluationCycle) domain.EvaluationCycle {
return domain.EvaluationCycle{
Id: m.Id,
Name: m.Name,
TimeStart: m.TimeStart,
TimeEnd: m.TimeEnd,
CompanyId: m.CompanyId,
CreatorId: m.CreatorId,
KpiCycle: m.KpiCycle,
CreatedAt: m.CreatedAt.Local(),
UpdatedAt: m.UpdatedAt.Local(),
DeletedAt: m.DeletedAt,
Id: m.Id,
Name: m.Name,
TimeStart: m.TimeStart,
TimeEnd: m.TimeEnd,
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,
}
}
func (repo *EvaluationCycleRepository) TransformToModel(d *domain.EvaluationCycle) models.EvaluationCycle {
return models.EvaluationCycle{
Id: d.Id,
Name: d.Name,
TimeStart: d.TimeStart,
TimeEnd: d.TimeEnd,
CompanyId: d.CompanyId,
CreatorId: d.CreatorId,
KpiCycle: d.KpiCycle,
CreatedAt: d.CreatedAt,
UpdatedAt: d.UpdatedAt,
DeletedAt: d.DeletedAt,
Id: d.Id,
Name: d.Name,
TimeStart: d.TimeStart,
TimeEnd: d.TimeEnd,
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",
... ...