Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
-
00213e9a
by Tony Chemit at 2020-11-25T15:47:50+01:00
-
be2566af
by Tony Chemit at 2021-01-14T21:43:47+01:00
2 changed files:
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/longline/BranchlineUIHandler.java
- common-persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaIdFactory.java
Changes:
| ... | ... | @@ -270,7 +270,7 @@ public class BranchlineUIHandler extends ContentUIHandler<BranchlineDto, Branchl |
| 270 | 270 |
Calendar calendar = Calendar.getInstance();
|
| 271 | 271 |
calendar.setTime(getModel().getTimeSinceContact());
|
| 272 | 272 |
int minutes = calendar.get(Calendar.MINUTE);
|
| 273 |
- int hours = calendar.get(Calendar.HOUR);
|
|
| 273 |
+ int hours = calendar.get(Calendar.HOUR_OF_DAY);
|
|
| 274 | 274 |
beanToSave.setTimeSinceContact(minutes + 60L * hours);
|
| 275 | 275 |
} else {
|
| 276 | 276 |
beanToSave.setTimeSinceContact(null);
|
| ... | ... | @@ -29,6 +29,8 @@ import org.apache.logging.log4j.Logger; |
| 29 | 29 |
import org.nuiton.topia.persistence.TopiaEntity;
|
| 30 | 30 |
import org.nuiton.topia.persistence.internal.LegacyTopiaIdFactory;
|
| 31 | 31 |
|
| 32 |
+import java.util.Objects;
|
|
| 33 |
+ |
|
| 32 | 34 |
/**
|
| 33 | 35 |
* Created on 21/08/15.
|
| 34 | 36 |
*
|
| ... | ... | @@ -54,10 +56,10 @@ public class ObserveTopiaIdFactory extends LegacyTopiaIdFactory { |
| 54 | 56 |
if (str != null && !str.endsWith(getSeparator())) {
|
| 55 | 57 |
String[] split = str.split(getSeparator());
|
| 56 | 58 |
if (split.length == 3) {
|
| 57 |
- String className = split[0];
|
|
| 58 |
- isTopiaId = entityClass.getName().equals(className);
|
|
| 59 |
- for (int index = 1; index < split.length; index++) {
|
|
| 60 |
- isTopiaId &= StringUtils.isNumeric(split[index]);
|
|
| 59 |
+ isTopiaId = Objects.equals(entityClass, getClassName(str));
|
|
| 60 |
+ for (int index = 1; isTopiaId && index < split.length; index++) {
|
|
| 61 |
+ String part = split[index];
|
|
| 62 |
+ isTopiaId = !part.endsWith(".") && StringUtils.isNumeric(part.replace(".", ""));
|
|
| 61 | 63 |
}
|
| 62 | 64 |
}
|
| 63 | 65 |
}
|