审查视图

pkg/domain/evaluation_cycle.go 1.9 KB
郑周 authored
1 2 3 4 5 6
package domain

import (
	"time"
)
郑周 authored
7 8 9 10 11 12 13 14 15 16
const (
	KpiCycleDay        int = 1 // 考核周期-日
	KpiCycleWeek       int = 2 // 考核周期-周
	KpiCycleOneMonth   int = 3 // 考核周期-月
	KpiCycleTwoMonth   int = 4 // 考核周期-双月
	KpiCycleThreeMonth int = 5 // 考核周期-季度
	KpiCycleSixMonth   int = 6 // 考核周期-半年
	KpiCycleYear       int = 7 // 考核周期-年
)
17 18 19
type TemplateSimple struct {
	Id        int64     `json:"id,string" comment:"模板ID"`
	Name      string    `json:"name" comment:"模板名称"`
20
	CreatedAt time.Time `json:"createdAt" comment:"模板创建时间"`
21 22
}
郑周 authored
23
type EvaluationCycle struct {
tangxvhui authored
24 25 26 27 28 29 30 31 32 33 34
	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:"删除时间"`
郑周 authored
35
}
36 37 38 39 40

type EvaluationCycleRepository interface {
	Insert(cycle *EvaluationCycle) (*EvaluationCycle, error)
	Remove(cycle *EvaluationCycle) (*EvaluationCycle, error)
	FindOne(queryOptions map[string]interface{}) (*EvaluationCycle, error)
41
	Find(queryOptions map[string]interface{}) (int64, []*EvaluationCycle, error)
42
	Count(queryOptions map[string]interface{}) (int64, error)
tangxvhui authored
43
	FindCycleEnd(limit int) ([]*EvaluationCycle, error) // 获取已结束的周期,且还没下发周期评估
44
}