...
|
...
|
@@ -2,7 +2,6 @@ package command |
|
|
|
|
|
import (
|
|
|
"github.com/beego/beego/v2/core/validation"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
type UpdateProjectCommand struct {
|
...
|
...
|
@@ -17,16 +16,16 @@ type UpdateProjectCommand struct { |
|
|
}
|
|
|
|
|
|
type UpdateProjectTemplateCommand struct {
|
|
|
CompanyId int64 `cname:"公司ID" json:"companyId"`
|
|
|
CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"`
|
|
|
Id int64 `cname:"项目ID" json:"id,string" valid:"Required"`
|
|
|
TemplateId int64 `cname:"模板ID" json:"templateId,string"`
|
|
|
Recipients []string `cname:"被评估人ID" json:"recipients"`
|
|
|
TimeStart *time.Time `cname:"自评起始时间" json:"timeStart" valid:"Required"`
|
|
|
TimeEnd *time.Time `cname:"自评截止时间" json:"timeEnd" valid:"Required"`
|
|
|
KpiCycle int `cname:"评估周期" json:"kpiCycle" valid:"Required"`
|
|
|
KpiResultStart *time.Time `cname:"绩效结果开始查看时间" json:"kpiResultStart"`
|
|
|
Activate int `cname:"启动项目" json:"activate"`
|
|
|
CompanyId int64 `cname:"公司ID" json:"companyId"`
|
|
|
CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"`
|
|
|
Id int64 `cname:"项目ID" json:"id,string" valid:"Required"`
|
|
|
TemplateId int64 `cname:"模板ID" json:"templateId,string"`
|
|
|
Recipients []string `cname:"被评估人ID" json:"recipients"`
|
|
|
TimeStart string `cname:"自评起始时间" json:"timeStart" valid:"Required"`
|
|
|
TimeEnd string `cname:"自评截止时间" json:"timeEnd" valid:"Required"`
|
|
|
KpiCycle int `cname:"评估周期" json:"kpiCycle" valid:"Required"`
|
|
|
KpiResultStart string `cname:"绩效结果开始查看时间" json:"kpiResultStart"`
|
|
|
Activate int `cname:"启动项目" json:"activate"`
|
|
|
}
|
|
|
|
|
|
type CheckRecipientCommand struct {
|
...
|
...
|
@@ -48,4 +47,13 @@ func (in *UpdateProjectTemplateCommand) Valid(validation *validation.Validation) |
|
|
validation.SetError("recipients", "请添加被评估人")
|
|
|
return
|
|
|
}
|
|
|
if len(in.TimeStart) == 0 {
|
|
|
validation.SetError("timeEnd", "请选择开始时间")
|
|
|
return
|
|
|
}
|
|
|
if len(in.TimeEnd) == 0 {
|
|
|
validation.SetError("timeEnd", "请选择结束时间")
|
|
|
return
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|