|
|
@@ -70,25 +70,30 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
|
|
|
remark = existNotice.getRemark() + "; ";
|
|
|
}
|
|
|
// 对卖家传输状态 // 待上传
|
|
|
- existNotice.setSendStatus((short) Status.NOT_UPLOAD.value());
|
|
|
+ existNotice.setSendStatus((short) Status.NOT_UPLOAD.value());
|
|
|
+ Double sendQty = purchaseNoticeDao.getSendQtyByItemId(notice.getOrderItemId());
|
|
|
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());
|
|
|
- notices.add(existNotice);
|
|
|
- } else {
|
|
|
- // 已发货数小于或等于新的需求数,修改平台上的需求数为新的需求数
|
|
|
- existNotice.setRemark(
|
|
|
- remark + dateString + "修改需求数量," + existNotice.getQty() + " -> " + notice.getQty());
|
|
|
- existNotice.setQty(notice.getQty());
|
|
|
- existNotice.setDelivery(notice.getDelivery());
|
|
|
- notices.add(existNotice);
|
|
|
- }
|
|
|
+ // 本次需求数量加上已发货数量不得超过订单明细的需求数量
|
|
|
+ Double neeQty = sendQty + notice.getQty();
|
|
|
+ if (neeQty <= notice.getOrderItem().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());
|
|
|
+ notices.add(existNotice);
|
|
|
+ } else {
|
|
|
+ // 已发货数小于或等于新的需求数,修改平台上的需求数为新的需求数
|
|
|
+ existNotice.setRemark(
|
|
|
+ remark + dateString + "修改需求数量:" + existNotice.getQty() + " -> " + notice.getQty());
|
|
|
+ existNotice.setQty(notice.getQty());
|
|
|
+ existNotice.setDelivery(notice.getDelivery());
|
|
|
+ notices.add(existNotice);
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
String existDeliveryStr = "空";
|
|
|
String deliveryStr = "空";
|
|
|
@@ -99,7 +104,7 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
|
|
|
deliveryStr = dateFormat.format(notice.getDelivery());
|
|
|
}
|
|
|
if (!existDeliveryStr.equals(deliveryStr)) {
|
|
|
- existNotice.setRemark(remark + dateString + "修改交期," + existDeliveryStr + " -> " + deliveryStr);
|
|
|
+ existNotice.setRemark(remark + dateString + "修改交期: " + existDeliveryStr + " -> " + deliveryStr);
|
|
|
mergeWaitingStatus(existNotice.getId(), SqlDateFormdateUtils.DATE_FORMAT.format(notice.getDelivery()));
|
|
|
}
|
|
|
existNotice.setDelivery(notice.getDelivery());
|