|
@@ -2,7 +2,6 @@ package command |
|
@@ -2,7 +2,6 @@ package command |
|
2
|
|
2
|
|
|
3
|
import (
|
3
|
import (
|
|
4
|
"github.com/beego/beego/v2/core/validation"
|
4
|
"github.com/beego/beego/v2/core/validation"
|
|
5
|
- "time"
|
|
|
|
6
|
)
|
5
|
)
|
|
7
|
|
6
|
|
|
8
|
type UpdateProjectCommand struct {
|
7
|
type UpdateProjectCommand struct {
|
|
@@ -17,16 +16,16 @@ type UpdateProjectCommand struct { |
|
@@ -17,16 +16,16 @@ type UpdateProjectCommand struct { |
|
17
|
}
|
16
|
}
|
|
18
|
|
17
|
|
|
19
|
type UpdateProjectTemplateCommand struct {
|
18
|
type UpdateProjectTemplateCommand struct {
|
|
20
|
- CompanyId int64 `cname:"公司ID" json:"companyId"`
|
|
|
|
21
|
- CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"`
|
|
|
|
22
|
- Id int64 `cname:"项目ID" json:"id,string" valid:"Required"`
|
|
|
|
23
|
- TemplateId int64 `cname:"模板ID" json:"templateId,string"`
|
|
|
|
24
|
- Recipients []string `cname:"被评估人ID" json:"recipients"`
|
|
|
|
25
|
- TimeStart *time.Time `cname:"自评起始时间" json:"timeStart" valid:"Required"`
|
|
|
|
26
|
- TimeEnd *time.Time `cname:"自评截止时间" json:"timeEnd" valid:"Required"`
|
|
|
|
27
|
- KpiCycle int `cname:"评估周期" json:"kpiCycle" valid:"Required"`
|
|
|
|
28
|
- KpiResultStart *time.Time `cname:"绩效结果开始查看时间" json:"kpiResultStart"`
|
|
|
|
29
|
- Activate int `cname:"启动项目" json:"activate"`
|
19
|
+ CompanyId int64 `cname:"公司ID" json:"companyId"`
|
|
|
|
20
|
+ CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"`
|
|
|
|
21
|
+ Id int64 `cname:"项目ID" json:"id,string" valid:"Required"`
|
|
|
|
22
|
+ TemplateId int64 `cname:"模板ID" json:"templateId,string"`
|
|
|
|
23
|
+ Recipients []string `cname:"被评估人ID" json:"recipients"`
|
|
|
|
24
|
+ TimeStart string `cname:"自评起始时间" json:"timeStart" valid:"Required"`
|
|
|
|
25
|
+ TimeEnd string `cname:"自评截止时间" json:"timeEnd" valid:"Required"`
|
|
|
|
26
|
+ KpiCycle int `cname:"评估周期" json:"kpiCycle" valid:"Required"`
|
|
|
|
27
|
+ KpiResultStart string `cname:"绩效结果开始查看时间" json:"kpiResultStart"`
|
|
|
|
28
|
+ Activate int `cname:"启动项目" json:"activate"`
|
|
30
|
}
|
29
|
}
|
|
31
|
|
30
|
|
|
32
|
type CheckRecipientCommand struct {
|
31
|
type CheckRecipientCommand struct {
|
|
@@ -48,4 +47,13 @@ func (in *UpdateProjectTemplateCommand) Valid(validation *validation.Validation) |
|
@@ -48,4 +47,13 @@ func (in *UpdateProjectTemplateCommand) Valid(validation *validation.Validation) |
|
48
|
validation.SetError("recipients", "请添加被评估人")
|
47
|
validation.SetError("recipients", "请添加被评估人")
|
|
49
|
return
|
48
|
return
|
|
50
|
}
|
49
|
}
|
|
|
|
50
|
+ if len(in.TimeStart) == 0 {
|
|
|
|
51
|
+ validation.SetError("timeEnd", "请选择开始时间")
|
|
|
|
52
|
+ return
|
|
|
|
53
|
+ }
|
|
|
|
54
|
+ if len(in.TimeEnd) == 0 {
|
|
|
|
55
|
+ validation.SetError("timeEnd", "请选择结束时间")
|
|
|
|
56
|
+ return
|
|
|
|
57
|
+ }
|
|
|
|
58
|
+
|
|
51
|
} |
59
|
} |