Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement