Add extra fees empty list check

pull/8040/head
Qiuyi LI 2024-12-12 12:30:59 +01:00
parent 1eff5b91a3
commit 722908f2d4
1 changed files with 3 additions and 3 deletions

View File

@ -262,7 +262,7 @@ public class ShippingInvoiceFactory {
if (savRefunds != null) { if (savRefunds != null) {
updateSavRefundsInDb(savRefunds, invoiceCode); updateSavRefundsInDb(savRefunds, invoiceCode);
} }
if(extraFees != null) { if(extraFees != null && !extraFees.isEmpty()) {
List<String> extraFeesIds = extraFees.stream().map(ExtraFeeResult::getId).collect(toList()); List<String> extraFeesIds = extraFees.stream().map(ExtraFeeResult::getId).collect(toList());
extraFeeService.updateInvoiceNumberByIds(extraFeesIds, invoiceCode); extraFeeService.updateInvoiceNumberByIds(extraFeesIds, invoiceCode);
} }
@ -398,7 +398,7 @@ public class ShippingInvoiceFactory {
if (savRefunds != null) { if (savRefunds != null) {
updateSavRefundsInDb(savRefunds, invoiceCode); updateSavRefundsInDb(savRefunds, invoiceCode);
} }
if(extraFees != null) { if(extraFees != null && !extraFees.isEmpty()) {
List<String> extraFeesIds = extraFees.stream().map(ExtraFeeResult::getId).collect(toList()); List<String> extraFeesIds = extraFees.stream().map(ExtraFeeResult::getId).collect(toList());
extraFeeService.updateInvoiceNumberByIds(extraFeesIds, invoiceCode); extraFeeService.updateInvoiceNumberByIds(extraFeesIds, invoiceCode);
} }
@ -587,7 +587,7 @@ public class ShippingInvoiceFactory {
if (savRefunds != null) { if (savRefunds != null) {
updateSavRefundsInDb(savRefunds, invoiceCode); updateSavRefundsInDb(savRefunds, invoiceCode);
} }
if(extraFees != null) { if(extraFees != null && !extraFees.isEmpty()) {
List<String> extraFeesIds = extraFees.stream().map(ExtraFeeResult::getId).collect(toList()); List<String> extraFeesIds = extraFees.stream().map(ExtraFeeResult::getId).collect(toList());
extraFeeService.updateInvoiceNumberByIds(extraFeesIds, invoiceCode); extraFeeService.updateInvoiceNumberByIds(extraFeesIds, invoiceCode);
} }