From bc42f9fdece93a52b49f5959018a9c8693a10af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E6=9E=9D=E5=88=9A?= Date: Sat, 28 Dec 2024 16:40:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=85=A8=E9=83=A8=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/service/impl/DocumentServiceImpl.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentServiceImpl.java b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentServiceImpl.java index 163c912..73243ad 100644 --- a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentServiceImpl.java +++ b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentServiceImpl.java @@ -3882,6 +3882,26 @@ public class DocumentServiceImpl extends ServiceImpl i @Override public void documentCancelExecute(Document document){ + String site = TenantContextHolder.getTenantStrId(); + String documentNo = document.getDocumentNo(); + if(StringUtil.isEmpty(documentNo)){ + throw BusinessException.build("单据号不能为空"); + } + Document docObj = super.getById(Document.genHandle(site, documentNo)); + if(docObj == null){ + throw BusinessException.build("单据" + documentNo + "不存在"); + } + if(!"CLOSE".equals(docObj.getState())){ + throw BusinessException.build("单据" + documentNo + "状态不是关闭,不能冲销"); + } + List sfcList = documentSfcService.list(new QueryWrapper().lambda().eq(DocumentSfc::getDocumentNo, docObj.getDocumentNo()).eq(DocumentSfc::getSite, site)); + if(sfcList.isEmpty()){ + throw BusinessException.build("单据" + documentNo + "没有条码库存数据,不能冲销"); + } + // 入库冲销 + + + // 出库冲销 } }