evaluation_cycle.go 1.8 KB
package domain

import (
	"time"
)

const (
	KpiCycleDay        int = 1 // 考核周期-日
	KpiCycleWeek       int = 2 // 考核周期-周
	KpiCycleOneMonth   int = 3 // 考核周期-月
	KpiCycleTwoMonth   int = 4 // 考核周期-双月
	KpiCycleThreeMonth int = 5 // 考核周期-季度
	KpiCycleSixMonth   int = 6 // 考核周期-半年
	KpiCycleYear       int = 7 // 考核周期-年
)

type TemplateSimple struct {
	Id        int64     `json:"id,string" comment:"模板ID"`
	Name      string    `json:"name" comment:"模板名称"`
	CreatedAt time.Time `json:"createdAt" comment:"模板创建时间"`
}

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月)"`
	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 {
	Insert(cycle *EvaluationCycle) (*EvaluationCycle, error)
	Remove(cycle *EvaluationCycle) (*EvaluationCycle, error)
	FindOne(queryOptions map[string]interface{}) (*EvaluationCycle, error)
	Find(queryOptions map[string]interface{}) (int64, []*EvaluationCycle, error)
	Count(queryOptions map[string]interface{}) (int64, error)
}