作者 tangxvhui

更新

... ... @@ -164,6 +164,10 @@ func (srv TaskService) CreateTaskByProject(transactionContext application.Transa
// 创建任务
func (srv TaskService) CreateTask(param *command.CreateTaskCommand) (map[string]interface{}, error) {
sortNamed := domain.TaskSortBy(param.SortBy)
if sortNamed.Named() == "" {
return nil, application.ThrowError(application.TRANSACTION_ERROR, "优先级设置错误")
}
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -43,13 +43,17 @@ const (
)
func (t TaskSortBy) Named() string {
nameMap := map[TaskSortBy]string{
TaskSortHight: "高",
TaskSortMiddle: "中",
TaskSortLow: "低",
TaskSortNull: "无",
switch t {
case TaskSortHight:
return "高"
case TaskSortMiddle:
return "中"
case TaskSortLow:
return "低"
case TaskSortNull:
return "无"
}
return nameMap[t]
return ""
}
// 任务
... ...
... ... @@ -29,12 +29,13 @@ type TaskRecord struct {
TaskLeader TaskLeader `json:"taskLeader" comment:"任务负责人"`
AssistLevel int `json:"assistLevel" comment:"上级辅导情况"`
AssistContent string `json:"assistContent" comment:"上级辅导内容"`
AnomalyState int `json:"anomalyState" comment:"异常是否反馈状态(-1初始状态、0异常、1正常"`
AnomalyState int `json:"anomalyState" comment:"异常是否反馈状态(-1初始状态、0异常、1正常)"`
TaskStages []TaskStage `json:"taskStages" comment:"里程碑列表"`
TaskStageCheck TaskStage `json:"taskStageCheck" comment:"提交的里程碑"`
CreatedAt time.Time `json:"createdAt" comment:"创建时间"`
UpdatedAt time.Time `json:"updatedAt" comment:"更新时间"`
DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"`
TaskCreatedBy int `json:"taskCreatedBy" comment:"任务的创建方式"` // 任务的创建方式 0: 根据模板中的任务创建,1:页面主动直接创建
}
type TaskRecordRepository interface {
... ...