fix配置pad端菜品bug

This commit is contained in:
谭凯凯 2024-11-25 16:56:12 +08:00 committed by Tankaikai
parent a38fbfd564
commit 9d0b0a4c25
1 changed files with 5 additions and 3 deletions

View File

@ -211,7 +211,8 @@ public class TbPadProductCategoryServiceImpl extends ServiceImpl<TbPadProductCat
BeanUtil.copyProperties(dto, entity);
entity.setCreateTime(new Date());
super.save(entity);
for (Long productId : productIdList) {
Set<Long> productIdSet = productIdList.stream().collect(Collectors.toSet());
for (Long productId : productIdSet) {
TbPadProductCategoryDetail subEntity = new TbPadProductCategoryDetail();
subEntity.setProductId(productId);
subEntity.setPadProductCategoryId(entity.getId());
@ -269,8 +270,9 @@ public class TbPadProductCategoryServiceImpl extends ServiceImpl<TbPadProductCat
BeanUtil.copyProperties(dto, entity, "createTime");
entity.setUpdateTime(new Date());
super.updateById(entity);
for (Long productId : productIdList) {
tbPadProductCategoryDetailMapper.delete(Wrappers.<TbPadProductCategoryDetail>lambdaQuery().eq(TbPadProductCategoryDetail::getPadProductCategoryId, entity.getId()));
tbPadProductCategoryDetailMapper.delete(Wrappers.<TbPadProductCategoryDetail>lambdaQuery().eq(TbPadProductCategoryDetail::getPadProductCategoryId, entity.getId()));
Set<Long> productIdSet = productIdList.stream().collect(Collectors.toSet());
for (Long productId : productIdSet) {
TbPadProductCategoryDetail subEntity = new TbPadProductCategoryDetail();
subEntity.setProductId(productId);
subEntity.setPadProductCategoryId(entity.getId());