...
|
...
|
@@ -216,8 +216,65 @@ func (status *UnReleasedStatus) RejectReceiver(task *Task) error { |
|
|
|
|
|
type UnClaimedStatus struct{}
|
|
|
|
|
|
// TODO 待领取任务开放编辑
|
|
|
func (status *UnClaimedStatus) Update(task *Task, data map[string]interface{}) error {
|
|
|
return fmt.Errorf("待领取的任务不允许编辑")
|
|
|
//return fmt.Errorf("待领取的任务不允许编辑")
|
|
|
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 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 *UnClaimedStatus) Release(task *Task) error {
|
...
|
...
|
|