branch feature/2263 updated (44b8232 -> e2e361a)
This is an automated email from the git hooks/post-receive script. New change to branch feature/2263 in repository wao. See http://git.codelutin.com/wao.git from 44b8232 Pour les coordinateurs et les observateurs, on affiche que les lignes du plan d'échantillonnage de l'organisation new e2e361a Dans la scléro, on utilise pas la notion de Profession The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit e2e361a595fc675c909553ec5aea137a804a2eb7 Author: Brendan Le Ny <bleny@codelutin.com> Date: Mon Dec 22 11:15:09 2014 +0100 Dans la scléro, on utilise pas la notion de Profession Summary of changes: .../main/java/fr/ifremer/wao/entity/SampleRowImpl.java | 15 ++++++++------- .../fr/ifremer/wao/services/service/SamplingPlan.java | 14 +++++++++----- .../ifremer/wao/services/service/SamplingPlanService.java | 11 +++++------ .../csv/ObsMerObsVenteSamplingPlanImportExportModel.java | 4 +++- 4 files changed, 25 insertions(+), 19 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/2263 in repository wao. See http://git.codelutin.com/wao.git commit e2e361a595fc675c909553ec5aea137a804a2eb7 Author: Brendan Le Ny <bleny@codelutin.com> Date: Mon Dec 22 11:15:09 2014 +0100 Dans la scléro, on utilise pas la notion de Profession --- .../main/java/fr/ifremer/wao/entity/SampleRowImpl.java | 15 ++++++++------- .../fr/ifremer/wao/services/service/SamplingPlan.java | 14 +++++++++----- .../ifremer/wao/services/service/SamplingPlanService.java | 11 +++++------ .../csv/ObsMerObsVenteSamplingPlanImportExportModel.java | 4 +++- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowImpl.java b/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowImpl.java index e5d10c9..ce002fc 100644 --- a/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowImpl.java +++ b/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowImpl.java @@ -155,15 +155,16 @@ public class SampleRowImpl extends SampleRowAbstract { @Override public String getProfessionDescriptionWithoutDcf5() { String code = ""; - if (getProfession() != null) { - if (!StringUtils.isEmpty(getProfession().getMeshSize())) { - code += " " + getProfession().getMeshSize(); + Profession profession = getProfession(); + if (profession != null) { + if (!StringUtils.isEmpty(profession.getMeshSize())) { + code += " " + profession.getMeshSize(); } - if (!StringUtils.isEmpty(getProfession().getSize())) { - code += " " + getProfession().getSize(); + if (!StringUtils.isEmpty(profession.getSize())) { + code += " " + profession.getSize(); } - if (!StringUtils.isEmpty(getProfession().getOther())) { - code += " " + getProfession().getOther(); + if (!StringUtils.isEmpty(profession.getOther())) { + code += " " + profession.getOther(); } } return code; diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/SamplingPlan.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/SamplingPlan.java index 47eb232..d2f7b41 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/SamplingPlan.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/SamplingPlan.java @@ -24,6 +24,7 @@ package fr.ifremer.wao.services.service; import fr.ifremer.wao.WaoUtils; import fr.ifremer.wao.entity.Dcf5Code; import fr.ifremer.wao.entity.FishingZone; +import fr.ifremer.wao.entity.Profession; import fr.ifremer.wao.entity.SampleMonth; import fr.ifremer.wao.entity.SampleRow; import fr.ifremer.wao.entity.SampleRowLog; @@ -394,11 +395,14 @@ public abstract class SamplingPlan implements Iterable<SamplingPlan.SamplingPlan periodEnd = sampleRow.getPeriodEnd(); companyName = sampleRow.getCompany().getName(); code = sampleRow.getCode(); - professionMeshSize = sampleRow.getProfession().getMeshSize(); - professionSize = sampleRow.getProfession().getSize(); - professionOther = sampleRow.getProfession().getOther(); - professionLibelle = sampleRow.getProfession().getLibelle(); - professionSpecies = sampleRow.getProfession().getSpecies(); + Profession profession = sampleRow.getProfession(); + if (profession != null) { + professionMeshSize = profession.getMeshSize(); + professionSize = profession.getSize(); + professionOther = profession.getOther(); + professionLibelle = profession.getLibelle(); + professionSpecies = profession.getSpecies(); + } dcf5CodesAndDescriptions = new LinkedHashMap<>(); for (Dcf5Code dcf5Code : sampleRow.getDcf5Code()) { String key = dcf5Code.getCode(); diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/SamplingPlanService.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/SamplingPlanService.java index 2376fb1..87495c6 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/SamplingPlanService.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/SamplingPlanService.java @@ -333,7 +333,9 @@ public class SamplingPlanService extends WaoServiceSupport { SampleRow newSampleRow = new SampleRowImpl(); newSampleRow.setObsProgram(obsProgram); - newSampleRow.setProfession(new ProfessionImpl()); + if (obsProgram.isObsMer() || obsProgram.isObsVente()) { + newSampleRow.setProfession(new ProfessionImpl()); + } newSampleRow.setFishingZone(new HashSet<FishingZone>()); newSampleRow.setSampleMonth(new HashSet<SampleMonth>()); @@ -508,12 +510,9 @@ public class SamplingPlanService extends WaoServiceSupport { } } - ProfessionTopiaDao professionDao = getProfessionDao(); Profession profession = sampleRow.getProfession(); - if (profession.isPersisted()) { - professionDao.update(profession); - } else { - professionDao.create(profession); + if (profession != null) { + getProfessionDao().save(profession); } SampleRowTopiaDao dao = getSampleRowDao(); diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModel.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModel.java index 54204a6..5723088 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModel.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModel.java @@ -189,7 +189,9 @@ public class ObsMerObsVenteSamplingPlanImportExportModel implements ImportExport public SampleRow newEmptyInstance() { SampleRow newSampleRow = new SampleRowImpl(); newSampleRow.setObsProgram(obsProgram); - newSampleRow.setProfession(new ProfessionImpl()); + if (obsProgram.isObsMer() || obsProgram.isObsVente()) { + newSampleRow.setProfession(new ProfessionImpl()); + } return newSampleRow; } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm