...
|
...
|
@@ -82,7 +82,7 @@ type TaskStatus interface { |
|
|
ChooseSuccessfulBidder(task *Task, successfulBidder *EmployeeInfo) error
|
|
|
ApplyComplete(task *Task) error
|
|
|
Off(task *Task) error
|
|
|
Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, solveReport string, solvePictureUrls []string) error
|
|
|
Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, referenceResourceScore []*ReferenceResourceItem, solveReport string, solvePictureUrls []string) error
|
|
|
}
|
|
|
|
|
|
type UnReleasedStatus struct{}
|
...
|
...
|
@@ -156,7 +156,7 @@ func (status *UnReleasedStatus) Off(task *Task) error { |
|
|
return fmt.Errorf("待发布的任务不允许关闭")
|
|
|
}
|
|
|
|
|
|
func (status *UnReleasedStatus) Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, solveReport string, solvePictureUrls []string) error {
|
|
|
func (status *UnReleasedStatus) Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, referenceResourceScore []*ReferenceResourceItem, solveReport string, solvePictureUrls []string) error {
|
|
|
return fmt.Errorf("待发布的任务不允许验收")
|
|
|
}
|
|
|
|
...
|
...
|
@@ -234,7 +234,7 @@ func (status *UnClaimedStatus) Off(task *Task) error { |
|
|
return nil
|
|
|
}
|
|
|
|
|
|
func (status *UnClaimedStatus) Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, solveReport string, solvePictureUrls []string) error {
|
|
|
func (status *UnClaimedStatus) Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, referenceResourceScore []*ReferenceResourceItem, solveReport string, solvePictureUrls []string) error {
|
|
|
return fmt.Errorf("待领取的任务不允许验收")
|
|
|
}
|
|
|
|
...
|
...
|
@@ -272,7 +272,7 @@ func (status *UnderwayStatus) Off(task *Task) error { |
|
|
return nil
|
|
|
}
|
|
|
|
|
|
func (status *UnderwayStatus) Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, solveReport string, solvePictureUrls []string) error {
|
|
|
func (status *UnderwayStatus) Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, referenceResourceScore []*ReferenceResourceItem, solveReport string, solvePictureUrls []string) error {
|
|
|
return fmt.Errorf("进行中的任务不允许验收")
|
|
|
}
|
|
|
|
...
|
...
|
@@ -308,11 +308,21 @@ func (status *UnAcceptanceStatus) Off(task *Task) error { |
|
|
return nil
|
|
|
}
|
|
|
|
|
|
func (status *UnAcceptanceStatus) Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, solveReport string, solvePictureUrls []string) error {
|
|
|
func (status *UnAcceptanceStatus) Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, referenceResourceScore []*ReferenceResourceItem, solveReport string, solvePictureUrls []string) error {
|
|
|
task.Participators = participators
|
|
|
task.TaskPercentage = taskPercentage
|
|
|
task.SolveReport = solveReport
|
|
|
task.SolvePictureUrls = solvePictureUrls
|
|
|
if task.ReferenceResource != nil {
|
|
|
for _, referenceResourceItem := range task.ReferenceResource.ReferenceResourceItems {
|
|
|
for _, referenceResourceScoreItem := range referenceResourceScore {
|
|
|
if referenceResourceItem.ReferenceResourceId == referenceResourceScoreItem.ReferenceResourceId {
|
|
|
referenceResourceItem.IssueScore = referenceResourceScoreItem.IssueScore
|
|
|
referenceResourceItem.SolveScore = referenceResourceScoreItem.SolveScore
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
task.TaskStatus = TASK_STATUS_COMPLETED
|
|
|
task.CurrentStatus = &CompletedStatus{}
|
|
|
return nil
|
...
|
...
|
@@ -350,7 +360,7 @@ func (status *CompletedStatus) Off(task *Task) error { |
|
|
return nil
|
|
|
}
|
|
|
|
|
|
func (status *CompletedStatus) Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, solveReport string, solvePictureUrls []string) error {
|
|
|
func (status *CompletedStatus) Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, referenceResourceScore []*ReferenceResourceItem, solveReport string, solvePictureUrls []string) error {
|
|
|
return fmt.Errorf("已完成的任务不允许验收")
|
|
|
}
|
|
|
|
...
|
...
|
@@ -384,7 +394,7 @@ func (status *ClosedStatus) Off(task *Task) error { |
|
|
return fmt.Errorf("已关闭的任务不允许关闭")
|
|
|
}
|
|
|
|
|
|
func (status *ClosedStatus) Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, solveReport string, solvePictureUrls []string) error {
|
|
|
func (status *ClosedStatus) Acceptance(task *Task, participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, referenceResourceScore []*ReferenceResourceItem, solveReport string, solvePictureUrls []string) error {
|
|
|
return fmt.Errorf("已关闭的任务不允许验收")
|
|
|
}
|
|
|
|
...
|
...
|
@@ -430,6 +440,6 @@ func (task *Task) Off() error { |
|
|
return task.CurrentStatus.Off(task)
|
|
|
}
|
|
|
|
|
|
func (task *Task) Acceptance(participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, solveReport string, solvePictureUrls []string) error {
|
|
|
return task.CurrentStatus.Acceptance(task, participators, taskPercentage, solveReport, solvePictureUrls)
|
|
|
func (task *Task) Acceptance(participators []*EmployeeInfo, taskPercentage []*TaskPercentageItem, referenceResourceScore []*ReferenceResourceItem, solveReport string, solvePictureUrls []string) error {
|
|
|
return task.CurrentStatus.Acceptance(task, participators, taskPercentage, referenceResourceScore, solveReport, solvePictureUrls)
|
|
|
} |
...
|
...
|
|