作者 tangxvhui

更新

@@ -36,6 +36,7 @@ func TaskSendSummaryEvaluationV2() error { @@ -36,6 +36,7 @@ func TaskSendSummaryEvaluationV2() error {
36 return nil 36 return nil
37 } 37 }
38 38
  39 +func getPrepareEvaluationCycle() {}
39 func getPrepareSummaryEvaluation() ([]*domain.EvaluationProject, error) { 40 func getPrepareSummaryEvaluation() ([]*domain.EvaluationProject, error) {
40 transactionContext, err := factory.CreateTransactionContext(nil) 41 transactionContext, err := factory.CreateTransactionContext(nil)
41 if err != nil { 42 if err != nil {
@@ -21,16 +21,17 @@ type TemplateSimple struct { @@ -21,16 +21,17 @@ type TemplateSimple struct {
21 } 21 }
22 22
23 type EvaluationCycle struct { 23 type EvaluationCycle struct {
24 - Id int64 `json:"id,string" comment:"ID"`  
25 - Name string `json:"name" comment:"名称"`  
26 - TimeStart *time.Time `json:"timeStart" comment:"起始时间"`  
27 - TimeEnd *time.Time `json:"timeEnd" comment:"截至时间"`  
28 - CompanyId int64 `json:"companyId,string" comment:"公司ID"`  
29 - CreatorId int64 `json:"creatorId,string" comment:"创建人ID"`  
30 - KpiCycle int `json:"kpiCycle" comment:"考核周期(1日、2周、3月)"`  
31 - CreatedAt time.Time `json:"createdAt" comment:"创建时间"`  
32 - UpdatedAt time.Time `json:"updatedAt" comment:"更新时间"`  
33 - DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"` 24 + Id int64 `json:"id,string" comment:"ID"`
  25 + Name string `json:"name" comment:"名称"`
  26 + TimeStart *time.Time `json:"timeStart" comment:"起始时间"`
  27 + TimeEnd *time.Time `json:"timeEnd" comment:"截至时间"`
  28 + CompanyId int64 `json:"companyId,string" comment:"公司ID"`
  29 + CreatorId int64 `json:"creatorId,string" comment:"创建人ID"`
  30 + KpiCycle int `json:"kpiCycle" comment:"考核周期(1日、2周、3月)"`
  31 + SummaryState ProjectSummaryState `json:"summaryState" comment:"周期评估是否下发"`
  32 + CreatedAt time.Time `json:"createdAt" comment:"创建时间"`
  33 + UpdatedAt time.Time `json:"updatedAt" comment:"更新时间"`
  34 + DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"`
34 } 35 }
35 36
36 type EvaluationCycleRepository interface { 37 type EvaluationCycleRepository interface {
@@ -33,6 +33,7 @@ type EvaluationProject struct { @@ -33,6 +33,7 @@ type EvaluationProject struct {
33 DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"` 33 DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"`
34 } 34 }
35 35
  36 +// 周期评估的下发状态
36 type ProjectSummaryState int 37 type ProjectSummaryState int
37 38
38 const ( 39 const (
@@ -5,15 +5,16 @@ import ( @@ -5,15 +5,16 @@ import (
5 ) 5 )
6 6
7 type EvaluationCycle struct { 7 type EvaluationCycle struct {
8 - tableName struct{} `comment:"评估周期" pg:"evaluation_cycle"`  
9 - Id int64 `comment:"周期ID" pg:"pk:id"`  
10 - Name string `comment:"名称"`  
11 - TimeStart *time.Time `comment:"起始时间"`  
12 - TimeEnd *time.Time `comment:"截至时间"`  
13 - CompanyId int64 `comment:"公司ID"`  
14 - CreatorId int64 `comment:"创建人ID"`  
15 - KpiCycle int `comment:"考核周期(1日、2周、3月)"`  
16 - CreatedAt time.Time `comment:"创建时间"`  
17 - UpdatedAt time.Time `comment:"更新时间"`  
18 - DeletedAt *time.Time `comment:"删除时间"` 8 + tableName struct{} `comment:"评估周期" pg:"evaluation_cycle"`
  9 + Id int64 `comment:"周期ID" pg:"pk:id"`
  10 + Name string `comment:"名称"`
  11 + TimeStart *time.Time `comment:"起始时间"`
  12 + TimeEnd *time.Time `comment:"截至时间"`
  13 + CompanyId int64 `comment:"公司ID"`
  14 + CreatorId int64 `comment:"创建人ID"`
  15 + KpiCycle int `comment:"考核周期(1日、2周、3月)"`
  16 + SummaryState int `comment:"周期评估是否下发" pg:",use_zero"`
  17 + CreatedAt time.Time `comment:"创建时间"`
  18 + UpdatedAt time.Time `comment:"更新时间"`
  19 + DeletedAt *time.Time `comment:"删除时间"`
19 } 20 }
@@ -23,31 +23,33 @@ func NewEvaluationCycleRepository(transactionContext *pgTransaction.TransactionC @@ -23,31 +23,33 @@ func NewEvaluationCycleRepository(transactionContext *pgTransaction.TransactionC
23 23
24 func (repo *EvaluationCycleRepository) TransformToDomain(m *models.EvaluationCycle) domain.EvaluationCycle { 24 func (repo *EvaluationCycleRepository) TransformToDomain(m *models.EvaluationCycle) domain.EvaluationCycle {
25 return domain.EvaluationCycle{ 25 return domain.EvaluationCycle{
26 - Id: m.Id,  
27 - Name: m.Name,  
28 - TimeStart: m.TimeStart,  
29 - TimeEnd: m.TimeEnd,  
30 - CompanyId: m.CompanyId,  
31 - CreatorId: m.CreatorId,  
32 - KpiCycle: m.KpiCycle,  
33 - CreatedAt: m.CreatedAt.Local(),  
34 - UpdatedAt: m.UpdatedAt.Local(),  
35 - DeletedAt: m.DeletedAt, 26 + Id: m.Id,
  27 + Name: m.Name,
  28 + TimeStart: m.TimeStart,
  29 + TimeEnd: m.TimeEnd,
  30 + CompanyId: m.CompanyId,
  31 + CreatorId: m.CreatorId,
  32 + KpiCycle: m.KpiCycle,
  33 + SummaryState: domain.ProjectSummaryState(m.SummaryState),
  34 + CreatedAt: m.CreatedAt.Local(),
  35 + UpdatedAt: m.UpdatedAt.Local(),
  36 + DeletedAt: m.DeletedAt,
36 } 37 }
37 } 38 }
38 39
39 func (repo *EvaluationCycleRepository) TransformToModel(d *domain.EvaluationCycle) models.EvaluationCycle { 40 func (repo *EvaluationCycleRepository) TransformToModel(d *domain.EvaluationCycle) models.EvaluationCycle {
40 return models.EvaluationCycle{ 41 return models.EvaluationCycle{
41 - Id: d.Id,  
42 - Name: d.Name,  
43 - TimeStart: d.TimeStart,  
44 - TimeEnd: d.TimeEnd,  
45 - CompanyId: d.CompanyId,  
46 - CreatorId: d.CreatorId,  
47 - KpiCycle: d.KpiCycle,  
48 - CreatedAt: d.CreatedAt,  
49 - UpdatedAt: d.UpdatedAt,  
50 - DeletedAt: d.DeletedAt, 42 + Id: d.Id,
  43 + Name: d.Name,
  44 + TimeStart: d.TimeStart,
  45 + TimeEnd: d.TimeEnd,
  46 + CompanyId: d.CompanyId,
  47 + CreatorId: d.CreatorId,
  48 + KpiCycle: d.KpiCycle,
  49 + SummaryState: int(d.SummaryState),
  50 + CreatedAt: d.CreatedAt,
  51 + UpdatedAt: d.UpdatedAt,
  52 + DeletedAt: d.DeletedAt,
51 } 53 }
52 } 54 }
53 55
@@ -341,3 +341,19 @@ func (c *StaffAssessController) ListTargetUserSelfCycle() { @@ -341,3 +341,19 @@ func (c *StaffAssessController) ListTargetUserSelfCycle() {
341 data, err := srv.ListTargetUserSelfCycle(paramReq) 341 data, err := srv.ListTargetUserSelfCycle(paramReq)
342 c.Response(data, err) 342 c.Response(data, err)
343 } 343 }
  344 +
  345 +// ListTargetUserSelfCycle 按照周期获取员工的每日自评小结
  346 +func (c *StaffAssessController) GetStaffAsessSelfCountLevel() {
  347 + srv := service.NewStaffAssessServeice()
  348 + paramReq := &query.StaffAsessSelfCountLevel{}
  349 + err := c.BindJSON(paramReq)
  350 + if err != nil {
  351 + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
  352 + c.Response(nil, e)
  353 + return
  354 + }
  355 + userReq := middlewares.GetUser(c.Ctx)
  356 + paramReq.CompanyId = int(userReq.CompanyId)
  357 + data, err := srv.GetStaffAsessSelfCountLevel(paramReq)
  358 + c.Response(data, err)
  359 +}
@@ -36,6 +36,7 @@ func init() { @@ -36,6 +36,7 @@ func init() {
36 web.NSCtrlPost("/summary/users-indicator", (*controllers.StaffAssessController).QueryMemberPerformanceIndicator), //员工绩效-综合管理-绩效导出指标 36 web.NSCtrlPost("/summary/users-indicator", (*controllers.StaffAssessController).QueryMemberPerformanceIndicator), //员工绩效-综合管理-绩效导出指标
37 web.NSCtrlPost("/summary/export-indicator", (*controllers.StaffAssessController).ExportPerformanceIndicator), //员工绩效-综合管理-绩效导出指标 37 web.NSCtrlPost("/summary/export-indicator", (*controllers.StaffAssessController).ExportPerformanceIndicator), //员工绩效-综合管理-绩效导出指标
38 web.NSCtrlPost("/target_user/self/cycle", (*controllers.StaffAssessController).ListTargetUserSelfCycle), //获取员工自评的周期下拉列表 38 web.NSCtrlPost("/target_user/self/cycle", (*controllers.StaffAssessController).ListTargetUserSelfCycle), //获取员工自评的周期下拉列表
  39 + web.NSCtrlPost("/target_user/self/summary", (*controllers.StaffAssessController).GetStaffAsessSelfCountLevel), //获取员工每日自评小结
39 ) 40 )
40 //v2 改版 41 //v2 改版
41 assessTaskV2NS := web.NewNamespace("/v2/staff-assess-task", 42 assessTaskV2NS := web.NewNamespace("/v2/staff-assess-task",