- Conexión para el ws de SISVECOM

- Corrección de error en la fecha al guardar gastos
This commit is contained in:
Brayan.Gonzalez 2025-02-12 09:54:24 -07:00
parent c269ac5570
commit d44659160b
5 changed files with 237 additions and 178 deletions

View File

@ -36,6 +36,26 @@
</dependency>
</dependencies>
<profiles>
<profile>
<id>AWS-EC2-2</id>
<properties>
<hibernate.connection.url>jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=UTC</hibernate.connection.url>
<hibernate.connection.username>root</hibernate.connection.username>
<hibernate.connection.password>root</hibernate.connection.password>
<hibernate.connection.min_size>10</hibernate.connection.min_size>
<hibernate.connection.max_size>40</hibernate.connection.max_size>
<hibernate.connection.timeout>1800</hibernate.connection.timeout>
<hibernate.connection.max_statements>300</hibernate.connection.max_statements>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</profile>
<profile>
<id>AWS-EC2</id>
<properties>

View File

@ -13,6 +13,7 @@ import java.io.Serializable;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Optional;
@ -79,7 +80,6 @@ public class OtherExpense implements Serializable {
nullable = false,
insertable = false,
updatable = false
)
private User userCreatedBy;
@ -110,7 +110,12 @@ public class OtherExpense implements Serializable {
this.expense = expense;
this.description = description;
this.createdBy = userId;
this.createdOn = new Date();
Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_YEAR, -1);
date = calendar.getTime();
this.createdOn = date;
}
public String getId() {
@ -222,22 +227,22 @@ public class OtherExpense implements Serializable {
if (closingDayToday != null) {
Optional<ClosingDay> optUser = closingDayToday.stream().filter(p -> p.getUser().getId().equalsIgnoreCase(user.getId())
&& p.getCreatedOn().equals(createdOn)).findFirst();
closingDayUser = optUser.isPresent() ? optUser.get().getId(): null;
closingDayUser = optUser.isPresent() ? optUser.get().getId() : null;
String dateStrCD;
Date dateCD;
for(ClosingDay dato : closingDayToday){
for (ClosingDay dato : closingDayToday) {
dateStrCD = dt1.format(dato.getCreatedOn());
dateCD = dt1.parse(dateStrCD);
if(dato.getUser().getId().equalsIgnoreCase(getUser().getId()) && dateCD.equals(date)){
if (dato.getUser().getId().equalsIgnoreCase(getUser().getId()) && dateCD.equals(date)) {
closingDayUser = dato.getUser().getId();
}
}
}
if(action){
if(closingDayUser != null){
if (action) {
if (closingDayUser != null) {
action = false;
}
}

View File

@ -116,6 +116,16 @@
</dependencies>
<profiles>
<profile>
<id>AWS-EC2-2</id>
<properties>
<hibernate.connection.url>jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=UTC</hibernate.connection.url>
<hibernate.connection.username>root</hibernate.connection.username>
<hibernate.connection.password>root</hibernate.connection.password>
<hibernate.connection.useSSL>false</hibernate.connection.useSSL>
<log4j2.path>/var/log/tomcat/cardriver.log</log4j2.path>
</properties>
</profile>
<profile>
<id>AWS-EC2</id>
<properties>

View File

@ -189,6 +189,14 @@
</dependencies>
<profiles>
<profile>
<id>AWS-EC2-2</id>
<properties>
<hibernate.connection.url>jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=UTC</hibernate.connection.url>
<hibernate.connection.username>root</hibernate.connection.username>
<hibernate.connection.password>root</hibernate.connection.password>
</properties>
</profile>
<profile>
<id>AWS-EC2</id>
<properties>

View File

@ -11,6 +11,22 @@
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<profiles>
<profile>
<id>AWS-EC2-2</id>
<activation>
<property>
<name>AWS-EC2</name>
<value>true</value>
</property>
</activation>
<modules>
<module>../ace-security</module>
<module>../ace-layout</module>
<module>../ace-model</module>
<module>../ace-controller</module>
<module>../ace-web</module>
</modules>
</profile>
<profile>
<id>AWS-EC2</id>
<activation>