...
|
...
|
@@ -115,9 +115,7 @@ func (srv TaskService) CreateTask(transactionContext application.TransactionCont |
|
|
if err != nil {
|
|
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, "创建任务失败:"+err.Error())
|
|
|
}
|
|
|
|
|
|
nowEndTime := dayZeroTime(nowTime)
|
|
|
|
|
|
nowEndTime := dayEndTime(nowTime)
|
|
|
newTaskStage := []*domain.TaskStage{
|
|
|
{
|
|
|
Id: 0,
|
...
|
...
|
@@ -144,6 +142,7 @@ func (srv TaskService) CreateTask(transactionContext application.TransactionCont |
|
|
RealCompletedAt: 0,
|
|
|
},
|
|
|
}
|
|
|
|
|
|
err = taskStageRepo.Save(newTaskStage)
|
|
|
if err != nil {
|
|
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, "创建任务失败:"+err.Error())
|
...
|
...
|
@@ -240,7 +239,6 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "请填写里程碑完成时间")
|
|
|
}
|
|
|
t = dayEndTime(t)
|
|
|
if i > 0 {
|
|
|
if lastPlanCompletedAt.After(t) {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "里程碑["+val2.Name+"]完成时间填写错误")
|
...
|
...
|
@@ -253,9 +251,10 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
|
|
TaskId: taskData.Id,
|
|
|
Name: val2.Name,
|
|
|
SortBy: i + 1,
|
|
|
PlanCompletedAt: t.Unix(),
|
|
|
PlanCompletedAt: 0,
|
|
|
RealCompletedAt: 0,
|
|
|
}
|
|
|
newStage.SetPlanCompleted(t)
|
|
|
newStageList = append(newStageList, &newStage)
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -266,7 +265,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
|
|
oldStage.DeletedAt = nil
|
|
|
oldStage.SortBy = i + 1
|
|
|
oldStage.Name = val2.Name
|
|
|
if ok := oldStage.PlanCompleted(t); ok {
|
|
|
if ok := oldStage.SetPlanCompleted(t); ok {
|
|
|
markStage = append(markStage, *oldStage)
|
|
|
}
|
|
|
}
|
...
|
...
|
|