Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
7ac51b1a
by Tony CHEMIT at 2017-08-04T00:01:05+02:00
14 changed files:
- client/src/main/java/fr/ird/observe/client/ui/content/impl/seine/FloatingObjectUI.jaxx
- client/src/main/java/fr/ird/observe/client/ui/content/impl/seine/FloatingObjectUI.jcss
- client/src/main/java/fr/ird/observe/client/ui/content/impl/seine/FloatingObjectUIModel.java
- persistence/src/main/models/Observe.model
- persistence/src/main/resources/db/migration/6.901/08_add_floating_object_fields-common.sql
- services-topia/src/main/java/fr/ird/observe/services/binder/data/seine/FloatingObjectBinder.java
- services-topia/src/main/java/fr/ird/observe/services/topia/service/actions/consolidate/ConsolidateActivitySeineDataResultBuilder.java
- services-topia/src/main/java/fr/ird/observe/services/topia/service/actions/consolidate/ConsolidateDataServiceTopia.java
- services/src/main/models/Observe.model
- test/src/main/resources/db/6.902/dataForTestLongline.sql.gz
- test/src/main/resources/db/6.902/dataForTestSeine.sql.gz
- test/src/main/resources/db/6.902/empty_h2.sql.gz
- test/src/main/resources/db/6.902/empty_pg.sql.gz
- test/src/main/resources/db/6.902/referentiel.sql.gz
Changes:
| ... | ... | @@ -112,26 +112,46 @@ |
| 112 | 112 |
<Table id="computedPanel" fill="both" weightx="1">
|
| 113 | 113 |
<row>
|
| 114 | 114 |
<cell anchor="west">
|
| 115 |
+ <JLabel/>
|
|
| 116 |
+ </cell>
|
|
| 117 |
+ <cell weightx="0.5" fill="both">
|
|
| 118 |
+ <JLabel text="observe.common.whenArriving"/>
|
|
| 119 |
+ </cell>
|
|
| 120 |
+ <cell weightx="0.5" fill="both">
|
|
| 121 |
+ <JLabel text="observe.common.whenLeaving"/>
|
|
| 122 |
+ </cell>
|
|
| 123 |
+ </row>
|
|
| 124 |
+ <row>
|
|
| 125 |
+ <cell anchor="west">
|
|
| 115 | 126 |
<JLabel id='computedBiodegradableLabel'/>
|
| 116 | 127 |
</cell>
|
| 117 |
- <cell anchor='east' weightx="1" fill="both">
|
|
| 118 |
- <JLabel id='computedBiodegradable'/>
|
|
| 128 |
+ <cell weightx="0.5" fill="both">
|
|
| 129 |
+ <JLabel id='computedWhenArrivingBiodegradable'/>
|
|
| 130 |
+ </cell>
|
|
| 131 |
+ <cell weightx="0.5" fill="both">
|
|
| 132 |
+ <JLabel id='computedWhenLeavingBiodegradable'/>
|
|
| 119 | 133 |
</cell>
|
| 120 | 134 |
</row>
|
| 121 | 135 |
<row>
|
| 122 | 136 |
<cell anchor="west">
|
| 123 | 137 |
<JLabel id='computedNonEntanglingLabel'/>
|
| 124 | 138 |
</cell>
|
| 125 |
- <cell anchor='east' weightx="1" fill="both">
|
|
| 126 |
- <JLabel id='computedNonEntangling'/>
|
|
| 139 |
+ <cell weightx="0.5" fill="both">
|
|
| 140 |
+ <JLabel id='computedWhenArrivingNonEntangling'/>
|
|
| 141 |
+ </cell>
|
|
| 142 |
+ <cell weightx="0.5" fill="both">
|
|
| 143 |
+ <JLabel id='computedWhenLeavingNonEntangling'/>
|
|
| 127 | 144 |
</cell>
|
| 128 | 145 |
</row>
|
| 129 | 146 |
<row>
|
| 130 | 147 |
<cell anchor="west">
|
| 131 | 148 |
<JLabel id='computedSimplifiedObjectTypeLabel'/>
|
| 132 | 149 |
</cell>
|
| 133 |
- <cell anchor='east' weightx="1" fill="both">
|
|
| 134 |
- <JLabel id='computedSimplifiedObjectType'/>
|
|
| 150 |
+ <cell weightx="0.5" fill="both">
|
|
| 151 |
+ <JLabel id='computedWhenArrivingSimplifiedObjectType'/>
|
|
| 152 |
+ </cell>
|
|
| 153 |
+ <cell weightx="0.5" fill="both">
|
|
| 154 |
+ <JLabel id='computedWhenLeavingSimplifiedObjectType'/>
|
|
| 135 | 155 |
</cell>
|
| 136 | 156 |
</row>
|
| 137 | 157 |
</Table>
|
| ... | ... | @@ -75,31 +75,43 @@ BeanComboBox { |
| 75 | 75 |
}
|
| 76 | 76 |
#computedBiodegradableLabel {
|
| 77 | 77 |
text:"observe.common.computedBiodegradable";
|
| 78 |
- labelFor:{computedBiodegradable};
|
|
| 79 | 78 |
}
|
| 80 | 79 |
|
| 81 |
-#computedBiodegradable {
|
|
| 82 |
- text:{model.getComputedBiodegradableValue()};
|
|
| 80 |
+#computedNonEntanglingLabel {
|
|
| 81 |
+ text:"observe.common.computedNonEntangling";
|
|
| 82 |
+}
|
|
| 83 |
+ |
|
| 84 |
+#computedSimplifiedObjectTypeLabel {
|
|
| 85 |
+ text:"observe.common.computedSimplifiedObjectType";
|
|
| 86 |
+}
|
|
| 87 |
+ |
|
| 88 |
+#computedWhenArrivingBiodegradable {
|
|
| 89 |
+ text:{model.getComputedWhenArrivingBiodegradableValue()};
|
|
| 83 | 90 |
font-weight:bold;
|
| 84 | 91 |
}
|
| 85 | 92 |
|
| 86 |
-#computedNonEntanglingLabel {
|
|
| 87 |
- text:"observe.common.computedNonEntangling";
|
|
| 88 |
- labelFor:{computedNonEntangling};
|
|
| 93 |
+#computedWhenArrivingNonEntangling {
|
|
| 94 |
+ text:{model.getComputedWhenArrivingNonEntanglingValue()};
|
|
| 95 |
+ font-weight:bold;
|
|
| 89 | 96 |
}
|
| 90 | 97 |
|
| 91 |
-#computedNonEntangling {
|
|
| 92 |
- text:{model.getComputedNonEntanglingValue()};
|
|
| 98 |
+#computedWhenArrivingSimplifiedObjectType {
|
|
| 99 |
+ text:{model.getComputedWhenArrivingSimplifiedObjectTypeValue()};
|
|
| 93 | 100 |
font-weight:bold;
|
| 94 | 101 |
}
|
| 95 | 102 |
|
| 96 |
-#computedSimplifiedObjectTypeLabel {
|
|
| 97 |
- text:"observe.common.computedSimplifiedObjectType";
|
|
| 98 |
- labelFor:{computedSimplifiedObjectType};
|
|
| 103 |
+#computedWhenLeavingBiodegradable {
|
|
| 104 |
+ text:{model.getComputedWhenLeavingBiodegradableValue()};
|
|
| 105 |
+ font-weight:bold;
|
|
| 106 |
+}
|
|
| 107 |
+ |
|
| 108 |
+#computedWhenLeavingNonEntangling {
|
|
| 109 |
+ text:{model.getComputedWhenLeavingNonEntanglingValue()};
|
|
| 110 |
+ font-weight:bold;
|
|
| 99 | 111 |
}
|
| 100 | 112 |
|
| 101 |
-#computedSimplifiedObjectType {
|
|
| 102 |
- text:{model.getComputedSimplifiedObjectTypeValue()};
|
|
| 113 |
+#computedWhenLeavingSimplifiedObjectType {
|
|
| 114 |
+ text:{model.getComputedWhenLeavingSimplifiedObjectTypeValue()};
|
|
| 103 | 115 |
font-weight:bold;
|
| 104 | 116 |
}
|
| 105 | 117 |
|
| ... | ... | @@ -116,7 +116,6 @@ public class FloatingObjectUIModel extends ContentUIModel<FloatingObjectDto> { |
| 116 | 116 |
firePropertyChange(PROPERTY_GENERAL_TAB_VALID, oldValue, generalTabValid);
|
| 117 | 117 |
}
|
| 118 | 118 |
|
| 119 |
- |
|
| 120 | 119 |
ImmutableSet<FloatingObjectPartDto> toParts() {
|
| 121 | 120 |
ImmutableSet.Builder<FloatingObjectPartDto> result = ImmutableSet.builder();
|
| 122 | 121 |
for (ObjectMaterialDto o : getAll()) {
|
| ... | ... | @@ -136,9 +135,12 @@ public class FloatingObjectUIModel extends ContentUIModel<FloatingObjectDto> { |
| 136 | 135 |
public void reset() {
|
| 137 | 136 |
whenArriving.clear();
|
| 138 | 137 |
whenLeaving.clear();
|
| 139 |
- firePropertyChange("computedBiodegradableValue", getComputedBiodegradableValue());
|
|
| 140 |
- firePropertyChange("computedNonEntanglingValue", getComputedNonEntanglingValue());
|
|
| 141 |
- firePropertyChange("computedSimplifiedObjectTypeValue", getComputedSimplifiedObjectTypeValue());
|
|
| 138 |
+ firePropertyChange("computedWhenArrivingBiodegradableValue", getComputedWhenArrivingBiodegradableValue());
|
|
| 139 |
+ firePropertyChange("computedWhenArrivingNonEntanglingValue", getComputedWhenArrivingNonEntanglingValue());
|
|
| 140 |
+ firePropertyChange("computedWhenArrivingSimplifiedObjectTypeValue", getComputedWhenArrivingSimplifiedObjectTypeValue());
|
|
| 141 |
+ firePropertyChange("computedWhenLeavingBiodegradableValue", getComputedWhenLeavingBiodegradableValue());
|
|
| 142 |
+ firePropertyChange("computedWhenLeavingNonEntanglingValue", getComputedWhenLeavingNonEntanglingValue());
|
|
| 143 |
+ firePropertyChange("computedWhenLeavingSimplifiedObjectTypeValue", getComputedWhenLeavingSimplifiedObjectTypeValue());
|
|
| 142 | 144 |
}
|
| 143 | 145 |
|
| 144 | 146 |
public Map<ObjectMaterialDto, String> getWhenArriving() {
|
| ... | ... | @@ -192,23 +194,40 @@ public class FloatingObjectUIModel extends ContentUIModel<FloatingObjectDto> { |
| 192 | 194 |
firePropertyChange(PROPERTY_REFERENCE, null, reference);
|
| 193 | 195 |
}
|
| 194 | 196 |
|
| 195 |
- public String getComputedBiodegradableValue() {
|
|
| 196 |
- return booleanValue(bean.getComputedBiodegradable());
|
|
| 197 |
+ public String getComputedWhenArrivingBiodegradableValue() {
|
|
| 198 |
+ return booleanValue(bean.getComputedWhenArrivingBiodegradable());
|
|
| 199 |
+ }
|
|
| 200 |
+ |
|
| 201 |
+ public String getComputedWhenArrivingNonEntanglingValue() {
|
|
| 202 |
+ return booleanValue(bean.getComputedWhenArrivingNonEntangling());
|
|
| 203 |
+ }
|
|
| 204 |
+ |
|
| 205 |
+ public String getComputedWhenArrivingSimplifiedObjectTypeValue() {
|
|
| 206 |
+ String computedSimplifiedObjectType = bean.getComputedWhenArrivingSimplifiedObjectType();
|
|
| 207 |
+ return stringValue(computedSimplifiedObjectType);
|
|
| 197 | 208 |
}
|
| 198 | 209 |
|
| 199 |
- public String getComputedNonEntanglingValue() {
|
|
| 200 |
- return booleanValue(bean.getComputedNonEntangling());
|
|
| 210 |
+ public String getComputedWhenLeavingBiodegradableValue() {
|
|
| 211 |
+ return booleanValue(bean.getComputedWhenLeavingBiodegradable());
|
|
| 201 | 212 |
}
|
| 202 | 213 |
|
| 203 |
- public String getComputedSimplifiedObjectTypeValue() {
|
|
| 204 |
- String computedSimplifiedObjectType = bean.getComputedSimplifiedObjectType();
|
|
| 205 |
- return computedSimplifiedObjectType == null ? t("observe.common.notComputed") : computedSimplifiedObjectType;
|
|
| 214 |
+ public String getComputedWhenLeavingNonEntanglingValue() {
|
|
| 215 |
+ return booleanValue(bean.getComputedWhenLeavingNonEntangling());
|
|
| 216 |
+ }
|
|
| 217 |
+ |
|
| 218 |
+ public String getComputedWhenLeavingSimplifiedObjectTypeValue() {
|
|
| 219 |
+ String computedSimplifiedObjectType = bean.getComputedWhenLeavingSimplifiedObjectType();
|
|
| 220 |
+ return stringValue(computedSimplifiedObjectType);
|
|
| 206 | 221 |
}
|
| 207 | 222 |
|
| 208 | 223 |
private String booleanValue(DcpComputedValue value) {
|
| 209 | 224 |
return value == null ? t("observe.common.notComputed") : I18nEnumHelper.getLabel(value);
|
| 210 | 225 |
}
|
| 211 | 226 |
|
| 227 |
+ private String stringValue(String value) {
|
|
| 228 |
+ return value == null ? t("observe.common.notComputed") : value;
|
|
| 229 |
+ }
|
|
| 230 |
+ |
|
| 212 | 231 |
public boolean isArriving() {
|
| 213 | 232 |
return arriving;
|
| 214 | 233 |
}
|
| ... | ... | @@ -732,9 +732,12 @@ objectOperation {*:1} referentiel.seine.ObjectOperation |
| 732 | 732 |
supportVesselName + {*:1} String
|
| 733 | 733 |
transmittingBuoy + {*} seine.TransmittingBuoy | unique
|
| 734 | 734 |
floatingObjectPart + {*} seine.FloatingObjectPart | unique
|
| 735 |
-computedBiodegradable + {*:1} !fr.ird.observe.common.constants.seine.DcpComputedValue | useEnumerationName
|
|
| 736 |
-computedNonEntangling + {*:1} !fr.ird.observe.common.constants.seine.DcpComputedValue | useEnumerationName
|
|
| 737 |
-computedSimplifiedObjectType + {*:1} String
|
|
| 735 |
+computedWhenArrivingBiodegradable + {*:1} !fr.ird.observe.common.constants.seine.DcpComputedValue | useEnumerationName
|
|
| 736 |
+computedWhenArrivingNonEntangling + {*:1} !fr.ird.observe.common.constants.seine.DcpComputedValue | useEnumerationName
|
|
| 737 |
+computedWhenArrivingSimplifiedObjectType + {*:1} String
|
|
| 738 |
+computedWhenLeavingBiodegradable + {*:1} !fr.ird.observe.common.constants.seine.DcpComputedValue | useEnumerationName
|
|
| 739 |
+computedWhenLeavingNonEntangling + {*:1} !fr.ird.observe.common.constants.seine.DcpComputedValue | useEnumerationName
|
|
| 740 |
+computedWhenLeavingSimplifiedObjectType + {*:1} String
|
|
| 738 | 741 |
getTypeTransmittingBuoyOperation() !fr.ird.observe.common.constants.seine.TypeTransmittingBuoyOperation
|
| 739 | 742 |
|
| 740 | 743 |
seine.FloatingObjectPart > ObserveDataEntity | entity
|
| ... | ... | @@ -19,6 +19,9 @@ |
| 19 | 19 |
-- <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 |
-- #L%
|
| 21 | 21 |
---
|
| 22 |
-ALTER TABLE observe_seine.FloatingObject ADD COLUMN computedBiodegradable VARCHAR(255);
|
|
| 23 |
-ALTER TABLE observe_seine.FloatingObject ADD COLUMN computedNonEntangling VARCHAR(255);
|
|
| 24 |
-ALTER TABLE observe_seine.FloatingObject ADD COLUMN computedSimplifiedObjectType VARCHAR(255);
|
|
| 22 |
+ALTER TABLE observe_seine.FloatingObject ADD COLUMN computedWhenArrivingBiodegradable VARCHAR(255);
|
|
| 23 |
+ALTER TABLE observe_seine.FloatingObject ADD COLUMN computedWhenArrivingNonEntangling VARCHAR(255);
|
|
| 24 |
+ALTER TABLE observe_seine.FloatingObject ADD COLUMN computedWhenArrivingSimplifiedObjectType VARCHAR(255);
|
|
| 25 |
+ALTER TABLE observe_seine.FloatingObject ADD COLUMN computedWhenLeavingBiodegradable VARCHAR(255);
|
|
| 26 |
+ALTER TABLE observe_seine.FloatingObject ADD COLUMN computedWhenLeavingNonEntangling VARCHAR(255);
|
|
| 27 |
+ALTER TABLE observe_seine.FloatingObject ADD COLUMN computedWhenLeavingSimplifiedObjectType VARCHAR(255);
|
| ... | ... | @@ -48,9 +48,12 @@ public class FloatingObjectBinder extends DataBinderSupport<FloatingObject, Floa |
| 48 | 48 |
|
| 49 | 49 |
entity.setObjectOperation(toEntity(dto.getObjectOperation(), ObjectOperation.class));
|
| 50 | 50 |
entity.setSupportVesselName(dto.getSupportVesselName());
|
| 51 |
- entity.setComputedBiodegradable(dto.getComputedBiodegradable());
|
|
| 52 |
- entity.setComputedNonEntangling(dto.getComputedNonEntangling());
|
|
| 53 |
- entity.setComputedSimplifiedObjectType(dto.getComputedSimplifiedObjectType());
|
|
| 51 |
+ entity.setComputedWhenArrivingBiodegradable(dto.getComputedWhenArrivingBiodegradable());
|
|
| 52 |
+ entity.setComputedWhenArrivingNonEntangling(dto.getComputedWhenArrivingNonEntangling());
|
|
| 53 |
+ entity.setComputedWhenArrivingSimplifiedObjectType(dto.getComputedWhenArrivingSimplifiedObjectType());
|
|
| 54 |
+ entity.setComputedWhenLeavingBiodegradable(dto.getComputedWhenLeavingBiodegradable());
|
|
| 55 |
+ entity.setComputedWhenLeavingNonEntangling(dto.getComputedWhenLeavingNonEntangling());
|
|
| 56 |
+ entity.setComputedWhenLeavingSimplifiedObjectType(dto.getComputedWhenLeavingSimplifiedObjectType());
|
|
| 54 | 57 |
|
| 55 | 58 |
}
|
| 56 | 59 |
|
| ... | ... | @@ -61,9 +64,12 @@ public class FloatingObjectBinder extends DataBinderSupport<FloatingObject, Floa |
| 61 | 64 |
|
| 62 | 65 |
dto.setObjectOperation(toReferentialReference(referentialLocale, entity.getObjectOperation(), ObjectOperationDto.class));
|
| 63 | 66 |
dto.setSupportVesselName(entity.getSupportVesselName());
|
| 64 |
- dto.setComputedBiodegradable(entity.getComputedBiodegradable());
|
|
| 65 |
- dto.setComputedNonEntangling(entity.getComputedNonEntangling());
|
|
| 66 |
- dto.setComputedSimplifiedObjectType(entity.getComputedSimplifiedObjectType());
|
|
| 67 |
+ dto.setComputedWhenArrivingBiodegradable(entity.getComputedWhenArrivingBiodegradable());
|
|
| 68 |
+ dto.setComputedWhenArrivingNonEntangling(entity.getComputedWhenArrivingNonEntangling());
|
|
| 69 |
+ dto.setComputedWhenArrivingSimplifiedObjectType(entity.getComputedWhenArrivingSimplifiedObjectType());
|
|
| 70 |
+ dto.setComputedWhenLeavingBiodegradable(entity.getComputedWhenLeavingBiodegradable());
|
|
| 71 |
+ dto.setComputedWhenLeavingNonEntangling(entity.getComputedWhenLeavingNonEntangling());
|
|
| 72 |
+ dto.setComputedWhenLeavingSimplifiedObjectType(entity.getComputedWhenLeavingSimplifiedObjectType());
|
|
| 67 | 73 |
}
|
| 68 | 74 |
|
| 69 | 75 |
|
| ... | ... | @@ -87,35 +87,67 @@ public class ConsolidateActivitySeineDataResultBuilder { |
| 87 | 87 |
String dcpLabel = activitySeine.getVesselActivitySeine().getLabel2() + "[" + activitySeine.getTime() + "]" + " - " + (dcp.getObjectOperation() == null ? "" : dcp.getObjectOperation().getLabel2());
|
| 88 | 88 |
for (String modifiedProperty : propertyNamesModified) {
|
| 89 | 89 |
switch (modifiedProperty) {
|
| 90 |
- case FloatingObject.PROPERTY_COMPUTED_BIODEGRADABLE: {
|
|
| 90 |
+ case FloatingObject.PROPERTY_COMPUTED_WHEN_ARRIVING_BIODEGRADABLE: {
|
|
| 91 | 91 |
|
| 92 | 92 |
DcpModification element = new DcpModification();
|
| 93 | 93 |
element.setDcpId(dcp.getTopiaId());
|
| 94 | 94 |
element.setDcpLabel(dcpLabel);
|
| 95 |
- element.setPropertyName(FloatingObject.PROPERTY_COMPUTED_BIODEGRADABLE);
|
|
| 96 |
- element.setNewValue(dcp.getComputedBiodegradable());
|
|
| 95 |
+ element.setPropertyName(FloatingObject.PROPERTY_COMPUTED_WHEN_ARRIVING_BIODEGRADABLE);
|
|
| 96 |
+ element.setNewValue(dcp.getComputedWhenArrivingBiodegradable());
|
|
| 97 | 97 |
dcpModificationBuilder.add(element);
|
| 98 | 98 |
|
| 99 | 99 |
break;
|
| 100 | 100 |
}
|
| 101 |
- case FloatingObject.PROPERTY_COMPUTED_NON_ENTANGLING: {
|
|
| 101 |
+ case FloatingObject.PROPERTY_COMPUTED_WHEN_ARRIVING_NON_ENTANGLING: {
|
|
| 102 | 102 |
|
| 103 | 103 |
DcpModification element = new DcpModification();
|
| 104 | 104 |
element.setDcpId(dcp.getTopiaId());
|
| 105 | 105 |
element.setDcpLabel(dcpLabel);
|
| 106 |
- element.setPropertyName(FloatingObject.PROPERTY_COMPUTED_NON_ENTANGLING);
|
|
| 107 |
- element.setNewValue(dcp.getComputedNonEntangling());
|
|
| 106 |
+ element.setPropertyName(FloatingObject.PROPERTY_COMPUTED_WHEN_ARRIVING_NON_ENTANGLING);
|
|
| 107 |
+ element.setNewValue(dcp.getComputedWhenArrivingNonEntangling());
|
|
| 108 | 108 |
dcpModificationBuilder.add(element);
|
| 109 | 109 |
|
| 110 | 110 |
break;
|
| 111 | 111 |
}
|
| 112 |
- case FloatingObject.PROPERTY_COMPUTED_SIMPLIFIED_OBJECT_TYPE: {
|
|
| 112 |
+ case FloatingObject.PROPERTY_COMPUTED_WHEN_ARRIVING_SIMPLIFIED_OBJECT_TYPE: {
|
|
| 113 | 113 |
|
| 114 | 114 |
DcpModification element = new DcpModification();
|
| 115 | 115 |
element.setDcpId(dcp.getTopiaId());
|
| 116 | 116 |
element.setDcpLabel(dcpLabel);
|
| 117 |
- element.setPropertyName(FloatingObject.PROPERTY_COMPUTED_SIMPLIFIED_OBJECT_TYPE);
|
|
| 118 |
- element.setNewValue(dcp.getComputedSimplifiedObjectType());
|
|
| 117 |
+ element.setPropertyName(FloatingObject.PROPERTY_COMPUTED_WHEN_ARRIVING_SIMPLIFIED_OBJECT_TYPE);
|
|
| 118 |
+ element.setNewValue(dcp.getComputedWhenArrivingSimplifiedObjectType());
|
|
| 119 |
+ dcpModificationBuilder.add(element);
|
|
| 120 |
+ break;
|
|
| 121 |
+ }
|
|
| 122 |
+ case FloatingObject.PROPERTY_COMPUTED_WHEN_LEAVING_BIODEGRADABLE: {
|
|
| 123 |
+ |
|
| 124 |
+ DcpModification element = new DcpModification();
|
|
| 125 |
+ element.setDcpId(dcp.getTopiaId());
|
|
| 126 |
+ element.setDcpLabel(dcpLabel);
|
|
| 127 |
+ element.setPropertyName(FloatingObject.PROPERTY_COMPUTED_WHEN_LEAVING_BIODEGRADABLE);
|
|
| 128 |
+ element.setNewValue(dcp.getComputedWhenLeavingBiodegradable());
|
|
| 129 |
+ dcpModificationBuilder.add(element);
|
|
| 130 |
+ |
|
| 131 |
+ break;
|
|
| 132 |
+ }
|
|
| 133 |
+ case FloatingObject.PROPERTY_COMPUTED_WHEN_LEAVING_NON_ENTANGLING: {
|
|
| 134 |
+ |
|
| 135 |
+ DcpModification element = new DcpModification();
|
|
| 136 |
+ element.setDcpId(dcp.getTopiaId());
|
|
| 137 |
+ element.setDcpLabel(dcpLabel);
|
|
| 138 |
+ element.setPropertyName(FloatingObject.PROPERTY_COMPUTED_WHEN_LEAVING_NON_ENTANGLING);
|
|
| 139 |
+ element.setNewValue(dcp.getComputedWhenLeavingNonEntangling());
|
|
| 140 |
+ dcpModificationBuilder.add(element);
|
|
| 141 |
+ |
|
| 142 |
+ break;
|
|
| 143 |
+ }
|
|
| 144 |
+ case FloatingObject.PROPERTY_COMPUTED_WHEN_LEAVING_SIMPLIFIED_OBJECT_TYPE: {
|
|
| 145 |
+ |
|
| 146 |
+ DcpModification element = new DcpModification();
|
|
| 147 |
+ element.setDcpId(dcp.getTopiaId());
|
|
| 148 |
+ element.setDcpLabel(dcpLabel);
|
|
| 149 |
+ element.setPropertyName(FloatingObject.PROPERTY_COMPUTED_WHEN_LEAVING_SIMPLIFIED_OBJECT_TYPE);
|
|
| 150 |
+ element.setNewValue(dcp.getComputedWhenLeavingSimplifiedObjectType());
|
|
| 119 | 151 |
dcpModificationBuilder.add(element);
|
| 120 | 152 |
break;
|
| 121 | 153 |
}
|
| ... | ... | @@ -113,9 +113,12 @@ public class ConsolidateDataServiceTopia extends ObserveServiceTopia implements |
| 113 | 113 |
);
|
| 114 | 114 |
|
| 115 | 115 |
BeanMonitor dcpMonitor = new BeanMonitor(
|
| 116 |
- FloatingObject.PROPERTY_COMPUTED_BIODEGRADABLE,
|
|
| 117 |
- FloatingObject.PROPERTY_COMPUTED_NON_ENTANGLING,
|
|
| 118 |
- FloatingObject.PROPERTY_COMPUTED_SIMPLIFIED_OBJECT_TYPE
|
|
| 116 |
+ FloatingObject.PROPERTY_COMPUTED_WHEN_ARRIVING_BIODEGRADABLE,
|
|
| 117 |
+ FloatingObject.PROPERTY_COMPUTED_WHEN_ARRIVING_NON_ENTANGLING,
|
|
| 118 |
+ FloatingObject.PROPERTY_COMPUTED_WHEN_ARRIVING_SIMPLIFIED_OBJECT_TYPE,
|
|
| 119 |
+ FloatingObject.PROPERTY_COMPUTED_WHEN_LEAVING_BIODEGRADABLE,
|
|
| 120 |
+ FloatingObject.PROPERTY_COMPUTED_WHEN_LEAVING_NON_ENTANGLING,
|
|
| 121 |
+ FloatingObject.PROPERTY_COMPUTED_WHEN_LEAVING_SIMPLIFIED_OBJECT_TYPE
|
|
| 119 | 122 |
);
|
| 120 | 123 |
|
| 121 | 124 |
Locale applicationLocale = serviceContext.getApplicationLocale();
|
| ... | ... | @@ -284,46 +287,71 @@ public class ConsolidateDataServiceTopia extends ObserveServiceTopia implements |
| 284 | 287 |
private void updateDcp(FloatingObject dcp, ConsolidationActivitySeineDataContext activityContext) {
|
| 285 | 288 |
activityContext.watchDcp(dcp);
|
| 286 | 289 |
|
| 287 |
- computeDcpBiodegradable(dcp);
|
|
| 288 |
- computeDcpNonEntangling(dcp);
|
|
| 289 |
- computeDcpSimplifiedObjectType(dcp, activityContext.simplifiedObjectTypeManager);
|
|
| 290 |
+ Set<FloatingObjectPart> whenArriving = dcp.getFloatingObjectPart().stream().filter(p -> p.getWhenArriving() != null).collect(Collectors.toSet());
|
|
| 291 |
+ Set<FloatingObjectPart> whenLeaving = dcp.getFloatingObjectPart().stream().filter(p -> p.getWhenLeaving() != null).collect(Collectors.toSet());
|
|
| 292 |
+ computeDcpBiodegradable(dcp, whenArriving, whenLeaving);
|
|
| 293 |
+ computeDcpNonEntangling(dcp, whenArriving, whenLeaving);
|
|
| 294 |
+ computeDcpSimplifiedObjectType(dcp, whenArriving, whenLeaving, activityContext.simplifiedObjectTypeManager);
|
|
| 290 | 295 |
|
| 291 | 296 |
activityContext.flushDcp();
|
| 292 | 297 |
|
| 293 | 298 |
}
|
| 294 | 299 |
|
| 295 |
- private void computeDcpSimplifiedObjectType(FloatingObject dcp, SimplifiedObjectTypeManager simplifiedObjectTypeManager) {
|
|
| 296 |
- Set<String> objectMaterialIds = dcp.getFloatingObjectPart().stream().map(p -> p.getObjectMaterial().getTopiaId()).collect(Collectors.toSet());
|
|
| 297 |
- String value = simplifiedObjectTypeManager.getStandardCode(objectMaterialIds);
|
|
| 298 |
- dcp.setComputedSimplifiedObjectType(value);
|
|
| 300 |
+ private void computeDcpSimplifiedObjectType(FloatingObject dcp, Set<FloatingObjectPart> whenArriving, Set<FloatingObjectPart> whenLeaving, SimplifiedObjectTypeManager simplifiedObjectTypeManager) {
|
|
| 301 |
+ String whenArrivingValue = computeDcpSimplifiedObjectType0(whenArriving, simplifiedObjectTypeManager);
|
|
| 302 |
+ dcp.setComputedWhenArrivingSimplifiedObjectType(whenArrivingValue);
|
|
| 303 |
+ |
|
| 304 |
+ String whenLeavingValue = computeDcpSimplifiedObjectType0(whenLeaving, simplifiedObjectTypeManager);
|
|
| 305 |
+ dcp.setComputedWhenLeavingSimplifiedObjectType(whenLeavingValue);
|
|
| 299 | 306 |
}
|
| 300 | 307 |
|
| 301 |
- private void computeDcpNonEntangling(FloatingObject dcp) {
|
|
| 302 |
- DcpComputedValue value = DcpComputedValue.UNKNOWN;
|
|
| 303 |
- if (dcp.isFloatingObjectPartNotEmpty()) {
|
|
| 304 |
- value = DcpComputedValue.TRUE;
|
|
| 305 |
- for (FloatingObjectPart floatingObjectPart : dcp.getFloatingObjectPart()) {
|
|
| 306 |
- if (!floatingObjectPart.getObjectMaterial().isNonEntangling()) {
|
|
| 307 |
- value = DcpComputedValue.FALSE;
|
|
| 308 |
+ private void computeDcpNonEntangling(FloatingObject dcp, Set<FloatingObjectPart> whenArriving, Set<FloatingObjectPart> whenLeaving) {
|
|
| 309 |
+ DcpComputedValue whenArrivingValue = computeDcpNonEntangling0(whenArriving);
|
|
| 310 |
+ dcp.setComputedWhenArrivingNonEntangling(whenArrivingValue);
|
|
| 311 |
+ |
|
| 312 |
+ DcpComputedValue whenLeavingValue = computeDcpNonEntangling0(whenLeaving);
|
|
| 313 |
+ dcp.setComputedWhenLeavingNonEntangling(whenLeavingValue);
|
|
| 314 |
+ }
|
|
| 315 |
+ |
|
| 316 |
+ private void computeDcpBiodegradable(FloatingObject dcp, Set<FloatingObjectPart> whenArriving, Set<FloatingObjectPart> whenLeaving) {
|
|
| 317 |
+ DcpComputedValue whenArrivingValue = computeDcpBiodegradable0(whenArriving);
|
|
| 318 |
+ dcp.setComputedWhenArrivingBiodegradable(whenArrivingValue);
|
|
| 319 |
+ |
|
| 320 |
+ DcpComputedValue whenLeavingValue = computeDcpBiodegradable0(whenLeaving);
|
|
| 321 |
+ dcp.setComputedWhenLeavingBiodegradable(whenLeavingValue);
|
|
| 322 |
+ }
|
|
| 323 |
+ |
|
| 324 |
+ private DcpComputedValue computeDcpBiodegradable0(Set<FloatingObjectPart> floatingObjectParts) {
|
|
| 325 |
+ DcpComputedValue result = DcpComputedValue.UNKNOWN;
|
|
| 326 |
+ if (!floatingObjectParts.isEmpty()) {
|
|
| 327 |
+ result = DcpComputedValue.TRUE;
|
|
| 328 |
+ for (FloatingObjectPart floatingObjectPart : floatingObjectParts) {
|
|
| 329 |
+ if (!floatingObjectPart.getObjectMaterial().isBiodegradable()) {
|
|
| 330 |
+ result = DcpComputedValue.FALSE;
|
|
| 308 | 331 |
break;
|
| 309 | 332 |
}
|
| 310 | 333 |
}
|
| 311 | 334 |
}
|
| 312 |
- dcp.setComputedNonEntangling(value);
|
|
| 335 |
+ return result;
|
|
| 313 | 336 |
}
|
| 314 | 337 |
|
| 315 |
- private void computeDcpBiodegradable(FloatingObject dcp) {
|
|
| 316 |
- DcpComputedValue value = DcpComputedValue.UNKNOWN;
|
|
| 317 |
- if (dcp.isFloatingObjectPartNotEmpty()) {
|
|
| 318 |
- value = DcpComputedValue.TRUE;
|
|
| 319 |
- for (FloatingObjectPart floatingObjectPart : dcp.getFloatingObjectPart()) {
|
|
| 320 |
- if (!floatingObjectPart.getObjectMaterial().isBiodegradable()) {
|
|
| 321 |
- value = DcpComputedValue.FALSE;
|
|
| 338 |
+ private String computeDcpSimplifiedObjectType0(Set<FloatingObjectPart> floatingObjectParts, SimplifiedObjectTypeManager simplifiedObjectTypeManager) {
|
|
| 339 |
+ Set<String> objectMaterialIds = floatingObjectParts.stream().map(p -> p.getObjectMaterial().getTopiaId()).collect(Collectors.toSet());
|
|
| 340 |
+ return simplifiedObjectTypeManager.getStandardCode(objectMaterialIds);
|
|
| 341 |
+ }
|
|
| 342 |
+ |
|
| 343 |
+ private DcpComputedValue computeDcpNonEntangling0(Set<FloatingObjectPart> floatingObjectParts) {
|
|
| 344 |
+ DcpComputedValue result = DcpComputedValue.UNKNOWN;
|
|
| 345 |
+ if (!floatingObjectParts.isEmpty()) {
|
|
| 346 |
+ result = DcpComputedValue.TRUE;
|
|
| 347 |
+ for (FloatingObjectPart floatingObjectPart : floatingObjectParts) {
|
|
| 348 |
+ if (!floatingObjectPart.getObjectMaterial().isNonEntangling()) {
|
|
| 349 |
+ result = DcpComputedValue.FALSE;
|
|
| 322 | 350 |
break;
|
| 323 | 351 |
}
|
| 324 | 352 |
}
|
| 325 | 353 |
}
|
| 326 |
- dcp.setComputedBiodegradable(value);
|
|
| 354 |
+ return result;
|
|
| 327 | 355 |
}
|
| 328 | 356 |
|
| 329 | 357 |
private void updateNonTargetCatch(ConsolidationActivitySeineDataContext activityContext, NonTargetCatch nonTargetCatch) {
|
| ... | ... | @@ -622,12 +622,12 @@ activityFinDeVeille + {*:1} boolean |
| 622 | 622 |
seine.FloatingObject > Commentable
|
| 623 | 623 |
objectOperation {*:1} reference.ReferentialReference | attributeGeneric=fr.ird.observe.services.dto.referential.seine.ObjectOperationDto
|
| 624 | 624 |
supportVesselName + {*:1} String
|
| 625 |
-computedBiodegradable + {*:1} !fr.ird.observe.common.constants.seine.DcpComputedValue
|
|
| 626 |
-computedNonEntangling + {*:1} !fr.ird.observe.common.constants.seine.DcpComputedValue
|
|
| 627 |
-computedSimplifiedObjectType + {*:1} String
|
|
| 628 |
-getComputedBiodegradableValue() String
|
|
| 629 |
-getComputedNonEntanglingValue() String
|
|
| 630 |
-getComputedSimplifiedObjectTypeValue() String
|
|
| 625 |
+computedWhenArrivingBiodegradable + {*:1} !fr.ird.observe.common.constants.seine.DcpComputedValue
|
|
| 626 |
+computedWhenArrivingNonEntangling + {*:1} !fr.ird.observe.common.constants.seine.DcpComputedValue
|
|
| 627 |
+computedWhenArrivingSimplifiedObjectType + {*:1} String
|
|
| 628 |
+computedWhenLeavingBiodegradable + {*:1} !fr.ird.observe.common.constants.seine.DcpComputedValue
|
|
| 629 |
+computedWhenLeavingNonEntangling + {*:1} !fr.ird.observe.common.constants.seine.DcpComputedValue
|
|
| 630 |
+computedWhenLeavingSimplifiedObjectType + {*:1} String
|
|
| 631 | 631 |
|
| 632 | 632 |
seine.FloatingObjectObservedSpecies > Commentable
|
| 633 | 633 |
objectObservedSpecies {*} seine.ObjectObservedSpecies
|
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type