fix(自定义对比): 维护清单编辑问题修复
This commit is contained in:
+1
-1
@@ -143,7 +143,7 @@ public class LawsCustomCompareInfoController {
|
|||||||
@AutoLog(value = "自定义对比-清单维护编辑")
|
@AutoLog(value = "自定义对比-清单维护编辑")
|
||||||
@ApiOperation(value="自定义对比-清单维护编辑", notes="自定义对比-清单维护编辑")
|
@ApiOperation(value="自定义对比-清单维护编辑", notes="自定义对比-清单维护编辑")
|
||||||
@PostMapping(value = "/editInventory")
|
@PostMapping(value = "/editInventory")
|
||||||
public Result<T> editInventory(Map<String, Object> map) {
|
public Result<T> editInventory(@RequestBody Map<String, Object> map) {
|
||||||
lawsCustomCompareInfoService.editInventory(map);
|
lawsCustomCompareInfoService.editInventory(map);
|
||||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-19
@@ -387,36 +387,25 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl<LawsCustomComp
|
|||||||
|
|
||||||
// 不是第一次添加
|
// 不是第一次添加
|
||||||
if (!list.isEmpty()){
|
if (!list.isEmpty()){
|
||||||
List<String> idList = list.stream().map(LawsCustomCompareInventory::getInfoId).collect(Collectors.toList());
|
List<String> idList = list.stream().map(LawsCustomCompareInventory::getId).collect(Collectors.toList());
|
||||||
List<String> featureIdList = featureList.stream().map(LawsCustomCompareInventory::getInfoId).collect(Collectors.toList());
|
List<String> featureIdList = featureList.stream().map(LawsCustomCompareInventory::getId).collect(Collectors.toList());
|
||||||
List<String> compareIdList = compareList.stream().map(LawsCustomCompareInventory::getInfoId).collect(Collectors.toList());
|
List<String> compareIdList = compareList.stream().map(LawsCustomCompareInventory::getId).collect(Collectors.toList());
|
||||||
|
|
||||||
idList.retainAll(featureIdList);
|
idList.removeAll(featureIdList);
|
||||||
idList.retainAll(compareIdList);
|
idList.removeAll(compareIdList);
|
||||||
|
|
||||||
if (!idList.isEmpty()){
|
if (!idList.isEmpty()){
|
||||||
// 删除旧数据
|
// 删除旧数据
|
||||||
lawsCustomCompareInventoryService.remove(
|
lawsCustomCompareInventoryService.remove(
|
||||||
new LambdaQueryWrapper<LawsCustomCompareInventory>()
|
new LambdaQueryWrapper<LawsCustomCompareInventory>()
|
||||||
.in(LawsCustomCompareInventory::getId, idList));
|
.in(LawsCustomCompareInventory::getId, idList));
|
||||||
|
|
||||||
// 删除单元格数据
|
// 删除单元格数据
|
||||||
lawsCustomCompareCellService.remove(
|
lawsCustomCompareCellService.remove(
|
||||||
new LambdaQueryWrapper<LawsCustomCompareCell>()
|
new LambdaQueryWrapper<LawsCustomCompareCell>()
|
||||||
.in(LawsCustomCompareCell::getFeatureId, idList)
|
.in(LawsCustomCompareCell::getInfoId, infoId)
|
||||||
.or().eq(LawsCustomCompareCell::getCompareItemId, idList));
|
.and(v -> v.eq(LawsCustomCompareCell::getFeatureId, idList)
|
||||||
}else {
|
.or().eq(LawsCustomCompareCell::getCompareItemId, idList)));
|
||||||
// 删除旧数据
|
|
||||||
lawsCustomCompareInventoryService.remove(
|
|
||||||
new LambdaQueryWrapper<LawsCustomCompareInventory>()
|
|
||||||
.eq(LawsCustomCompareInventory::getInfoId, infoId));
|
|
||||||
|
|
||||||
// 删除单元格数据
|
|
||||||
lawsCustomCompareCellService.remove(
|
|
||||||
new LambdaQueryWrapper<LawsCustomCompareCell>()
|
|
||||||
.eq(LawsCustomCompareCell::getInfoId, infoId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user