feat: 添加31码不能生成仙桃(1020)的pbom验证

This commit is contained in:
曹鹏飞 2024-04-14 12:25:13 +08:00
parent e4c6973305
commit 43580fe0f9
1 changed files with 7 additions and 3 deletions

View File

@ -827,10 +827,14 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
public void convertToPBom(EBomToPBomParamDTO paramDto) throws ExecutionException, InterruptedException {
//31 须有虚拟包
List<BomNewEbomParentEntity> parents = this.getBaseMapper().selectBatchIds(paramDto.getBomRowIds());
List<String> noVirPackage = parents.stream().filter(u -> u.getMaterialNo().startsWith("31") && u.getVirtrualPackageEnum() <= 0).map(BomNewEbomParentEntity::getMaterialNo).collect(Collectors.toList());
VUtils.isTure(CollUtil.isNotEmpty(noVirPackage)).throwMessage("31码须有虚拟包");
for (Long bomRowId : paramDto.getBomRowIds()) {
VUtils.isTure(paramDto.getFacCodes().contains("1020") && parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31")))
.throwMessage("31码不能生成仙桃(1020)的pbom");
VUtils.isTure(parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31") && u.getVirtrualPackageEnum() <= 0))
.throwMessage("31码须有虚拟包");
for (Long bomRowId : paramDto.getBomRowIds()) {
BomNewEbomParentVO parent = Convert.convert(BomNewEbomParentVO.class, this.getById(bomRowId));
VUtils.isTure(Objects.isNull(parent)).throwMessage("Bom版本不存在" + bomRowId.toString());
LogRecordContext.putVariable("CToPbom", parent);