diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoController.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoController.java index 4de9b033..d57ca664 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoController.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoController.java @@ -143,7 +143,7 @@ public class LawsCustomCompareInfoController { @AutoLog(value = "自定义对比-清单维护编辑") @ApiOperation(value="自定义对比-清单维护编辑", notes="自定义对比-清单维护编辑") @PostMapping(value = "/editInventory") - public Result editInventory(Map map) { + public Result editInventory(@RequestBody Map map) { lawsCustomCompareInfoService.editInventory(map); return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); } diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoServiceImpl.java index 4bb05f55..99a08e81 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoServiceImpl.java @@ -387,36 +387,25 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl idList = list.stream().map(LawsCustomCompareInventory::getInfoId).collect(Collectors.toList()); - List featureIdList = featureList.stream().map(LawsCustomCompareInventory::getInfoId).collect(Collectors.toList()); - List compareIdList = compareList.stream().map(LawsCustomCompareInventory::getInfoId).collect(Collectors.toList()); + List idList = list.stream().map(LawsCustomCompareInventory::getId).collect(Collectors.toList()); + List featureIdList = featureList.stream().map(LawsCustomCompareInventory::getId).collect(Collectors.toList()); + List compareIdList = compareList.stream().map(LawsCustomCompareInventory::getId).collect(Collectors.toList()); - idList.retainAll(featureIdList); - idList.retainAll(compareIdList); + idList.removeAll(featureIdList); + idList.removeAll(compareIdList); if (!idList.isEmpty()){ // 删除旧数据 lawsCustomCompareInventoryService.remove( new LambdaQueryWrapper() .in(LawsCustomCompareInventory::getId, idList)); - // 删除单元格数据 lawsCustomCompareCellService.remove( new LambdaQueryWrapper() - .in(LawsCustomCompareCell::getFeatureId, idList) - .or().eq(LawsCustomCompareCell::getCompareItemId, idList)); - }else { - // 删除旧数据 - lawsCustomCompareInventoryService.remove( - new LambdaQueryWrapper() - .eq(LawsCustomCompareInventory::getInfoId, infoId)); - - // 删除单元格数据 - lawsCustomCompareCellService.remove( - new LambdaQueryWrapper() - .eq(LawsCustomCompareCell::getInfoId, infoId)); + .in(LawsCustomCompareCell::getInfoId, infoId) + .and(v -> v.eq(LawsCustomCompareCell::getFeatureId, idList) + .or().eq(LawsCustomCompareCell::getCompareItemId, idList))); } - } }