|
@@ -224,9 +224,7 @@ func (status *UnReleasedStatus) RejectReceiver(task *Task) error { |
|
@@ -224,9 +224,7 @@ func (status *UnReleasedStatus) RejectReceiver(task *Task) error { |
224
|
|
224
|
|
225
|
type UnClaimedStatus struct{}
|
225
|
type UnClaimedStatus struct{}
|
226
|
|
226
|
|
227
|
-// 待领取任务开放编辑
|
|
|
228
|
func (status *UnClaimedStatus) Update(task *Task, data map[string]interface{}) error {
|
227
|
func (status *UnClaimedStatus) Update(task *Task, data map[string]interface{}) error {
|
229
|
- //return fmt.Errorf("待领取的任务不允许编辑")
|
|
|
230
|
if taskName, ok := data["taskName"]; ok {
|
228
|
if taskName, ok := data["taskName"]; ok {
|
231
|
task.TaskName = taskName.(string)
|
229
|
task.TaskName = taskName.(string)
|
232
|
}
|
230
|
}
|
|
@@ -638,15 +636,86 @@ func (status *UnConfirmedStatus) RejectReceiver(task *Task) error { |
|
@@ -638,15 +636,86 @@ func (status *UnConfirmedStatus) RejectReceiver(task *Task) error { |
638
|
return nil
|
636
|
return nil
|
639
|
}
|
637
|
}
|
640
|
|
638
|
|
641
|
-// TODO 已过期任务
|
639
|
+// TODO 已过期任务支持编辑
|
642
|
type ExpiredStatus struct{}
|
640
|
type ExpiredStatus struct{}
|
643
|
|
641
|
|
644
|
func (status ExpiredStatus) Update(task *Task, data map[string]interface{}) error {
|
642
|
func (status ExpiredStatus) Update(task *Task, data map[string]interface{}) error {
|
645
|
- panic("implement me")
|
643
|
+ if taskName, ok := data["taskName"]; ok {
|
|
|
644
|
+ task.TaskName = taskName.(string)
|
|
|
645
|
+ }
|
|
|
646
|
+ if referenceResourceType, ok := data["referenceResourceType"]; ok {
|
|
|
647
|
+ task.ReferenceResource.ReferenceResourceType = referenceResourceType.(int)
|
|
|
648
|
+ }
|
|
|
649
|
+ if referenceResourceItems, ok := data["referenceResourceItems"]; ok {
|
|
|
650
|
+ task.ReferenceResource.ReferenceResourceItems = referenceResourceItems.([]*ReferenceResourceItem)
|
|
|
651
|
+ }
|
|
|
652
|
+ if projectBelong, ok := data["projectBelong"]; ok {
|
|
|
653
|
+ task.ProjectBelong = projectBelong.(int)
|
|
|
654
|
+ }
|
|
|
655
|
+ if customerValues, ok := data["customerValues"]; ok {
|
|
|
656
|
+ task.CustomerValues = customerValues.([]int)
|
|
|
657
|
+ }
|
|
|
658
|
+ if taskNature, ok := data["taskNature"]; ok {
|
|
|
659
|
+ task.TaskNature = taskNature.(int)
|
|
|
660
|
+ }
|
|
|
661
|
+ if suMoney, ok := data["suMoney"]; ok {
|
|
|
662
|
+ task.SuMoney = suMoney.(float64)
|
|
|
663
|
+ }
|
|
|
664
|
+ if minSuMoney, ok := data["minSuMoney"]; ok {
|
|
|
665
|
+ task.MinSuMoney = minSuMoney.(float64)
|
|
|
666
|
+ }
|
|
|
667
|
+ if maxSuMoney, ok := data["maxSuMoney"]; ok {
|
|
|
668
|
+ task.MaxSuMoney = maxSuMoney.(float64)
|
|
|
669
|
+ }
|
|
|
670
|
+ if task.TaskType == TASK_TYPE_BID {
|
|
|
671
|
+ if bidStartTime, ok := data["bidStartTime"]; ok {
|
|
|
672
|
+ task.BidInfo.BidStartTime = bidStartTime.(time.Time)
|
|
|
673
|
+ }
|
|
|
674
|
+ if bidEndTime, ok := data["bidEndTime"]; ok {
|
|
|
675
|
+ task.BidInfo.BidEndTime = bidEndTime.(time.Time)
|
|
|
676
|
+ }
|
|
|
677
|
+ if isRemind, ok := data["isRemind"]; ok {
|
|
|
678
|
+ task.BidInfo.IsRemind = isRemind.(bool)
|
|
|
679
|
+ }
|
|
|
680
|
+ }
|
|
|
681
|
+ if acceptanceStandard, ok := data["acceptanceStandard"]; ok {
|
|
|
682
|
+ task.AcceptanceStandard = acceptanceStandard.(string)
|
|
|
683
|
+ }
|
|
|
684
|
+ if taskDescription, ok := data["taskDescription"]; ok {
|
|
|
685
|
+ task.TaskDescription = taskDescription.(string)
|
|
|
686
|
+ }
|
|
|
687
|
+ if taskPictureUrls, ok := data["taskPictureUrls"]; ok {
|
|
|
688
|
+ task.TaskPictureUrls = taskPictureUrls.([]string)
|
|
|
689
|
+ }
|
|
|
690
|
+ if isRewardTake, ok := data["isRewardTake"]; ok {
|
|
|
691
|
+ task.IsRewardTake = isRewardTake.(bool)
|
|
|
692
|
+ }
|
|
|
693
|
+ if task.TaskType == TASK_TYPE_DESIGNATE {
|
|
|
694
|
+ if plannedCompletionTime, ok := data["plannedCompletionTime"]; ok {
|
|
|
695
|
+ task.PlannedCompletionTime = plannedCompletionTime.(time.Time)
|
|
|
696
|
+ }
|
|
|
697
|
+ if assignedPerson, ok := data["assignedPerson"]; ok {
|
|
|
698
|
+ task.AssignedPerson = assignedPerson.(*EmployeeInfo)
|
|
|
699
|
+ if task.AssignedPerson.Uid == 0 {
|
|
|
700
|
+ task.AssignedPerson = nil
|
|
|
701
|
+ }
|
|
|
702
|
+ }
|
|
|
703
|
+ }
|
|
|
704
|
+ return nil
|
646
|
}
|
705
|
}
|
647
|
|
706
|
|
648
|
func (status ExpiredStatus) Release(task *Task) error {
|
707
|
func (status ExpiredStatus) Release(task *Task) error {
|
649
|
- panic("implement me")
|
708
|
+ currentTime := time.Now()
|
|
|
709
|
+ task.ReleaseTime = currentTime
|
|
|
710
|
+ if task.TaskType == TASK_TYPE_BID {
|
|
|
711
|
+ task.ReceiveTime = currentTime
|
|
|
712
|
+ task.TaskStatus = TASK_STATUS_UNDERWAY
|
|
|
713
|
+ task.CurrentStatus = &UnderwayStatus{}
|
|
|
714
|
+ } else {
|
|
|
715
|
+ task.TaskStatus = TASK_STATUS_UNCLAIMED
|
|
|
716
|
+ task.CurrentStatus = &UnClaimedStatus{}
|
|
|
717
|
+ }
|
|
|
718
|
+ return nil
|
650
|
}
|
719
|
}
|
651
|
|
720
|
|
652
|
func (status ExpiredStatus) Rob(task *Task, receiver *EmployeeInfo) error {
|
721
|
func (status ExpiredStatus) Rob(task *Task, receiver *EmployeeInfo) error {
|