Test

mail@pastecode.io avatar
unknown
java
a year ago
876 B
1
Indexable
Never
  if (!CollectionUtils.isEmpty(projectsWithCommercialStopEnabled)) {
            Study projectWithMaxCommercialStop = Collections.max(projectsWithCommercialStopEnabled,
                                                                 Comparator.comparingInt(Study::getCommercialStopDate));
            retrofitPlanVesselDto.setCommercialStopDate(projectWithMaxCommercialStop.getCommercialStopDate());
            if(Boolean.TRUE.equals(vessel.hasDryDockDate())){
                int dryDockYear = vessel.getVesselCharacteristic().getDryDockDate().getYear();
                if (dryDockYear < projectWithMaxCommercialStop.getCommercialStopDate()) {
                    retrofitPlanVesselDto.setNextDryDockDate(null);
                    retrofitPlanVesselDto.setCommercialStopDate(projectWithMaxCommercialStop.getCommercialStopDate());
                }
            }
        }