1.出口报关提交时金额差值汇总为0则通过
This commit is contained in:
25655 2025-04-07 11:42:34 +08:00
parent f31f694a88
commit ca069154f6

View File

@ -34,14 +34,15 @@ public class DeclareDocxSubmitValidator extends AbstractValidator {
map.put(index, exportmat); map.put(index, exportmat);
} }
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
BigDecimal amt = BigDecimal.ZERO;
for (Map.Entry<Integer, BigDecimal> entry : map.entrySet()) { for (Map.Entry<Integer, BigDecimal> entry : map.entrySet()) {
Integer idx = entry.getKey(); Integer idx = entry.getKey();
BigDecimal amt = entry.getValue(); amt = entry.getValue();
if (amt.compareTo(BigDecimal.ZERO) != 0) {
sb.append(String.format("商品明细第 [ %s ] 行,出库金额跟报关金额差值 [ %s ]不允许提交,请修改后重试。", idx + 1, amt.setScale(2, RoundingMode.HALF_UP)));
}
}
}
if (amt.compareTo(BigDecimal.ZERO) != 0) {
sb.append(String.format("商品明细,出库金额跟报关金额差值 [ %s ]不允许提交,请修改后重试。", amt.setScale(2, RoundingMode.HALF_UP)));
}
if (sb.length() > 0) { if (sb.length() > 0) {
this.addErrorMessage(extendedDataEntity, sb.toString()); this.addErrorMessage(extendedDataEntity, sb.toString());
} }