|
|
@@ -409,13 +409,9 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
@Override
|
|
|
public SaleSend send(Long noticeId, SaleSend send) {
|
|
|
PurchaseNotice notice = purchaseNoticeDao.findOne(noticeId);
|
|
|
- if (notice != null) {
|
|
|
-// //限制同一个供应商给同一个客户发货单号不可以重复,(避免一次发货产生多张单)
|
|
|
-// List<SaleSend> sends =
|
|
|
-// saleSendDao.findByEnUUAndCustUUAndCode(SystemSession.getUser().getEnterprise().getUu(),notice.getEnUU(), send.getCode());
|
|
|
-// if (sends.size() > 0) {
|
|
|
-// throw new IllegalOperatorException("发货单号重复,无法发货!提示:多个物料一起发货请选择批量发货。");
|
|
|
-// }
|
|
|
+ List<SaleSend> sends = saleSendDao.findByUuid(send.getUuid());
|
|
|
+ //限制同一个供应商给同一个客户发货单号不可以重复,(避免一次发货产生多张单)
|
|
|
+ if (notice != null && CollectionUtils.isEmpty(sends)) {
|
|
|
if (notice.getEnd() != null && notice.getEnd() == Constant.YES) {
|
|
|
throw new IllegalOperatorException("客户已经取消了本次送货提醒,请刷新重试!");
|
|
|
}
|
|
|
@@ -474,13 +470,9 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
|
|
|
@Override
|
|
|
public SaleSend send(SaleSend saleSend) {
|
|
|
- if (saleSend != null) {
|
|
|
-// //限制同一个供应商给同一个客户发货单号不可以重复,(避免一次发货产生多张单)
|
|
|
-// List<SaleSend> sends =
|
|
|
-// saleSendDao.findByEnUUAndCustUUAndCode(SystemSession.getUser().getEnterprise().getUu(),saleSend.getCustUU(), saleSend.getCode());
|
|
|
-// if (sends.size() > 0) {
|
|
|
-// throw new IllegalOperatorException("发货单号重复,无法发货!提示:多个物料一起发货请选择批量发货。");
|
|
|
-// }
|
|
|
+ //限制同一个供应商给同一个客户发货单号不可以重复,(避免一次发货产生多张单),存在时不做处理
|
|
|
+ List<SaleSend> sendList = saleSendDao.findByUuid(saleSend.getUuid());
|
|
|
+ if (saleSend != null && CollectionUtils.isEmpty(sendList)) {
|
|
|
saleSend.setBackStatus((short) Status.NOT_UPLOAD.value());
|
|
|
saleSend.setSendStatus((short) Status.NOT_UPLOAD.value());
|
|
|
saleSend.setEnUU(SystemSession.getUser().getEnterprise().getUu());
|