ogre_x icon

auto07

ogre_x | PRO | 02/23/17 06:01:10 AM UTC | 0 ⭐ | 344 👁️ | Never ⏰ | []
Java |

1.38 KB

|

None

|

0 👍

/

0 👎

    public void apply(ProduktEntity subject) throws LiivApplicationException {
        if(!isLIC(subject)) {
            Set<ArtikelEntity> articlesExporteras = findExporterasArticles(subject.getArtikelSet(), this::exporteras);
 
            boolean innehallerLatex = false;
            boolean innehallerEjLatex = false;
 
            for (ArtikelEntity artikel : articlesExporteras) {
                if (artikel.getInnehallerLatex() == null) {
                    // Omöjligt. latex är obligatoriskt om artikeln exporteras.
                    // Avbryt beräkning
                    return;
                }
                else if (YesNoEntity.TRUE.equals(artikel.getInnehallerLatex())) {
                    innehallerLatex = true;
                }
                else {
                    innehallerEjLatex = true;
                }
 
            }
 
            if (innehallerLatex && !innehallerEjLatex) {
                andraInnehallerLatex(subject, InnehallerLatexEntity.YES);
            }
            else if (!innehallerLatex && innehallerEjLatex) {
                andraInnehallerLatex(subject, InnehallerLatexEntity.NO);
            }
            else if (innehallerLatex && innehallerEjLatex) {
                andraInnehallerLatex(subject, InnehallerLatexEntity.SOME);
            }
            else {
                // Ignore
            }
 
        }

Comments