|
@@ -251,9 +251,12 @@ public class MenuController {
|
|
|
|
|
|
//多选
|
|
//多选
|
|
List<XjrMenuDeptRelation> menuDeptRelationsList = new ArrayList<>();
|
|
List<XjrMenuDeptRelation> menuDeptRelationsList = new ArrayList<>();
|
|
- for (AddXjrMenuDeptRelationDto addXjrMenuDeptRelationDto : dto.getMenuDeptRelations()) {
|
|
|
|
- menuDeptRelationsList.add(BeanUtil.toBean(addXjrMenuDeptRelationDto, XjrMenuDeptRelation.class));
|
|
|
|
|
|
+ if(dto.getMenuDeptRelations() != null){
|
|
|
|
+ for (AddXjrMenuDeptRelationDto addXjrMenuDeptRelationDto : dto.getMenuDeptRelations()) {
|
|
|
|
+ menuDeptRelationsList.add(BeanUtil.toBean(addXjrMenuDeptRelationDto, XjrMenuDeptRelation.class));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
menuDeptRelationsList.forEach(XjrMenuDeptRelation -> XjrMenuDeptRelation.setMenuId(menu.getId()));
|
|
menuDeptRelationsList.forEach(XjrMenuDeptRelation -> XjrMenuDeptRelation.setMenuId(menu.getId()));
|
|
xjrMenuDeptRelationService.remove(Wrappers.<XjrMenuDeptRelation>query().lambda().eq(XjrMenuDeptRelation::getMenuId, menu.getId()));
|
|
xjrMenuDeptRelationService.remove(Wrappers.<XjrMenuDeptRelation>query().lambda().eq(XjrMenuDeptRelation::getMenuId, menu.getId()));
|
|
xjrMenuDeptRelationService.saveBatch(menuDeptRelationsList);
|
|
xjrMenuDeptRelationService.saveBatch(menuDeptRelationsList);
|