Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausRicharz committed Feb 22, 2024
1 parent 4c8536f commit 82f3376
Show file tree
Hide file tree
Showing 123 changed files with 589 additions and 583 deletions.
641 changes: 316 additions & 325 deletions pom.xml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/main/java/org/tb/SalatApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
import org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@EnableJpaRepositories
@EnableJpaAuditing
@EnableTransactionManagement
@SpringBootApplication(exclude = { SecurityAutoConfiguration.class, ManagementWebSecurityAutoConfiguration.class})
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class, ManagementWebSecurityAutoConfiguration.class})
@EnableWebSecurity
public class SalatApplication {

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/tb/auth/AfterLogin.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpSession;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.struts.util.MessageResources;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/tb/auth/AuthService.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import static org.tb.auth.AuthorizationRule.Category.TIMEREPORT;
import static org.tb.common.GlobalConstants.SUBORDER_INVOICE_YES;

import jakarta.annotation.PostConstruct;
import java.time.Clock;
import java.time.LocalDate;
import java.util.HashMap;
Expand All @@ -17,7 +18,6 @@
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import javax.annotation.PostConstruct;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/tb/chicoree/ChangeDayAction.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.tb.chicoree;

import java.time.LocalDate;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/tb/chicoree/ChicoreeSessionStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.servlet.http.HttpSession;
import jakarta.servlet.http.HttpSession;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/tb/chicoree/DeleteTimereportAction.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.tb.chicoree;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/tb/chicoree/EditTimereportAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import static org.tb.common.util.DateUtils.validateDate;

import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import static org.tb.common.util.DateUtils.validateDate;

import java.util.Optional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/tb/chicoree/ShowDashboardAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import static org.tb.common.util.DateUtils.today;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/tb/chicoree/StoreTimereportAction.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.tb.chicoree;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/tb/chicoree/TimereportForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import static org.tb.common.util.DateUtils.validateDate;

import java.time.LocalDate;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import lombok.Getter;
import lombok.Setter;
import org.apache.struts.action.ActionErrors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import java.io.IOException;
import java.security.Principal;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpFilter;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.context.SecurityContextHolder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.tb.common.configuration;

import java.util.Properties;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.tb.common.configuration;

import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpFilter;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;

@Slf4j
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.tb.common.configuration;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpFilter;
import java.io.IOException;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpFilter;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.ServletRequestBindingException;
Expand All @@ -19,8 +19,8 @@ public class ResourceUrlProviderExposingFilter extends HttpFilter {
private final ResourceUrlProvider resourceUrlProvider;

@Override
public void doFilter(
ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
protected void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
throws IOException, ServletException {
try {
request.setAttribute(RESOURCE_URL_PROVIDER_ATTR, this.resourceUrlProvider);
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/tb/common/jsptags/FormatDurationTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import java.io.IOException;
import java.time.Duration;
import java.time.LocalDate;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
import jakarta.servlet.jsp.JspException;
import jakarta.servlet.jsp.JspWriter;
import jakarta.servlet.jsp.tagext.TagSupport;
import lombok.Setter;
import org.tb.common.util.DurationUtils;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/tb/common/jsptags/FormatLocalDateTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import java.io.IOException;
import java.time.LocalDate;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
import jakarta.servlet.jsp.JspException;
import jakarta.servlet.jsp.JspWriter;
import jakarta.servlet.jsp.tagext.TagSupport;
import lombok.Setter;
import org.tb.common.util.DateUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import java.io.IOException;
import java.time.LocalDateTime;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
import jakarta.servlet.jsp.JspException;
import jakarta.servlet.jsp.JspWriter;
import jakarta.servlet.jsp.tagext.TagSupport;
import lombok.Setter;
import org.tb.common.util.DateUtils;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/tb/common/jsptags/FormatYearMonthTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import java.io.IOException;
import java.time.LocalDate;
import java.time.YearMonth;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
import jakarta.servlet.jsp.JspException;
import jakarta.servlet.jsp.JspWriter;
import jakarta.servlet.jsp.tagext.TagSupport;
import lombok.Setter;
import org.tb.common.util.DateUtils;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/tb/common/jsptags/TreeTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import java.util.List;
import java.util.Objects;
import java.util.Random;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
import jakarta.servlet.jsp.JspWriter;
import jakarta.servlet.jsp.tagext.TagSupport;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.tb.common.GlobalConstants;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.tb.common.struts;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.struts.action.Action;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/tb/common/struts/LoginRequiredAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import java.text.MessageFormat;
import java.util.Locale;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/tb/common/struts/TypedAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/tb/common/util/DurationUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static String format(Duration duration) {
sb.append('-');
}
sb.append(abs(duration.toHours())).append(':');
sb.append(String.format("%02d", abs(duration.toMinutesPart())));
sb.append("%02d".formatted(abs(duration.toMinutesPart())));
return sb.toString();
}

Expand Down Expand Up @@ -117,7 +117,7 @@ public static String decimalFormat(Duration duration) {
.multiply(BigDecimal.valueOf(100))
.divide(BigDecimal.valueOf(MINUTES_PER_HOUR), RoundingMode.HALF_UP)
.intValueExact();
sb.append(String.format("%02d", abs(minutesDecimal)));
sb.append("%02d".formatted(abs(minutesDecimal)));
return sb.toString();
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/tb/common/util/UrlUtils.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.tb.common.util;

import javax.servlet.ServletContext;
import jakarta.servlet.ServletContext;
import lombok.experimental.UtilityClass;

@UtilityClass
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/tb/customer/AddCustomerForm.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.tb.customer;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import lombok.Getter;
import lombok.Setter;
import org.apache.struts.action.ActionForm;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/tb/customer/CreateCustomerAction.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.tb.customer;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/org/tb/customer/CustomerRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
import org.tb.employee.domain.Employeecontract;

@Repository
public interface CustomerRepository extends PagingAndSortingRepository<Customer, Long>,
CrudRepository<Customer,Long> {
CrudRepository<Customer, Long> {

@Query("select c from Customer c where upper(c.id) like upper(:filter) or upper(c.name) like upper(:filter) "
+ "or upper(c.address) like upper(:filter) or upper(c.shortname) like upper(:filter) order by c.name asc")
@Query("""
select c from Customer c where upper(c.id) like upper(:filter) or upper(c.name) like upper(:filter) \
or upper(c.address) like upper(:filter) or upper(c.shortname) like upper(:filter) order by c.name asc\
""")
List<Customer> findAllByFilterIgnoringCase(String filter);

}
4 changes: 2 additions & 2 deletions src/main/java/org/tb/customer/DeleteCustomerAction.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.tb.customer;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.commons.validator.GenericValidator;
import org.apache.struts.action.ActionForm;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/tb/customer/EditCustomerAction.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.tb.customer;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/tb/customer/ShowCustomerAction.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.tb.customer;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
Expand Down
Loading

0 comments on commit 82f3376

Please sign in to comment.