🐛 修复lov模块新增时 body或search组件为0时,保存成功却提示异常
This commit is contained in:
@@ -93,12 +93,18 @@ public class LovServiceImpl extends ServiceImpl<LovMapper, Lov> implements LovSe
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean save(Lov lov, List<LovBody> bodyList, List<LovSearch> searchList) {
|
||||
return save(lov)
|
||||
&& bodyService.saveBatch(
|
||||
bodyList.stream().map(body -> body.setKeyword(lov.getKeyword())).collect(Collectors.toList()))
|
||||
&& searchService.saveBatch(searchList.stream().map(search -> search.setKeyword(lov.getKeyword()))
|
||||
boolean res = save(lov);
|
||||
if (res && bodyList.size() > 0) {
|
||||
res = bodyService.saveBatch(
|
||||
bodyList.stream().map(body -> body.setKeyword(lov.getKeyword())).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
if (res && searchList.size() > 0) {
|
||||
res = searchService.saveBatch(searchList.stream().map(search -> search.setKeyword(lov.getKeyword()))
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LovVo getDataByKeyword(String keyword) {
|
||||
|
||||
Reference in New Issue
Block a user