Browse Source

处理送货提醒不能保存的问题

hejq 8 years ago
parent
commit
47194838b8

+ 8 - 10
src/main/java/com/uas/platform/b2b/erp/service/impl/PurchaseNotifyServiceImpl.java

@@ -4,7 +4,10 @@ import com.uas.platform.b2b.dao.PurchaseNoticeDao;
 import com.uas.platform.b2b.dao.PurchaseOrderItemDao;
 import com.uas.platform.b2b.dao.SaleSendItemDao;
 import com.uas.platform.b2b.dao.SaleSendItemVerifyDao;
-import com.uas.platform.b2b.erp.model.*;
+import com.uas.platform.b2b.erp.model.AcceptNotify;
+import com.uas.platform.b2b.erp.model.AcceptNotifyConfirm;
+import com.uas.platform.b2b.erp.model.AcceptNotifyVerify;
+import com.uas.platform.b2b.erp.model.PurchaseNotify;
 import com.uas.platform.b2b.erp.service.PurchaseNotifyService;
 import com.uas.platform.b2b.model.*;
 import com.uas.platform.b2b.support.SystemSession;
@@ -36,7 +39,6 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
 	public List<List<PurchaseNotice>> convertPurchaseNotify(List<PurchaseNotify> notifies) {
 		List<List<PurchaseNotice>> allNotices = new ArrayList<List<PurchaseNotice>>();
 		List<PurchaseNotice> notices = new ArrayList<PurchaseNotice>();
-		List<PurchaseNotice> oppNotices = new ArrayList<PurchaseNotice>();
 		for (PurchaseNotify notify : notifies) {
 			PurchaseNotice notice = notify.convert();
 			List<PurchaseNotice> existNotices = purchaseNoticeDao.findByEnUUAndSourceId(notice.getEnUU(),
@@ -46,8 +48,8 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
 						notice.getEnUU(), notice.getOrderItem().getOrder().getCode(),
 						notice.getOrderItem().getNumber());
 				if (!CollectionUtils.isEmpty(orderItems)) {
-					notice.setOrderItem(orderItems.get(0));
-					notice.setOrderItemId(notice.getOrderItem().getId());
+				    notice.setOrderItem(orderItems.get(0));
+					notice.setOrderItemId(orderItems.get(0).getId());
 					notices.add(notice);
 				}
 			} else {// 对现有的单据,修改
@@ -58,17 +60,14 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
 				if (StringUtils.hasText(existNotice.getRemark())) {
 					remark = existNotice.getRemark() + "; ";
 				}
-				existNotice.setSendStatus((short) Status.NOT_UPLOAD.value());// 对卖家传输状态
-																				// 待上传
+				existNotice.setSendStatus((short) Status.NOT_UPLOAD.value());// 对卖家传输状态 // 待上传
 				if (existNotice.getQty() != null && !existNotice.getQty().equals(notice.getQty())) {
 					if (existNotice.getEndQty() > notice.getQty()) {
 						// 已发货数大于新的需求数,修改平台上的需求数为已发货数,将已发货数量传回买家ERP修改发货提醒的数量
 						existNotice.setRemark(remark + dateString + "修改需求数量," + existNotice.getQty() + " -> "
 								+ existNotice.getEndQty());
 						existNotice.setQty(existNotice.getEndQty());// 需求数量
-						existNotice.setStatus((short) Status.REPLIED.value());// 状态
-																				// 已回复
-						oppNotices.add(existNotice);
+						existNotice.setStatus((short) Status.REPLIED.value());// 状态  已回复
 						notices.add(existNotice);
 					} else {
 						// 已发货数小于或等于新的需求数,修改平台上的需求数为新的需求数
@@ -96,7 +95,6 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
 			}
 		}
 		allNotices.add(notices);
-		allNotices.add(oppNotices);
 		return allNotices;
 	}