|
@@ -218,6 +218,8 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
notice.setEndQty(endQty);
|
|
notice.setEndQty(endQty);
|
|
|
notice.setStatus((short) (endQty == notice.getQty() ? Status.REPLIED.value() : Status.NOT_REPLY.value()));
|
|
notice.setStatus((short) (endQty == notice.getQty() ? Status.REPLIED.value() : Status.NOT_REPLY.value()));
|
|
|
purchaseNoticeDao.save(notice);
|
|
purchaseNoticeDao.save(notice);
|
|
|
|
|
+ XingePusher.pushSingleAccountAndroid(send.getCustUserUU().toString(), "供应商发货了", "供应商:" + SystemSession.getUser().getEnterprise().getEnName(), null);
|
|
|
|
|
+ XingePusher.pushSingleAccountIOS(send.getCustUserUU().toString(), "供应商发货了" + " 供应商:" + SystemSession.getUser().getEnterprise().getEnName());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -227,4 +229,42 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
(short) Status.NOT_REPLY.value());
|
|
(short) Status.NOT_REPLY.value());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public SaleSend send(SaleSend saleSend) {
|
|
|
|
|
+ if (saleSend != null) {
|
|
|
|
|
+ saleSend.setBackStatus((short) Status.NOT_UPLOAD.value());
|
|
|
|
|
+ saleSend.setSendStatus((short) Status.NOT_UPLOAD.value());
|
|
|
|
|
+ saleSend.setEnUU(SystemSession.getUser().getEnterprise().getUu());
|
|
|
|
|
+ saleSend.setRecorder(SystemSession.getUser().getUserName());
|
|
|
|
|
+ short number = 0;
|
|
|
|
|
+ for (SaleSendItem item : saleSend.getSendItems()) {
|
|
|
|
|
+ PurchaseNotice notice = purchaseNoticeDao.findOne(item.getNoticeId());
|
|
|
|
|
+ if(notice != null) {
|
|
|
|
|
+ double thisQty = item.getQty();
|
|
|
|
|
+ double endQty = (notice.getEndQty() == null ? 0.0 : notice.getEndQty()) + thisQty;
|
|
|
|
|
+ if (endQty > notice.getQty())
|
|
|
|
|
+ throw new IllegalArgumentException("累计发货数量将超出本次送货提醒的需求数!");
|
|
|
|
|
+ item.setNotice(notice);
|
|
|
|
|
+ item.setNumber(++number);
|
|
|
|
|
+ item.setSend(saleSend);
|
|
|
|
|
+ saleSend.setRate(notice.getOrderItem().getOrder().getRate());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new IllegalArgumentException("参数错误,无效的客户送货提醒单!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ List<SaleSendItem> sendItems = saleSendItemDao.save(saleSend.getSendItems());
|
|
|
|
|
+ for(SaleSendItem sendItem : sendItems) {
|
|
|
|
|
+ PurchaseNotice notice = purchaseNoticeDao.findOne(sendItem.getNoticeId());
|
|
|
|
|
+ double endQty = (notice.getEndQty() == null ? 0.0 : notice.getEndQty()) + sendItem.getQty();
|
|
|
|
|
+ notice.setEndQty(endQty);
|
|
|
|
|
+ notice.setStatus((short) (endQty == notice.getQty() ? Status.REPLIED.value() : Status.NOT_REPLY.value()));
|
|
|
|
|
+ purchaseNoticeDao.save(notice);
|
|
|
|
|
+ }
|
|
|
|
|
+ XingePusher.pushSingleAccountAndroid(saleSend.getCustUserUU().toString(), "供应商发货了", "供应商:" + SystemSession.getUser().getEnterprise().getEnName(), null);
|
|
|
|
|
+ XingePusher.pushSingleAccountIOS(saleSend.getCustUserUU().toString(), "供应商发货了" + " 供应商:" + SystemSession.getUser().getEnterprise().getEnName());
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|