Skip to content

Commit

Permalink
Clean up + fix for type equals
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkain committed Nov 3, 2023
1 parent 99cbd8a commit f8b797a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class RabbitMqStudyCardService {
private StudyCardRepository studyCardService;

@Autowired
ObjectMapper mapper;
private ObjectMapper mapper;

@RabbitListener(queues = RabbitMQConfiguration.FIND_STUDY_CARD_QUEUE)
@RabbitHandler
Expand All @@ -59,10 +59,9 @@ public String findStudyCard(String message) {
public Long getBestStudyCard(String message) {
try {
Properties properties = mapper.readValue(message, Properties.class);
String equipmentId = String.valueOf(properties.getProperty("EQUIPMENT_ID_PROPERTY"));
Long equipmentId = Long.valueOf(properties.getProperty("EQUIPMENT_ID_PROPERTY"));
Long studyId = Long.valueOf(properties.getProperty("STUDY_ID_PROPERTY"));
Long studyCardId = Long.valueOf(properties.getProperty("STUDYCARD_ID_PROPERTY"));

List<StudyCard> studyCards = this.studyCardService.findByStudyId(studyId);
for (StudyCard sc : studyCards) {
if (sc.getAcquisitionEquipmentId().equals(equipmentId)) {
Expand All @@ -74,4 +73,5 @@ public Long getBestStudyCard(String message) {
throw new AmqpRejectAndDontRequeueException(e);
}
}

}

0 comments on commit f8b797a

Please sign in to comment.