...
|
...
|
@@ -224,9 +224,7 @@ func (status *UnReleasedStatus) RejectReceiver(task *Task) error { |
|
|
|
|
|
type UnClaimedStatus struct{}
|
|
|
|
|
|
// 待领取任务开放编辑
|
|
|
func (status *UnClaimedStatus) Update(task *Task, data map[string]interface{}) error {
|
|
|
//return fmt.Errorf("待领取的任务不允许编辑")
|
|
|
if taskName, ok := data["taskName"]; ok {
|
|
|
task.TaskName = taskName.(string)
|
|
|
}
|
...
|
...
|
@@ -638,15 +636,86 @@ func (status *UnConfirmedStatus) RejectReceiver(task *Task) error { |
|
|
return nil
|
|
|
}
|
|
|
|
|
|
// TODO 已过期任务
|
|
|
// TODO 已过期任务支持编辑
|
|
|
type ExpiredStatus struct{}
|
|
|
|
|
|
func (status ExpiredStatus) Update(task *Task, data map[string]interface{}) error {
|
|
|
panic("implement me")
|
|
|
if taskName, ok := data["taskName"]; ok {
|
|
|
task.TaskName = taskName.(string)
|
|
|
}
|
|
|
if referenceResourceType, ok := data["referenceResourceType"]; ok {
|
|
|
task.ReferenceResource.ReferenceResourceType = referenceResourceType.(int)
|
|
|
}
|
|
|
if referenceResourceItems, ok := data["referenceResourceItems"]; ok {
|
|
|
task.ReferenceResource.ReferenceResourceItems = referenceResourceItems.([]*ReferenceResourceItem)
|
|
|
}
|
|
|
if projectBelong, ok := data["projectBelong"]; ok {
|
|
|
task.ProjectBelong = projectBelong.(int)
|
|
|
}
|
|
|
if customerValues, ok := data["customerValues"]; ok {
|
|
|
task.CustomerValues = customerValues.([]int)
|
|
|
}
|
|
|
if taskNature, ok := data["taskNature"]; ok {
|
|
|
task.TaskNature = taskNature.(int)
|
|
|
}
|
|
|
if suMoney, ok := data["suMoney"]; ok {
|
|
|
task.SuMoney = suMoney.(float64)
|
|
|
}
|
|
|
if minSuMoney, ok := data["minSuMoney"]; ok {
|
|
|
task.MinSuMoney = minSuMoney.(float64)
|
|
|
}
|
|
|
if maxSuMoney, ok := data["maxSuMoney"]; ok {
|
|
|
task.MaxSuMoney = maxSuMoney.(float64)
|
|
|
}
|
|
|
if task.TaskType == TASK_TYPE_BID {
|
|
|
if bidStartTime, ok := data["bidStartTime"]; ok {
|
|
|
task.BidInfo.BidStartTime = bidStartTime.(time.Time)
|
|
|
}
|
|
|
if bidEndTime, ok := data["bidEndTime"]; ok {
|
|
|
task.BidInfo.BidEndTime = bidEndTime.(time.Time)
|
|
|
}
|
|
|
if isRemind, ok := data["isRemind"]; ok {
|
|
|
task.BidInfo.IsRemind = isRemind.(bool)
|
|
|
}
|
|
|
}
|
|
|
if acceptanceStandard, ok := data["acceptanceStandard"]; ok {
|
|
|
task.AcceptanceStandard = acceptanceStandard.(string)
|
|
|
}
|
|
|
if taskDescription, ok := data["taskDescription"]; ok {
|
|
|
task.TaskDescription = taskDescription.(string)
|
|
|
}
|
|
|
if taskPictureUrls, ok := data["taskPictureUrls"]; ok {
|
|
|
task.TaskPictureUrls = taskPictureUrls.([]string)
|
|
|
}
|
|
|
if isRewardTake, ok := data["isRewardTake"]; ok {
|
|
|
task.IsRewardTake = isRewardTake.(bool)
|
|
|
}
|
|
|
if task.TaskType == TASK_TYPE_DESIGNATE {
|
|
|
if plannedCompletionTime, ok := data["plannedCompletionTime"]; ok {
|
|
|
task.PlannedCompletionTime = plannedCompletionTime.(time.Time)
|
|
|
}
|
|
|
if assignedPerson, ok := data["assignedPerson"]; ok {
|
|
|
task.AssignedPerson = assignedPerson.(*EmployeeInfo)
|
|
|
if task.AssignedPerson.Uid == 0 {
|
|
|
task.AssignedPerson = nil
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
func (status ExpiredStatus) Release(task *Task) error {
|
|
|
panic("implement me")
|
|
|
currentTime := time.Now()
|
|
|
task.ReleaseTime = currentTime
|
|
|
if task.TaskType == TASK_TYPE_BID {
|
|
|
task.ReceiveTime = currentTime
|
|
|
task.TaskStatus = TASK_STATUS_UNDERWAY
|
|
|
task.CurrentStatus = &UnderwayStatus{}
|
|
|
} else {
|
|
|
task.TaskStatus = TASK_STATUS_UNCLAIMED
|
|
|
task.CurrentStatus = &UnClaimedStatus{}
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
func (status ExpiredStatus) Rob(task *Task, receiver *EmployeeInfo) error {
|
...
|
...
|
|