创建根

This commit is contained in:
jing's 2023-12-21 11:27:20 +08:00
parent 0b8748bd1f
commit 56aa5bc38a
1 changed files with 13 additions and 0 deletions

View File

@ -167,6 +167,19 @@ public class EbomApi extends BaseApi {
return ResultVO.success(true);
}
@PostMapping("createParentBom")
@ApiOperation("创建BOM")
public ResultVO<Boolean> createParentBom(@RequestBody BomNewEBomCreateDTO createDTO) {
VUtils.isTure(StrUtil.isBlank(createDTO.getMaterialNo())).throwMessage("物料编码不能为空");
//子级物料编码不能为空
VUtils.isTure(CollUtil.isEmpty(createDTO.getDatas())).throwMessage("子级不能为空");
List<BomNewEBomImportExcelDTO> noMaterialList = createDTO.getDatas().stream().filter(u -> StrUtil.isBlank(u.getMaterialNo())).collect(Collectors.toList());
VUtils.isTure(CollUtil.isNotEmpty(noMaterialList)).throwMessage("子级存在物料编码为空的数据");
bomNewEbomParentService.createBom(createDTO);
return ResultVO.success(true);
}
@PostMapping("revertDesign")
@ApiOperation("退回到设计")