Skip to content

Commit

Permalink
Merge branch 'release/v1.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
shiido committed Jun 1, 2022
2 parents c83a38c + 76654f1 commit a937528
Show file tree
Hide file tree
Showing 53 changed files with 1,072 additions and 911 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENV CLOUD_CONFIG=$CLOUD_CONFIG

VOLUME /tmp

ADD ./target/st-microservice-supplies-1.6.8.jar st-microservice-supplies.jar
ADD ./target/st-microservice-supplies-1.6.9.jar st-microservice-supplies.jar

EXPOSE 8080

Expand Down
58 changes: 56 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

<groupId>com.ai.st.microservice.supplies</groupId>
<artifactId>st-microservice-supplies</artifactId>
<version>1.6.8</version>
<version>1.8.0</version>
<name>st-microservice-supplies</name>
<description>Microservice Supplies</description>

<properties>
<java.version>1.8</java.version>
<java.version>11</java.version>
<spring-cloud.version>Hoxton.RC2</spring-cloud.version>
</properties>

Expand Down Expand Up @@ -91,6 +91,31 @@
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
<groupId>com.ai.st.microservice.common</groupId>
<artifactId>st-common</artifactId>
<version>1.1.6</version>
</dependency>

<dependency>
<groupId>com.newrelic.logging</groupId>
<artifactId>logback</artifactId>
<version>2.3.2</version>
</dependency>

<dependency>
<groupId>com.newrelic.agent.java</groupId>
<artifactId>newrelic-api</artifactId>
<version>7.5.0</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.newrelic.agent.java</groupId>
<artifactId>newrelic-agent</artifactId>
<version>7.5.0</version>
<scope>provided</scope>
</dependency>

</dependencies>

Expand All @@ -112,6 +137,35 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.18.0</version>
<configuration>
<lineEnding>LF</lineEnding>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>8.5.4</version>
<configuration>
<user>postgres</user>
<password>123456</password>
<url>jdbc:postgresql://localhost:54321/sistema-transicion</url>
<schemas>
<schema>supplies</schema>
</schemas>
</configuration>
</plugin>
</plugins>
</build>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.ai.st.microservice.supplies.dto.managers.MicroserviceManagerDto;
import com.ai.st.microservice.supplies.dto.managers.MicroserviceManagerProfileDto;

import com.ai.st.microservice.supplies.services.tracing.SCMTracing;
import feign.FeignException;

import org.slf4j.Logger;
Expand All @@ -21,48 +22,17 @@ public class ManagerBusiness {
@Autowired
private ManagerFeignClient managerClient;

public MicroserviceManagerDto getManagerById(Long managerId) {
MicroserviceManagerDto managerDto = null;
try {
managerDto = managerClient.findById(managerId);
} catch (Exception e) {
log.error("No se ha podido consultar el gestor: " + e.getMessage());
}
return managerDto;
}

public MicroserviceManagerDto getManagerByUserCode(Long userCode) {
MicroserviceManagerDto managerDto = null;
try {
managerDto = managerClient.findByUserCode(userCode);
} catch (Exception e) {
log.error("No se ha podido consultar el gestor: " + e.getMessage());
String messageError = String.format("Error consultando gestor por el usuario %d : %s", userCode,
e.getMessage());
SCMTracing.sendError(messageError);
log.error(messageError);
}
return managerDto;
}


public boolean userManagerIsDirector(Long userCode) {

Boolean isDirector = false;

try {

List<MicroserviceManagerProfileDto> managerProfiles = managerClient.findProfilesByUser(userCode);

MicroserviceManagerProfileDto profileDirector = managerProfiles.stream()
.filter(profileDto -> profileDto.getId().equals(RoleBusiness.SUB_ROLE_DIRECTOR)).findAny()
.orElse(null);

if (profileDirector instanceof MicroserviceManagerProfileDto) {
isDirector = true;
}

} catch (FeignException e) {
log.error("No se ha podido verificar si el usuario es un director(gestor): " + e.getMessage());
}

return isDirector;
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@
import com.ai.st.microservice.supplies.dto.SupplyAttachmentTypeDto;
import com.ai.st.microservice.supplies.entities.SupplyAttachmentTypeEntity;
import com.ai.st.microservice.supplies.exceptions.BusinessException;
import com.ai.st.microservice.supplies.services.ISupplyAttachmentTypeService;
import com.ai.st.microservice.supplies.models.services.ISupplyAttachmentTypeService;

@Component
public class SupplyAttachmentTypeBusiness {

public static final Long SUPPLY_ATTACHMENT_TYPE_SUPPLY = (long) 1;
public static final Long SUPPLY_ATTACHMENT_TYPE_FTP = (long) 2;
public static final Long SUPPLY_ATTACHMENT_TYPE_EXTERNAL_SOURCE = (long) 3;
public static final Long SUPPLY_ATTACHMENT_TYPE_SUPPLY = (long) 1;
public static final Long SUPPLY_ATTACHMENT_TYPE_FTP = (long) 2;
public static final Long SUPPLY_ATTACHMENT_TYPE_EXTERNAL_SOURCE = (long) 3;

@Autowired
private ISupplyAttachmentTypeService attachmentTypeService;
@Autowired
private ISupplyAttachmentTypeService attachmentTypeService;

public List<SupplyAttachmentTypeDto> getAttachmentsTypes() throws BusinessException {
public List<SupplyAttachmentTypeDto> getAttachmentsTypes() throws BusinessException {

List<SupplyAttachmentTypeDto> attachmentsTypesDto = new ArrayList<>();
List<SupplyAttachmentTypeDto> attachmentsTypesDto = new ArrayList<>();

List<SupplyAttachmentTypeEntity> attachmentsTypesEntity = attachmentTypeService.getSupplyAttachmentsTypes();
List<SupplyAttachmentTypeEntity> attachmentsTypesEntity = attachmentTypeService.getSupplyAttachmentsTypes();

for (SupplyAttachmentTypeEntity attachmentEntity : attachmentsTypesEntity) {
attachmentsTypesDto.add(new SupplyAttachmentTypeDto(attachmentEntity.getId(), attachmentEntity.getName()));
}
for (SupplyAttachmentTypeEntity attachmentEntity : attachmentsTypesEntity) {
attachmentsTypesDto.add(new SupplyAttachmentTypeDto(attachmentEntity.getId(), attachmentEntity.getName()));
}

return attachmentsTypesDto;
}
return attachmentsTypesDto;
}

}
Loading

0 comments on commit a937528

Please sign in to comment.