From e8d9cf6e501d9c664b7f01270d8593e876572ca4 Mon Sep 17 00:00:00 2001 From: Guiqiang Zhang Date: Thu, 14 Mar 2019 09:22:54 +0800 Subject: [PATCH] change score related fields to double --- .../view/dto/SoftwareContestWinnerDTO.java | 12 +++--- .../dto/contest/SoftwareSubmissionDTO.java | 40 +++++++++---------- .../contest/SoftwareSubmissionReviewDTO.java | 24 +++++------ .../services/view/util/DataProvider.java | 26 ++++++------ 4 files changed, 51 insertions(+), 51 deletions(-) diff --git a/src/java/main/com/topcoder/direct/services/view/dto/SoftwareContestWinnerDTO.java b/src/java/main/com/topcoder/direct/services/view/dto/SoftwareContestWinnerDTO.java index b172dc19e..40197d291 100644 --- a/src/java/main/com/topcoder/direct/services/view/dto/SoftwareContestWinnerDTO.java +++ b/src/java/main/com/topcoder/direct/services/view/dto/SoftwareContestWinnerDTO.java @@ -19,9 +19,9 @@ public class SoftwareContestWinnerDTO extends UserDTO { private int placement; /** - *

A float providing the final score assigned to winner's submission.

+ *

A double providing the final score assigned to winner's submission.

*/ - private float finalScore; + private double finalScore; /** *

A long providing the ID of a software project.

@@ -60,18 +60,18 @@ public void setProjectId(long projectId) { /** *

Gets the final score assigned to winner's submission.

* - * @return a float providing the final score assigned to winner's submission. + * @return a double providing the final score assigned to winner's submission. */ - public float getFinalScore() { + public double getFinalScore() { return this.finalScore; } /** *

Sets the final score assigned to winner's submission.

* - * @param finalScore a float providing the final score assigned to winner's submission. + * @param finalScore a double providing the final score assigned to winner's submission. */ - public void setFinalScore(float finalScore) { + public void setFinalScore(double finalScore) { this.finalScore = finalScore; } diff --git a/src/java/main/com/topcoder/direct/services/view/dto/contest/SoftwareSubmissionDTO.java b/src/java/main/com/topcoder/direct/services/view/dto/contest/SoftwareSubmissionDTO.java index 03a08e95d..0e3181789 100644 --- a/src/java/main/com/topcoder/direct/services/view/dto/contest/SoftwareSubmissionDTO.java +++ b/src/java/main/com/topcoder/direct/services/view/dto/contest/SoftwareSubmissionDTO.java @@ -42,19 +42,19 @@ public class SoftwareSubmissionDTO implements Serializable { private Date submissionDate; /** - *

A Float providing the screening score for submission.

+ *

A Double providing the screening score for submission.

*/ - private Float screeningScore; + private Double screeningScore; /** - *

A Float providing the initial score for submission.

+ *

A Double providing the initial score for submission.

*/ - private Float initialScore; + private Double initialScore; /** *

A Float providing the final score for submission.

*/ - private Float finalScore; + private Double finalScore; /** *

A UserDTO providing the details for the submitter.

@@ -106,7 +106,7 @@ public class SoftwareSubmissionDTO implements Serializable { * * @since 1.0.2 */ - private Float checkpointReviewScore; + private Double checkpointReviewScore; /** *

Constructs new SoftwareSubmissionDTO instance. This implementation does nothing.

@@ -191,54 +191,54 @@ public void setSubmitter(UserDTO submitter) { /** *

Gets the final score for submission.

* - * @return a Float providing the final score for submission. + * @return a Double providing the final score for submission. */ - public Float getFinalScore() { + public Double getFinalScore() { return this.finalScore; } /** *

Sets the final score for submission.

* - * @param finalScore a Float providing the final score for submission. + * @param finalScore a Double providing the final score for submission. */ - public void setFinalScore(Float finalScore) { + public void setFinalScore(Double finalScore) { this.finalScore = finalScore; } /** *

Gets the initial score for submission.

* - * @return a Float providing the initial score for submission. + * @return a Double providing the initial score for submission. */ - public Float getInitialScore() { + public Double getInitialScore() { return this.initialScore; } /** *

Sets the initial score for submission.

* - * @param initialScore a Float providing the initial score for submission. + * @param initialScore a Double providing the initial score for submission. */ - public void setInitialScore(Float initialScore) { + public void setInitialScore(Double initialScore) { this.initialScore = initialScore; } /** *

Gets the screening score for submission.

* - * @return a Float providing the screening score for submission. + * @return a Double providing the screening score for submission. */ - public Float getScreeningScore() { + public Double getScreeningScore() { return this.screeningScore; } /** *

Sets the screening score for submission.

* - * @param screeningScore a Float providing the screening score for submission. + * @param screeningScore a Double providing the screening score for submission. */ - public void setScreeningScore(Float screeningScore) { + public void setScreeningScore(Double screeningScore) { this.screeningScore = screeningScore; } @@ -360,7 +360,7 @@ public String getCheckpointFeedback() { * @param checkpointReviewScore the checkpoint review score for the checkpoint submission to set * @since 1.0.2 */ - public void setCheckpointReviewScore(Float checkpointReviewScore) { + public void setCheckpointReviewScore(Double checkpointReviewScore) { this.checkpointReviewScore = checkpointReviewScore; } @@ -370,7 +370,7 @@ public void setCheckpointReviewScore(Float checkpointReviewScore) { * @return the checkpoint review score for the checkpoint submission * @since 1.0.2 */ - public Float getCheckpointReviewScore() { + public Double getCheckpointReviewScore() { return checkpointReviewScore; } diff --git a/src/java/main/com/topcoder/direct/services/view/dto/contest/SoftwareSubmissionReviewDTO.java b/src/java/main/com/topcoder/direct/services/view/dto/contest/SoftwareSubmissionReviewDTO.java index 3fa9683b7..248dd1e55 100644 --- a/src/java/main/com/topcoder/direct/services/view/dto/contest/SoftwareSubmissionReviewDTO.java +++ b/src/java/main/com/topcoder/direct/services/view/dto/contest/SoftwareSubmissionReviewDTO.java @@ -29,9 +29,9 @@ public class SoftwareSubmissionReviewDTO implements Serializable { private UserDTO reviewer; /** - *

A Float providing the review final score.

+ *

A Double providing the review final score.

*/ - private Float finalScore; + private Double finalScore; /** *

A long providing the ID of submission associated with this review.

@@ -44,9 +44,9 @@ public class SoftwareSubmissionReviewDTO implements Serializable { private long reviewId; /** - *

A Float providing the initial score for review.

+ *

A Double providing the initial score for review.

*/ - private Float initialScore; + private Double initialScore; /** *

A String providing the feedback for the checkpoint submission.

@@ -64,9 +64,9 @@ public SoftwareSubmissionReviewDTO() { /** *

Gets the initial score for review.

* - * @return a Float providing the initial score for review. + * @return a Double providing the initial score for review. */ - public Float getInitialScore() { + public Double getInitialScore() { return this.initialScore; } @@ -96,9 +96,9 @@ public void setCommitted(boolean committed) { /** *

Sets the initial score for review.

* - * @param initialScore a Float providing the initial score for review. + * @param initialScore a Double providing the initial score for review. */ - public void setInitialScore(Float initialScore) { + public void setInitialScore(Double initialScore) { this.initialScore = initialScore; } @@ -141,18 +141,18 @@ public void setSubmissionId(long submissionId) { /** *

Gets the review final score.

* - * @return a Float providing the review final score. + * @return a Double providing the review final score. */ - public Float getFinalScore() { + public Double getFinalScore() { return this.finalScore; } /** *

Sets the review final score.

* - * @param finalScore a Float providing the review final score. + * @param finalScore a Double providing the review final score. */ - public void setFinalScore(Float finalScore) { + public void setFinalScore(Double finalScore) { this.finalScore = finalScore; } diff --git a/src/java/main/com/topcoder/direct/services/view/util/DataProvider.java b/src/java/main/com/topcoder/direct/services/view/util/DataProvider.java index c0d7d17c1..6f080997d 100644 --- a/src/java/main/com/topcoder/direct/services/view/util/DataProvider.java +++ b/src/java/main/com/topcoder/direct/services/view/util/DataProvider.java @@ -2382,7 +2382,7 @@ public static ProjectStatsDTO getProjectStats(TCSubject tcSubject, long projectI * @param projectId the direct project id. * @param clientId the client id. * @param billingAccountId the billing accounts id. - * @param projectStatus the project status. + * @param projectStatusIds the project status ids. * @param startDate the start date. * @param endDate the end date. * @param statses the project metrics data. @@ -2988,9 +2988,9 @@ public static void setSoftwareCheckpointSubmissionsData(SoftwareContestSubmissio checkpointReview.setReviewId(reviewRow.getLongItem("review_id")); checkpointReview.setCommitted(reviewRow.getBooleanItem("is_committed")); checkpointReview.setFinalScore(reviewRow.getItem("final_score").getResultData() == null ? 0 : - reviewRow.getFloatItem("final_score")); + reviewRow.getDoubleItem("final_score")); checkpointReview.setInitialScore(reviewRow.getItem("initial_score").getResultData() == null ? 0 : - reviewRow.getFloatItem("initial_score")); + reviewRow.getDoubleItem("initial_score")); checkpointReview.setCheckpointFeedback(reviewRow.getStringItem("feedback")); long submissionId = checkpointReview.getSubmissionId(); @@ -3024,10 +3024,10 @@ public static void setSoftwareCheckpointSubmissionsData(SoftwareContestSubmissio long submissionId = submissionRow.getLongItem("submission_id"); submission.setSubmissionId(submissionId); submission.setSubmissionDate(submissionRow.getTimestampItem("create_date")); - submission.setScreeningScore((Float) submissionRow.getItem("screening_score").getResultData()); - submission.setInitialScore((Float) submissionRow.getItem("initial_score").getResultData()); - submission.setFinalScore((Float) submissionRow.getItem("final_score").getResultData()); - submission.setPlacement((Integer) submissionRow.getItem("placement").getResultData()); + submission.setScreeningScore(submissionRow.getItem("screening_score").getResultData() == null ? null : submissionRow.getDoubleItem("screening_score")); + submission.setInitialScore(submissionRow.getItem("initial_score").getResultData() == null ? null : submissionRow.getDoubleItem("initial_score")); + submission.setFinalScore(submissionRow.getItem("final_score").getResultData() == null ? null : submissionRow.getDoubleItem("final_score")); + submission.setPlacement(submissionRow.getItem("placement").getResultData() == null ? null : submissionRow.getIntItem("placement")); submission.setPassedScreening(!submissionRow.getBooleanItem("failed_milestone_screening")); submission.setPassedReview(!submissionRow.getBooleanItem("failed_milestone_review")); submission.setUploadId(submissionRow.getLongItem("upload_id")); @@ -3107,8 +3107,8 @@ public static void setSoftwareSubmissionsData(SoftwareContestSubmissionsDTO dto) SoftwareSubmissionReviewDTO review = new SoftwareSubmissionReviewDTO(); review.setReviewer(reviewersMap.get(reviewRow.getLongItem("resource_id"))); review.setSubmissionId(reviewRow.getLongItem("submission_id")); - review.setFinalScore(reviewRow.getFloatItem("final_score")); - review.setInitialScore(reviewRow.getFloatItem("initial_score")); + review.setFinalScore(reviewRow.getDoubleItem("final_score")); + review.setInitialScore(reviewRow.getDoubleItem("initial_score")); review.setReviewId(reviewRow.getLongItem("review_id")); review.setCommitted(reviewRow.getBooleanItem("is_committed")); long reviewerRoleId = reviewRow.getLongItem("reviewer_role_id"); @@ -3144,10 +3144,10 @@ public static void setSoftwareSubmissionsData(SoftwareContestSubmissionsDTO dto) long submissionId = submissionRow.getLongItem("submission_id"); submission.setSubmissionId(submissionId); submission.setSubmissionDate(submissionRow.getTimestampItem("create_date")); - submission.setScreeningScore((Float) submissionRow.getItem("screening_score").getResultData()); - submission.setInitialScore((Float) submissionRow.getItem("initial_score").getResultData()); - submission.setFinalScore((Float) submissionRow.getItem("final_score").getResultData()); - submission.setPlacement((Integer) submissionRow.getItem("placement").getResultData()); + submission.setScreeningScore(submissionRow.getItem("screening_score").getResultData() == null ? null : submissionRow.getDoubleItem("screening_score")); + submission.setInitialScore(submissionRow.getItem("initial_score").getResultData() == null ? null : submissionRow.getDoubleItem("initial_score")); + submission.setFinalScore(submissionRow.getItem("final_score").getResultData() == null ? null : submissionRow.getDoubleItem("final_score")); + submission.setPlacement(submissionRow.getItem("placement").getResultData() == null ? null : submissionRow.getIntItem("placement")); submission.setPassedScreening(!submissionRow.getBooleanItem("failed_screening")); submission.setPassedReview(!submissionRow.getBooleanItem("failed_review")); submission.setUploadId(submissionRow.getLongItem("upload_id"));