Эх сурвалжийг харах

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@451 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d

administrator 11 жил өмнө
parent
commit
e49fe45b70

+ 1 - 1
src/main/java/com/uas/platform/b2b/dao/PurchaseNoticeDao.java

@@ -30,6 +30,6 @@ public interface PurchaseNoticeDao extends JpaSpecificationExecutor<PurchaseNoti
 	 * 
 	 * @return
 	 */
-	List<PurchaseNotice> findByVendUUAndEndAndEndStatus(long vendUU, Short end, Short sendStatus);
+	List<PurchaseNotice> findByVendUUAndEndStatus(long vendUU, Short endStatus);
 
 }

+ 17 - 8
src/main/java/com/uas/platform/b2b/erp/service/impl/SaleNotifyDownServiceImpl.java

@@ -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;
 	}
 

+ 2 - 2
src/main/java/com/uas/platform/b2b/model/PurchaseNotice.java

@@ -49,7 +49,7 @@ public class PurchaseNotice implements Serializable {
 	/**
 	 * 卖家企业UU
 	 */
-	@Column(name = "pn_venduu'")
+	@Column(name = "pn_venduu")
 	private Long vendUU;
 
 	/**
@@ -211,4 +211,4 @@ public class PurchaseNotice implements Serializable {
 		this.endStatus = endStatus;
 	}
 
-}
+}

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/PurchaseNoticeServiceImpl.java

@@ -152,7 +152,7 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 
 	@Override
 	public List<PurchaseNotice> findNotSendEnd() {
-		return purchaseNoticeDao.findByVendUUAndEndAndEndStatus(SystemSession.getUser().getEnterprise().getUu(), Constant.YES,
+		return purchaseNoticeDao.findByVendUUAndEndStatus(SystemSession.getUser().getEnterprise().getUu(),
 				(short) Status.NOT_UPLOAD.value());
 	}