Advertisement
ogre_x

auto07

Feb 23rd, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.38 KB | None | 0 0
  1.     public void apply(ProduktEntity subject) throws LiivApplicationException {
  2.         if(!isLIC(subject)) {
  3.             Set<ArtikelEntity> articlesExporteras = findExporterasArticles(subject.getArtikelSet(), this::exporteras);
  4.  
  5.             boolean innehallerLatex = false;
  6.             boolean innehallerEjLatex = false;
  7.  
  8.             for (ArtikelEntity artikel : articlesExporteras) {
  9.                 if (artikel.getInnehallerLatex() == null) {
  10.                     // Omöjligt. latex är obligatoriskt om artikeln exporteras.
  11.                     // Avbryt beräkning
  12.                     return;
  13.                 }
  14.                 else if (YesNoEntity.TRUE.equals(artikel.getInnehallerLatex())) {
  15.                     innehallerLatex = true;
  16.                 }
  17.                 else {
  18.                     innehallerEjLatex = true;
  19.                 }
  20.  
  21.             }
  22.  
  23.             if (innehallerLatex && !innehallerEjLatex) {
  24.                 andraInnehallerLatex(subject, InnehallerLatexEntity.YES);
  25.             }
  26.             else if (!innehallerLatex && innehallerEjLatex) {
  27.                 andraInnehallerLatex(subject, InnehallerLatexEntity.NO);
  28.             }
  29.             else if (innehallerLatex && innehallerEjLatex) {
  30.                 andraInnehallerLatex(subject, InnehallerLatexEntity.SOME);
  31.             }
  32.             else {
  33.                 // Ignore
  34.             }
  35.  
  36.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement