feat: 生成虚拟包前进行异常检查,有异常时不能生成虚拟包

This commit is contained in:
曹鹏飞 2024-07-05 10:07:08 +08:00
parent 6423a67ebe
commit 4fb0a338de
2 changed files with 7 additions and 1 deletions

View File

@ -71,6 +71,12 @@ public class BomNewEbomGenerateVirtualPackageServiceFor31Impl implements IBomNew
BomNewEbomParentEntity root = ebomParentService.getById(query.getParentRowId());
VUtils.isTure(Objects.isNull(root)).throwMessage("无效的数据");
//异常检查
ebomParentService.batchCheckAndSaveEBomException(Collections.singletonList(root.getRowId()));
VUtils.isTure(!Objects.equals(root.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())
&& !Objects.equals(root.getExceptionStatus(), EBomExceptionStatusEnum.EXCEPT_NO_8.getValue()))
.throwMessage("请先解决异常再生成发货包");
VUtils.isTure(root.getMaterialNo().startsWith("21")).throwMessage("21编码接口调用错误");
VUtils.isTure(!root.getMaterialNo().startsWith("31")).throwMessage("该编码的物料不能生成发货包:" + root.getMaterialNo());

View File

@ -909,7 +909,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
// VUtils.isTure(root.getVirtrualPackageEnum() > 0).throwMessage("已生成过虚拟包不能2次生成");
VUtils.isTure(!Objects.equals(root.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())
&& !Objects.equals(root.getExceptionStatus(), EBomExceptionStatusEnum.EXCEPT_NO_8.getValue()))
.throwMessage("异常状态下不允许生成虚拟");
.throwMessage("请先解决异常再生成发货");
LogRecordContext.putVariable("gvbom", root);
BomNewEbomParentVO parent = Convert.convert(BomNewEbomParentVO.class, root);