|
|
@@ -3,6 +3,7 @@ package com.uas.platform.b2b.erp.service.impl;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.uas.platform.b2b.erp.model.SaleNotifyDown;
|
|
|
@@ -18,8 +19,10 @@ public class SaleNotifyDownServiceImpl implements SaleNotifyDownService {
|
|
|
@Override
|
|
|
public List<SaleNotifyDown> convertPurchaseNotice(List<PurchaseNotice> notices) {
|
|
|
List<SaleNotifyDown> downs = new ArrayList<SaleNotifyDown>();
|
|
|
- for (PurchaseNotice notice : notices)
|
|
|
- downs.add(new SaleNotifyDown(notice));
|
|
|
+ if (!CollectionUtils.isEmpty(notices)) {
|
|
|
+ for (PurchaseNotice notice : notices)
|
|
|
+ downs.add(new SaleNotifyDown(notice));
|
|
|
+ }
|
|
|
return downs;
|
|
|
}
|
|
|
|
|
|
@@ -28,8 +31,10 @@ public class SaleNotifyDownServiceImpl implements SaleNotifyDownService {
|
|
|
List<SaleSend> sends = new ArrayList<SaleSend>();
|
|
|
// 按卖家发货单明细的订单号,对应的买家的采购单的采购员、币别、付款方式分组
|
|
|
// 卖家的发货单产生的时候,直接是按币别、付款方式、客户联系人分组了
|
|
|
- for (SaleOut out : outs) {
|
|
|
- sends.add(out.convert());
|
|
|
+ if (!CollectionUtils.isEmpty(outs)) {
|
|
|
+ for (SaleOut out : outs) {
|
|
|
+ sends.add(out.convert());
|
|
|
+ }
|
|
|
}
|
|
|
return sends;
|
|
|
}
|
|
|
@@ -37,16 +42,20 @@ public class SaleNotifyDownServiceImpl implements SaleNotifyDownService {
|
|
|
@Override
|
|
|
public List<SaleOut> convertSaleSend(List<SaleSend> sends) {
|
|
|
List<SaleOut> outs = new ArrayList<SaleOut>();
|
|
|
- for (SaleSend send : sends)
|
|
|
- outs.add(new SaleOut(send));
|
|
|
+ if (!CollectionUtils.isEmpty(sends)) {
|
|
|
+ for (SaleSend send : sends)
|
|
|
+ outs.add(new SaleOut(send));
|
|
|
+ }
|
|
|
return outs;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<SaleNotifyDownEnd> convertPurchaseNoticeEnd(List<PurchaseNotice> notices) {
|
|
|
List<SaleNotifyDownEnd> ends = new ArrayList<SaleNotifyDownEnd>();
|
|
|
- for (PurchaseNotice notice : notices)
|
|
|
- ends.add(new SaleNotifyDownEnd(notice));
|
|
|
+ if (!CollectionUtils.isEmpty(notices)) {
|
|
|
+ for (PurchaseNotice notice : notices)
|
|
|
+ ends.add(new SaleNotifyDownEnd(notice));
|
|
|
+ }
|
|
|
return ends;
|
|
|
}
|
|
|
|