|
|
@@ -340,8 +340,13 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
|
|
|
@Override
|
|
|
public SaleSend send(Long noticeId, SaleSend send) {
|
|
|
- PurchaseNotice notice = purchaseNoticeDao.findOne(noticeId);
|
|
|
- List<SaleSend> sends = saleSendDao.findByUuid(send.getUuid());
|
|
|
+ Integer count = saleSendDao.countByUuid(send.getUuid());
|
|
|
+ // 重复点击发货
|
|
|
+ if (count > 0) {
|
|
|
+ throw new IllegalOperatorException("请不要重复点击发货");
|
|
|
+ }
|
|
|
+ PurchaseNotice notice = purchaseNoticeDao.findOne(noticeId);
|
|
|
+ List<SaleSend> sends = saleSendDao.findByEnUUAndCode(send.getEnUU(), send.getCode());
|
|
|
//限制同一个供应商给同一个客户发货单号不可以重复,(避免一次发货产生多张单)
|
|
|
if (notice != null && CollectionUtils.isEmpty(sends)) {
|
|
|
if (notice.getEnd() != null && notice.getEnd() == Constant.YES) {
|
|
|
@@ -404,8 +409,9 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
@Override
|
|
|
public SaleSend send(SaleSend saleSend) {
|
|
|
//限制同一个供应商给同一个客户发货单号不可以重复,(避免一次发货产生多张单),存在时不做处理
|
|
|
- List<SaleSend> sendList = saleSendDao.findByUuid(saleSend.getUuid());
|
|
|
- if (saleSend != null && CollectionUtils.isEmpty(sendList)) {
|
|
|
+ Integer count = saleSendDao.countByUuid(saleSend.getUuid());
|
|
|
+ List<SaleSend> sendList = saleSendDao.findByEnUUAndCode(saleSend.getEnUU(), saleSend.getCode());
|
|
|
+ if (count == 0 && CollectionUtils.isEmpty(sendList)) {
|
|
|
saleSend.setBackStatus((short) Status.NOT_UPLOAD.value());
|
|
|
saleSend.setSendStatus((short) Status.NOT_UPLOAD.value());
|
|
|
saleSend.setEnUU(SystemSession.getUser().getEnterprise().getUu());
|