|
@@ -94,42 +94,42 @@ type TaskStatus interface { |
|
@@ -94,42 +94,42 @@ type TaskStatus interface { |
94
|
type UnReleasedStatus struct{}
|
94
|
type UnReleasedStatus struct{}
|
95
|
|
95
|
|
96
|
func (status *UnReleasedStatus) Update(task *Task, data map[string]interface{}) error {
|
96
|
func (status *UnReleasedStatus) Update(task *Task, data map[string]interface{}) error {
|
97
|
- if taskName, ok := data["taskName"]; ok && taskName != "" {
|
97
|
+ if taskName, ok := data["taskName"]; ok {
|
98
|
task.TaskName = taskName.(string)
|
98
|
task.TaskName = taskName.(string)
|
99
|
}
|
99
|
}
|
100
|
- if referenceResourceType, ok := data["referenceResourceType"]; ok && referenceResourceType != 0 {
|
100
|
+ if referenceResourceType, ok := data["referenceResourceType"]; ok {
|
101
|
task.ReferenceResource.ReferenceResourceType = referenceResourceType.(int)
|
101
|
task.ReferenceResource.ReferenceResourceType = referenceResourceType.(int)
|
102
|
}
|
102
|
}
|
103
|
- if referenceResourceItems, ok := data["referenceResourceItems"]; ok && len(referenceResourceItems.([]*ReferenceResourceItem)) != 0 {
|
103
|
+ if referenceResourceItems, ok := data["referenceResourceItems"]; ok {
|
104
|
task.ReferenceResource.ReferenceResourceItems = referenceResourceItems.([]*ReferenceResourceItem)
|
104
|
task.ReferenceResource.ReferenceResourceItems = referenceResourceItems.([]*ReferenceResourceItem)
|
105
|
}
|
105
|
}
|
106
|
- if customerValue, ok := data["customerValue"]; ok && len(customerValue.([]string)) != 0 {
|
106
|
+ if customerValue, ok := data["customerValue"]; ok {
|
107
|
task.CustomerValue = customerValue.([]string)
|
107
|
task.CustomerValue = customerValue.([]string)
|
108
|
}
|
108
|
}
|
109
|
- if taskNature, ok := data["taskNature"]; ok && taskNature != "" {
|
109
|
+ if taskNature, ok := data["taskNature"]; ok {
|
110
|
task.TaskNature = taskNature.(string)
|
110
|
task.TaskNature = taskNature.(string)
|
111
|
}
|
111
|
}
|
112
|
- if suMoney, ok := data["suMoney"]; ok && suMoney.(float64) != float64(0) {
|
112
|
+ if suMoney, ok := data["suMoney"]; ok {
|
113
|
task.SuMoney = suMoney.(float64)
|
113
|
task.SuMoney = suMoney.(float64)
|
114
|
}
|
114
|
}
|
115
|
if task.TaskType == TASK_TYPE_BID {
|
115
|
if task.TaskType == TASK_TYPE_BID {
|
116
|
- if bidStartTime, ok := data["bidStartTime"]; ok && !bidStartTime.(time.Time).IsZero() {
|
116
|
+ if bidStartTime, ok := data["bidStartTime"]; ok {
|
117
|
task.BidInfo.BidStartTime = bidStartTime.(time.Time)
|
117
|
task.BidInfo.BidStartTime = bidStartTime.(time.Time)
|
118
|
}
|
118
|
}
|
119
|
- if bidEndTime, ok := data["bidEndTime"]; ok && !bidEndTime.(time.Time).IsZero() {
|
119
|
+ if bidEndTime, ok := data["bidEndTime"]; ok {
|
120
|
task.BidInfo.BidEndTime = bidEndTime.(time.Time)
|
120
|
task.BidInfo.BidEndTime = bidEndTime.(time.Time)
|
121
|
}
|
121
|
}
|
122
|
}
|
122
|
}
|
123
|
- if acceptanceStandard, ok := data["acceptanceStandard"]; ok && acceptanceStandard != "" {
|
123
|
+ if acceptanceStandard, ok := data["acceptanceStandard"]; ok {
|
124
|
task.AcceptanceStandard = acceptanceStandard.(string)
|
124
|
task.AcceptanceStandard = acceptanceStandard.(string)
|
125
|
}
|
125
|
}
|
126
|
- if taskDescription, ok := data["taskDescription"]; ok && taskDescription != "" {
|
126
|
+ if taskDescription, ok := data["taskDescription"]; ok {
|
127
|
task.TaskDescription = taskDescription.(string)
|
127
|
task.TaskDescription = taskDescription.(string)
|
128
|
}
|
128
|
}
|
129
|
- if taskPictureUrls, ok := data["taskPictureUrls"]; ok && len(taskPictureUrls.([]string)) != 0 {
|
129
|
+ if taskPictureUrls, ok := data["taskPictureUrls"]; ok {
|
130
|
task.TaskPictureUrls = taskPictureUrls.([]string)
|
130
|
task.TaskPictureUrls = taskPictureUrls.([]string)
|
131
|
}
|
131
|
}
|
132
|
- if isRewardTake, ok := data["isRewardTake"]; ok && isRewardTake != false {
|
132
|
+ if isRewardTake, ok := data["isRewardTake"]; ok {
|
133
|
task.IsRewardTake = isRewardTake.(bool)
|
133
|
task.IsRewardTake = isRewardTake.(bool)
|
134
|
}
|
134
|
}
|
135
|
return nil
|
135
|
return nil
|