代码全部提交
This commit is contained in:
parent
c632ae1d39
commit
bc42f9fdec
@ -3882,6 +3882,26 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> 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<DocumentSfc> sfcList = documentSfcService.list(new QueryWrapper<DocumentSfc>().lambda().eq(DocumentSfc::getDocumentNo, docObj.getDocumentNo()).eq(DocumentSfc::getSite, site));
|
||||
if(sfcList.isEmpty()){
|
||||
throw BusinessException.build("单据" + documentNo + "没有条码库存数据,不能冲销");
|
||||
}
|
||||
// 入库冲销
|
||||
|
||||
|
||||
// 出库冲销
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user