...
|
...
|
@@ -88,42 +88,42 @@ type TaskStatus interface { |
|
|
type UnReleasedStatus struct{}
|
|
|
|
|
|
func (status *UnReleasedStatus) Update(task *Task, data map[string]interface{}) error {
|
|
|
if taskName, ok := data["taskName"]; ok {
|
|
|
if taskName, ok := data["taskName"]; ok && taskName != "" {
|
|
|
task.TaskName = taskName.(string)
|
|
|
}
|
|
|
if referenceResourceType, ok := data["referenceResourceType"]; ok {
|
|
|
if referenceResourceType, ok := data["referenceResourceType"]; ok && referenceResourceType != 0 {
|
|
|
task.ReferenceResource.ReferenceResourceType = referenceResourceType.(int)
|
|
|
}
|
|
|
if referenceResourceItems, ok := data["referenceResourceItems"]; ok {
|
|
|
if referenceResourceItems, ok := data["referenceResourceItems"]; ok && len(referenceResourceItems.([]*ReferenceResourceItem)) != 0 {
|
|
|
task.ReferenceResource.ReferenceResourceItems = referenceResourceItems.([]*ReferenceResourceItem)
|
|
|
}
|
|
|
if customerValue, ok := data["customerValue"]; ok {
|
|
|
if customerValue, ok := data["customerValue"]; ok && len(customerValue.([]string)) != 0 {
|
|
|
task.CustomerValue = customerValue.([]string)
|
|
|
}
|
|
|
if taskNature, ok := data["taskNature"]; ok {
|
|
|
if taskNature, ok := data["taskNature"]; ok && taskNature != "" {
|
|
|
task.TaskNature = taskNature.(string)
|
|
|
}
|
|
|
if suMoney, ok := data["suMoney"]; ok {
|
|
|
if suMoney, ok := data["suMoney"]; ok && suMoney.(float64) != float64(0) {
|
|
|
task.SuMoney = suMoney.(float64)
|
|
|
}
|
|
|
if task.TaskType == TASK_TYPE_BID {
|
|
|
if bidStartTime, ok := data["bidStartTime"]; ok {
|
|
|
if bidStartTime, ok := data["bidStartTime"]; ok && !bidStartTime.(time.Time).IsZero() {
|
|
|
task.BidInfo.BidStartTime = bidStartTime.(time.Time)
|
|
|
}
|
|
|
if bidEndTime, ok := data["bidEndTime"]; ok {
|
|
|
if bidEndTime, ok := data["bidEndTime"]; ok && !bidEndTime.(time.Time).IsZero() {
|
|
|
task.BidInfo.BidEndTime = bidEndTime.(time.Time)
|
|
|
}
|
|
|
}
|
|
|
if acceptanceStandard, ok := data["acceptanceStandard"]; ok {
|
|
|
if acceptanceStandard, ok := data["acceptanceStandard"]; ok && acceptanceStandard != "" {
|
|
|
task.AcceptanceStandard = acceptanceStandard.(string)
|
|
|
}
|
|
|
if taskDescription, ok := data["taskDescription"]; ok {
|
|
|
if taskDescription, ok := data["taskDescription"]; ok && taskDescription != "" {
|
|
|
task.TaskDescription = taskDescription.(string)
|
|
|
}
|
|
|
if taskPictureUrls, ok := data["taskPictureUrls"]; ok {
|
|
|
if taskPictureUrls, ok := data["taskPictureUrls"]; ok && len(taskPictureUrls.([]string)) != 0 {
|
|
|
task.TaskPictureUrls = taskPictureUrls.([]string)
|
|
|
}
|
|
|
if isRewardTake, ok := data["isRewardTake"]; ok {
|
|
|
if isRewardTake, ok := data["isRewardTake"]; ok && isRewardTake != false {
|
|
|
task.IsRewardTake = isRewardTake.(bool)
|
|
|
}
|
|
|
return nil
|
...
|
...
|
|