finetuning

This commit is contained in:
Jottyfan
2022-10-20 21:44:57 +02:00
parent 8344186ad2
commit 230cbc5d00
14 changed files with 216 additions and 108 deletions

View File

@@ -21,6 +21,7 @@ public class BookerBean implements Serializable {
private BigDecimal paid;
private String camp;
private String price;
private Integer campId;
/**
* @return the accept
@@ -117,4 +118,12 @@ public class BookerBean implements Serializable {
public void setPrice(String price) {
this.price = price;
}
public Integer getCampId() {
return campId;
}
public void setCampId(Integer campId) {
this.campId = campId;
}
}

View File

@@ -15,7 +15,7 @@ import org.apache.logging.log4j.Logger;
import org.jooq.DSLContext;
import org.jooq.Record;
import org.jooq.Record10;
import org.jooq.Record11;
import org.jooq.Record12;
import org.jooq.SelectConditionStep;
import org.jooq.SelectSeekStep4;
import org.jooq.UpdateConditionStep;
@@ -89,9 +89,9 @@ public class BookingsGateway {
* @return the booker bean or null
*/
public BookerBean getBooking(Integer id, String username) {
SelectConditionStep<Record11<Integer, Boolean, BigDecimal, String, String, EnumCamprole, EnumSex, LocalDateTime, String, Double, String>> sql = jooq
SelectConditionStep<Record12<Integer, Boolean, BigDecimal, String, String, EnumCamprole, EnumSex, LocalDateTime, String, Double, String, Integer>> sql = jooq
// @formatter:off
.select(T_PERSON.PK, T_PERSON.ACCEPT, T_PERSON.PAID, T_PERSON.FORENAME, T_PERSON.SURNAME, T_PERSON.CAMPROLE, T_PERSON.SEX, T_PERSON.CREATED, V_CAMP.NAME, V_CAMP.YEAR, V_CAMP.PRICE)
.select(T_PERSON.PK, T_PERSON.ACCEPT, T_PERSON.PAID, T_PERSON.FORENAME, T_PERSON.SURNAME, T_PERSON.CAMPROLE, T_PERSON.SEX, T_PERSON.CREATED, V_CAMP.NAME, V_CAMP.YEAR, V_CAMP.PRICE, V_CAMP.PK)
.from(T_PERSON)
.leftJoin(V_CAMP).on(V_CAMP.PK.eq(T_PERSON.FK_CAMP))
.leftJoin(T_SALESPROFILE).on(T_SALESPROFILE.FK_CAMP.eq(T_PERSON.FK_CAMP))
@@ -110,6 +110,7 @@ public class BookingsGateway {
EnumSex sex = r.get(T_PERSON.SEX);
String campName = r.get(V_CAMP.NAME);
Double campYear = r.get(V_CAMP.YEAR);
Integer campId = r.get(V_CAMP.PK);
BookerBean bean = new BookerBean();
bean.setPk(r.get(T_PERSON.PK));
bean.setName(String.format("%s %s", forename, surname));
@@ -119,6 +120,7 @@ public class BookingsGateway {
bean.setAccept(r.get(T_PERSON.ACCEPT));
bean.setPaid(r.get(T_PERSON.PAID));
bean.setCamp(String.format("%s %4.0f", campName, campYear));
bean.setCampId(campId);
bean.setPrice(r.get(V_CAMP.PRICE));
return bean;
}

View File

@@ -18,6 +18,10 @@ public class ProfileBean implements Serializable {
private String username;
private LocalDateTime duedate;
public String getFullname() {
return new StringBuilder().append(forename).append(" ").append(surname).toString();
}
public String dropdown() {
StringBuilder buf = new StringBuilder();
buf.append(forename).append(" ");