修改采购联系单

This commit is contained in:
lcj
2025-08-30 06:29:25 +08:00
parent a588b94310
commit 788f13fa7b

View File

@ -210,11 +210,10 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
BusPurchaseDoc update = MapstructUtils.convert(bo, BusPurchaseDoc.class);
validEntityBeforeSave(update);
planDocAssociationService.remove(Wrappers.<BusPlanDocAssociation>lambdaQuery()
.eq(BusPlanDocAssociation::getProjectId, update.getProjectId())
.eq(BusPlanDocAssociation::getDocId, update.getId()));
if (CollectionUtil.isNotEmpty(bo.getAssociationList())) {
planDocAssociationService.remove(Wrappers.<BusPlanDocAssociation>lambdaQuery()
.eq(BusPlanDocAssociation::getProjectId, update.getProjectId())
.eq(BusPlanDocAssociation::getDocId, update.getId()));
List<BusPlanDocAssociation> convert = MapstructUtils.convert(bo.getAssociationList(), BusPlanDocAssociation.class);
convert.forEach(item -> {
item.setProjectId(update.getProjectId());
@ -505,6 +504,7 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
BeanUtils.copyProperties(item, itemDto);
itemDto.setNum(i);
itemDto.setChildName(item.getName());
itemDto.setDemandQuantity(item.getDemandQuantity() != null ? item.getDemandQuantity().longValue() : null);
dtoItems.add(itemDto);
}
dto.setItems(dtoItems);