|
@@ -122,7 +122,7 @@ public class CrowdTestTask {
|
|
|
}).collect(Collectors.toList());
|
|
|
}else{
|
|
|
TaskToUser taskToUser = new TaskToUser();
|
|
|
- taskToUser.setValue(this.code, user.getId(), 0, this.getDistributionType(), 1, new Timestamp(System.currentTimeMillis()));
|
|
|
+ taskToUser.setValue(this.code, user.getId(), this.quotedPrice,0, this.getDistributionType(), 1, new Timestamp(System.currentTimeMillis()));
|
|
|
this.getAcceptedUserList().add(taskToUser);
|
|
|
}
|
|
|
this.setAcceptedUserList(acceptedUserList);
|
|
@@ -182,12 +182,14 @@ public class CrowdTestTask {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void confirmFinish(Long userId) {
|
|
|
- if (this.getStatus()!=CrowdTestTaskStatus.HAS_COMMITED){
|
|
|
+ public void confirmFinish() {
|
|
|
+ if ((this.getParticipantHasCommittedCount() == this.getAcceptedCount() && this.getStatus() == CrowdTestTaskStatus.HAS_RECEIVED)|| (this.getParticipantHasCommittedCount() == this.getParticipantCount() && this.getStatus() == CrowdTestTaskStatus.HAS_COMMITED)) {
|
|
|
+ this.setStatus(CrowdTestTaskStatus.HAS_FINISHED);
|
|
|
+ this.setEndTime(new Timestamp(System.currentTimeMillis()));
|
|
|
+ }else {
|
|
|
throw new CrowdTestTaskException("评测机构未提请结束任务,无法确认结束!");
|
|
|
}
|
|
|
- this.setStatus(CrowdTestTaskStatus.HAS_FINISHED);
|
|
|
- this.setEndTime(new Timestamp(System.currentTimeMillis()));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public void create(String taskCode) {
|
|
@@ -196,7 +198,7 @@ public class CrowdTestTask {
|
|
|
if (this.getDistributionType() == DistributeType.DIRECT.getId()){
|
|
|
this.setParticipantCount(1);
|
|
|
TaskToUser taskToUser = new TaskToUser();
|
|
|
- taskToUser.setValue(this.code, this.getEvaluationAgencyId(), 0, this.getDistributionType(), 0, null);
|
|
|
+ taskToUser.setValue(this.code, this.getEvaluationAgencyId(), this.quotedPrice,0, this.getDistributionType(), 0, null);
|
|
|
this.getAcceptedUserList().add(taskToUser);
|
|
|
this.setAcceptedUserList(acceptedUserList);
|
|
|
}
|