Small fixes for formula matching

This commit is contained in:
2026-08-03 10:09:38 +02:00
parent 2055c15906
commit c8ec6f1846
5 changed files with 21 additions and 17 deletions
+4 -12
View File
@@ -179,19 +179,11 @@ public class TLWMatch extends BaseMatch{
}
public String getFormulaHome() {
String formula = "D";
if (this.formulaHome != null) {
formula = this.formulaHome;
}
return "'" + formula + "'";
return this.formulaHome != null ? this.formulaHome : "D";
}
public String getFormulaGuest() {
String formula = "D";
if (this.formulaGuest != null) {
formula = this.formulaGuest;
}
return "'" + formula + "'";
return this.formulaGuest != null ? this.formulaGuest : "D";
}
public String getSQLQueryInsert() {
@@ -218,8 +210,8 @@ public class TLWMatch extends BaseMatch{
this.status + ", " +
nullToSqlEmptyString(this.matchDatetime) + ", " +
nullToSqlEmptyString(this.groupId) + ", " +
getFormulaHome() + ", " +
getFormulaGuest() + ", " +
"'" + getFormulaHome() + "'" + ", " +
"'" + getFormulaGuest() + "'" + ", " +
nullToSqlEmptyString(this.koMatch) + ", " +
nullToSqlEmptyString(this.goalsOvertimeHome) + ", " +
nullToSqlEmptyString(this.goalsOvertimeGuest) + ", " +
@@ -193,9 +193,15 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
// update empty match
if(!done) {
for (TLWMatch tlwMatch : tlwMatches) {
if (tlwMatch.getTeamIdHome() == 0 && tlwMatch.getTeamIdGuest() == 0
&& (Objects.equals(tlwMatch.getFormulaHome(), "") || Objects.equals(tlwMatch.getFormulaHome(), "D"))
&& (Objects.equals(tlwMatch.getFormulaGuest(), "") || Objects.equals(tlwMatch.getFormulaGuest(), "D"))
Integer teamIdHome = tlwMatch.getTeamIdHome();
Integer teamIdGuest = tlwMatch.getTeamIdGuest();
String formulaHome = tlwMatch.getFormulaHome();
String formulaGuest = tlwMatch.getFormulaGuest();
if (
(Objects.equals(teamIdHome, 0) || Objects.equals(teamIdHome, null))
&& (Objects.equals(teamIdGuest, 0) || Objects.equals(teamIdGuest, null))
&& (Objects.equals(formulaHome, "") || Objects.equals(formulaHome, "D"))
&& (Objects.equals(formulaGuest, "") || Objects.equals(formulaGuest, "D"))
) {
tlwMatch.updateMatch(missingMatch);
done = true;