|
@@ -36,20 +36,17 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
|
|
|
private SaleSendItemVerifyDao saleSendItemVerifyDao;
|
|
private SaleSendItemVerifyDao saleSendItemVerifyDao;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public List<List<PurchaseNotice>> convertPurchaseNotify(List<PurchaseNotify> notifies) {
|
|
|
|
|
- List<List<PurchaseNotice>> allNotices = new ArrayList<List<PurchaseNotice>>();
|
|
|
|
|
|
|
+ public List<PurchaseNotice> convertPurchaseNotify(List<PurchaseNotify> notifies) {
|
|
|
List<PurchaseNotice> notices = new ArrayList<PurchaseNotice>();
|
|
List<PurchaseNotice> notices = new ArrayList<PurchaseNotice>();
|
|
|
for (PurchaseNotify notify : notifies) {
|
|
for (PurchaseNotify notify : notifies) {
|
|
|
PurchaseNotice notice = notify.convert();
|
|
PurchaseNotice notice = notify.convert();
|
|
|
List<PurchaseNotice> existNotices = purchaseNoticeDao.findByEnUUAndSourceId(notice.getEnUU(),
|
|
List<PurchaseNotice> existNotices = purchaseNoticeDao.findByEnUUAndSourceId(notice.getEnUU(),
|
|
|
notice.getSourceId());
|
|
notice.getSourceId());
|
|
|
if (CollectionUtils.isEmpty(existNotices)) {// sourceId不存在新增保存
|
|
if (CollectionUtils.isEmpty(existNotices)) {// sourceId不存在新增保存
|
|
|
- List<PurchaseOrderItem> orderItems = purchaseOrderItemDao.findByEnUUAndOrderCodeAndNumber(
|
|
|
|
|
- notice.getEnUU(), notice.getOrderItem().getOrder().getCode(),
|
|
|
|
|
- notice.getOrderItem().getNumber());
|
|
|
|
|
- if (!CollectionUtils.isEmpty(orderItems)) {
|
|
|
|
|
- notice.setOrderItem(orderItems.get(0));
|
|
|
|
|
- notice.setOrderItemId(orderItems.get(0).getId());
|
|
|
|
|
|
|
+ List<Long> idList = purchaseOrderItemDao.findIdByEnUUAndOrderCodeAndNumber(notice.getEnUU(),
|
|
|
|
|
+ notice.getOrderItem().getOrder().getCode(), notice.getOrderItem().getNumber());
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(idList)) {
|
|
|
|
|
+ notice.setOrderItemId(idList.get(0));
|
|
|
notices.add(notice);
|
|
notices.add(notice);
|
|
|
}
|
|
}
|
|
|
} else {// 对现有的单据,修改
|
|
} else {// 对现有的单据,修改
|
|
@@ -76,6 +73,7 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
|
|
|
existNotice.setQty(notice.getQty());// 需求数量
|
|
existNotice.setQty(notice.getQty());// 需求数量
|
|
|
existNotice.setDelivery(notice.getDelivery());// 交期
|
|
existNotice.setDelivery(notice.getDelivery());// 交期
|
|
|
notices.add(existNotice);
|
|
notices.add(existNotice);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
String existDeliveryStr = "空";
|
|
String existDeliveryStr = "空";
|
|
@@ -94,8 +92,7 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- allNotices.add(notices);
|
|
|
|
|
- return allNotices;
|
|
|
|
|
|
|
+ return notices;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|