Fix Nomenclature matching by adding suffix comparison and optimize declarableCode check.
This commit is contained in:
parent
87cf07fb88
commit
8afdefe8d4
1 changed files with 2 additions and 2 deletions
|
|
@ -43,7 +43,7 @@ public class NomenclatureDeConverter implements ExcelTableConverter<Nomenclature
|
||||||
String hsCode = goodsCode.substring(0, 10);
|
String hsCode = goodsCode.substring(0, 10);
|
||||||
String suffix = goodsCode.substring(11, 13);
|
String suffix = goodsCode.substring(11, 13);
|
||||||
|
|
||||||
Nomenclature nomenclature = nomenclatures.stream().filter(n -> n.getHscode().equals(hsCode)).findAny().orElse(null);
|
Nomenclature nomenclature = nomenclatures.stream().filter(n -> n.getHscode().equals(hsCode) && n.getSuffix().equals(suffix)).findAny().orElse(null);
|
||||||
NomenclatureFootnoteWrapper footnoteWrapper = nomenclatureFootnoteWrappers.stream().filter(n -> n.getHsCode().equals(hsCode) && n.getSuffix().equals(suffix)).findFirst().orElse(null);
|
NomenclatureFootnoteWrapper footnoteWrapper = nomenclatureFootnoteWrappers.stream().filter(n -> n.getHsCode().equals(hsCode) && n.getSuffix().equals(suffix)).findFirst().orElse(null);
|
||||||
NomenclatureDesc descEn = nomenclatureDescEn.stream().filter(n -> n.getHscode().equals(hsCode) && n.getSuffix().equals(suffix)).map(NomenclatureDescEnWrapper::getDesc).findFirst().orElse(null);
|
NomenclatureDesc descEn = nomenclatureDescEn.stream().filter(n -> n.getHscode().equals(hsCode) && n.getSuffix().equals(suffix)).map(NomenclatureDescEnWrapper::getDesc).findFirst().orElse(null);
|
||||||
NomenclatureDesc descFr = nomenclatureDescFr.stream().filter(n -> n.getHscode().equals(hsCode) && n.getSuffix().equals(suffix)).map(NomenclatureDescFrWrapper::getDesc).findFirst().orElse(null);
|
NomenclatureDesc descFr = nomenclatureDescFr.stream().filter(n -> n.getHscode().equals(hsCode) && n.getSuffix().equals(suffix)).map(NomenclatureDescFrWrapper::getDesc).findFirst().orElse(null);
|
||||||
|
|
@ -59,7 +59,7 @@ public class NomenclatureDeConverter implements ExcelTableConverter<Nomenclature
|
||||||
|
|
||||||
nomenclature = new Nomenclature(hsCode, suffix, row.getAs("Hier. Pos.", Integer.class), indent,
|
nomenclature = new Nomenclature(hsCode, suffix, row.getAs("Hier. Pos.", Integer.class), indent,
|
||||||
row.getAs("Start date", LocalDate.class), row.getAs("End date", LocalDate.class),
|
row.getAs("Start date", LocalDate.class), row.getAs("End date", LocalDate.class),
|
||||||
declarableCode == null ? false : declarableCode.getIsLeaf(),
|
declarableCode != null && declarableCode.getIsLeaf(),
|
||||||
declarableCode == null ? null : declarableCode.getDeclStartDate(),
|
declarableCode == null ? null : declarableCode.getDeclStartDate(),
|
||||||
null, null == footnoteWrapper ? null : footnoteWrapper.getNomenclatureFootnote());
|
null, null == footnoteWrapper ? null : footnoteWrapper.getNomenclatureFootnote());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue