修改了钢构包和普通物料打印条码时查询和存储的供应商编号为Id
This commit is contained in:
parent
a37736494a
commit
45d678f980
|
|
@ -58,13 +58,19 @@ public class BomControllerService {
|
|||
|
||||
@Transactional
|
||||
public void add(@Valid BomMaterialDTO dto) {
|
||||
VUtil.trueThrowBusinessError(StrUtil.isBlank(dto.getMaterialNo())).throwMessage("物料编号不能为空");
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(dto.getChildren())).throwMessage("子级物料不可以为空!");
|
||||
|
||||
BigDecimal totalWight = dto.getChildren().stream()
|
||||
.map(child -> child.getMaterialWeight() != null ? child.getMaterialWeight() : new BigDecimal(0))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
WmsBom parent = new WmsBom()
|
||||
.setParentId(0L)
|
||||
.setNo(dto.getMaterialNo())
|
||||
.setDescribe(dto.getMaterialDesc())
|
||||
.setDrawingNo(dto.getDrawingNo())
|
||||
.setWeight(dto.getMaterialWeight())
|
||||
.setNum(dto.getNum())
|
||||
.setWeight(totalWight)
|
||||
.setNum(new BigDecimal(1))
|
||||
.setCreateBy(UserUtil.getUserName())
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
bomService.add(parent, dto.getChildren().stream().map(it -> new WmsBom()
|
||||
|
|
|
|||
Loading…
Reference in New Issue